qmmp-0.7.4/0000775000175000017500000000000012256224752011223 5ustar useruserqmmp-0.7.4/bin/0000775000175000017500000000000012256224734011773 5ustar useruserqmmp-0.7.4/bin/qmmp_launcher0000775000175000017500000000072112256224734014554 0ustar useruser#!/bin/sh MYDIR=$(dirname $0) QT_LIB_DIR=$(dirname $(which qmake))/../lib QMMP_LIB_DIRS=$MYDIR/../lib:$MYDIR/../src/qmmpui if [ -z ${LD_LIBRARY_PATH} ]; then LD_LIBRARY_PATH=${QMMP_LIB_DIRS}:${QT_LIB_DIR} else LD_LIBRARY_PATH=${QMMP_LIB_DIRS}:${QT_LIB_DIR}:${LD_LIBRARY_PATH} fi echo 'Setting LD_LIBRARY_PATH to' echo "$LD_LIBRARY_PATH" | awk -F: '{ for(i = 1; i <= NF; i++) printf "%d) %s\n", i, $i; }' export LD_LIBRARY_PATH echo exec $MYDIR/qmmp "$@" qmmp-0.7.4/doc/0000775000175000017500000000000012256224734011770 5ustar useruserqmmp-0.7.4/doc/README0000664000175000017500000000007712256224734012654 0ustar useruserRun "doxygen Doxyfile" to generate the Qmmp API documentation. qmmp-0.7.4/doc/Doxyfile0000664000175000017500000022570312256224734013507 0ustar useruser# Doxyfile 1.8.1.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" "). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or sequence of words) that should # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. PROJECT_NAME = Qmmp # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer # a quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = ./ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = NO # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = YES # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding # "class=itcl::class" will allow you to use the command class in the # itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this # tag. The format is ext=language, where ext is a file extension, and language # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all # comments according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you # can mix doxygen, HTML, and XML commands with Markdown formatting. # Disable only in case of backward compatibilities issues. MARKDOWN_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also makes the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = YES # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and # unions are shown inside the group in which they are included (e.g. using # @ingroup) instead of on a separate page (for HTML and Man pages) or # section (for LaTeX and RTF). INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and # unions with only public data fields will be shown inline in the documentation # of the scope in which they are defined (i.e. file, namespace, or group # documentation), provided this scope is documented. If set to NO (the default), # structs, classes, and unions are shown on a separate page (for HTML and Man # pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. SYMBOL_CACHE_SIZE = 0 # Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be # set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given # their name and scope. Since this can be an expensive process and often the # same symbol appear multiple times in the code, doxygen keeps a cache of # pre-resolved symbols. If the cache is too small doxygen will become slower. # If the cache is too large, memory is wasted. The cache size is given by this # formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespaces are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = YES # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = YES # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to # do proper type resolution of all parameters of a function it will reject a # match between the prototype and the implementation of a member function even # if there is only one candidate or it is obvious which candidate to choose # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen # will still accept a match between prototype and implementation in such cases. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or macro consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and macros in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. # You can optionally specify a file name after the option, if omitted # DoxygenLayout.xml will be used as the name of the layout file. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files # containing the references data. This must be a list of .bib files. The # .bib extension is automatically appended if omitted. Using this command # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this # feature you need bibtex and perl available in the search path. CITE_BIB_FILES = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # The WARN_NO_PARAMDOC option can be enabled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../src/qmmp \ ../src/qmmpui # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty or if # non of the patterns match the file name, INPUT_FILTER is applied. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) # and it is also possible to disable source filtering for a specific pattern # using *.ext= (so without naming a filter). This option only has effect when # FILTER_SOURCE_FILES is enabled. FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C, C++ and Fortran comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. Note that when using a custom header you are responsible # for the proper inclusion of any scripts and style sheets that doxygen # needs, which is dependent on the configuration options used. # It is advised to generate a default header using "doxygen -w html # header.html footer.html stylesheet.css YourConfigFile" and then modify # that header. Note that the header is subject to change so you typically # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # style sheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images # according to this color. Hue is specified as an angle on a colorwheel, # see http://en.wikipedia.org/wiki/Hue for more information. # For instance the value 0 represents red, 60 is yellow, 120 is green, # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. # The allowed range is 0 to 359. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of # the colors in the HTML output. For a value of 0 the output will use # grayscales only. A value of 255 will produce the most vivid colors. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to # the luminance component of the colors in the HTML output. Values below # 100 gradually make the output lighter, whereas values above 100 make # the output darker. The value divided by 100 is the actual gamma applied, # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, # and 100 does not change the gamma. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of # entries shown in the various tree structured indices initially; the user # can expand and collapse entries dynamically later on. Doxygen will expand # the tree to such a level that at most the specified number of entries are # visible (unless a fully collapsed tree already exceeds this amount). # So setting the number of entries 1 will produce a full collapsed tree by # default. 0 is a special value representing an infinite number of entries # and will result in a full expanded tree by default. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated # that can be used as input for Qt's qhelpgenerator to generate a # Qt Compressed Help (.qch) of the generated HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to # add. For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see # # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's # filter section matches. # # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) # at top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. Since the tabs have the same information as the # navigation tree you can set this option to NO if you already set # GENERATE_TREEVIEW to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. # Since the tree basically has the same information as the tab index you # could consider to set DISABLE_INDEX to NO when enabling this option. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values # (range [0,1..20]) that doxygen will group on one line in the generated HTML # documentation. Note that a value of 0 will completely suppress the enum # values from appearing in the overview section. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open # links to external symbols imported via tag files in a separate window. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are # not supported properly for IE 6.0, but are supported on all modern browsers. # Note that when changing this option you need to delete any form_*.png files # in the HTML output before the changes have effect. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax # (see http://www.mathjax.org) which uses client side Javascript for the # rendering instead of using prerendered bitmaps. Use this if you do not # have LaTeX installed or if you want to formulas look prettier in the HTML # output. When enabled you may also need to install MathJax separately and # configure the path to it using the MATHJAX_RELPATH option. USE_MATHJAX = NO # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax # directory is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to # the MathJax Content Delivery Network so you can quickly see the result without # installing MathJax. # However, it is strongly recommended to install a local # copy of MathJax from http://www.mathjax.org before deployment. MATHJAX_RELPATH = http://www.mathjax.org/mathjax # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension # names that should be enabled during MathJax rendering. MATHJAX_EXTENSIONS = # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvantages are that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for # the generated latex document. The footer should contain everything after # the last chapter. If it is left blank doxygen will generate a # standard footer. Notice: only use this tag if you know what you are doing! LATEX_FOOTER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See # http://en.wikipedia.org/wiki/BibTeX for more info. LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load style sheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # pointed to by INCLUDE_PATH will be searched when a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition that # overrules the definition found in the source code. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all references to function-like macros # that are alone on a line, have an all uppercase name, and do not end with a # semicolon, because these will confuse the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. For each # tag file the location of the external documentation should be added. The # format of a tag file without this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths # or URLs. Note that each tag file must have a unique name (where the name does # NOT include the path). If a tag file is not located in the directory in which # doxygen is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option also works with HAVE_DOT disabled, but it is recommended to # install and use dot, since it yields more powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will # base this on the number of processors available in the system. You can set it # explicitly to a value larger than 0 to get control over the balance # between CPU load and processing speed. DOT_NUM_THREADS = 0 # By default doxygen will use the Helvetica font for all dot files that # doxygen generates. When you want a differently looking font you can specify # the font name using DOT_FONTNAME. You need to make sure dot is able to find # the font, which can be done by putting it in a standard location or by setting # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the # directory containing the font. DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the Helvetica font. # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to # set the path where dot can find it. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside # the class node. If there are many fields or methods and many nodes the # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS # threshold limits the number of items for each type to make the size more # managable. Set this to 0 for no limit. Note that the threshold may be # exceeded by 50% before the limit is enforced. UML_LIMIT_NUM_FIELDS = 10 # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will generate a graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are svg, png, jpg, or gif. # If left blank png will be used. If you choose svg you need to set # HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible in IE 9+ (other browsers do not have this requirement). DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. # Note that this requires a modern browser other than Internet Explorer. # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files # visible. Older versions of IE do not have SVG support. INTERACTIVE_SVG = NO # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the # \mscfile command). MSCFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES qmmp-0.7.4/src/0000775000175000017500000000000012256224735012013 5ustar useruserqmmp-0.7.4/src/app/0000775000175000017500000000000012256224734012572 5ustar useruserqmmp-0.7.4/src/app/lxdesupport.h0000664000175000017500000000315412256224734015337 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LXDESUPPORT_H #define LXDESUPPORT_H /** @author Ilya Kotov */ class LXDESupport { public: static void load(); }; #endif // LXDESUPPORT_H qmmp-0.7.4/src/app/qmmp_enqueue.desktop0000664000175000017500000000234712256224734016674 0ustar useruser[Desktop Entry] X-Desktop-File-Install-Version=0.11 Name=Enqueue in Qmmp Name[cs]=Zařadit do fronty v Qmmp Name[de]=Zur Qmmp-Wiedergabeliste hinzufügen Name[ru]=Добавить в Qmmp Name[uk]=Додати до черги Qmmp Name[zh_CN]=加入 Qmmp 播放列表 Name[zh_TW]=加入 Qmmp 播放清單 Name[he]=ספח לתור של Qmmp Comment=Add file(s) to the Qmmp playlist Comment[cs]=Přidat soubor(y) do seznamu stop v Qmmp Comment[de]=Datei(en) zur Qmmp-Wiedergabeliste hinzufügen Comment[ru]=Добавить файл(ы) в список Qmmp Comment[uk]=Додати файл(и) до переліку програвання Qmmp Comment[zh_CN]=添加一个或多个文件到 Qmmp 播放列表 Comment[zh_TW]=添加一個或多個檔案到 Qmmp 播放清單 Comment[he]=הוסף קבצים אל רשימת הניגון של Qmmp Exec=qmmp -e %F Icon=qmmp Categories=AudioVideo;Player;Audio;Qt; MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mpegurl;audio/x-it;audio/x-mod;audio/x-ape;application/x-cue;audio/x-ffmpeg-shorten;inode/directory; Type=Application X-KDE-StartupNotify=false NoDisplay=true Terminal=false qmmp-0.7.4/src/app/qmmp.desktop0000664000175000017500000000347412256224734015147 0ustar useruser[Desktop Entry] X-Desktop-File-Install-Version=0.11 Name=Qmmp Comment=Qt4-based Multimedia Player Comment[ru]=Медиа-проигрыватель на базе Qt4 Comment[uk]=Медіа-програвач на базі Qt4 Comment[cs]=Přehrávač hudby založený na Qt Comment[tr]=Qt4 tabanlı Çokluortam Oynatıcı Comment[de]=Qt4-basierter Audio-Player Comment[zh_CN]=基于Qt4的多媒体播放器 Comment[zh_TW]=基于Qt4的多媒體播放器 Comment[he]=נגן מולטימדיה מבוסס Qt4 GenericName=Audio player GenericName[cs]=Přehrávač hudby GenericName[de]=Audio-Player GenericName[ru]=Аудио-проигрыватель GenericName[uk]=Медіа-програвач GenericName[tr]=Ses Oynatıcı GenericName[zh_CN]=音乐播放器 GenericName[zh_TW]=音樂播放器 GenericName[he]=נגן שמע Exec=qmmp %F Icon=qmmp Terminal=false Type=Application Categories=AudioVideo;Player;Audio;Qt; MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mpegurl;audio/x-it;audio/x-mod;audio/x-ape;application/x-cue;x-content/audio-cdda;audio/x-ffmpeg-shorten; X-KDE-StartupNotify=false Actions=Play;Pause;Stop;Previous;Next; [Desktop Action Play] Name=Play Name[ru]=Воспроизвести Exec=qmmp --no-start --play OnlyShowIn=Unity; [Desktop Action Pause] Name=Pause Name[ru]=Пауза Exec=qmmp --no-start --pause OnlyShowIn=Unity; [Desktop Action Stop] Name=Stop Name[ru]=Остановить Exec=qmmp --no-start --stop OnlyShowIn=Unity; [Desktop Action Previous] Name=Previous Name[ru]=Предыдущий фрагмент Exec=qmmp --no-start --previous OnlyShowIn=Unity; [Desktop Action Next] Name=Next Name[ru]=Следующий фрагмент Exec=qmmp --no-start --next OnlyShowIn=Unity; qmmp-0.7.4/src/app/qmmpstarter.h0000664000175000017500000000534512256224734015331 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _QMMPSTARTER_H #define _QMMPSTARTER_H #include #include #include #ifdef Q_OS_WIN #include #endif class QLocalServer; class QLocalSocket; class MediaPlayer; class SoundCore; class BuiltinCommandLineOption; /*! * QMMPStarter represents wrapper object that is responsible * for proper QMMP initialization(only one instance of running * MainWindow) and passing command line args to application. * @author Vladimir Kuznetsov */ class QMMPStarter : public QObject { Q_OBJECT public: QMMPStarter(int argc,char ** argv,QObject* parent = 0); ~QMMPStarter(); private slots: /*! * Passes command args to the running application */ void writeCommand(); void readCommand(); void savePosition(); private: QString processCommandArgs(const QStringList &list,const QString& cwd); /*! * Prints usage */ void printUsage(); /*! * Prints version of program */ void printVersion(); void startPlayer(); private: MediaPlayer *m_player; SoundCore *m_core; QObject *m_ui; QString argString; BuiltinCommandLineOption* m_option_manager; QLocalServer *m_server; QLocalSocket *m_socket; #ifdef Q_OS_WIN HANDLE m_named_mutex; #endif }; #endif qmmp-0.7.4/src/app/qmmpapplication.cpp0000664000175000017500000000344712256224734016504 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "qmmpapplication.h" QmmpApplication::QmmpApplication(int &argc, char **argv) : QApplication(argc, argv) { } void QmmpApplication::commitData(QSessionManager &manager) { if(UiHelper::instance()) UiHelper::instance()->exit(); #ifndef QT_NO_SESSIONMANAGER else QApplication::commitData(manager); #endif } qmmp-0.7.4/src/app/CMakeLists.txt0000664000175000017500000000372712256224734015343 0ustar useruserproject(app) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 OLD) endif(COMMAND cmake_policy) SET(QT_USE_QTNETWORK TRUE) INCLUDE(UsePkgConfig) INCLUDE(FindQt4) include(${QT_USE_FILE}) ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # libqmmp & libqmmpui include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../) link_directories(${CMAKE_INSTALL_PREFIX}/${LIB_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../qmmpui) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../qmmp) SET(app_SRCS builtincommandlineoption.cpp main.cpp qmmpstarter.cpp lxdesupport.cpp qmmpapplication.cpp ) SET(app_HDRS lxdesupport.h) SET(app_MOC_HDRS builtincommandlineoption.h qmmpstarter.h qmmpapplication.h ) SET(app_RCCS images/images.qrc translations/qmmp_locales.qrc) QT4_ADD_RESOURCES(app_RCC_SRCS ${app_RCCS}) QT4_AUTOMOC(${app_MOC_SRC}) QT4_WRAP_CPP(app_MOC_SRCS ${app_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_EXECUTABLE(qmmp ${app_SRCS} ${app_MOC_SRCS} ${app_RCC_SRCS} ${app_HDRS}) target_link_libraries(qmmp ${QT_LIBRARIES} libqmmp qmmpui) add_dependencies(qmmp qmmpui libqmmp) install(TARGETS qmmp DESTINATION bin) install(FILES qmmp.desktop DESTINATION share/applications) install(FILES images/16x16/qmmp.png DESTINATION share/icons/hicolor/16x16/apps) install(FILES images/32x32/qmmp.png DESTINATION share/icons/hicolor/32x32/apps) install(FILES images/48x48/qmmp.png DESTINATION share/icons/hicolor/48x48/apps) install(FILES images/scalable/qmmp.svgz images/scalable/qmmp-simple.svgz DESTINATION share/icons/hicolor/scalable/apps) IF(USE_DIR_ASSOC) install(FILES qmmp_enqueue.desktop DESTINATION share/applications) install(FILES qmmp_dir.desktop DESTINATION share/applications) ENDIF(USE_DIR_ASSOC) qmmp-0.7.4/src/app/qmmp_dir.desktop0000664000175000017500000000173312256224734016001 0ustar useruser[Desktop Entry] X-Desktop-File-Install-Version=0.11 Name=Qmmp Comment=Qt4-based Multimedia Player Comment[ru]=Медиа-проигрыватель на базе Qt4 Comment[uk]=Медіа-програвач на базі Qt4 Comment[cs]=Přehrávač hudby založený na Qt Comment[tr]=Qt4 tabanlı Çokluortam Oynatıcı Comment[de]=Qt4-basierter Audio-Player Comment[zh_CN]=基于Qt4的多媒体播放器 Comment[zh_TW]=基于Qt4的多媒體播放器 Comment[he]=נגן מולטימדיה מבוסס Qt4 GenericName=Audio player GenericName[cs]=Přehrávač hudby GenericName[de]=Audio-Player GenericName[ru]=Аудио-проигрыватель GenericName[uk]=Медіа-програвач GenericName[tr]=Ses Oynatıcı GenericName[zh_CN]=音乐播放器 GenericName[zh_TW]=音樂播放器 GenericName[he]=נגן שמע Exec=qmmp %F Icon=qmmp Terminal=false NoDisplay=true Type=Application Categories=AudioVideo;Player;Audio;Qt; MimeType=inode/directory; X-KDE-StartupNotify=false qmmp-0.7.4/src/app/main.cpp0000664000175000017500000000473012256224734014226 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "lxdesupport.h" #include "qmmpapplication.h" #include "qmmpstarter.h" int main(int argc, char *argv[]) { QmmpApplication a (argc, argv ); a.setApplicationName("qmmp"); a.setWindowIcon(QIcon(":/32x32/qmmp.png")); LXDESupport::load(); //load lxde icons #ifdef Q_OS_WIN QIcon::setThemeSearchPaths(QStringList() << qApp->applicationDirPath() + "/themes/"); QIcon::setThemeName("oxygen"); #endif QTranslator translator; QString locale = Qmmp::systemLanguageID(); translator.load(QString(":/qmmp_") + locale); a.installTranslator(&translator); QTranslator qt_translator; qt_translator.load(QLibraryInfo::location (QLibraryInfo::TranslationsPath) + "/qt_" + locale); a.installTranslator(&qt_translator); QMMPStarter starter(argc,argv); Q_UNUSED(starter) a.setQuitOnLastWindowClosed(false); return a.exec(); } qmmp-0.7.4/src/app/qmmpstarter.cpp0000664000175000017500000002260612256224734015663 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "qmmpstarter.h" #include "builtincommandlineoption.h" #ifdef Q_OS_WIN #define UDS_PATH QString("qmmp") #else #define UDS_PATH QString("/tmp/qmmp.sock.%1").arg(getuid()).toAscii().constData() #endif using namespace std; QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent) { m_player = 0; m_core = 0; m_ui = 0; #ifdef Q_OS_WIN m_named_mutex = 0; #endif m_option_manager = new BuiltinCommandLineOption(this); QStringList tmp; for (int i = 1;i < argc;i++) tmp << QString::fromLocal8Bit(argv[i]).trimmed(); argString = tmp.join("\n"); QHash commands = m_option_manager->splitArgs(tmp); if(commands.keys().contains("--help")) { printUsage(); exit(0); } if(commands.keys().contains("--version")) { printVersion(); exit(0); } if(!commands.isEmpty()) { foreach(QString arg, commands.keys()) { if(!m_option_manager->identify(arg) && !CommandLineManager::hasOption(arg) && arg != "--no-start") { cout << qPrintable(tr("Unknown command")) << endl; exit(0); } } } m_server = new QLocalServer(this); m_socket = new QLocalSocket(this); bool noStart = commands.keys().contains("--no-start"); #ifdef Q_OS_WIN //Windows IPC implementation (named mutex and named pipe) m_named_mutex = CreateMutexA(NULL, TRUE, "QMMP-403cd318-cc7b-4622-8dfd-df18d1e70057"); if(GetLastError() == NO_ERROR && !noStart) { m_server->listen (UDS_PATH); startPlayer(); } else { m_socket->connectToServer(UDS_PATH); //connecting m_socket->waitForConnected(); if(!m_socket->isValid()) //invalid connection { qWarning("QMMPStarter: unable to connect to server"); exit(0); } writeCommand(); } #else if(!noStart && m_server->listen (UDS_PATH)) //trying to create server { startPlayer(); } else if(QFile::exists(UDS_PATH)) { m_socket->connectToServer(UDS_PATH); //connecting m_socket->waitForConnected(); if(!m_socket->isValid()) //invalid connection { if(!QLocalServer::removeServer(UDS_PATH)) { qWarning("QMMPStarter: unable to remove invalid socket file"); exit(1); return; } qWarning("QMMPStarter: removed invalid socket file"); if(noStart) exit(0); else if(m_server->listen (UDS_PATH)) startPlayer(); else { qWarning("QMMPStarter: server error: %s", qPrintable(m_server->errorString())); exit(1); } } else writeCommand(); } else exit(0); #endif } QMMPStarter::~QMMPStarter() { if (m_ui) delete m_ui; #ifdef Q_OS_WIN if(m_named_mutex) ReleaseMutex(m_named_mutex); #endif } void QMMPStarter::startPlayer() { connect(m_server, SIGNAL(newConnection()), SLOT(readCommand())); QStringList args = argString.split("\n", QString::SkipEmptyParts); //prepare libqmmp and libqmmpui libraries for usage m_player = new MediaPlayer(this); m_core = SoundCore::instance(); //additional featuries new UiHelper(this); //interface UiFactory *factory = UiLoader::selected(); if(factory) m_ui = factory->create(); else { qWarning("QMMPStarter: no user interface found"); exit(1); return; } connect(qApp, SIGNAL(aboutToQuit()), SLOT(savePosition())); processCommandArgs(args, QDir::currentPath()); if(args.isEmpty()) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("General"); if(settings.value("resume_playback", false).toBool()) { qint64 pos = settings.value("resume_playback_time").toLongLong(); m_player->play(pos); } } } void QMMPStarter::savePosition() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("General"); settings.setValue("resume_playback",m_core->state() == Qmmp::Playing && QmmpUiSettings::instance()->resumeOnStartup()); settings.setValue("resume_playback_time", m_core->totalTime() > 0 ? m_core->elapsed() : 0); settings.endGroup(); m_core->stop(); } void QMMPStarter::writeCommand() { if (!argString.isEmpty()) { QString workingDir = QDir::currentPath() + "\n"; QByteArray barray; barray.append(workingDir.toUtf8 ()); barray.append(argString.toUtf8 ()); while(!barray.isEmpty()) { qint64 size = m_socket->write(barray); barray.remove(0, size); } m_socket->flush(); //reading answer if(m_socket->waitForReadyRead(1500)) cout << m_socket->readAll().data(); } else { printUsage(); } exit(0); } void QMMPStarter::readCommand() { QLocalSocket *socket = m_server->nextPendingConnection(); socket->waitForReadyRead(); QByteArray inputArray = socket->readAll(); if(inputArray.isEmpty()) return; QStringList slist = QString::fromUtf8(inputArray.data()).split("\n",QString::SkipEmptyParts); QString cwd = slist.takeAt(0); QString out = processCommandArgs(slist, cwd); if(!out.isEmpty()) { //writing answer socket->write(out.toLocal8Bit()); socket->flush(); } socket->deleteLater(); } QString QMMPStarter::processCommandArgs(const QStringList &slist, const QString& cwd) { if(slist.isEmpty()) return QString(); QStringList paths; foreach(QString arg, slist) //detect file/directory paths { if(arg.startsWith("-")) break; paths.append(arg); } if(!paths.isEmpty()) { m_option_manager->executeCommand(QString(), paths, cwd); //add paths only return QString(); } QHash commands = m_option_manager->splitArgs(slist); if(commands.isEmpty()) return QString(); foreach(QString key, commands.keys()) { if(key == "--no-start") continue; if (CommandLineManager::hasOption(key)) return CommandLineManager::executeCommand(key, commands.value(key)); else if (m_option_manager->identify(key)) m_option_manager->executeCommand(key, commands.value(key), cwd); else return QString(); } return QString(); } void QMMPStarter::printUsage() { cout << qPrintable(tr("Usage: qmmp [options] [files]")) << endl; cout << qPrintable(tr("Options:")) << endl; cout << "--------" << endl; cout << qPrintable(m_option_manager->helpString()) << endl; CommandLineManager::printUsage(); cout << "--no-start " << qPrintable(tr("Don't start the application")) << endl; cout << "--help " << qPrintable(tr("Display this text and exit")) << endl; cout << "--version " << qPrintable(tr("Print version number and exit")) << endl; cout << qPrintable(tr("Ideas, patches, bugreports send to forkotov02@hotmail.ru")) << endl; } void QMMPStarter::printVersion() { cout << qPrintable(tr("QMMP version: %1").arg(Qmmp::strVersion())) << endl; cout << qPrintable(tr("Compiled with Qt version: %1").arg(QT_VERSION_STR)) << endl; cout << qPrintable(tr("Using Qt version: %1").arg(qVersion())) << endl; } qmmp-0.7.4/src/app/builtincommandlineoption.h0000664000175000017500000000437112256224734020056 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef BUILTINCOMMANDLINEOPTION_H #define BUILTINCOMMANDLINEOPTION_H #include #include #include class PlayListModel; /** @author Vladimir Kuznetsov */ /*! * Represens command line option handling for standard operations. */ class BuiltinCommandLineOption : public QObject { Q_OBJECT public: BuiltinCommandLineOption(QObject *parent = 0); ~BuiltinCommandLineOption(); bool identify(const QString& str)const; const QString helpString()const; void executeCommand(const QString& option, const QStringList &args, const QString &cwd); QHash splitArgs(const QStringList &args) const; private slots: void disconnectPl(); private: QStringList m_options; PlayListModel *m_model; }; #endif qmmp-0.7.4/src/app/images/0000775000175000017500000000000012256224734014037 5ustar useruserqmmp-0.7.4/src/app/images/16x16/0000775000175000017500000000000012256224734014624 5ustar useruserqmmp-0.7.4/src/app/images/16x16/qmmp.png0000664000175000017500000000101012256224734016274 0ustar useruserPNG  IHDR7sBITUF pHYstEXtSoftwarewww.inkscape.org<IDATOZ376٘UQk2#Y>7rq.i9C5VfZnVdTLfʹ,-YyU !9}}ӟ;~?~;C!BM.hpWg>`"E noИi_}3sJ_ЭUG^xgGԊW\C6=1nܤJG ,y I\3+͚+j8J6,+)!{$64j!vՎ9\Tk`X4\\G%"9s[2˚.9d]9 gH(PhTNeVb_^^j#KRlrV][N,SP=v%O'GmkXb U+w4!B!健SelBgzIENDB`qmmp-0.7.4/src/app/images/32x32/0000775000175000017500000000000012256224734014620 5ustar useruserqmmp-0.7.4/src/app/images/32x32/qmmp.png0000664000175000017500000000242112256224734016277 0ustar useruserPNG  IHDR ssBITUF pHYs E EHgtEXtSoftwarewww.inkscape.org<IDATHDž[Wr9g&$c:ڦłP)M⋶B*""J$TABS(" j@Ԋ5jDEMjLc2}3Img?oZ{kWOH7}'On,#:oٚw"W ,Ӈn.;:ZNv\-oy[KH `[GKKS(3ܻ.o^Η϶F iE"@V)d=3 klΏpj0,`jR/ӗ9~O- D?VM֘!PCCC, Q>,Zptsyr_ [aypzSF.* \)o >ُN`UTJCeҁ2J?P}kM[o̊˔aB[) ez.3R4IYQL*ߏc"PI]/ES~ IENDB`qmmp-0.7.4/src/app/images/48x48/0000775000175000017500000000000012256224734014636 5ustar useruserqmmp-0.7.4/src/app/images/48x48/qmmp.png0000664000175000017500000000433412256224734016322 0ustar useruserPNG  IHDR00 1 sBITUF pHYs <tEXtSoftwarewww.inkscape.org<[IDATXÕ{\U{ל3s}^Rj- <"ĄC01Do ET%B" P ,(K˼iz[}2w&[{ok)G[B"$ ewoOG%lZGz62%DŽD[G<Ώ:(R[@ХI._?.4W\TRE\H Pxuգw ']̆0ؤ$$#ϒEobh|:4i1Zx-O/`%OY#T( =ҁl bZF_BD+qSb #1JS0=,5  Qbxѯ:yȱ37nVr,`2 ``bac1J]'tcM֣M:Ղ3*'HĿ#2J.=|BJGߠF ]D$`JV~ 3ZTbFТ(5lR00YIi *Btza?qk|YgQ8(,bTKI&D 8lBL} II]$ \:BajK(Ü4pp8EX7yLx \|y F1bNlX xsHT,@ 3oBZ7Pa9k(<X!h-_Dǿ=xxxDXv~CGQ^wٕ sQB`R_[f`aO"ߧOCIАb H8FxEtlaP[IUYX㯘:ڪ`'>&0LaHfEe5E B"mz")'$2f ۸%G0~M KT1YNLL8џ`a. lbDRb9{y=,~0q0PD9Q0oSQ$$gv,5 ts&MD &bc93B-f,y[೉-t#R PDnHUҠI"o&4nc=j@,.e BFaRIO¿-qcui5!%ԭm!\t?CcRJ.vԾ&)$bt|.NSHحUI1q cOj_lY -bL\M)>F4Шt1 lʌPA@6C{klHX ,MwWu gv}V;!g=t(DТ/ 9_*oxg؅0E!=$E SǪ0{V dqZ Rܥ6% ^AѤNVRsyJ\D*I 2CԨQ$K:IR}a$yS>0B NE_(`阳"Z@65ݾ9Y zqWgAQkIE>ztQȿԿ8~ Em3o+Tq> 4bugDk6GY%Iݸgf9  ZD[X#&շO .+^-S0E*s [e40mӯ-(tbcUq1Ώ3ΛvO ?qS)gIENDB`qmmp-0.7.4/src/app/images/56x56/0000775000175000017500000000000012256224734014634 5ustar useruserqmmp-0.7.4/src/app/images/56x56/qmmp.ico0000664000175000017500000004107612256224734016312 0ustar useruser@@ (B(@ @99^^^BBB888)---?"""c%%%******(((&&&((((((%%%yW%%%5)))#555TTT  GGG...&C m,,,///,,,)))((('''&&&%%%$$$#########$$$$$$$$$%%%&&&''' ]6///mmmEEE###.***h///...---******+++,,,...///////////////...---,,,+++)))'''%%%###"""%%%'''$$$Q"///UUU,,,*+++_333...+++---///000111444777:::<<<===>>>??????>>>===;;;999666333///+++((('''$$$"""%%%(((JBBB zzz ..."***Q444///000//////222888<<<@@@CCCEEEFFFGGGHHHHHHIIIIIIIIIIIIIIIGGGEEECCC@@@;;;666///)))&&&&&&%%%###***y?ppplll<<<2777q000222111000555<<>>>:::555111777>>>DDDHHHJJJKKKJJJIIIGGGFFFDDDBBBAAAAAAAAABBBDDDEEEHHHJJJLLLNNNOOOPPPOOOLLLHHHBBB;;;333***###)))(((***m***+EEE aaa;;;ICCC>>>888;;;DDDKKKOOOPPPNNNLLLIIIEEEAAA===:::666444222222222333555777:::>>>AAAEEEIIIMMMPPPQQQPPPNNNJJJCCC:::000''''''***+++"""4>>>[[[;;;VEEE>>>;;;AAAKKKSSSXXXYYYXXXTTTOOOHHHAAA:::333...)))$$$""""""""""""###&&&))),,,111666;;;AAAGGGLLLPPPRRRRRRNNNGGG???555+++&&&***,,,=CCC]]]BBBYGGG===>>>GGGQQQYYY\\\]]]ZZZUUUNNNHHHAAA:::555000---)))%%%### %%%+++111888???GGGMMMQQQRRRPPPKKKCCC888...&&&(((...;SSS___FFFJNNNAAAAAAKKKVVV^^^bbbaaa\\\UUUMMMEEE>>>777222...+++((('''%%%""" """'''000888AAAHHHNNNQQQQQQMMMEEE;;;///''')))222$$$0ZZZ iiiKKK>OOOFFFCCCNNN[[[cccfffeee___VVVLLLDDD<<<555000,,,***&&&$$$###""" """)))111;;;DDDLLLQQQRRROOOGGG<<>>666222...,,,+++000PPP---'''((('''%%%%%%### 444 (((333>>>HHHOOOQQQNNNEEE999---)))---'''P555)))___MMMVMMMHHHMMM___mmmtttuuuoooeeeXXXKKKAAA999444111///......222QQQQQQ$$$,,,+++***)))'''WWW%%%000<<>>999777777777888999999;;;555rrr---999...qqq)))&&&###$$$111>>>HHHLLLJJJBBB444'''111999v111eeeTTTjMMMOOO^^^ttt|||lll\\\NNNDDD===:::999::::::;;;===>>>>>>+++OOO111RRR...+++((($$$!!!&&&444@@@HHHKKKGGG;;;---***...111Aeee  FFF#QQQMMMUUUlllzzzhhhWWWKKKCCC===<<<<<<===>>>???@@@BBB???yyyaaaZZZ///111---)))&&&"""***777BBBIIIIIIAAA444&&&...===y>>>VVVDLLLOOO```xxxvvvdddTTTIIIBBB???>>>???@@@BBBCCC<<>>111'''***<<>>888333---(((%%%$$$''',,,333===AAA===333%%%%%%]]]uUUUiiiKKKfff~~~kkk]]]TTTPPPPPPQQQSSSNNNwww???CCC>>>888222---)))'''(((,,,222:::???===444&&&,,,```RRRdddUUUkkklll^^^UUURRRRRRSSSRRRFFF{{{===FFFBBB===888222---++++++...333888===<<<555''',,,YYYPPP ]]]WWWooooooaaaXXXTTTSSSSSSlllwwweeedddSSSDDD===777222///...111555999<<<<<<555'''+++IIIKKK$SSSXXXrrrrrrcccZZZ\\\aaa~~~~~~XXXGGG<<<777333222333777:::<<<;;;444'''(((???CCC'KKKWWWsssuuufffUUUnnncccEEE;;;888666666999>>>===:::333''''''999???)OOOVVVrrryyyiii\\\RRRAAA===;;;;;;===@@@???:::111%%%&&&;;;<<<(YYYVVVppp~~~eeeVVVAAA??????@@@BBBAAA:::000###'''DDDBBB%dddOOOllluuuzzzXXXAAACCCEEEEEECCC:::... (((TTTGGG mmmKKKggglll\\\NNNIIIEEE;;;,,,)))bbbJJJrrrFFFaaazzzfffRRRGGG;;;+++!!!nnnNNN???[[[|||^^^KKK<<<***uuusRRR777SSStttbbbLLL<<<)))yyySSSS k666NNNjjjYYYJJJ<<<((($$$///FFF&bbb2]]]OOO]]]zzzhhhXXXKKK;;;&&&111TTT UUUEEEOOOoootttcccXXXJJJ::: :::~~~x ooo{;;;@@@ccczzz{{{lllcccXXXJJJ888,,,222}}}=FFF>EEEHHHVVVlll|||uuuooofffXXXIII666===FFF111999uuuPPP???```uuuzzzqqqgggXXXHHH000OOOwwwviXXX;;;UUUhhh{{{|||{{{}}}}}}sssfffWWWGGGFFF]]]9iiiTTTBBB\\\mmmtttfffWWWBBBaaaoool_bbb555RRRaaarrrtttfffWWWNNNnnn4jjj[[[BBBVVVddduuutttfffSSSyyymmm]111 RRRNqqq999MMMYYYhhhwwwtttgggkkk*llllppp<<.>>>xtސm^n̻M"yؘIk3"$ťI_ҍo ̀k<퐧D"y,$ B gDHHDHLHĚ\k~e衇*]ci{RDȈ019b"1/}+s?JnJ䰴\@ᒛ 0N5V̷:ߺJQDUPA11 ǧKyx(b6w@OX)M*]0 5ү.b"3$>>Cҋ{>h%& Esq]tC<-<"6<z'Kvd5Ӹ@rGqo2eB&MZDZ2AQk u{s`.'~mAD&s襏g# DCb$e<d7# SL'ұź︓`ay29.预I?ч!l <.GP(`f3Glc|""w["sG|E ]s,s|H8.x2ݐA/yfuR54d\|zʔ8KC^O: ]+Xݔ(Sb.Pp K K qr!k_(R鸏Ϻ6v~f.-Zyrau'e JccIecK^ v.lI@"gvٺP3H99]6N[ ,ez1IEHK{ŽmjYI/dNuLO(gqmYHD,y Mv?D_8)p>qŖ0Y)ygS11-4ӥo?:x ʓ\݌R{(aUL+_R~Ysa.B@iTҮYQ<A])]$&i*ƴQvPcEIMs{ LRnn1-b.U@n7")xNJ:1-qdwV`-N> Zp 2i!PPmB" ALD>d|WFo-Zt@ aZG'DMll۫{K&yR7`Qip>LL1  AD@LnU$JYѤJ7^-lg|=M@<9 !>vΘ$vwSG0)PL G͕ ?ԥxqxHlr8.0}BbSK \|0vלm ?J;--0-$6yr:Dʎ/h`PJ7e H% 32x32/qmmp.png qmmp-0.7.4/src/app/images/scalable/0000775000175000017500000000000012256224734015605 5ustar useruserqmmp-0.7.4/src/app/images/scalable/qmmp-simple.svgz0000664000175000017500000001103712256224734020763 0ustar useruser(-Kqmmp-simple.svgZncWr}W/c:y1A26hIlVއ$g`:Zjժ}ϟf̆v[mw_~U bZv7o^~8WÇؿmmqؽ޾,7ûǏc0᷻oabv<~Kz}~Xok;٩|%m~[/wAznߞ5ޯN^Zq]tuk|3\ݩfw#ogǙ<⿩C~~q>^+3a0ax\_Aa}x\,ׇKǣ<[oπv:y |ˌ^_Q_tk[r~xx~w_ן뭎E^ۄ^cWb8.8#H 'h|> z/ja7Ifж}۔ԴcG7vxՏ0{Es {;[ŗ;8C0݇j}ݯ-`^1Ջovo^_~f_Lɋ~}䧽3;˛avN[=b*12^bލ)hٮ« zu޷`UyZ=vȧcD^eXmй{+]6)^Ǔgq*Į7ͬ ~?;A8mYssٌ\f^;<[f{u}JN;s9!-p<_1ksx8/eG:#bY4QvvԯOWFp3DϾ⳶1/B8m Wn#\56g$+Sv|FIpnM܌a,6y1q?[ngD`O\OgRۻ6/"a+lg09wqo> b\\s3KNq~ukomΝsOKn%{ah¼6`˅yp "hZ_Q'}Oms}n"h䅉 cƮ]Joon,t{=c:y_߬[owp{٢ jA5k66yxWyL%es428)z0༵4fs~1LsR!1PrKXE5@6lqaJLs 6\E*s<4:s.ڀ덥xQo/KfOM{Apswzu3g?^t&w]8\4 rtэ0Hd.>"2b-Ot4&=du؂":@x_.GN$ĘF!?:"Ze+;HL)2n1G6;s1p"@e1:n!O@dɵzis3' Bg ## 81 hqkRh7bhe@H)xWe#,z';XJ MP"t™Nf\d+%$_LT9hSk N"wJ\ I'x}Yl(½S] u\ZCZ~  t :u":3;Cb1X9֡^a\QӅ==A%U'm<{6/:_mSAbϰq@55RL)ADr%/glOF1B1vnB/FMp^J%Ў6uv h*bFJ z8欬3e ꘺dW.Fiܫm*GBQL /i>< fP+q*xn;sY^:L@<$X;Cs1bwB>Q@N@zrE~:xa r =L6OP|#:t k'93BZ*~Qz +&M%j@Xs0j6iZHR8̗yEbpV?>h̭UH,^4ik+Np0J3@ ˙.\2@ٿn;.dp+X*BT͖2[@& lR^ET;zqˈ0O2 d$*!]D{@Vf:8c:Hȅy)Fڤle8qGIԗp'[t`K+26 )i}RLPrRjINBTxwq@y> ~TiBB @7BIkYGJZY( X.-0 ND}LɗX PQ@NFMQ@+Iחw eP;P"EhMJ} ɣ' @Y 3aY-q=fJ"[KP%#( wLG)/;PT2NIUBضX2 XFQ'ai`XUvS$v%WT&KVCʏ1"((M)@0>B3ba` Cl&I H@['2w7.A+vPގ@y':Ǽ'PYh j=@8U 絍#S3hXGpud8*{)eKUېkiaig,<d,idQH7P\DI-o )% 0OV^@rm"r!ɅRm<"RIނ y}!k/7 PR) EUE؜9x%{P=X˱ejIR)|0 N{Lq5R#=eg@H)yPWp! PhZlgBMN3DZZczo*X$֯<ÀRh3i&ڑyT4YF7TV@6.",ZmӴS Xg5Lt3L(X /[H V!)@nju:0SQ-)O8d8DbHP<(1@uxm Y)!Gt6F4  mr*ɱ,(CE/+R˅@jjOKV? #U4610RQ,Cː20CSrѹ\' qD?$ӗjzU+QwѦUܭlyrX_'?OAԟ#hagaK7w [#]-qmmp-0.7.4/src/app/images/scalable/qmmp.svgz0000664000175000017500000001143412256224734017475 0ustar useruser[nI}W/c,,y ;Md)RCR察YJ[rۻC-f-2.'Ndz]}hwvs1эTf]6Ws&0,l?yq~صCn\|vnZwj{Y^^Yp9fyFUo^8zQUϖIts[b֮vstgab Vzhnyُ&,923cjc}<2jR3 #6zyYaw;r ݃f-KlM{ӏ}ga9Zhk~ov?b́ջjy1 7:zRnqvA\Lq}}`O+lo7F FnezOί|9?̩WN=ъG` ^,g{_Ѐ[lz1/g0fu=j 8 G7,k'c^ѤɤrΊ9g1띔j>:}߭6]ݙ>d79=8VF=qu11:p>ܢ|uZ7=a=۷.nwvt,b2tl]%&ܿޑTv{}1q~ؽ Y]n?,G:/]mң5ow;j߷Q?~=^}jq2]|^-Puk绿n~Tk| ?ܯaZzXqΊm^b3z2AڷAMݮ4{q|nnn|v|oF3.kը6QݞFWYi%֒LK~&_Pĉ#fC?,-)6iM9YN˥)q 03dI=nR\L =;e>9^Fh 1(~i"BݭV ]j]x=8=hNXs1=gkh᫲ϛm~,Fx 黉XS"N>˓c/O0Ii'=cpaG=URj g6(Ԅ%ڐ 6Jl#)OH'^ :hYk3sA'|Q>u(1/äBԻF; Q)iE8g/=ИCD!'.=*?+ fi;&<{2m8}1S.Y;S)m[GktSd l4&BY )aGQcCrui1:;3(^Gg"T?nt2bv_7}T,l?<5F#PGp\N݂܍ÿ` ӥPt4O}y>Plۛ~T^` ;z"yKje>yONդz{W5zD@ |j躲`# <{9kjjIwK 3nԇ%V!1M4U hK6}A:6j[+RX<lYIÎM!ilk 930 ms(ʑ ;NL9!Ҵ)4Ġ G}qf1}Ʀ83QeEwh擂P&F"jP)Q3>OQF9^F:%4PbC:K \ "ehذˉ^Ěy+HM >+4X2e(σi*6"j@ t*Dm2#$&dTTe)YL=TuhSDdɡ `}^byR2-`1ADF P#kjGW&OOΊ\>j-a.7|d 4=x ʚJ;aL1ͬdD ˍrK !S)q8VRa*'n'8= $-9&a!d:x`.칖SofiV!8v됓"5u0U0T^IL&@t`r$s DVeH(tlK -x[&|D]< VH+v^ٲY>9% 7"rd1V"zx=# /,7e=ǝ>$3C#bB&A>#JS&@>!X6 "V>`%ghoy<-bZd@1Y6ZPZu^f:8&@%tX\R[bѩYhԚSIF6 @J]KE Mf74xz,Hr(Zn-WVD#$F^P! bص%)}iKgccAd4CO9XJ8<D%~ZB^8&#b#0&%"Z"/ҵ$ LPFE[e=IKRX/DSG"- 41.d~^xH  2Y@? r~zԉg h[ȕҚ/bQYįg y M:=!>_D[d``oX+{Z<\6rD=ӝ$F`.dVarzJ`BrSI0e$Q nK7pEHต\FlX[^ʥ~)2! M)N*FE^ 0F''4WDKZ}ͺWgrp+7v %+(8qlə-U61 4SN7)7ГR[.FWӂT%gGL%#IvȐheD"bS+%MPRJ(֐H >q2F@뫡 +ejdb@Q+G)%G6@> CH;sA~P?#Y̐ǵUdc@MA:L7%:%1%u% MjElZ!z ;irMk3j|bDZP|=d(ҦȪҡ$־ē/aJP F䆶.PN9&F0 ƕdETAYI1&)G X#XJbBRꞢGӅ3TLfވgQF3"a_%,xrRC.I ʺ##!Q7V٢4f;CWTx;ݙs)5N@© 8uhu:q)h#YGĐ%4K"2I] d!d*xB[9x)e^ٱ6K1m Q184$h!Z8VA܂lk>#{8JaEK8D}tc!Ip/J S|Gkܰv]n*xD"qoJNj:4Z(k.rr7\yEW~ U |(U,/:,٣[$>>Yc&)#e{V]dj%K%9: 2ҁۆ,G*t-ol[(\ygeP :*X+WΆ)_~I:j$]׶bi?֒/A C)mkD'w+Kw(RDqlQj_k`v bkd"%cvU5Eˈh(ϭxKCQs9ug36Ͼ lJnxqRDȧXuT|1MjTtU(_5J|6ϯl^=xK@3L4OoI #@ Q )CL(^gv6.Oo3LB+Wtg3iz?E ue; D.P2w BuiltinCommandLineOption Don't clear the playlist Non borrar a lista de reprodución Start playing current song Comezar reprodución da pista actual Pause current song Pausar pista actual Pause if playing, play otherwise Pausar se se está a reproducir, reproducir noutro caso Stop current song Deter pista actual Display Jump to File dialog Mostrar o diálogo de saltar a arquivo Quit application Pechar aplicativo Set playback volume (example: qmmp --volume 20) Establecer volume de reprodución (exemplo: qmmp --volume 20) Skip forward in playlist Saltar á seguinte pista da lista Skip backwards in playlist Saltar á pista anterior da lista Show/hide application Amosar/agochar aplicativo Display Add File dialog Mostrar o diálogo de engadir arquivo Display Add Directory dialog Mostrar o diálogo de engadir directorio QMMPStarter Unknown command Comando descoñecido Usage: qmmp [options] [files] Uso: qmmp [opcións] [ficheiros] Options: Opcións: Don't start the application Non lanzar o aplicativo Display this text and exit Mostar este texto e saír Print version number and exit Mostar número de versión e saír Ideas, patches, bugreports send to forkotov02@hotmail.ru Ideas, parches, reporte de erros enviar a forkotov02@hotmail.ru QMMP version: %1 versión de QMMP: %1 Compiled with Qt version: %1 Compilado coa versión %1 de Qt Using Qt version: %1 Usando a versión %1 de Qt qmmp-0.7.4/src/app/translations/qmmp_locales.qrc0000664000175000017500000000121112256224734020471 0ustar useruser qmmp_ru.qm qmmp_uk_UA.qm qmmp_zh_CN.qm qmmp_zh_TW.qm qmmp_tr.qm qmmp_cs.qm qmmp_pt_BR.qm qmmp_de.qm qmmp_pl_PL.qm qmmp_fr.qm qmmp_it.qm qmmp_kk.qm qmmp_lt.qm qmmp_hu.qm qmmp_nl.qm qmmp_ja.qm qmmp_sk.qm qmmp_es.qm qmmp_he.qm qmmp_gl_ES.qm qmmp-0.7.4/src/app/translations/qmmp_uk_UA.ts0000664000175000017500000001262612256224734017730 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Перейти до наступного фрагменту Skip backwards in playlist Перейти до попереднього фрагменту Start playing current song Грати поточну пісню Don't clear the playlist Не очищати список Pause current song Призупитини поточну пісню Pause if playing, play otherwise Призупинити/відтворити Stop current song Зупитини поточну пісню Display Jump to File dialog Показати діалог переходу до файла Quit application Закрити програму Set playback volume (example: qmmp --volume 20) Встановити гучність (приклад: qmmp --volume 20) Show/hide application Показати/сховати програму Display Add File dialog Показати діалог додавання файлів Display Add Directory dialog Показати діалог додавання тек QMMPStarter Usage: qmmp [options] [files] Використання: qmmp [options] [files] Options: Опції: Don't start the application Не запускати програму Print version number and exit Показати версію та вийти Ideas, patches, bugreports send to forkotov02@hotmail.ru Ідеї, виправлення, звіти про помилки: forkotov02@hotmail.ru QMMP version: %1 Версія QMMP: %1 Compiled with Qt version: %1 Зібрано з Qt версії: %1 Using Qt version: %1 Використовується Qt версії: %1 Display this text and exit Показати цей текст та вийти Unknown command Невідома команда qmmp-0.7.4/src/app/translations/qmmp_pl_PL.ts0000664000175000017500000001211612256224734017724 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Przeskocz do przodu na liście odtwarzania Skip backwards in playlist Przeskocz do tyłu na liście odtwarzania Start playing current song Zacznij odtwarzać bieżący utwór Don't clear the playlist Nie czyść listy Pause current song Wstrzymaj bieżący utwór Pause if playing, play otherwise Wstrzymaj jeśli odtwarza, odtwarzaj w przeciwnym wypadku Stop current song Zatrzymaj bieżący utwór Display Jump to File dialog Wyświetl okno dialogowe Skocz do Quit application Zamknij program Set playback volume (example: qmmp --volume 20) Ustaw głośność odtwarzania (np: qmmp --volume 20) Show/hide application Pokaż/ukryj aplikację Display Add File dialog Wyświetl okno dialogowe dodawania plików Display Add Directory dialog Wyświetl okno dialogowe dodawania katalogów QMMPStarter Usage: qmmp [options] [files] Użycie: qmmp [opcje] [pliki] Options: Opcje: Don't start the application Nie uruchamiaj aplikacji Print version number and exit Wyświetla wersję programu i wychodzi Ideas, patches, bugreports send to forkotov02@hotmail.ru Pomysły, poprawki, raporty o błędach proszę wysyłać na forkotov02@hotmail.ru QMMP version: %1 Wersja QMMP: %1 Compiled with Qt version: %1 Skompilowane z wersją QT: %1 Using Qt version: %1 Używana wersja Qt: %1 Display this text and exit Wyświetla ten tekst i wychodzi Unknown command Nieznane polecenie qmmp-0.7.4/src/app/translations/qmmp_de.ts0000664000175000017500000001210212256224734017301 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Nächsten Titel in Wiedergabeliste abspielen Skip backwards in playlist Vorherigen Titel in Wiedergabeliste abspielen Start playing current song Aktuellen Titel abspielen Don't clear the playlist Titel an Wiedergabeliste anhängen Pause current song Aktuellen Titel anhalten Pause if playing, play otherwise Wiedergabe anhalten oder fortsetzen Stop current song Aktuellen Titel stoppen Display Jump to File dialog „Springe zu Titel“-Dialog anzeigen Quit application Anwendung beenden Set playback volume (example: qmmp --volume 20) Lautstärke der Wiedergabe einstellen (Beispiel: qmmp --volume 20) Show/hide application Anwendung ein-/ausblenden Display Add File dialog „Datei hinzufügen“-Dialog anzeigen Display Add Directory dialog „Verzeichnis hinzufügen“-Dialog anzeigen QMMPStarter Usage: qmmp [options] [files] Aufruf: qmmp [Optionen] [Dateien] Options: Optionen: Don't start the application Die Anwendung nicht starten Print version number and exit Gibt die Versionsnummer aus Ideas, patches, bugreports send to forkotov02@hotmail.ru Ideen, Patches und Bugreports an <forkotov02@hotmail.ru> senden QMMP version: %1 Qmmp-Version: %1 Compiled with Qt version: %1 Kompiliert mit der Qt-Version %1 Using Qt version: %1 Display this text and exit Zeigt diesen Hilfetext an Unknown command Unbekannter Befehl qmmp-0.7.4/src/app/translations/qmmp_cs.ts0000664000175000017500000001207012256224734017322 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Přejít vpřed v seznamu skladeb Skip backwards in playlist Přejít zpět v seznamu skladeb Start playing current song Spustit přehrávání aktuální skladby Don't clear the playlist Nevyprazdňovat seznam skladeb Pause current song Pozastavit aktuální skladbu Pause if playing, play otherwise Pozastavit, přehrává-li se, jinak přehrávat Stop current song Zastavit aktuální skladbu Display Jump to File dialog Zobrazit dialog Přeskočit na soubor Quit application Ukončit aplikaci Set playback volume (example: qmmp --volume 20) Nastavit hlasitost přehrávání (příklad: qmmp --volume 20) Show/hide application Zobrazit/skrýt aplikaci Display Add File dialog Zobrazit dialog Přidat soubor Display Add Directory dialog Zobrazit dialog Přidat adresář QMMPStarter Usage: qmmp [options] [files] Použití: qmmp [volby] [soubory] Options: Volby: Don't start the application Nespouštět aplikaci Print version number and exit Vypsat číslo verze a skončit Ideas, patches, bugreports send to forkotov02@hotmail.ru Nápady, patche, hlášení chyb posílejte na forkotov02@hotmail.ru (anglicky) QMMP version: %1 QMMP verze: %1 Compiled with Qt version: %1 Zkompilováno s Qt verze: %1 Using Qt version: %1 Používá Qt verze: %1 Display this text and exit Zobrazit tento text a skončit Unknown command Neznámý příkaz qmmp-0.7.4/src/app/translations/qmmp_es.ts0000664000175000017500000001206212256224734017325 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Avanzar en la lista de reproducción Skip backwards in playlist Retroceder en la lista de reproducción Start playing current song Empezar reproduciendo la canción actual Don't clear the playlist No limpiar la lista de reproducción Pause current song Pausar la canción actual Pause if playing, play otherwise Pausar si se está reproduciendo, o viceversa Stop current song Detener la canción actual Display Jump to File dialog Mostrar el diálogo Saltar a archivo Quit application Set playback volume (example: qmmp --volume 20) Cambiar el volumen de reproducción (ejemplo: qmmp --volume 20) Show/hide application Mostrar/ocultar aplicación Display Add File dialog Mostrar el diálogo Añadir archivo Display Add Directory dialog Mostrar el diálogo Añadir directorio QMMPStarter Usage: qmmp [options] [files] Uso: qmmp [opciones] [archivos] Options: Opciones: Print version number and exit Mostrar el número de versión y salir Ideas, patches, bugreports send to forkotov02@hotmail.ru Enviar ideas, parches, errores a: forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Muestra este texto y sale Unknown command Comando desconocido Don't start the application No iniciar la aplicación qmmp-0.7.4/src/app/translations/qmmp_fr.ts0000664000175000017500000001210512256224734017323 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Avancer dans la liste de lecture Skip backwards in playlist Reculer dans la liste de lecture Start playing current song Démarrer la lecture du morceau courant Don't clear the playlist Pause current song Mettre en pause le morceau courant Pause if playing, play otherwise Mettre en pause si le morceau est joué ; autrement, le jouer Stop current song Arrêter le morceau courant Display Jump to File dialog Afficher la boîte de dialogue « Aller au fichier » Quit application Set playback volume (example: qmmp --volume 20) Show/hide application Afficher ou cacher Qmmp Display Add File dialog Afficher la boîte de dialogue « Ajouter un fichier » Display Add Directory dialog Afficher la boîte de dialogue « Ajouter un dossier » QMMPStarter Unknown command Usage: qmmp [options] [files] Usage : qmmp [options] [fichiers] Options: Options : Don't start the application Print version number and exit Imprimer le numéro de version et quitter Ideas, patches, bugreports send to forkotov02@hotmail.ru Idées, patches, rapports de bogues à envoyer à : forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Afficher ce texte et quitter qmmp-0.7.4/src/app/translations/qmmp_he.ts0000664000175000017500000001140212256224734017307 0ustar useruser BuiltinCommandLineOption Don't clear the playlist Start playing current song Pause current song Pause if playing, play otherwise Stop current song Display Jump to File dialog Quit application Set playback volume (example: qmmp --volume 20) Skip forward in playlist Skip backwards in playlist Show/hide application Display Add File dialog Display Add Directory dialog QMMPStarter Unknown command Usage: qmmp [options] [files] Options: Don't start the application Display this text and exit Print version number and exit Ideas, patches, bugreports send to forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 qmmp-0.7.4/src/app/translations/qmmp_hu.ts0000664000175000017500000001221012256224734017325 0ustar useruser BuiltinCommandLineOption Don't clear the playlist Ne töröld a lejátszási listát Start playing current song Aktuális szám lejátszásának indítása Pause current song Aktuális szám szüneteltetése Pause if playing, play otherwise Szünet ha lejátszás van, különben lejátszás Stop current song Aktuális szám megállítása Display Jump to File dialog Számra ugrás ablak mutatása Quit application Set playback volume (example: qmmp --volume 20) Lejátszási hangerő beállítása (pl.: qmmp --volume 20) Skip forward in playlist Lejátszási lista következő számának kihagyása Skip backwards in playlist Lejátszási lista előző számainak kihagyása Show/hide application Alkalmazás mutatása/elrejtése Display Add File dialog Fájl hozzáadása ablak mutatása Display Add Directory dialog Könyvtár hozzáadása ablak mutatása QMMPStarter Unknown command Ismeretlen parancs Usage: qmmp [options] [files] Használat: qmmp [opciók] [fájlok] Options: Opciók: Don't start the application Display this text and exit Mutasd ezt a szöveget, majd lépj ki Print version number and exit Mutasd a verziószámot, majd lépj ki Ideas, patches, bugreports send to forkotov02@hotmail.ru Ötleteket, foltokat, hibajelentéseket küld a forkotov02@hotmail.ru címre QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 qmmp-0.7.4/src/app/translations/qmmp_ja.ts0000664000175000017500000001247512256224734017320 0ustar useruser BuiltinCommandLineOption Don't clear the playlist プレイリストをクリアしない Start playing current song 今の曲から再生を開始 Pause current song 今の曲で一時停止 Pause if playing, play otherwise 再生中なら一時停止、一時停止しておれば再生 Stop current song 今の曲で終止 Display Jump to File dialog 「ファイルを指定して即刻再生」ダイアログを表示 Quit application アプリケーションを終了 Set playback volume (example: qmmp --volume 20) 音量設定 (例: qmmp --volume 20) Skip forward in playlist プレイリストでの次の曲にスキップ Skip backwards in playlist プレイリストで前の曲にスキップ Show/hide application アプリケーションウィンドウを表示/非表示 Display Add File dialog 「ファイル追加」ダイアログを表示 Display Add Directory dialog 「ディレクトリ追加」ダイアログを表示 QMMPStarter Unknown command 不明なコマンドです Usage: qmmp [options] [files] 使用法: qmmp [オプション] [ファイル名:複数可] Options: オプション: Don't start the application アプリケーションを始動しない Display this text and exit このメッセージを表示して終了 Print version number and exit バージョン番号を表示して終了 Ideas, patches, bugreports send to forkotov02@hotmail.ru 名案, パッチ, バグ報告は forkotov02@hotmail.ru まで QMMP version: %1 QMMP のバージョン: %1 Compiled with Qt version: %1 コンパイルに使用した Qt のバージョン: %1 Using Qt version: %1 現在使用中の Qt のバージョン: %1 qmmp-0.7.4/src/app/translations/qmmp_it.ts0000664000175000017500000001201512256224734017330 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Scorri in avanti lista dei brani Skip backwards in playlist Scorri indietro la lista dei brani Start playing current song Inizia il brano scelto Don't clear the playlist Non ripulire la lista esecuzione Pause current song Sospendi il brano in esecuzione Pause if playing, play otherwise Sospendi il brano se in esecuzione; lo riprende se in pausa Stop current song Arresta il brano in esecuzione Display Jump to File dialog Mostra il menu «Vai al brano» Quit application Set playback volume (example: qmmp --volume 20) Show/hide application Mostra/nascondi Qmmp Display Add File dialog Mostra il menu «Aggiungi brani» Display Add Directory dialog Mostra il menu «Aggiungi cartella» QMMPStarter Usage: qmmp [options] [files] Uso: qmmp [options] [fichiers] Options: Opzioni: Print version number and exit Stampa il numero di versione ed esci Ideas, patches, bugreports send to forkotov02@hotmail.ru Per idee, modifiche, segnalazione di errori scrivire a: forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Mostra questo testo ed esci Unknown command Comando sconosciuto Don't start the application qmmp-0.7.4/src/app/translations/qmmp_kk.ts0000664000175000017500000001235512256224734017330 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Келесіге өту Skip backwards in playlist Алдыңғысына өту Start playing current song Ағымдағы өленді ойнату Don't clear the playlist Тізімді тазартпау Pause current song Ағымдағы өленді аялдату Pause if playing, play otherwise Аялдату/ойнату Stop current song Ағымдағы өленді тоқтату Display Jump to File dialog Файлға өту сұхбатын көрсету Quit application Set playback volume (example: qmmp --volume 20) Show/hide application Бағдарламаны көрсету/жасыру Display Add File dialog Файлдарды қосу сұхбатын көрсету Display Add Directory dialog Бумаларды қосу сұхбатын көрсету QMMPStarter Unknown command Usage: qmmp [options] [files] Қолданылуы: qmmp [опциялар] [файлдар] Options: Опциялары: Don't start the application Print version number and exit Нұсқасын көрсету мен шығу Ideas, patches, bugreports send to forkotov02@hotmail.ru Ұсыныстар, түзетулер, қателер туралы хабарласыңыз: forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Осы мәтінді көрсету және шығу qmmp-0.7.4/src/app/translations/qmmp_lt.ts0000664000175000017500000001170212256224734017335 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Eiti prie sekančio elemento Skip backwards in playlist Eiti prie ankstesnio elemento Start playing current song Groti dainą Don't clear the playlist Neišvalyti sąrašo Pause current song Pristabdyti dainą Pause if playing, play otherwise Pristabdyti/Groti Stop current song Sustabdyti dainą Display Jump to File dialog Parodyti langą bylos pasirinkimui Quit application Išjungti programą Set playback volume (example: qmmp --volume 20) Nustatyti grojimo garsą (pvz: qmmp --volume 20) Show/hide application Parodyti/Slėpti programą Display Add File dialog Parodyti langą bylų pridėjimui Display Add Directory dialog Parodyti langą aplanko pridėjimui QMMPStarter Usage: qmmp [options] [files] Naudojimas: qmmp [nuostatos] [bylos] Options: Nustatymai: Print version number and exit Parodyti versiją ir išeiti Display this text and exit Parodyti šį tekstą ir išeiti Unknown command Nežinoma komanda Don't start the application Nepaleisti programos Ideas, patches, bugreports send to forkotov02@hotmail.ru Idėjas, pataisymus, klaidas siųsti forkotov02@hotmail.ru QMMP version: %1 QMMP versija: %1 Compiled with Qt version: %1 Sukompiliuota su Qt versija: %1 Using Qt version: %1 Naudojama Qt versija: %1 qmmp-0.7.4/src/app/translations/qmmp_nl.ts0000664000175000017500000001203012256224734017322 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Naar voren schuiven in afspeellijst Skip backwards in playlist Naar achteren schuiven in afspeellijst Start playing current song Begin met afspelen van huidig nummer Don't clear the playlist Niet de afspeellijst leeghalen Pause current song Pauzeer huidig nummer Pause if playing, play otherwise Pauzeer als er wordt gespeeld, anders spelen Stop current song Stop huidig nummer Display Jump to File dialog Weergeef bestandskeuze venster Quit application Sluit applicatie Set playback volume (example: qmmp --volume 20) Verander afspeelvolume (voorbeeld: qmmp --volume 20) Show/hide application Toon/verberg programma Display Add File dialog Toon venster om bestanden toe te voegen Display Add Directory dialog Toon venster om mappen toe te voegen QMMPStarter Usage: qmmp [options] [files] Gebruik: qmmp [opties] [bestanden] Options: Opties: Don't start the application Niet de applicatie starten Print version number and exit Print versienummer en sluit Ideas, patches, bugreports send to forkotov02@hotmail.ru Ideëen, patches, foutrapporten zenden naar forkotov02@hotmail.ru (anglicky) QMMP version: %1 QMMP versie: %1 Compiled with Qt version: %1 Gecompileerd met QT versie: %1 Using Qt version: %1 Gebruikt QT versie: %1 Display this text and exit Toon deze tekst en sluit Unknown command Onbekend commando qmmp-0.7.4/src/app/translations/qmmp_ru.ts0000664000175000017500000001271712256224734017353 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Перейти к следующему фрагменту Skip backwards in playlist Перейти к предыдущему фрагменту Start playing current song Воспроизвести текущую песню Don't clear the playlist Не очищать лист Pause current song Приостановить текущую песню Pause if playing, play otherwise Приостановить/воспроизвести Stop current song Остановить текущую песню Display Jump to File dialog Показать диалог перехода к файлу Quit application Завершить приложение Set playback volume (example: qmmp --volume 20) Установить громкость (пример: qmmp --volume 20) Show/hide application Показать/скрыть приложение Display Add File dialog Показать диалог добавления файлов Display Add Directory dialog Показать диалог добавления директорий QMMPStarter Usage: qmmp [options] [files] Использование: qmmp [options] [files] Options: Опции: Don't start the application Не запускать приложение Print version number and exit Показать версии и выйти Ideas, patches, bugreports send to forkotov02@hotmail.ru Идеи, исправления, отчёты об ошибках: forkotov02@hotmail.ru QMMP version: %1 Версия QMMP: %1 Compiled with Qt version: %1 Собрано с версией Qt: %1 Using Qt version: %1 Используемая версия Qt: %1 Display this text and exit Показать этот текст и выйти Unknown command Неизвестная команда qmmp-0.7.4/src/app/translations/qmmp_sk.ts0000664000175000017500000001202712256224734017334 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Posunúť sa v plaliste Skip backwards in playlist Vrátiť sa v playliste Start playing current song Začať prehrávanie súčasnej piesne Don't clear the playlist Nevyčisťovať playlist Pause current song Pozastaviť súčasnú pieseň Pause if playing, play otherwise Pozastaviť ak hrá, inak hrať Stop current song Zastaviť súčasnú pieseň Display Jump to File dialog Zobraziť dialóg Preskočiť na súbor Quit application Ukončiť program Set playback volume (example: qmmp --volume 20) Nastaviť hlasitosť prehrávania (napríklad: qmmp --volume 20) Show/hide application Zobraziť/skryť program Display Add File dialog Zobraziť dialóg Pridať súbor Display Add Directory dialog Zobraziť dialóg Pridať priečinok QMMPStarter Usage: qmmp [options] [files] Použitie: qmmp [možnosti] [súbory] Options: Možnosti: Don't start the application Nezapnúť program Print version number and exit Vypísať číslo verzie a skončiť Ideas, patches, bugreports send to forkotov02@hotmail.ru Nápady, záplaty, hlásenie chýb posílejte na forkotov02@hotmail.ru (anglicky) QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Zobraziť tento text a skončiť Unknown command Neznámý príkaz qmmp-0.7.4/src/app/translations/qmmp_tr.ts0000664000175000017500000001173412256224734017350 0ustar useruser BuiltinCommandLineOption Skip forward in playlist İleri atla Skip backwards in playlist Geri atla Start playing current song Mevcut şarkıyı çalmaya başla Don't clear the playlist Çalma listesini temizleme Pause current song Mevcut şarkıyı duraklat Pause if playing, play otherwise Çalıyorsa duraklat, değilse oynat Stop current song Mevcut şarkıyı durdur Display Jump to File dialog Dosyaya atlama diyaloğunu göster Quit application Set playback volume (example: qmmp --volume 20) Show/hide application Uygulamayı göster/gizle Display Add File dialog Dosya ekleme diyaloğunu göster Display Add Directory dialog Dizin ekleme diyaloğunu göster QMMPStarter Usage: qmmp [options] [files] Kullanım:qmmp [seçenek] [dosyalar] Options: Seçenekler: Don't start the application Print version number and exit Sürüm numarasını yazdır ve çık Ideas, patches, bugreports send to forkotov02@hotmail.ru Fikirleinizi, yamalarınızı, hata raporlarınızı forkotov02@hotmail.ru adresine gönderin QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Bu metni göster ve çık Unknown command qmmp-0.7.4/src/app/translations/qmmp_pt_BR.ts0000664000175000017500000001137712256224734017734 0ustar useruser BuiltinCommandLineOption Skip forward in playlist Skip backwards in playlist Start playing current song Don't clear the playlist Pause current song Pause if playing, play otherwise Stop current song Display Jump to File dialog Quit application Set playback volume (example: qmmp --volume 20) Show/hide application Display Add File dialog Display Add Directory dialog QMMPStarter Usage: qmmp [options] [files] Options: Don't start the application Print version number and exit Ideas, patches, bugreports send to forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit Unknown command qmmp-0.7.4/src/app/translations/qmmp_zh_CN.ts0000664000175000017500000001167712256224734017732 0ustar useruser BuiltinCommandLineOption Skip forward in playlist 跳到播放列表中的下一曲 Skip backwards in playlist 跳到播放列表中的上一曲 Start playing current song 开始播放当前曲目 Don't clear the playlist 不要清除这个播放列表 Pause current song 暂停当前曲目 Pause if playing, play otherwise 正在播放则暂停,相反处于暂停则播放 Stop current song 停止当前曲目 Display Jump to File dialog 显示跳到文件对话 Quit application Set playback volume (example: qmmp --volume 20) 设置回放音量 (例如:qmmp --volume 20) Show/hide application 显示/隐藏程序 Display Add File dialog 显示添加文件对话 Display Add Directory dialog 显示添加文件夹对话 QMMPStarter Usage: qmmp [options] [files] 使用:qmmp [设置] [文件] Options: 设置: Don't start the application 无法启动此程序 Print version number and exit 显示版本并退出 Ideas, patches, bugreports send to forkotov02@hotmail.ru 建议、补丁或提交 bug 请发送到 forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit 显示这些文本并退出 Unknown command 未知指令 qmmp-0.7.4/src/app/translations/qmmp_zh_TW.ts0000664000175000017500000001167412256224734017761 0ustar useruser BuiltinCommandLineOption Skip forward in playlist 跳到播放清單中的下一曲 Skip backwards in playlist 跳到播放清單中的上一曲 Start playing current song 開始播放目前曲目 Don't clear the playlist 不要清除這個播放清單 Pause current song 暫停目前曲目 Pause if playing, play otherwise 正在播放則暫停,相反處於暫停則播放 Stop current song 停止目前曲目 Display Jump to File dialog 察看跳到文件對話 Quit application Set playback volume (example: qmmp --volume 20) 設置回放音量 (例如:qmmp --volume 20) Show/hide application 察看/隱藏程式 Display Add File dialog 察看添加文件對話 Display Add Directory dialog 察看添加目錄對話 QMMPStarter Usage: qmmp [options] [files] 使用:qmmp [設定] [文件] Options: 設定: Don't start the application 無法啟動此程式 Print version number and exit 察看版本並結束 Ideas, patches, bugreports send to forkotov02@hotmail.ru 建議、補丁或提交 bug 請傳送到 forkotov02@hotmail.ru QMMP version: %1 Compiled with Qt version: %1 Using Qt version: %1 Display this text and exit 察看這些字檔並結束 Unknown command 未知指令 qmmp-0.7.4/src/app/app.pro0000664000175000017500000000400612256224734014074 0ustar useruserinclude(../../qmmp.pri) HEADERS += qmmpstarter.h \ builtincommandlineoption.h \ lxdesupport.h \ qmmpapplication.h SOURCES += \ qmmpstarter.cpp \ builtincommandlineoption.cpp \ lxdesupport.cpp \ main.cpp \ qmmpapplication.cpp # Some conf to redirect intermediate stuff in separate dirs UI_DIR = ./.build/ui/ MOC_DIR = ./.build/moc/ OBJECTS_DIR = ./.build/obj QT += network unix:TARGET = ../../bin/qmmp win32:TARGET = ../../../bin/qmmp CONFIG += thread \ release \ warn_on QMAKE_LIBDIR += ../../lib \ qmmpui LIBS += -Wl,-rpath,../lib unix:LIBS += -L../../lib \ -lqmmp \ -lqmmpui win32:LIBS += -L../../bin \ -lqmmp0 \ -lqmmpui0 win32:RC_FILE = images/56x56/icon.rc INCLUDEPATH += ../ RESOURCES = images/images.qrc TEMPLATE = app unix { target.path = /bin desktop.files = qmmp.desktop \ qmmp_enqueue.desktop \ qmmp_dir.desktop desktop.path = /share/applications icon16.files = images/16x16/qmmp.png icon32.files = images/32x32/qmmp.png icon48.files = images/48x48/qmmp.png icon_svg.files = images/scalable/qmmp.svgz \ images/scalable/qmmp-simple.svgz icon16.path = /share/icons/hicolor/16x16/apps icon32.path = /share/icons/hicolor/32x32/apps icon48.path = /share/icons/hicolor/48x48/apps icon_svg.path = /share/icons/hicolor/scalable/apps INSTALLS += desktop \ target \ icon16 \ icon32 \ icon48 \ icon_svg } RESOURCES += translations/qmmp_locales.qrc TRANSLATIONS = translations/qmmp_ru.ts \ translations/qmmp_tr.ts \ translations/qmmp_zh_CN.ts \ translations/qmmp_cs.ts \ translations/qmmp_pt_BR.ts \ translations/qmmp_uk_UA.ts \ translations/qmmp_zh_TW.ts \ translations/qmmp_de.ts \ translations/qmmp_pl_PL.ts \ translations/qmmp_it.ts \ translations/qmmp_lt.ts \ translations/qmmp_hu.ts \ translations/qmmp_nl.ts \ translations/qmmp_ja.ts \ translations/qmmp_es.ts \ translations/qmmp_sk.ts qmmp-0.7.4/src/app/builtincommandlineoption.cpp0000664000175000017500000002145512256224734020413 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "builtincommandlineoption.h" BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) : QObject(parent) { m_model = 0; m_options << "--enqueue" << "-e" << "--play" << "-p" << "--pause" << "-u" << "--play-pause" << "-t" << "--stop" << "-s" << "--jump-to-file" << "-j" << "--quit" << "-q" << "--volume" << "--next" << "--previous" << "--toggle-visibility" << "--add-file" << "--add-dir"; } BuiltinCommandLineOption::~BuiltinCommandLineOption() { } // BuiltinCommandLineOption methods implementation bool BuiltinCommandLineOption::identify(const QString &str) const { return m_options.contains(str); } const QString BuiltinCommandLineOption::helpString() const { return QString( "-e, --enqueue "+tr("Don't clear the playlist") + "\n" + "-p, --play "+tr("Start playing current song")+"\n" + "-u, --pause "+tr("Pause current song")+ "\n" "-t, --play-pause "+tr("Pause if playing, play otherwise")+ "\n" "-s, --stop "+tr("Stop current song")+ "\n" + "-j, --jump-to-file "+tr("Display Jump to File dialog")+ "\n" + "-q, --quit "+tr("Quit application") + "\n" + "--volume <0..100> "+tr("Set playback volume (example: qmmp --volume 20)") + "\n" "--next "+tr("Skip forward in playlist")+ "\n" + "--previous "+tr("Skip backwards in playlist")+"\n" + "--toggle-visibility "+tr("Show/hide application")+ "\n" + "--add-file "+tr("Display Add File dialog")+ "\n" + "--add-dir "+tr("Display Add Directory dialog") ); } void BuiltinCommandLineOption::executeCommand(const QString &option_string, const QStringList &args, const QString &cwd) { SoundCore *core = SoundCore::instance(); MediaPlayer *player = MediaPlayer::instance(); PlayListManager *pl_manager = PlayListManager::instance(); QmmpUiSettings *settings = QmmpUiSettings::instance(); if(!core || !player) return; if(option_string == "--enqueue" || option_string == "-e" || option_string.isEmpty()) { if(args.isEmpty()) return; QStringList full_path_list, remote_pls_list; foreach(QString s, args) { #ifdef Q_OS_WIN s.replace("\\","/"); #endif if (QFileInfo(s).isAbsolute()) //absolute path full_path_list << s; else if(s.contains("://")) //url { if(PlayListParser::findByUrl(s)) //remote playlist remote_pls_list << s; else full_path_list << s; //url } else //relative path full_path_list << cwd + "/" + s; } //default playlist if(settings->useDefaultPlayList()) { if(!pl_manager->playListNames().contains(settings->defaultPlayListName())) pl_manager->createPlayList(settings->defaultPlayListName()); pl_manager->selectPlayList(settings->defaultPlayListName()); } pl_manager->activatePlayList(pl_manager->selectedPlayList()); m_model = pl_manager->selectedPlayList(); if(option_string.isEmpty()) //clear playlist if option is empty { if (core->state() != Qmmp::Stopped) { core->stop(); qApp->processEvents(); //receive stop signal } m_model = pl_manager->selectedPlayList(); m_model->clear(); if(!full_path_list.isEmpty()) { connect(m_model, SIGNAL(itemAdded(PlayListItem*)), player, SLOT(play())); connect(core, SIGNAL(stateChanged(Qmmp::State)), SLOT(disconnectPl())); connect(m_model, SIGNAL(loaderFinished()), SLOT(disconnectPl())); } } m_model->add(full_path_list); if(!remote_pls_list.isEmpty()) { PlayListDownloader *downloader = new PlayListDownloader(this); connect(downloader, SIGNAL(done(QStringList)), m_model, SLOT(add(QStringList))); connect(downloader, SIGNAL(done(QStringList)), downloader, SLOT(deleteLater())); connect(downloader, SIGNAL(error(QString)), downloader, SLOT(deleteLater())); downloader->start(remote_pls_list.at(0)); } } else if (option_string == "--play" || option_string == "-p") { player->play(); } else if (option_string == "--stop" || option_string == "-s") { core->stop(); } else if (option_string == "--pause" || option_string == "-u") { if(core->state() == Qmmp::Playing) core->pause(); } else if (option_string == "--next") { player->next(); if (core->state() == Qmmp::Stopped) player->play(); } else if (option_string == "--previous") { player->previous(); if (core->state() == Qmmp::Stopped) player->play(); } else if (option_string == "--play-pause" || option_string == "-t") { if (core->state() == Qmmp::Playing) core->pause(); else player->play(); } else if (option_string == "--jump-to-file" || option_string == "-j") { UiHelper::instance()->jumpToTrack(); } else if (option_string == "--quit" || option_string == "-q") { qApp->closeAllWindows(); qApp->quit(); } else if (option_string == "--toggle-visibility") { UiHelper::instance()->toggleVisibility(); } else if (option_string == "--add-file") { UiHelper::instance()->addFile(); } else if (option_string == "--add-dir") { UiHelper::instance()->addDirectory(); } else if (option_string == "--volume" && !args.isEmpty()) { bool ok = false; int volume = args.at(0).toInt(&ok); if (ok) core->setVolume(volume,volume); } } QHash BuiltinCommandLineOption::splitArgs(const QStringList &args) const { QHash commands; foreach(QString arg, args) { if(arg.startsWith("-") || arg.startsWith("--")) commands.insert(arg, QStringList()); else if(!commands.isEmpty()) commands[commands.keys().last()] << arg; } return commands; } void BuiltinCommandLineOption::disconnectPl() { if(m_model) { disconnect(m_model, SIGNAL(itemAdded(PlayListItem*)), MediaPlayer::instance(), SLOT(play())); disconnect(m_model, SIGNAL(loaderFinished()), this, SLOT(disconnectPl())); disconnect(SoundCore::instance(), SIGNAL(stateChanged(Qmmp::State)), this, SLOT(disconnectPl())); m_model = 0; } } qmmp-0.7.4/src/app/qmmpapplication.h0000664000175000017500000000340712256224734016145 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMPAPPLICATION_H #define QMMPAPPLICATION_H #include /** @author Ilya Kotov */ class QmmpApplication : public QApplication { Q_OBJECT public: explicit QmmpApplication(int &argc, char **argv); void commitData(QSessionManager &manager); }; #endif // QMMPAPPLICATION_H qmmp-0.7.4/src/app/lxdesupport.cpp0000664000175000017500000000431512256224734015672 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "lxdesupport.h" void LXDESupport::load() { if(qgetenv("XDG_CURRENT_DESKTOP") != "LXDE") return; QString config_dir = qgetenv("XDG_CONFIG_HOME"); if(config_dir.isEmpty()) config_dir = QDir::homePath() + "/.config/"; QString config_file = config_dir + "/lxsession/LXDE/desktop.conf"; if(qgetenv("DESKTOP_SESSION") == "Lubuntu") { qDebug("LXDESupport: using Lubuntu configuration"); config_file = config_dir + "/lxsession/Lubuntu/desktop.conf"; } QSettings lxde_settings(config_file, QSettings::IniFormat); QString themeName = lxde_settings.value("GTK/sNet/IconThemeName").toString(); if(!themeName.isEmpty()) QIcon::setThemeName(themeName); } qmmp-0.7.4/src/qmmp/0000775000175000017500000000000012256224752012764 5ustar useruserqmmp-0.7.4/src/qmmp/equ/0000775000175000017500000000000012256224734013556 5ustar useruserqmmp-0.7.4/src/qmmp/equ/iir.c0000664000175000017500000000417712256224734014516 0ustar useruser/* * PCM time-domain equalizer * * Copyright (C) 2002-2005 Felipe Rivera * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: iir.c,v 1.15 2005/10/17 01:57:59 liebremx Exp $ */ #include #include "iir.h" /* Coefficients */ sIIRCoefficients *iir_cf; /* Volume gain * values should be between 0.0 and 1.0 * Use the preamp from XMMS for now * */ float preamp[EQ_CHANNELS]; #ifdef BENCHMARK #include "benchmark.h" double timex = 0.0; int count = 0; unsigned int blength = 0; #endif /* * Equalizer settings */ unsigned int rate = 0; int band_count = 0; void set_preamp(int chn, float val) { preamp[chn] = val; } /* Init the filters */ void init_iir(unsigned int srate, int band_num) { calc_coeffs(); #if 0 band_count = cfg.band_num; #endif if(srate == rate && band_num == band_count) return; band_count = band_num; rate = srate; iir_cf = get_coeffs(&band_count, rate); clean_history(); } #ifdef ARCH_X86 /* Round function provided by Frank Klemm which saves around 100K * CPU cycles in my PIII for each call to the IIR function with 4K samples */ __inline__ int round_trick(float floatvalue_to_round) { float floattmp ; int rounded_value ; floattmp = (int) 0x00FD8000L + (floatvalue_to_round); rounded_value = *(int*)(&floattmp) - (int)0x4B7D8000L; if ( rounded_value != (short) rounded_value ) rounded_value = ( rounded_value >> 31 ) ^ 0x7FFF; return rounded_value; } #endif qmmp-0.7.4/src/qmmp/equ/iir.h0000664000175000017500000000426412256224734014520 0ustar useruser/* * PCM time-domain equalizer * * Copyright (C) 2002-2005 Felipe Rivera * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: iir.h,v 1.12 2005/10/17 01:57:59 liebremx Exp $ */ #ifndef IIR_H #define IIR_H //#include //#include "main.h" #include "iir_cfs.h" /* * Flush-to-zero to avoid flooding the CPU with underflow exceptions */ #ifdef SSE_MATH #define FTZ 0x8000 #define FTZ_ON { \ unsigned int mxcsr; \ __asm__ __volatile__ ("stmxcsr %0" : "=m" (*&mxcsr)); \ mxcsr |= FTZ; \ __asm__ __volatile__ ("ldmxcsr %0" : : "m" (*&mxcsr)); \ } #define FTZ_OFF { \ unsigned int mxcsr; \ __asm__ __volatile__ ("stmxcsr %0" : "=m" (*&mxcsr)); \ mxcsr &= ~FTZ; \ __asm__ __volatile__ ("ldmxcsr %0" : : "m" (*&mxcsr)); \ } #else #define FTZ_ON #define FTZ_OFF #endif /* * Function prototypes */ void init_iir(unsigned int srate, int band_num); void clean_history(); void set_gain(int index, int chn, float val); void set_preamp(int chn, float val); int iir(void * d, int length, int nch); int iir32(void * d, int length, int nch); int iir24(void * d, int length, int nch); #ifdef ARCH_X86 __inline__ int round_trick(float floatvalue_to_round); #endif #ifdef ARCH_PPC __inline__ int round_ppc(float x); #endif #define EQ_CHANNELS 6 #define EQ_MAX_BANDS 32 extern float preamp[EQ_CHANNELS]; extern sIIRCoefficients *iir_cf; extern int band_count; #ifdef BENCHMARK extern double timex; extern int count; extern unsigned int blength; #endif #endif /* #define IIR_H */ qmmp-0.7.4/src/qmmp/equ/iir_cfs.c0000664000175000017500000002162012256224734015341 0ustar useruser/* * Copyright (C) 2002-2005 Felipe Rivera * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * Coefficient stuff * * $Id: iir_cfs.c,v 1.1 2005/10/17 01:57:59 liebremx Exp $ */ #include "iir_cfs.h" #include #include /*************************** * IIR filter coefficients * ***************************/ static sIIRCoefficients iir_cf10_11k_11025[10] __attribute__((aligned)); static sIIRCoefficients iir_cf10_22k_22050[10] __attribute__((aligned)); static sIIRCoefficients iir_cforiginal10_44100[10] __attribute__((aligned)); static sIIRCoefficients iir_cforiginal10_48000[10] __attribute__((aligned)); static sIIRCoefficients iir_cf10_44100[10] __attribute__((aligned)); static sIIRCoefficients iir_cf10_48000[10] __attribute__((aligned)); static sIIRCoefficients iir_cf10_96000[10] __attribute__((aligned)); static sIIRCoefficients iir_cf15_44100[15] __attribute__((aligned)); static sIIRCoefficients iir_cf15_48000[15] __attribute__((aligned)); static sIIRCoefficients iir_cf15_96000[15] __attribute__((aligned)); static sIIRCoefficients iir_cf25_44100[25] __attribute__((aligned)); static sIIRCoefficients iir_cf25_48000[25] __attribute__((aligned)); static sIIRCoefficients iir_cf25_96000[25] __attribute__((aligned)); static sIIRCoefficients iir_cf31_44100[31] __attribute__((aligned)); static sIIRCoefficients iir_cf31_48000[31] __attribute__((aligned)); static sIIRCoefficients iir_cf31_96000[31] __attribute__((aligned)); /****************************************************************** * Definitions and data structures to calculate the coefficients ******************************************************************/ static const double band_f011k[] = { 31, 62, 125, 250, 500, 1000, 2000, 3000, 4000, 5500 }; static const double band_f022k[] = { 31, 62, 125, 250, 500, 1000, 2000, 4000, 8000, 11000 }; static const double band_f010[] = { 31, 62, 125, 250, 500, 1000, 2000, 4000, 8000, 16000 }; static const double band_original_f010[] = { 60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000 }; static const double band_f015[] = { 25,40,63,100,160,250,400,630,1000,1600,2500,4000,6300,10000,16000 }; static const double band_f025[] = { 20,31.5,40,50,80,100,125,160,250,315,400,500,800, 1000,1250,1600,2500,3150,4000,5000,8000,10000,12500,16000,20000 }; static const double band_f031[] = { 20,25,31.5,40,50,63,80,100,125,160,200,250,315,400,500,630,800, 1000,1250,1600,2000,2500,3150,4000,5000,6300,8000,10000,12500,16000,20000 }; #define GAIN_F0 1.0 #define GAIN_F1 GAIN_F0 / M_SQRT2 #define SAMPLING_FREQ 44100.0 #define TETA(f) (2*M_PI*(double)f/bands[n].sfreq) #define TWOPOWER(value) (value * value) #define BETA2(tf0, tf) \ (TWOPOWER(GAIN_F1)*TWOPOWER(cos(tf0)) \ - 2.0 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \ + TWOPOWER(GAIN_F1) \ - TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf))) #define BETA1(tf0, tf) \ (2.0 * TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf)) \ + TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf0)) \ - 2.0 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \ - TWOPOWER(GAIN_F1) + TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf))) #define BETA0(tf0, tf) \ (0.25 * TWOPOWER(GAIN_F1) * TWOPOWER(cos(tf0)) \ - 0.5 * TWOPOWER(GAIN_F1) * cos(tf) * cos(tf0) \ + 0.25 * TWOPOWER(GAIN_F1) \ - 0.25 * TWOPOWER(GAIN_F0) * TWOPOWER(sin(tf))) #define GAMMA(beta, tf0) ((0.5 + beta) * cos(tf0)) #define ALPHA(beta) ((0.5 - beta)/2.0) struct { sIIRCoefficients *coeffs; const double *cfs; double octave; int band_count; double sfreq; } bands[] = { { iir_cf10_11k_11025, band_f011k, 1.0, 10, 11025.0 }, { iir_cf10_22k_22050, band_f022k, 1.0, 10, 22050.0 }, { iir_cforiginal10_44100, band_original_f010, 1.0, 10, 44100.0 }, { iir_cforiginal10_48000, band_original_f010, 1.0, 10, 48000.0 }, { iir_cf10_44100, band_f010, 1.0, 10, 44100.0 }, { iir_cf10_48000, band_f010, 1.0, 10, 48000.0 }, { iir_cf10_96000, band_f010, 1.0, 10, 96000.0 }, { iir_cf15_44100, band_f015, 2.0/3.0, 15, 44100.0 }, { iir_cf15_48000, band_f015, 2.0/3.0, 15, 48000.0 }, { iir_cf15_96000, band_f015, 2.0/3.0, 15, 96000.0 }, { iir_cf25_44100, band_f025, 1.0/3.0, 25, 44100.0 }, { iir_cf25_48000, band_f025, 1.0/3.0, 25, 48000.0 }, { iir_cf25_96000, band_f025, 1.0/3.0, 25, 96000.0 }, { iir_cf31_44100, band_f031, 1.0/3.0, 31, 44100.0 }, { iir_cf31_48000, band_f031, 1.0/3.0, 31, 48000.0 }, { iir_cf31_96000, band_f031, 1.0/3.0, 31, 96000.0 }, { 0, 0, 0, 0, 0 } }; /************* * Functions * *************/ /* Get the coeffs for a given number of bands and sampling frequency */ sIIRCoefficients* get_coeffs(int *bands, unsigned int sfreq) { sIIRCoefficients *iir_cf = 0; switch(sfreq) { case 11025: iir_cf = iir_cf10_11k_11025; *bands = 10; break; case 22050: iir_cf = iir_cf10_22k_22050; *bands = 10; break; case 48000: switch(*bands) { case 31: iir_cf = iir_cf31_48000; break; case 25: iir_cf = iir_cf25_48000; break; case 15: iir_cf = iir_cf15_48000; break; default: iir_cf = iir_cforiginal10_48000; break; } break; case 96000: switch(*bands) { case 31: iir_cf = iir_cf31_96000; break; case 25: iir_cf = iir_cf25_96000; break; case 15: iir_cf = iir_cf15_96000; break; default: iir_cf = iir_cf10_96000; break; } break; default: switch(*bands) { case 31: iir_cf = iir_cf31_44100; break; case 25: iir_cf = iir_cf25_44100; break; case 15: iir_cf = iir_cf15_44100; break; default: iir_cf = iir_cforiginal10_44100; break; } break; } return iir_cf; } /* Get the freqs at both sides of F0. These will be cut at -3dB */ static void find_f1_and_f2(double f0, double octave_percent, double *f1, double *f2) { double octave_factor = pow(2.0, octave_percent/2.0); *f1 = f0/octave_factor; *f2 = f0*octave_factor; } /* Find the quadratic root * Always return the smallest root */ static int find_root(double a, double b, double c, double *x0) { double k = c-((b*b)/(4.*a)); double h = -(b/(2.*a)); double x1 = 0.; if (-(k/a) < 0.) return -1; *x0 = h - sqrt(-(k/a)); x1 = h + sqrt(-(k/a)); if (x1 < *x0) *x0 = x1; return 0; } /* Calculate all the coefficients as specified in the bands[] array */ void calc_coeffs() { int i, n; double f1, f2; double x0; n = 0; for (; bands[n].cfs; n++) { double *freqs = (double *)bands[n].cfs; for (i=0; i * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: iir_cfs.h,v 1.1 2005/10/17 01:57:59 liebremx Exp $ */ #ifndef IIR_CFS_H #define IIR_CFS_H //#include /* Coefficients entry */ typedef struct { float beta; float alpha; float gamma; float dummy; // Word alignment }sIIRCoefficients; sIIRCoefficients* get_coeffs(int *bands, unsigned int sfreq); //, bool use_xmms_original_freqs); void calc_coeffs(); #endif qmmp-0.7.4/src/qmmp/equ/iir_fpu.c0000664000175000017500000002523312256224734015364 0ustar useruser/* * PCM time-domain equalizer * * Copyright (C) 2002-2006 Felipe Rivera * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: iir_fpu.c,v 1.4 2006/01/15 00:26:32 liebremx Exp $ */ #include #include #include "iir_fpu.h" #include "iir.h" static sXYData data_history[EQ_MAX_BANDS][EQ_CHANNELS] __attribute__((aligned)); static sXYData data_history2[EQ_MAX_BANDS][EQ_CHANNELS] __attribute__((aligned)); float gain[EQ_MAX_BANDS][EQ_CHANNELS] __attribute__((aligned)); /* random noise */ sample_t dither[256]; int di; void set_gain(int index, int chn, float val) { gain[index][chn] = val; } void clean_history() { int n; /* Zero the history arrays */ memset(data_history, 0, sizeof(sXYData) * EQ_MAX_BANDS * EQ_CHANNELS); memset(data_history2, 0, sizeof(sXYData) * EQ_MAX_BANDS * EQ_CHANNELS); /* this is only needed if we use fpu code and there's no other place for the moment to init the dither array*/ for (n = 0; n < 256; n++) { dither[n] = (rand() % 4) - 2; } di = 0; } __inline__ int iir(void * d, int length, int nch) { // FTZ_ON; short *data = (short *) d; /* Indexes for the history arrays * These have to be kept between calls to this function * hence they are static */ static int i = 2, j = 1, k = 0; int index, band, channel; int tempgint, halflength; sample_t out[EQ_CHANNELS], pcm[EQ_CHANNELS]; // Load the correct filter table according to the sampling rate if needed /*if (srate != rate) { band_count = eqcfg.band_num; rate = srate; iir_cf = get_coeffs(&band_count, rate, eqcfg.use_xmms_original_freqs); clean_history(); }*/ #ifdef BENCHMARK start_counter(); #endif //BENCHMARK /** * IIR filter equation is * y[n] = 2 * (alpha*(x[n]-x[n-2]) + gamma*y[n-1] - beta*y[n-2]) * * NOTE: The 2 factor was introduced in the coefficients to save * a multiplication * * This algorithm cascades two filters to get nice filtering * at the expense of extra CPU cycles */ /* 16bit, 2 bytes per sample, so divide by two the length of * the buffer (length is in bytes) */ halflength = (length >> 1); for (index = 0; index < halflength; index+=nch) { /* For each channel */ for (channel = 0; channel < nch; channel++) { pcm[channel] = data[index+channel]; /* Preamp gain */ pcm[channel] *= preamp[channel]; /* add random noise */ pcm[channel] += dither[di]; out[channel] = 0.; /* For each band */ for (band = 0; band < band_count; band++) { /* Store Xi(n) */ data_history[band][channel].x[i] = pcm[channel]; /* Calculate and store Yi(n) */ data_history[band][channel].y[i] = ( /* = alpha * [x(n)-x(n-2)] */ iir_cf[band].alpha * ( data_history[band][channel].x[i] - data_history[band][channel].x[k]) /* + gamma * y(n-1) */ + iir_cf[band].gamma * data_history[band][channel].y[j] /* - beta * y(n-2) */ - iir_cf[band].beta * data_history[band][channel].y[k] ); /* * The multiplication by 2.0 was 'moved' into the coefficients to save * CPU cycles here */ /* Apply the gain */ out[channel] += data_history[band][channel].y[i]*gain[band][channel]; // * 2.0; } /* For each band */ //if (eqcfg.extra_filtering) { /* Filter the sample again */ for (band = 0; band < band_count; band++) { /* Store Xi(n) */ data_history2[band][channel].x[i] = out[channel]; /* Calculate and store Yi(n) */ data_history2[band][channel].y[i] = ( /* y(n) = alpha * [x(n)-x(n-2)] */ iir_cf[band].alpha * (data_history2[band][channel].x[i] - data_history2[band][channel].x[k]) /* + gamma * y(n-1) */ + iir_cf[band].gamma * data_history2[band][channel].y[j] /* - beta * y(n-2) */ - iir_cf[band].beta * data_history2[band][channel].y[k] ); /* Apply the gain */ out[channel] += data_history2[band][channel].y[i]*gain[band][channel]; } /* For each band */ } /* Volume stuff Scale down original PCM sample and add it to the filters output. This substitutes the multiplication by 0.25 Go back to use the floating point multiplication before the conversion to give more dynamic range */ out[channel] += pcm[channel]*0.25; /* remove random noise */ out[channel] -= dither[di]*0.25; /* Round and convert to integer */ #ifdef ARCH_PPC tempgint = round_ppc(out[channel]); #else #ifdef ARCH_X86 tempgint = round_trick(out[channel]); #else tempgint = (int)out[channel]; #endif #endif /* Limit the output */ if (tempgint < -32768) data[index+channel] = -32768; else if (tempgint > 32767) data[index+channel] = 32767; else data[index+channel] = tempgint; } /* For each channel */ /* Wrap around the indexes */ i = (i+1)%3; j = (j+1)%3; k = (k+1)%3; /* random noise index */ di = (di + 1) % 256; }/* For each pair of samples */ #ifdef BENCHMARK timex += get_counter(); blength += length; if (count++ == 1024) { printf("FLOATING POINT: %f %d\n",timex/1024.0, blength/1024); blength = 0; timex = 0.; count = 0; } #endif // BENCHMARK // FTZ_OFF; return length; } __inline__ int iir32(void * d, int length, int nch) { // FTZ_ON; int *data = (int *) d; /* Indexes for the history arrays * These have to be kept between calls to this function * hence they are static */ static int i = 2, j = 1, k = 0; int index, band, channel; int tempgint, quaterlength; sample_t out[EQ_CHANNELS], pcm[EQ_CHANNELS]; // Load the correct filter table according to the sampling rate if needed /*if (srate != rate) { band_count = eqcfg.band_num; rate = srate; iir_cf = get_coeffs(&band_count, rate, eqcfg.use_xmms_original_freqs); clean_history(); }*/ #ifdef BENCHMARK start_counter(); #endif //BENCHMARK /** * IIR filter equation is * y[n] = 2 * (alpha*(x[n]-x[n-2]) + gamma*y[n-1] - beta*y[n-2]) * * NOTE: The 2 factor was introduced in the coefficients to save * a multiplication * * This algorithm cascades two filters to get nice filtering * at the expense of extra CPU cycles */ /* 32bit, 4 bytes per sample, so divide by four the length of * the buffer (length is in bytes) */ quaterlength = (length >> 2); for (index = 0; index < quaterlength; index+=nch) { /* For each channel */ for (channel = 0; channel < nch; channel++) { pcm[channel] = data[index+channel]; /* Preamp gain */ pcm[channel] *= preamp[channel]; /* add random noise */ pcm[channel] += dither[di]; out[channel] = 0.; /* For each band */ for (band = 0; band < band_count; band++) { /* Store Xi(n) */ data_history[band][channel].x[i] = pcm[channel]; /* Calculate and store Yi(n) */ data_history[band][channel].y[i] = ( /* = alpha * [x(n)-x(n-2)] */ iir_cf[band].alpha * ( data_history[band][channel].x[i] - data_history[band][channel].x[k]) /* + gamma * y(n-1) */ + iir_cf[band].gamma * data_history[band][channel].y[j] /* - beta * y(n-2) */ - iir_cf[band].beta * data_history[band][channel].y[k] ); /* * The multiplication by 2.0 was 'moved' into the coefficients to save * CPU cycles here */ /* Apply the gain */ out[channel] += data_history[band][channel].y[i]*gain[band][channel]; // * 2.0; } /* For each band */ //if (eqcfg.extra_filtering) { /* Filter the sample again */ for (band = 0; band < band_count; band++) { /* Store Xi(n) */ data_history2[band][channel].x[i] = out[channel]; /* Calculate and store Yi(n) */ data_history2[band][channel].y[i] = ( /* y(n) = alpha * [x(n)-x(n-2)] */ iir_cf[band].alpha * (data_history2[band][channel].x[i] - data_history2[band][channel].x[k]) /* + gamma * y(n-1) */ + iir_cf[band].gamma * data_history2[band][channel].y[j] /* - beta * y(n-2) */ - iir_cf[band].beta * data_history2[band][channel].y[k] ); /* Apply the gain */ out[channel] += data_history2[band][channel].y[i]*gain[band][channel]; } /* For each band */ } /* Volume stuff Scale down original PCM sample and add it to the filters output. This substitutes the multiplication by 0.25 Go back to use the floating point multiplication before the conversion to give more dynamic range */ out[channel] += pcm[channel]*0.25; /* remove random noise */ out[channel] -= dither[di]*0.25; /* Round and convert to integer */ #ifdef ARCH_PPC tempgint = round_ppc(out[channel]); #else #ifdef ARCH_X86 tempgint = round_trick(out[channel]); #else tempgint = (int)out[channel]; #endif #endif data[index+channel] = tempgint; } /* For each channel */ /* Wrap around the indexes */ i = (i+1)%3; j = (j+1)%3; k = (k+1)%3; /* random noise index */ di = (di + 1) % 256; }/* For each pair of samples */ #ifdef BENCHMARK timex += get_counter(); blength += length; if (count++ == 1024) { printf("FLOATING POINT: %f %d\n",timex/1024.0, blength/1024); blength = 0; timex = 0.; count = 0; } #endif // BENCHMARK // FTZ_OFF; return length; } __inline__ int iir24(void * d, int length, int nch) { int *data = (int *) d; int index; for (index = 0; index < length; index++) { if(data[index] & 0x800000) data[index] |= 0xff000000; } return iir32(d, length, nch); } qmmp-0.7.4/src/qmmp/equ/iir_fpu.h0000664000175000017500000000234612256224734015371 0ustar useruser/* * PCM time-domain equalizer * * Copyright (C) 2002-2006 Felipe Rivera * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: iir_fpu.h,v 1.3 2006/01/15 00:26:32 liebremx Exp $$ */ #ifndef IIR_FPU_H #define IIR_FPU_H #define sample_t double /* * Normal FPU implementation data structures */ /* Coefficient history for the IIR filter */ typedef struct { sample_t x[3]; /* x[n], x[n-1], x[n-2] */ sample_t y[3]; /* y[n], y[n-1], y[n-2] */ sample_t dummy1; // Word alignment sample_t dummy2; }sXYData; #endif qmmp-0.7.4/src/qmmp/eqsettings.h0000664000175000017500000000661712256224734015335 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQSETTINGS_H #define EQSETTINGS_H /*! @brief The EqSettings class helps to work with equalizer settings. * @author Ilya Kotov */ class EqSettings { public: /*! * Constructs an empty equalizer settings (0 dB, disabled) * @param bands - Number of bands (supported: 10, 15, 25, 31) */ EqSettings(int bands = EQ_BANDS_10); /*! * Returns \b true if equalizer os enabled, otherwise returns \b false. */ bool isEnabled() const; /*! * Returns gain of the channel number \b chan. */ double gain(int chan) const; /*! * Returns equalizer preamp. */ double preamp() const; /*! * Returns number of bands */ int bands() const; /*! * Enables equalizer if \p enabled is \b true or disables it if \p enabled is \b false. */ void setEnabled(bool enabled = true); /*! * Sets gain of the equalizer channel. * @param band Number of equalizer band. * @param gain Channel gain (-20.0..20.0 dB) */ void setGain(int band, double gain); /*! * Sets equalizer preamp to \b preamp. */ void setPreamp(double preamp); /*! * Assigns equalizer settings \b s to this settings. */ void operator=(const EqSettings &s); /*! * Returns \b true if equalizer settins \b s is equal to this settings; otherwise returns false. */ bool operator==(const EqSettings &s) const; /*! * Returns \b true if equalizer settins \b s is not equal to this settings; otherwise returns false. */ bool operator!=(const EqSettings &s) const; /*! * Equalizer bands number */ enum BANDS { EQ_BANDS_10 = 10, /*!< 10 bands */ EQ_BANDS_15 = 15, /*!< 15 bands */ EQ_BANDS_25 = 25, /*!< 25 bands */ EQ_BANDS_31 = 31 /*!< 31 bands */ }; private: double m_gains[31]; double m_preamp; bool m_is_enabled; int m_bands; }; #endif // EQSETTINGS_H qmmp-0.7.4/src/qmmp/outputwriter.cpp0000664000175000017500000002702312256224734016271 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "statehandler.h" #include "visual.h" #include "output.h" #include "volumecontrol_p.h" #include "outputwriter_p.h" extern "C" { #include "equ/iir.h" } //static functions static inline void s8_to_s16(qint8 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] << 8; return; } static inline void s24_to_s16(qint32 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] >> 8; return; } static inline void s32_to_s16(qint32 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] >> 16; return; } OutputWriter::OutputWriter (QObject* parent) : QThread (parent) { m_handler = StateHandler::instance(); m_frequency = 0; m_channels = 0; m_output = 0; m_format = Qmmp::PCM_UNKNOWM; m_totalWritten = 0; m_currentMilliseconds = -1; m_bytesPerMillisecond = 0; m_userStop = false; m_finish = false; m_visBuffer = 0; m_visBufferSize = 0; m_kbps = 0; m_skip = false; m_pause = false; m_prev_pause = false; m_useEq = false; m_eqEnabled = false; m_settings = QmmpSettings::instance(); connect(m_settings,SIGNAL(eqSettingsChanged()), SLOT(updateEqSettings())); updateEqSettings(); } OutputWriter::~OutputWriter() { if(m_output) { delete m_output; m_output = 0; } if(m_visBuffer) { delete[] m_visBuffer; m_visBuffer = 0; } } bool OutputWriter::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { m_output = Output::create(); if(!m_output) { qWarning("OutputWriter: unable to create output"); return false; } if (!m_output->initialize(freq, chan, format)) { qWarning("OutputWriter: unable to initialize output"); delete m_output; m_output = 0; return false; } m_frequency = m_output->sampleRate(); m_channels = m_output->channels(); m_format = m_output->format(); QMap formatNames; formatNames.insert(Qmmp::PCM_S8, "s8"); formatNames.insert(Qmmp::PCM_S16LE, "s16le"); formatNames.insert(Qmmp::PCM_S24LE, "s24le"); formatNames.insert(Qmmp::PCM_S32LE, "s32le"); qDebug("OutputWriter: [%s] %d Hz, %d ch, %s", qPrintable(Output::currentFactory()->properties().shortName), freq, chan, qPrintable(formatNames.value(format))); m_bytesPerMillisecond = freq * chan * AudioParameters::sampleSize(format) / 1000; m_recycler.configure(freq, chan, format); //calculate output buffer size //visual buffer if(m_visBuffer) delete [] m_visBuffer; m_visBufferSize = QMMP_BLOCK_FRAMES * 2 * chan; //16-bit samples if(m_format != Qmmp::PCM_S16LE) m_visBuffer = new unsigned char [m_visBufferSize]; m_useEq = m_eqEnabled && m_frequency && m_format == Qmmp::PCM_S16LE; if(m_frequency) { init_iir(m_frequency, m_settings->eqSettings().bands()); clean_history(); } return true; } void OutputWriter::pause() { mutex()->lock(); m_pause = !m_pause; mutex()->unlock(); Qmmp::State state = m_pause ? Qmmp::Paused: Qmmp::Playing; dispatch(state); } void OutputWriter::stop() { m_userStop = true; } void OutputWriter::finish() { m_finish = true; } void OutputWriter::seek(qint64 pos, bool reset) { m_totalWritten = pos * m_bytesPerMillisecond; m_currentMilliseconds = -1; m_skip = isRunning() && reset; } Recycler *OutputWriter::recycler() { return &m_recycler; } QMutex *OutputWriter::mutex() { return &m_mutex; } AudioParameters OutputWriter::audioParameters() const { return AudioParameters(m_frequency, m_channels, m_format); } quint32 OutputWriter::sampleRate() { return m_frequency; } int OutputWriter::channels() { return m_channels; } Qmmp::AudioFormat OutputWriter::format() const { return m_format; } int OutputWriter::sampleSize() const { return AudioParameters::sampleSize(m_format); } void OutputWriter::dispatchVisual (Buffer *buffer) { if (!buffer) return; int sampleSize = AudioParameters::sampleSize(m_format); int samples = buffer->nbytes/sampleSize; int outSize = samples*2; if((m_format != Qmmp::PCM_S16LE) && outSize > m_visBufferSize) //increase buffer size { delete[] m_visBuffer; m_visBufferSize = outSize; m_visBuffer = new unsigned char [m_visBufferSize]; } switch(m_format) { case Qmmp::PCM_S8: s8_to_s16((qint8 *)buffer->data, (qint16 *) m_visBuffer, samples); break; case Qmmp::PCM_S16LE: m_visBuffer = buffer->data; outSize = buffer->nbytes; break; case Qmmp::PCM_S24LE: s24_to_s16((qint32 *)buffer->data, (qint16 *) m_visBuffer, samples); break; case Qmmp::PCM_S32LE: s32_to_s16((qint32 *)buffer->data, (qint16 *) m_visBuffer, samples); break; default: return; } foreach (Visual *visual, *Visual::visuals()) { visual->mutex()->lock (); visual->add (m_visBuffer, outSize, m_channels); visual->mutex()->unlock(); } if(m_format == Qmmp::PCM_S16LE) m_visBuffer = 0; } void OutputWriter::clearVisuals() { foreach (Visual *visual, *Visual::visuals()) { visual->mutex()->lock (); visual->clear (); visual->mutex()->unlock(); } } void OutputWriter::dispatch(qint64 elapsed, int bitrate, int frequency, int precision, int channels) { if (m_handler) m_handler->dispatch(elapsed, bitrate, frequency, precision, channels); } void OutputWriter::dispatch(const Qmmp::State &state) { if (m_handler) m_handler->dispatch(state); if (state == Qmmp::Stopped) clearVisuals(); } void OutputWriter::run() { mutex()->lock (); if (!m_bytesPerMillisecond) { qWarning("OutputWriter: invalid audio parameters"); mutex()->unlock (); return; } mutex()->unlock (); bool done = false; Buffer *b = 0; qint64 l, m = 0; dispatch(Qmmp::Playing); while (!done) { mutex()->lock (); if(m_pause != m_prev_pause) { if(m_pause) { m_output->suspend(); mutex()->unlock(); m_prev_pause = m_pause; continue; } else m_output->resume(); m_prev_pause = m_pause; } recycler()->mutex()->lock (); done = m_userStop || (m_finish && recycler()->empty()); while (!done && (recycler()->empty() || m_pause)) { recycler()->cond()->wakeOne(); mutex()->unlock(); recycler()->cond()->wait(recycler()->mutex()); mutex()->lock (); done = m_userStop || m_finish; } status(); if (!b) { b = recycler()->next(); if (b && b->rate) m_kbps = b->rate; } recycler()->cond()->wakeOne(); recycler()->mutex()->unlock(); mutex()->unlock(); if (b) { if (m_useEq) { switch(m_format) { case Qmmp::PCM_S16LE: iir((void*) b->data, b->nbytes, m_channels); break; case Qmmp::PCM_S24LE: iir24((void*) b->data, b->nbytes, m_channels); break; case Qmmp::PCM_S32LE: iir32((void*) b->data, b->nbytes, m_channels); break; default: ; } } dispatchVisual(b); if (SoftwareVolume::instance()) SoftwareVolume::instance()->changeVolume(b, m_channels, m_format); l = 0; m = 0; while (l < b->nbytes && !m_pause) { mutex()->lock(); if(m_skip) { m_skip = false; m_output->reset(); mutex()->unlock(); break; } mutex()->unlock(); m = m_output->writeAudio(b->data + l, b->nbytes - l); if(m >= 0) { m_totalWritten += m; l+= m; } else break; } if(m < 0) break; } mutex()->lock(); //force buffer change recycler()->mutex()->lock (); recycler()->done(); recycler()->mutex()->unlock(); b = 0; mutex()->unlock(); } mutex()->lock (); //write remaining data if(m_finish) { m_output->drain(); #ifdef Q_OS_WIN qDebug("OutputWriter: total written %I64d", m_totalWritten); #else qDebug("OutputWriter: total written %lld", m_totalWritten); #endif } dispatch(Qmmp::Stopped); mutex()->unlock(); } void OutputWriter::status() { qint64 ct = m_totalWritten / m_bytesPerMillisecond - m_output->latency(); if (ct < 0) ct = 0; if (ct > m_currentMilliseconds) { m_currentMilliseconds = ct; dispatch(m_currentMilliseconds, m_kbps, m_frequency, AudioParameters::sampleSize(m_format)*8, m_channels); } } void OutputWriter::updateEqSettings() { mutex()->lock(); m_eqEnabled = m_settings->eqSettings().isEnabled(); double preamp = m_settings->eqSettings().preamp(); int bands = m_settings->eqSettings().bands(); init_iir(m_frequency, bands); set_preamp(0, 1.0 + 0.0932471 *preamp + 0.00279033 * preamp * preamp); set_preamp(1, 1.0 + 0.0932471 *preamp + 0.00279033 * preamp * preamp); for(int i = 0; i < bands; ++i) { double value = m_settings->eqSettings().gain(i); set_gain(i,0, 0.03*value+0.000999999*value*value); set_gain(i,1, 0.03*value+0.000999999*value*value); } m_useEq = isRunning() && m_eqEnabled; mutex()->unlock(); } qmmp-0.7.4/src/qmmp/outputwriter_p.h0000664000175000017500000001021012256224734016243 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTWRITER_P_H #define OUTPUTWRITER_P_H #include #include #include "recycler_p.h" #include "audioparameters.h" class QTimer; class QmmpSettings; class StateHandler; class Output; /** @internal @brief Output thread. @author Ilya Kotov */ class OutputWriter : public QThread { Q_OBJECT public: explicit OutputWriter(QObject *parent = 0); virtual ~OutputWriter(); /*! * Prepares object for usage and setups required audio parameters. * @param freq Sample rate. * @param chan Number of channels. * @param format Audio format * @return initialization result (\b true - success, \b false - failure) */ bool initialize(quint32 freq, int chan, Qmmp::AudioFormat format); /*! * Requests playback to pause. If it was paused already, playback should resume. */ void pause(); /*! * Requests playback to stop. */ void stop(); /*! * Requests playback to finish. */ void finish(); /*! * Requests a seek to the time \b pos indicated, specified in milliseconds. * If \b reset is \b true, this function also clears internal output buffers for faster seeking; * otherwise does nothing with buffers. */ void seek(qint64 pos, bool reset = false); /*! * Returns Recycler pointer. */ Recycler *recycler(); /*! * Returns mutex pointer. */ QMutex *mutex(); /*! * Returns selected audio parameters. */ AudioParameters audioParameters() const; /*! * Returns samplerate. */ quint32 sampleRate(); /*! * Returns channels number. */ int channels(); /*! * Returns selected audio format. */ Qmmp::AudioFormat format() const; /*! * Returns sample size in bytes. */ int sampleSize() const; private slots: void updateEqSettings(); private: void run(); //thread run function void status(); void dispatch(qint64 elapsed, int bitrate, int frequency, int bits, int channels); void dispatch(const Qmmp::State &state); void dispatchVisual(Buffer *buffer); void clearVisuals(); bool m_skip; QMutex m_mutex; Recycler m_recycler; StateHandler *m_handler; quint32 m_frequency; int m_channels, m_kbps; Qmmp::AudioFormat m_format; qint64 m_bytesPerMillisecond; bool m_userStop, m_pause; bool m_prev_pause; bool m_finish; bool m_useEq, m_eqEnabled; qint64 m_totalWritten, m_currentMilliseconds; unsigned char *m_visBuffer; qint64 m_visBufferSize; QmmpSettings *m_settings; Output *m_output; }; #endif // OUTPUTWRITER_P_H qmmp-0.7.4/src/qmmp/inputsourcefactory.h0000664000175000017500000000641212256224734017110 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef INPUTSOURCEFACTORY_H #define INPUTSOURCEFACTORY_H #include class QTranslator; class QStringList; class InputSource; /*! @brief Helper class to store transport plugin properies. * @author Ilya Kotov */ class InputSourceProperties { public: /*! * Constructor */ InputSourceProperties() { hasSettings = false; hasAbout = false; } QString name; /*!< Transport plugin full name */ QString shortName; /*!< Transport plugin name for internal usage */ QStringList protocols; /*!< A list of supported protocols. */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise \b false */ }; /*! @brief Transport plugin interface. * @author Ilya Kotov */ class InputSourceFactory { public: /*! * Returns transport plugin properties. */ virtual const InputSourceProperties properties() const = 0; /*! * Creates transport provided by plugin. * @param url URL of the stream. * @param parent Parent object. */ virtual InputSource *create(const QString &url, QObject *parent = 0) = 0; /*! * Shows settings dialog. * @param parent Parent widget. */ virtual void showSettings(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(InputSourceFactory, "InputSourceFactory/1.0"); #endif // INPUTSOURCEFACTORY_H qmmp-0.7.4/src/qmmp/metadatamodel.cpp0000664000175000017500000000371412256224734016276 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "metadatamodel.h" MetaDataModel::MetaDataModel(QObject *parent) : QObject(parent) { } MetaDataModel::~MetaDataModel() { } QHash MetaDataModel::audioProperties() { return QHash (); } QHash MetaDataModel::descriptions() { return QHash (); } QList MetaDataModel::tags() { return QList (); } QPixmap MetaDataModel::cover() { return QPixmap(); } QString MetaDataModel::coverPath() { return QString(); } qmmp-0.7.4/src/qmmp/audioparameters.h0000664000175000017500000000614112256224734016324 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef AUDIOPARAMETERS_H #define AUDIOPARAMETERS_H #include #include "qmmp.h" /*! @brief The AudioParameters class keeps information about audio settings. * @author Ilya Kotov */ class AudioParameters { public: /*! * Contsructor. */ AudioParameters(); /*! * Constructs audio settings with the given parameters. * @param srate Sampling rate. * @param chan Number of channels. * @param format PCM data format. */ AudioParameters(quint32 srate, int chan, Qmmp::AudioFormat format); /*! * Constructs a copy of \b other. */ AudioParameters(const AudioParameters &other); /*! * Assigns audio parameters \b p to this parameters. */ void operator=(const AudioParameters &p); /*! * Returns \b true if parameters \b p is equal to this parameters; otherwise returns \b false. */ bool operator==(const AudioParameters &p) const; /*! * Returns \b true if parameters \b p is not equal to this parameters; otherwise returns \b false. */ bool operator!=(const AudioParameters &p) const; /*! * Returns sample rate in Hz. */ quint32 sampleRate() const; /*! * Returns number of channels. */ int channels() const; /*! * Returns pcm format. */ Qmmp::AudioFormat format() const; /*! * Returns sample size in bytes. */ int sampleSize() const; /*! * Returns sample size in bytes of the given pcm data \b format. */ static int sampleSize(Qmmp::AudioFormat format); private: quint32 m_srate; int m_chan; Qmmp::AudioFormat m_format; }; #endif // AUDIOPARAMETERS_H qmmp-0.7.4/src/qmmp/replaygain.cpp0000664000175000017500000001157712256224734015636 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "audioparameters.h" #include "replaygain_p.h" ReplayGain::ReplayGain() { m_sampleSize = 2; m_scale = 1.0; m_mode = QmmpSettings::REPLAYGAIN_DISABLED; m_format = Qmmp::PCM_UNKNOWM; m_preamp = 0.0; m_default_gain = 0.0; m_prevent_clipping = false; } void ReplayGain::setFormat(Qmmp::AudioFormat format) { m_sampleSize = AudioParameters::sampleSize(format); m_format = format; updateScale(); } void ReplayGain::setReplayGainInfo(const QMap &info) { m_info = info; updateScale(); if(m_mode != QmmpSettings::REPLAYGAIN_DISABLED) { qDebug("ReplayGain: track: gain=%f dB, peak=%f; album: gain=%f dB, peak=%f", m_info[Qmmp::REPLAYGAIN_TRACK_GAIN], m_info[Qmmp::REPLAYGAIN_TRACK_PEAK], m_info[Qmmp::REPLAYGAIN_ALBUM_GAIN], m_info[Qmmp::REPLAYGAIN_ALBUM_PEAK]); qDebug("ReplayGain: scale=%f", m_scale); } else qDebug("ReplayGain: disabled"); } void ReplayGain::updateSettings(QmmpSettings::ReplayGainMode mode, double preamp, double default_gain, bool clip) { m_mode = mode; m_preamp = preamp; m_default_gain = default_gain; m_prevent_clipping = clip; setReplayGainInfo(m_info); } void ReplayGain::applyReplayGain(char *data, qint64 size) { if(m_mode == QmmpSettings::REPLAYGAIN_DISABLED || m_scale == 1.0) return; qint64 samples = size >> (m_sampleSize >> 1); //size / m_sampleSize; switch (m_format) { case Qmmp::PCM_S8: { for (qint64 i = 0; i < samples; i++) ((char*)data)[i] = qBound(-128.0, ((char*)data)[i] * m_scale, 127.0); break; } case Qmmp::PCM_S16LE: { for (qint64 i = 0; i < samples; i++) ((short*)data)[i] = qBound(-32768.0, ((short*)data)[i] * m_scale, 32767.0); break; } case Qmmp::PCM_S24LE: { for (qint64 i = 0; i < samples; i++) { ((qint32*)data)[i] = qBound(-(double)(1U << 23), ((qint32*)data)[i] * m_scale, (double)((1U << 23) - 1)); } break; } case Qmmp::PCM_S32LE: { for (qint64 i = 0; i < samples; i++) { ((qint32*)data)[i] = qBound(-(double)(1U << 31), ((qint32*)data)[i] * m_scale, (double)((1U << 31) - 1)); } break; } default: ; } } void ReplayGain::updateScale() { double peak = 0.0; m_scale = 1.0; switch(m_mode) { case QmmpSettings::REPLAYGAIN_TRACK: m_scale = pow(10.0, m_info[Qmmp::REPLAYGAIN_TRACK_GAIN]/20); peak = m_info[Qmmp::REPLAYGAIN_TRACK_PEAK]; break; case QmmpSettings::REPLAYGAIN_ALBUM: m_scale = pow(10.0, m_info[Qmmp::REPLAYGAIN_ALBUM_GAIN]/20); peak = m_info[Qmmp::REPLAYGAIN_ALBUM_PEAK]; break; case QmmpSettings::REPLAYGAIN_DISABLED: m_scale = 1.0; return; } if(m_scale == 1.0) m_scale = pow(10.0, m_default_gain/20); m_scale *= pow(10.0, m_preamp/20); if(peak > 0.0 && m_prevent_clipping) m_scale = m_scale*peak > 1.0 ? 1.0 / peak : m_scale; m_scale = qMin(m_scale, 5.6234); // +15 dB m_scale = qMax(m_scale, 0.1778); // -15 dB*/ } qmmp-0.7.4/src/qmmp/metadatamanager.cpp0000664000175000017500000002063512256224734016611 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "decoder.h" #include "decoderfactory.h" #include "abstractengine.h" #include "inputsource.h" #include "qmmpsettings.h" #include "metadatamanager.h" MetaDataManager* MetaDataManager::m_instance = 0; MetaDataManager::MetaDataManager() : m_mutex(QMutex::Recursive) { if(m_instance) qFatal("MetaDataManager is already created"); m_instance = this; m_settings = QmmpSettings::instance(); } MetaDataManager::~MetaDataManager() { m_instance = 0; } QList MetaDataManager::createPlayList(const QString &fileName, bool useMetaData) const { QMutexLocker locker(&m_mutex); QList list; DecoderFactory *fact = 0; EngineFactory *efact = 0; if (!fileName.contains("://")) //local file { if(!QFile::exists(fileName)) return list; else if((fact = Decoder::findByPath(fileName, m_settings->determineFileTypeByContent()))) return fact->createPlayList(fileName, useMetaData); else if((efact = AbstractEngine::findByPath(fileName))) return efact->createPlayList(fileName, useMetaData); return list; } else { QString scheme = fileName.section("://",0,0); if(InputSource::protocols().contains(scheme)) { list << new FileInfo(fileName); return list; } foreach(fact, *Decoder::factories()) { if(fact->properties().protocols.contains(scheme) && Decoder::isEnabled(fact)) return fact->createPlayList(fileName, useMetaData); } } return list; } MetaDataModel* MetaDataManager::createMetaDataModel(const QString &path, QObject *parent) const { DecoderFactory *fact = 0; EngineFactory *efact = 0; if (!path.contains("://")) //local file { if(!QFile::exists(path)) return 0; else if((fact = Decoder::findByPath(path, m_settings->determineFileTypeByContent()))) return fact->createMetaDataModel(path, parent); else if((efact = AbstractEngine::findByPath(path))) return efact->createMetaDataModel(path, parent); return 0; } else { QString scheme = path.section("://",0,0); MetaDataModel *model = 0; if((fact = Decoder::findByProtocol(scheme))) { return fact->createMetaDataModel(path, parent); } foreach(efact, *AbstractEngine::factories()) { if(efact->properties().protocols.contains(scheme) && AbstractEngine::isEnabled(efact)) model = efact->createMetaDataModel(path, parent); if(model) return model; } } return 0; } QStringList MetaDataManager::filters() const { QStringList filters; foreach(DecoderFactory *fact, *Decoder::factories()) { if (Decoder::isEnabled(fact) && !fact->properties().filters.isEmpty()) filters << fact->properties().description + " (" + fact->properties().filters.join(" ") + ")"; } foreach(EngineFactory *fact, *AbstractEngine::factories()) { if (AbstractEngine::isEnabled(fact) && !fact->properties().filters.isEmpty()) filters << fact->properties().description + " (" + fact->properties().filters.join(" ") + ")"; } return filters; } QStringList MetaDataManager::nameFilters() const { QStringList filters; foreach(DecoderFactory *fact, *Decoder::factories()) { if (Decoder::isEnabled(fact)) filters << fact->properties().filters; } foreach(EngineFactory *fact, *AbstractEngine::factories()) { if (AbstractEngine::isEnabled(fact)) filters << fact->properties().filters; } if(m_settings->determineFileTypeByContent()) filters << "*"; return filters; } QStringList MetaDataManager::protocols() const { QStringList p; p << InputSource::protocols(); p << Decoder::protocols(); p << AbstractEngine::protocols(); p.removeDuplicates(); return p; } bool MetaDataManager::supports(const QString &fileName) const { DecoderFactory *fact = 0; EngineFactory *efact = 0; if (!fileName.contains("://")) //local file { if (!QFile::exists(fileName)) return false; if((fact = Decoder::findByPath(fileName))) return true; else if((efact = AbstractEngine::findByPath(fileName))) return true; return false; } return false; } QPixmap MetaDataManager::getCover(const QString &url) { if(!url.contains("://") && m_settings->useCoverFiles()) { QString p = getCoverPath(url); if(!p.isEmpty()) return QPixmap(p); } MetaDataModel *model = createMetaDataModel(url); if(model) { QPixmap pix = model->cover(); model->deleteLater(); return pix; } return QPixmap(); } QString MetaDataManager::getCoverPath(const QString &url) { if(!m_settings->useCoverFiles()) return QString(); if(url.contains("://")) //url { MetaDataModel *model = createMetaDataModel(url); if(model) { QString coverPath = model->coverPath(); model->deleteLater(); return coverPath; } } else //local file { QString p = QFileInfo(url).absolutePath(); if(m_cover_cache.keys().contains(p)) return m_cover_cache.value(p); QFileInfoList l = findCoverFiles(p, m_settings->coverSearchDepth()); QString cover_path = l.isEmpty() ? QString() : l.at(0).filePath(); m_cover_cache.insert (p, cover_path); return cover_path; } return QString(); } QFileInfoList MetaDataManager::findCoverFiles(QDir dir, int depth) const { dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Name); QFileInfoList file_list = dir.entryInfoList(m_settings->coverNameFilters()); foreach(QFileInfo i, file_list) { foreach(QString pattern, m_settings->coverNameFilters(false)) { if(QRegExp (pattern, Qt::CaseInsensitive, QRegExp::Wildcard).exactMatch(i.fileName())) { file_list.removeAll(i); break; } } } if(!depth || !file_list.isEmpty()) return file_list; depth--; dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); dir.setSorting(QDir::Name); QFileInfoList dir_info_list = dir.entryInfoList(); foreach(QFileInfo i, dir_info_list) { file_list << findCoverFiles(QDir(i.absoluteFilePath()), depth); } return file_list; } void MetaDataManager::clearCoverChache() { m_cover_cache.clear(); } void MetaDataManager::prepareForAnotherThread() { protocols(); //this hack should load all requied plugins } MetaDataManager *MetaDataManager::instance() { if(!m_instance) new MetaDataManager(); return m_instance; } void MetaDataManager::destroy() { if(m_instance) delete m_instance; } qmmp-0.7.4/src/qmmp/replaygain_p.h0000664000175000017500000000437512256224734015620 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAIN_H #define REPLAYGAIN_H #include #include #include "qmmpsettings.h" #include "qmmp.h" /*! @internal * @author Ilya Kotov */ class ReplayGain { public: ReplayGain(); void setFormat(Qmmp::AudioFormat format); void updateSettings(QmmpSettings::ReplayGainMode mode, double preamp, double default_gain, bool clip); void setReplayGainInfo(const QMap &info); void applyReplayGain(char *data, qint64 size); private: void updateScale(); int m_sampleSize; QMap m_info; double m_scale; QmmpSettings::ReplayGainMode m_mode; double m_preamp; double m_default_gain; bool m_prevent_clipping; Qmmp::AudioFormat m_format; }; #endif // REPLAYGAIN_H qmmp-0.7.4/src/qmmp/qmmpsettings.h0000664000175000017500000001652712256224734015703 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMPSETTINGS_H #define QMMPSETTINGS_H #include #include #include #include "eqsettings.h" /*! @brief The QmmpSettings class provides access to global settings. * @author Ilya Kotov */ class QmmpSettings : public QObject { Q_OBJECT public: /*! * Constructor. * @param parent Parent object. * This functions is for internal usage only, use QmmpSettings::instance() instead. */ QmmpSettings(QObject *parent = 0); /*! * Destructor. */ virtual ~QmmpSettings(); /*! * This enum describes possible replaygain modes. */ enum ReplayGainMode { REPLAYGAIN_TRACK = 0, /*!< Use track gain/peak */ REPLAYGAIN_ALBUM, /*!< Use album gain/peak */ REPLAYGAIN_DISABLED /*!< Disable ReplayGain */ }; /*! * Returns current ReplayGain mode. */ QmmpSettings::ReplayGainMode replayGainMode() const; /*! * Returns preamp in dB. */ double replayGainPreamp() const; /*! * Returns default gain in dB. */ double replayGainDefaultGain() const; /*! * Returns \b true if clipping prevention is enabled; otherwise returns \b false. */ bool replayGainPreventClipping() const; /*! * Sets ReplayGains settings. * @param mode ReplayGain mode. * @param preamp Preamp in dB. * @param default_gain Default gain in dB. * @param clip Clipping prevention state. */ void setReplayGainSettings(ReplayGainMode mode, double preamp, double default_gain, bool clip); /*! * Returns \b true if software volume is enabled; otherwise returns \b false. */ bool useSoftVolume() const; /*! * Returns \b true if 16-bit converter is enabled; otherwise returns \b false. */ bool use16BitOutput() const; /*! * Sets audio settings. * @param soft_volume State of software volume. * @param use_16bit State of the 16-bit audio converter. */ void setAudioSettings(bool soft_volume, bool use_16bit); /*! * If \b include is \b true, this function returns include cover file name filters, * otherwise returns exclude filters. */ QStringList coverNameFilters(bool include = true) const; /*! * Returns a depth of recursive cover file search. */ int coverSearchDepth() const; /*! * Returns \b true if cover file search is enabled; otherwise returns \b false. */ bool useCoverFiles() const; /*! * Sets cover search options. * @param inc Include cover name filters * @param exc Exclude cover name filters * @param depth Depth of recursive cover file search. * Recursive cover file search can be disabled by setting \b depth to \b 0. * @param use_files Use or not use files with covers. * This parameter doesn't take effect in embedded covers. */ void setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files); /*! * Returns \b true if global proxy is enabled, otherwise returns \b false */ bool isProxyEnabled() const; /*! * Returns \b true if global proxy authentication is enabled, otherwise returns \b false */ bool useProxyAuth() const; /*! * Returns global proxy url. */ QUrl proxy() const; /*! * Sets network settings. * @param use_proxy Enables or disables global proxy. * @param auth Enables or disables proxy authentication. * @param proxy Proxy url. */ void setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy); /*! * Returns equalizer settings. */ EqSettings eqSettings() const; /*! * Changes equalizer settings to \b settings */ void setEqSettings(const EqSettings &settings); /*! * Reads equalizer settings. Call this function before equalizer usage. * @param bands Number of bands. */ void readEqSettings(int bands = EqSettings::EQ_BANDS_10); /*! * Returns buffer size in milliseconds */ int bufferSize() const; /*! * Sets buffer size * @param msec Buffer size in milliseconds */ void setBufferSize(int msec); /*! * Enables/Desables file type determination by content * @param enabled State of the content based type determination * (\b true - enabled, \b false - disabled) */ void setDetermineFileTypeByContent(bool enabled); /*! * Return \b true if content based file type determination is enabled. Otherwise returns \b false. */ bool determineFileTypeByContent() const; /*! * Returns a pointer to the QmmpSettings instance. */ static QmmpSettings* instance(); signals: /*! * Emitted when ReplayGain settings are changed. */ void replayGainSettingsChanged(); /*! * Emitted when audio settings are changed. */ void audioSettingsChanged(); /*! * Emitted when cover settings are changed. */ void coverSettingsChanged(); /*! * Emitted when network settings are changed. */ void networkSettingsChanged(); /*! * Emitted when equalizer settings are changed. */ void eqSettingsChanged(); public slots: /*! * Writes all unsaved settings to configuration file */ void sync(); private: //replaygain settings QmmpSettings::ReplayGainMode m_rg_mode; double m_rg_preamp; double m_rg_defaut_gain; bool m_rg_prevent_clipping; //audio settings bool m_aud_software_volume; bool m_aud_16bit; //cover settings QStringList m_cover_inc; QStringList m_cover_exclude; int m_cover_depth; bool m_cover_use_files; //network settings bool m_proxy_enabled; bool m_proxy_auth; QUrl m_proxy_url; //equalizer settings EqSettings m_eq_settings; //buffer size int m_buffer_size; //file type determination bool m_determine_by_content; static QmmpSettings* m_instance; }; #endif // QMMPSETTINGS_H qmmp-0.7.4/src/qmmp/metadatamanager.h0000664000175000017500000001053712256224734016256 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef METADATAMANAGER_H #define METADATAMANAGER_H #include #include #include #include #include #include "fileinfo.h" #include "metadatamodel.h" class DecoderFactory; class EngineFactory; class InputSourceFactory; class QmmpSettings; /*! @brief The MetaDataManager class is the base class for metadata access. * @author Ilya Kotov */ class MetaDataManager { public: /*! * Constructor. Use MetaDataManager::instance() instead. */ MetaDataManager(); /*! * Destructor. Use MetaDataManager::destroy() instead. */ ~MetaDataManager(); /*! * Extracts metadata and audio information from file \b path and returns a list of FileInfo items. * One file may contain several playlist items (for example: cda disk or flac with embedded cue) * @param path Source file path. * @param useMetaData Metadata usage (\b true - use, \b - do not use) */ QList createPlayList(const QString &path, bool useMetaData = true) const; /*! * Creats metadata object, which provides full access to file tags. * @param url File path or URL. * @param parent Parent object. * @return MetaDataModel pointer or null pointer. */ MetaDataModel* createMetaDataModel(const QString &url, QObject *parent = 0) const; /*! * Returns a list of file name filters with description, i.e. "MPEG Files (*.mp3 *.mpg)" */ QStringList filters() const; /*! * Returns a list of file name filters, i.e. "*.mp3 *.mpg" */ QStringList nameFilters() const; /*! * Returns a list of the suported protocols */ QStringList protocols() const; /*! * Returns \b true if \b file is supported and exists, otherwise returns \b false */ bool supports(const QString &file) const; /*! * Returns cover pixmap for the given file \b fileName, * or returns an empty pixmap if cover is not available. */ QPixmap getCover(const QString &fileName); /*! * Returns cover file path for the given file \b fileName, or returns * an empty string if cover file is not available. This function does not work * with embedded covers. */ QString getCoverPath(const QString &fileName); /*! * Clears cover path cache. */ void clearCoverChache(); /*! * Prepares object for usage by another thread to avoid warnings about parent the different thread */ void prepareForAnotherThread(); /*! * Returns a pointer to the MetaDataManager instance. */ static MetaDataManager* instance(); /*! * Destroys MetaDataManager object. */ static void destroy(); private: QFileInfoList findCoverFiles(QDir dir, int depth) const; QMap m_cover_cache; QmmpSettings *m_settings; mutable QMutex m_mutex; static MetaDataManager* m_instance; }; #endif // METADATAMANAGER_H qmmp-0.7.4/src/qmmp/visual.h0000664000175000017500000001125112256224734014440 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VISUAL_H #define VISUAL_H #include #include #include #include class Buffer; class Decoder; class Output; class VisualFactory; /*! @brief The Visual class provides the base interface class of visualizations. * @author Ilya Kotov */ class Visual : public QWidget { Q_OBJECT public: /*! * Object contsructor. * @param parent Parent object. */ Visual(QWidget *parent); /*! * Destructor. */ virtual ~Visual(); /*! * Adds data for visualization. * Subclass should reimplement this function. * @param data Audio data. * @param size Size of audio data. * @param chan Number of channels. */ virtual void add(unsigned char *data, qint64 size, int chan) = 0; /*! * Resets visual plugin buffers and widgets. * Subclass should reimplement this function. */ virtual void clear() = 0; /*! * Returns mutex pointer. */ QMutex *mutex(); /*! * Returns a list of visual factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory Visual plugin factory. */ static QString file(VisualFactory *factory); /*! * Sets whether the visual plugin is enabled. * @param factory Visual plugin factory. * @param enable Plugin enable state (\b true - enable, \b false - disable) */ static void setEnabled(VisualFactory* factory, bool enable = true); /*! * Returns \b true if visual plugin is enabled, otherwise returns \b false * @param factory Effect plugin factory. */ static bool isEnabled(VisualFactory* factory); /*! * Adds external visualization \b visual. */ static void add(Visual*visual); /*! * Removes external visualization \b visual. */ static void remove(Visual*); /*! * Prepares visual plugins for usage. * @param parent Parent widget. * @param receiver Receiver object. * @param member A slot to receive changes of active visualizations list. */ static void initialize(QWidget *parent, QObject *receiver = 0, const char *member = 0); /*! * Returns a pointer to a list of created visual objects. */ static QList *visuals(); /*! * Shows configuration dialog and updates settings automatically. * @param factory Visual plugin factory. * @param parent Parent widget. */ static void showSettings(VisualFactory *factory, QWidget *parent); signals: /*! * Emitted when visual widget is closed by user. */ void closedByUser(); protected: /*! * QWidget's close event. Reimplementation should call base function. * @param event QCloseEvent insatance. */ virtual void closeEvent (QCloseEvent *event); private: Decoder *m_decoder; Output *m_output; QMutex m_mutex; static QList *m_factories; static QHash *m_files; static void checkFactories(); static QList m_visuals; static QHash m_vis_map; //internal visualization static QWidget *m_parentWidget; static QObject *m_receiver; static const char *m_member; }; #endif qmmp-0.7.4/src/qmmp/recycler.cpp0000664000175000017500000000523612256224734015306 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #include "recycler_p.h" #include "qmmpsettings.h" #include "audioparameters.h" #include "buffer.h" Recycler::Recycler () { m_add_index = 0; m_done_index = 0; m_current_count = 0; m_buffer_count = 0; m_blocked = 0; m_block_size = 0; m_buffers = 0; } Recycler::~Recycler() { for (unsigned int i = 0; i < m_buffer_count; i++) { delete m_buffers[i]; m_buffers[i] = 0; } if(m_buffer_count) delete [] m_buffers; m_blocked = 0; } void Recycler::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { unsigned long block_size = AudioParameters::sampleSize(format) * chan * QMMP_BLOCK_FRAMES; unsigned int buffer_count = freq * QmmpSettings::instance()->bufferSize() / 1000 / QMMP_BLOCK_FRAMES; if(block_size == m_block_size && buffer_count == m_buffer_count) return; for (unsigned int i = 0; i < m_buffer_count; i++) { delete m_buffers[i]; m_buffers[i] = 0; } if(m_buffer_count) delete [] m_buffers; m_add_index = 0; m_done_index = 0; m_current_count = 0; m_blocked = 0; m_block_size = block_size; m_buffer_count = buffer_count; if (m_buffer_count < 4) m_buffer_count = 4; m_buffers = new Buffer*[m_buffer_count]; for (unsigned int i = 0; i < m_buffer_count; i++) { m_buffers[i] = new Buffer(m_block_size); } } bool Recycler::full() const { return m_current_count == m_buffer_count; } bool Recycler::blocked() { return m_buffers[m_add_index] == m_blocked; } bool Recycler::empty() const { return m_current_count == 0; } int Recycler::available() const { return m_buffer_count - m_current_count; } int Recycler::used() const { return m_current_count; } Buffer *Recycler::get() { if (full()) return 0; return m_buffers[m_add_index]; } void Recycler::add() { if(m_buffers[m_add_index]->nbytes) { m_add_index = (m_add_index + 1) % m_buffer_count; m_current_count++; } } Buffer *Recycler::next() { if(m_current_count) { m_blocked = m_buffers[m_done_index]; return m_blocked; } return 0; } void Recycler::done() { m_blocked = 0; if (m_current_count) { m_current_count--; m_done_index = (m_done_index + 1) % m_buffer_count; } } void Recycler::clear() { m_current_count = 0; m_add_index = 0; m_done_index = 0; } unsigned long Recycler::size() const { return m_buffer_count * m_block_size; } qmmp-0.7.4/src/qmmp/recycler_p.h0000664000175000017500000000437612256224734015276 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef RECYCLER_P_H #define RECYCLER_P_H #include #include #include "qmmp.h" #include "buffer.h" /*! @internal * @brief The Recycler class provides a queue of audio buffers. * @author Brad Hughes */ class Recycler { public: /*! * Constructor. */ Recycler(); /*! * Destructor. */ ~Recycler(); /*! * Setups audio parameters of output interface. * @param freq Sample rate. * @param chan Number of channels. * @param format Audio format */ void configure(quint32 freq, int chan, Qmmp::AudioFormat format); /*! * Returns \b true if queue if full, otherwise returns \b false */ bool full() const; /*! * Returns \b true if queue if empty, otherwise returns \b false */ bool empty() const; /*! * Returns a number of available buffers. */ int available() const; /*! * Returns a number of used buffers. */ int used() const; /*! * Returns next buffer in queue. */ Buffer *next(); /*! * Returns current buffer for writing. */ Buffer *get(); // get next in recycle /*! * Adds current buffer to queue. */ void add(); // add to queue /*! * Removes current buffer from queue. */ void done(); // add to recycle /*! * Clears queue. */ void clear(); // clear queue /*! * Returns size of all buffers in bytes. */ unsigned long size() const; // size in bytes /*! * Returns mutex pointer. */ QMutex *mutex() { return &m_mtx; } /*! * Returns wait condition pointer. */ QWaitCondition *cond() { return &m_cnd; } /*! * Returns \b true if the next buffer is used by output. Otherwise returns \b false. */ bool blocked(); private: unsigned int m_buffer_count, m_add_index, m_done_index, m_current_count; unsigned long m_block_size; Buffer **m_buffers; QMutex m_mtx; QWaitCondition m_cnd; Buffer *m_blocked; }; #endif // __recycler_h qmmp-0.7.4/src/qmmp/qmmpaudioengine.cpp0000664000175000017500000004472612256224734016667 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "replaygain_p.h" #include "effect.h" #include "buffer.h" #include "decoder.h" #include "outputwriter_p.h" #include "decoderfactory.h" #include "effectfactory.h" #include "inputsource.h" #include "statehandler.h" #include "audioconverter_p.h" #include "qmmpaudioengine_p.h" #include "metadatamanager.h" QmmpAudioEngine::QmmpAudioEngine(QObject *parent) : AbstractEngine(parent), m_factory(0), m_output(0) { qRegisterMetaType("Qmmp::State"); m_output_buf = 0; m_output_size = 0; m_bks = 0; m_decoder = 0; m_output = 0; m_replayGain = new ReplayGain; m_settings = QmmpSettings::instance(); connect(m_settings,SIGNAL(replayGainSettingsChanged()), SLOT(updateReplayGainSettings())); updateReplayGainSettings(); reset(); m_instance = this; } QmmpAudioEngine::~QmmpAudioEngine() { stop(); reset(); if(m_output_buf) delete [] m_output_buf; m_output_buf = 0; qDeleteAll(m_effects); m_instance = 0; delete m_replayGain; } void QmmpAudioEngine::reset() { m_done = false; m_finish = false; m_totalTime = 0; m_seekTime = -1; m_output_at = 0; m_user_stop = false; m_bitrate = 0; m_chan = 0; m_bps = 0; m_next = false; } bool QmmpAudioEngine::play() { if(isRunning() || m_decoders.isEmpty() || (m_output && m_output->isRunning())) return false; if(m_output) delete m_output; prepareEffects(m_decoders.head()); if(!(m_output = createOutput())) return false; start(); return true; } bool QmmpAudioEngine::enqueue(InputSource *source) { mutex()->lock(); if(m_decoder && m_decoder->nextURL() == source->url()) { m_inputs.value(m_decoder)->setOffset(source->offset()); delete source; m_next = true; mutex()->unlock(); return true; } mutex()->unlock(); DecoderFactory *factory = 0; if(!factory && !source->url().contains("://")) factory = Decoder::findByPath(source->url(), m_settings->determineFileTypeByContent()); if(!factory) factory = Decoder::findByMime(source->contentType()); if(!factory && source->ioDevice() && source->url().contains("://")) //ignore content of local files factory = Decoder::findByContent(source->ioDevice()); if(!factory && source->url().contains("://")) factory = Decoder::findByProtocol(source->url().section("://",0,0)); if(!factory) { qWarning("QmmpAudioEngine: unsupported file format"); return false; } qDebug("QmmpAudioEngine: selected decoder: %s",qPrintable(factory->properties().shortName)); if(factory->properties().noInput && source->ioDevice()) source->ioDevice()->close(); Decoder *decoder = factory->create(source->url(), source->ioDevice()); if(!decoder->initialize()) { qWarning("QmmpAudioEngine: invalid file format"); delete decoder; return false; } m_decoders.enqueue(decoder); m_inputs.insert(decoder, source); if(!decoder->totalTime()) source->setOffset(-1); source->setParent(this); return true; } qint64 QmmpAudioEngine::totalTime() { if(m_decoder) return m_decoder->totalTime(); else return 0; } void QmmpAudioEngine::addEffect(EffectFactory *factory) { foreach(Effect *effect, m_effects) { if(effect->factory() == factory) { qWarning("QmmpAudioEngine: effect %s already exists", qPrintable(factory->properties().shortName)); return; } } if(m_output && m_output->isRunning()) { Effect *effect = Effect::create(factory); if(!effect) return; effect->configure(m_ap.sampleRate(), m_ap.channels(), m_ap.format()); if(effect->audioParameters() == m_ap) { mutex()->lock(); m_effects << effect; mutex()->unlock(); } else { qDebug("QmmpAudioEngine: restart is required"); delete effect; } } } void QmmpAudioEngine::removeEffect(EffectFactory *factory) { Effect *effect = 0; foreach(Effect *e, m_effects) { if(e->factory() == factory) { effect = e; break; } } if(!effect) return; if(m_output && m_output->isRunning()) { mutex()->lock(); if(m_blockedEffects.contains(effect)) qDebug("QmmpAudioEngine: restart is required"); else m_effects.removeAll(effect); mutex()->unlock(); } } void QmmpAudioEngine::seek(qint64 time) { if (m_output && m_output->isRunning()) { m_output->mutex()->lock (); m_output->seek(time, true); m_output->mutex()->unlock(); if (isRunning()) { mutex()->lock (); m_seekTime = time; mutex()->unlock(); } } } void QmmpAudioEngine::pause() { if (m_output) m_output->pause(); if (m_output) { m_output->recycler()->mutex()->lock (); m_output->recycler()->cond()->wakeAll(); m_output->recycler()->mutex()->unlock(); } } void QmmpAudioEngine::stop() { mutex()->lock (); m_user_stop = true; mutex()->unlock(); if (m_output) m_output->recycler()->cond()->wakeAll(); if(isRunning()) wait(); if (m_output) { m_output->mutex()->lock (); m_output->stop(); m_output->mutex()->unlock(); } // wake up threads if (m_output) { m_output->mutex()->lock(); m_output->recycler()->cond()->wakeAll(); m_output->mutex()->unlock(); if(m_output->isRunning()) m_output->wait(); delete m_output; m_output = 0; } while(!m_decoders.isEmpty()) { Decoder *d = m_decoders.dequeue(); m_inputs.take(d)->deleteLater (); delete d; } reset(); m_decoder = 0; while(!m_effects.isEmpty()) //delete effects delete m_effects.takeFirst(); } qint64 QmmpAudioEngine::produceSound(char *data, qint64 size, quint32 brate) { Buffer *b = m_output->recycler()->get(); uint sz = size < m_bks ? size : m_bks; m_replayGain->applyReplayGain(data, sz); memcpy(b->data, data, sz); b->nbytes = sz; b->rate = brate; foreach(Effect* effect, m_effects) { effect->applyEffect(b); } size -= sz; memmove(data, data + sz, size); m_output->recycler()->add(); return sz; } void QmmpAudioEngine::finish() { if (m_output) { m_output->mutex()->lock (); m_output->finish(); m_output->mutex()->unlock(); } StateHandler::instance()->sendFinished(); } void QmmpAudioEngine::updateReplayGainSettings() { mutex()->lock(); m_replayGain->updateSettings(m_settings->replayGainMode(), m_settings->replayGainPreamp(), m_settings->replayGainDefaultGain(), m_settings->replayGainPreventClipping()); mutex()->unlock(); } void QmmpAudioEngine::run() { mutex()->lock (); m_next = false; qint64 len = 0; if(m_decoders.isEmpty()) { mutex()->unlock (); return; } m_decoder = m_decoders.dequeue(); addOffset(); //offset m_replayGain->setReplayGainInfo(m_decoder->replayGainInfo()); mutex()->unlock(); m_output->start(); StateHandler::instance()->dispatch(Qmmp::Playing); sendMetaData(); while (! m_done && ! m_finish) { mutex()->lock (); //seek if (m_seekTime >= 0) { m_decoder->seek(m_seekTime); m_seekTime = -1; m_output->recycler()->mutex()->lock (); m_output->recycler()->clear(); m_output->recycler()->mutex()->unlock (); m_output_at = 0; } //metadata if(m_decoder->hasMetaData()) StateHandler::instance()->dispatch(m_decoder->takeMetaData()); if(m_inputs[m_decoder]->hasMetaData()) StateHandler::instance()->dispatch(m_inputs[m_decoder]->takeMetaData()); if(m_inputs[m_decoder]->hasStreamInfo()) StateHandler::instance()->dispatch(m_inputs[m_decoder]->takeStreamInfo()); // decode len = m_decoder->read((char *)(m_output_buf + m_output_at), m_output_size - m_output_at); if (len > 0) { m_bitrate = m_decoder->bitrate(); m_output_at += len; if (m_output) flush(); } else if (len == 0) { if(m_next) //decoder can play next track without initialization { m_next = false; qDebug("QmmpAudioEngine: switching to the next track"); StateHandler::instance()->sendFinished(); StateHandler::instance()->dispatch(Qmmp::Stopped); //fake stop/start cycle StateHandler::instance()->dispatch(Qmmp::Buffering); StateHandler::instance()->dispatch(Qmmp::Playing); m_decoder->next(); m_replayGain->setReplayGainInfo(m_decoder->replayGainInfo()); m_output->seek(0); //reset counter addOffset(); //offset mutex()->unlock(); continue; } else if(!m_decoders.isEmpty()) { m_inputs.take(m_decoder)->deleteLater (); Decoder *d = m_decoder; m_decoder = m_decoders.dequeue(); delete d; //m_seekTime = m_inputs.value(m_decoder)->offset(); m_replayGain->setReplayGainInfo(m_decoder->replayGainInfo()); //use current output if possible prepareEffects(m_decoder); if(m_ap == m_output->audioParameters()) { StateHandler::instance()->sendFinished(); StateHandler::instance()->dispatch(Qmmp::Stopped); //fake stop/start cycle StateHandler::instance()->dispatch(Qmmp::Buffering); StateHandler::instance()->dispatch(Qmmp::Playing); m_output->seek(0); //reset counter mutex()->unlock(); sendMetaData(); addOffset(); //offset continue; } else { flush(true); finish(); //wake up waiting threads mutex()->unlock(); m_output->recycler()->mutex()->lock (); m_output->recycler()->cond()->wakeAll(); m_output->recycler()->mutex()->unlock(); m_output->wait(); delete m_output; m_output = createOutput(); if(m_output) { m_output->start(); StateHandler::instance()->dispatch(Qmmp::Playing); sendMetaData(); addOffset(); //offset continue; } } } flush(true); if (m_output) { m_output->recycler()->mutex()->lock (); // end of stream while (!m_output->recycler()->empty() && !m_user_stop) { m_output->recycler()->cond()->wakeOne(); mutex()->unlock(); m_output->recycler()->cond()->wait(m_output->recycler()->mutex()); mutex()->lock (); } m_output->recycler()->mutex()->unlock(); } m_done = true; m_finish = !m_user_stop; } else m_finish = true; mutex()->unlock(); } if(m_decoder) { m_inputs.take(m_decoder)->deleteLater (); Decoder *d = m_decoder; m_decoder = 0; delete d; } mutex()->lock (); m_next = false; if (m_finish) finish(); if(m_output) { m_output->mutex()->lock(); m_output->recycler()->cond()->wakeAll(); m_output->mutex()->unlock(); } mutex()->unlock(); } void QmmpAudioEngine::flush(bool final) { ulong min = final ? 0 : m_bks; while ((!m_done && !m_finish) && m_output_at > min) { m_output->recycler()->mutex()->lock (); while ((m_output->recycler()->full() || m_output->recycler()->blocked()) && (!m_done && !m_finish)) { if(m_seekTime > 0) { m_output_at = 0; m_output->recycler()->mutex()->unlock (); return; } mutex()->unlock(); m_output->recycler()->cond()->wait(m_output->recycler()->mutex()); mutex()->lock (); m_done = m_user_stop; } if (m_user_stop || m_finish) m_done = true; else { m_output_at -= produceSound((char*)m_output_buf, m_output_at, m_bitrate); } if (!m_output->recycler()->empty()) { m_output->recycler()->cond()->wakeOne(); } m_output->recycler()->mutex()->unlock(); } } void QmmpAudioEngine::addOffset() { qint64 pos = m_inputs.value(m_decoder)->offset(); if(pos > 0) { m_seekTime = pos; m_output->seek(pos); } } void QmmpAudioEngine::sendMetaData() { if(!m_decoder || m_inputs.isEmpty()) return; QString url = m_inputs.value(m_decoder)->url(); if (QFile::exists(url)) //send metadata for local files only { QList list = MetaDataManager::instance()->createPlayList(url, true); if (!list.isEmpty()) { StateHandler::instance()->dispatch(list[0]->metaData()); while (!list.isEmpty()) delete list.takeFirst(); } } } OutputWriter *QmmpAudioEngine::createOutput() { OutputWriter *output = new OutputWriter(0); if (!output->initialize(m_ap.sampleRate(), m_ap.channels(), m_ap.format())) { delete output; StateHandler::instance()->dispatch(Qmmp::FatalError); return 0; } if(output->audioParameters() != m_ap) { if(output->audioParameters().format() == Qmmp::PCM_S16LE) //output supports 16 bit only { Effect *effect = new AudioConverter(); effect->configure(m_ap.sampleRate(), m_ap.channels(), m_ap.format()); m_ap = effect->audioParameters(); m_effects.append(effect); qDebug("QmmpAudioEngine: output plugin requires 16 bit, using 16-bit converter"); } else { qWarning("QmmpAudioEngine: unsupported audio format"); delete output; StateHandler::instance()->dispatch(Qmmp::FatalError); return 0; } } if(m_output_buf) delete [] m_output_buf; m_bks = QMMP_BLOCK_FRAMES * m_ap.channels() * m_ap.sampleSize(); m_output_size = m_bks * 4; m_output_buf = new unsigned char[m_output_size]; return output; } void QmmpAudioEngine::prepareEffects(Decoder *d) { m_ap = d->audioParameters(); m_replayGain->setFormat(m_ap.format()); foreach(Effect *e, m_effects) //remove disabled and external effects { if(!e->factory() || !Effect::isEnabled(e->factory())) { m_effects.removeAll(e); m_blockedEffects.removeAll(e); delete e; } } QList tmp_effects = m_effects; m_effects.clear(); if(m_settings->use16BitOutput()) { m_effects << new AudioConverter(); m_effects.at(0)->configure(m_ap.sampleRate(), m_ap.channels(), m_ap.format()); m_ap = m_effects.at(0)->audioParameters(); } foreach(EffectFactory *factory, *Effect::factories()) { if(!Effect::isEnabled(factory)) continue; Effect *effect = 0; foreach(Effect *e, tmp_effects) //find effect { if(e->factory() == factory) effect = e; } if(effect && (effect->audioParameters() != m_ap || m_blockedEffects.contains(effect))) //destroy effect which require restart { m_blockedEffects.removeAll(effect); tmp_effects.removeAll(effect); delete effect; effect = 0; } if(!effect) { effect = Effect::create(factory); effect->configure(m_ap.sampleRate(), m_ap.channels(), m_ap.format()); if (m_ap != effect->audioParameters()) { m_blockedEffects << effect; //list of effects which require restart m_ap = effect->audioParameters(); } } m_effects << effect; tmp_effects.removeAll(effect); } m_chan = m_ap.channels(); } //static members QmmpAudioEngine *QmmpAudioEngine::m_instance = 0; QmmpAudioEngine *QmmpAudioEngine::instance() { return m_instance; } qmmp-0.7.4/src/qmmp/qmmpaudioengine_p.h0000664000175000017500000000620612256224734016642 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMPAUDIOENGINE_P_H #define QMMPAUDIOENGINE_P_H #include #include #include "abstractengine.h" #include "audioparameters.h" class QIODevice; class OutputWriter; class Effect; class DecoderFactory; class StateHandler; class Decoder; class InputSource; class EffectFactory; class ReplayGain; class QmmpSettings; /*! @internal * @author Ilya Kotov */ class QmmpAudioEngine : public AbstractEngine { Q_OBJECT public: QmmpAudioEngine(QObject *parent); ~QmmpAudioEngine(); bool play(); bool enqueue(InputSource *source); qint64 totalTime(); void seek(qint64 time); void stop(); void pause(); void addEffect(EffectFactory *factory); void removeEffect(EffectFactory *factory); static QmmpAudioEngine *instance(); private slots: void finish(); void updateReplayGainSettings(); private: void run(); void reset(); void flush(bool = false); void addOffset(); qint64 produceSound(char *data, qint64 size, quint32 brate); void sendMetaData(); OutputWriter *createOutput(); void prepareEffects(Decoder *d); DecoderFactory *m_factory; QList m_effects; QList m_blockedEffects; OutputWriter *m_output; bool m_done, m_finish, m_user_stop; uint m_bks; qint64 m_totalTime, m_seekTime; qint64 m_output_at, m_output_size; int m_bitrate, m_chan, m_bps; unsigned char *m_output_buf; Decoder *m_decoder; QQueue m_decoders; QHash m_inputs; AudioParameters m_ap; bool m_next; static QmmpAudioEngine *m_instance; ReplayGain *m_replayGain; QmmpSettings *m_settings; }; #endif // QMMPAUDIOENGINE_P_H qmmp-0.7.4/src/qmmp/audioconverter.cpp0000664000175000017500000000547412256224734016533 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "audioconverter_p.h" //static functions static inline void s8_to_s16(qint8 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] << 8; return; } static inline void s24_to_s16(qint32 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] >> 8; return; } static inline void s32_to_s16(qint32 *in, qint16 *out, qint64 samples) { for(qint64 i = 0; i < samples; ++i) out[i] = in[i] >> 16; return; } AudioConverter::AudioConverter() { m_format = Qmmp::PCM_UNKNOWM; } void AudioConverter::configure(quint32 srate, int chan, Qmmp::AudioFormat f) { m_format = f; Effect::configure(srate, chan, Qmmp::PCM_S16LE); } void AudioConverter::applyEffect(Buffer *b) { switch(m_format) { case Qmmp::PCM_S8: { unsigned char *out = new unsigned char[b->nbytes*2]; s8_to_s16((qint8 *)b->data, (qint16 *) out, b->nbytes); delete [] b->data; b->data = out; b->nbytes <<= 1; break; } case Qmmp::PCM_S24LE: s24_to_s16((qint32 *)b->data, (qint16 *)b->data, b->nbytes >> 2); b->nbytes >>= 1; break; case Qmmp::PCM_S32LE: s32_to_s16((qint32 *)b->data, (qint16 *)b->data, b->nbytes >> 2); b->nbytes >>= 1; break; default: ; } } qmmp-0.7.4/src/qmmp/audioconverter_p.h0000664000175000017500000000352712256224734016514 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef AUDIOCONVERTER_P_H #define AUDIOCONVERTER_P_H #include "effect.h" /*! @internal * @author Ilya Kotov */ class AudioConverter : public Effect { public: AudioConverter(); void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE); void applyEffect(Buffer *b); private: Qmmp::AudioFormat m_format; }; #endif // AUDIOCONVERTER_P_H qmmp-0.7.4/src/qmmp/output.cpp0000664000175000017500000000742412256224734015037 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #include #include #include #include #include #include "audioparameters.h" #include "qmmpsettings.h" #include "buffer.h" #include "volumecontrol_p.h" #include "qmmp.h" #include "output.h" Output::Output() { m_frequency = 0; m_channels = 0; m_format = Qmmp::PCM_UNKNOWM; } void Output::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_frequency = freq; m_channels = chan; m_format = format; } AudioParameters Output::audioParameters() const { return AudioParameters(m_frequency, m_channels, m_format); } quint32 Output::sampleRate() { return m_frequency; } int Output::channels() { return m_channels; } Qmmp::AudioFormat Output::format() const { return m_format; } int Output::sampleSize() const { return AudioParameters::sampleSize(m_format); } void Output::suspend() {} void Output::resume() {} Output::~Output() {} // static methods QList *Output::m_factories = 0; QHash *Output::m_files = 0; void Output::checkFactories() { if (!m_factories) { m_files = new QHash ; m_factories = new QList; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Output"); foreach ( QString fileName, pluginsDir.entryList ( QDir::Files ) ) { QPluginLoader loader ( pluginsDir.absoluteFilePath ( fileName ) ); QObject *plugin = loader.instance(); if ( loader.isLoaded() ) qDebug ( "Output: loaded plugin %s", qPrintable ( fileName ) ); else qWarning("Output: %s", qPrintable(loader.errorString ())); OutputFactory *factory = 0; if (plugin) factory = qobject_cast ( plugin ); if (factory) { m_factories->append (factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } } } Output *Output::create () { Output *output = 0; checkFactories(); if (m_factories->isEmpty ()) { qDebug("Output: unable to find output plugins"); return output; } OutputFactory *fact = Output::currentFactory(); if (!fact && !m_factories->isEmpty()) fact = m_factories->at(0); if (fact) output = fact->create (); return output; } QList *Output::factories() { checkFactories(); return m_factories; } QString Output::file(OutputFactory *factory) { checkFactories(); return m_files->value(factory); } void Output::setCurrentFactory(OutputFactory* factory) { checkFactories(); if (!m_factories->contains(factory)) return; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Output/current_plugin", factory->properties().shortName); } OutputFactory *Output::currentFactory() { checkFactories(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); #ifdef Q_OS_LINUX QString name = settings.value("Output/current_plugin", "alsa").toString(); #elif defined Q_WS_WIN QString name = settings.value("Output/current_plugin", "waveout").toString(); #else QString name = settings.value("Output/current_plugin", "oss4").toString(); #endif foreach(OutputFactory *factory, *m_factories) { if (factory->properties().shortName == name) return factory; } if (!m_factories->isEmpty()) return m_factories->at(0); return 0; } qmmp-0.7.4/src/qmmp/inputsource.cpp0000664000175000017500000001220712256224734016052 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "qmmp.h" #include "fileinputsource_p.h" #include "emptyinputsource_p.h" #include "inputsource.h" InputSource::InputSource(const QString &source, QObject *parent) : QObject(parent) { m_url = source; m_offset = -1; m_hasMetaData = false; m_hasStreamInfo = false; } QString InputSource::contentType() const { return QString(); } const QString InputSource::url() const { return m_url; } qint64 InputSource::offset() const { return m_offset; } void InputSource::setOffset(qint64 offset) { m_offset = offset; } bool InputSource::hasMetaData() const { return m_hasMetaData; } QMap InputSource::takeMetaData() { m_hasMetaData = false; return m_metaData; } void InputSource::addMetaData(const QMap &metaData) { m_metaData = metaData; m_hasMetaData = true; } void InputSource::addStreamInfo(const QHash &info) { m_streamInfo = info; m_hasStreamInfo = true; } bool InputSource::hasStreamInfo() const { return m_hasStreamInfo; } QHash InputSource::takeStreamInfo() { m_hasStreamInfo = false; return m_streamInfo; } // static methods QList *InputSource::m_factories = 0; QHash *InputSource::m_files = 0; InputSource *InputSource::create(const QString &url, QObject *parent) { checkFactories(); InputSourceFactory *factory = 0; if(!url.contains("://")) //local file path doesn't contain "://" { qDebug("InputSource: using file transport"); return new FileInputSource(url, parent); } foreach(InputSourceFactory *f, *m_factories) { if(f->properties().protocols.contains(url.section("://", 0, 0))) { factory = f; break; } } if(factory) { qDebug("InputSource: using %s transport", qPrintable(url.section("://", 0, 0))); return factory->create(url, parent); } else { qDebug("InputSource: using fake transport"); return new EmptyInputSource(url, parent); } } QList *InputSource::factories() { checkFactories(); return m_factories; } QString InputSource::file(InputSourceFactory *factory) { checkFactories(); return m_files->value(factory); } QStringList InputSource::protocols() { checkFactories(); QStringList protocolsList; foreach(InputSourceFactory *f, *m_factories) { protocolsList << f->properties().protocols; } protocolsList.removeDuplicates(); return protocolsList; } void InputSource::checkFactories() { if (!m_factories) { m_files = new QHash ; m_factories = new QList; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Transports"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("InputSource: loaded plugin %s", qPrintable(fileName)); else qWarning("InputSource: %s", qPrintable(loader.errorString ())); InputSourceFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } } } qmmp-0.7.4/src/qmmp/soundcore.cpp0000664000175000017500000002127612256224734015501 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "qmmpevents_p.h" #include "qmmpaudioengine_p.h" #include "decoderfactory.h" #include "effect.h" #include "statehandler.h" #include "inputsource.h" #include "volumecontrol_p.h" #include "enginefactory.h" #include "metadatamanager.h" #include "qmmpsettings.h" #include "soundcore.h" SoundCore *SoundCore::m_instance = 0; SoundCore::SoundCore(QObject *parent) : QObject(parent) { if(m_instance) qFatal("SoundCore: only one instance is allowed"); m_instance = this; m_engine = 0; m_nextState = NO_ENGINE; m_handler = new StateHandler(this); m_volumeControl = new VolumeControl(this); connect(m_handler, SIGNAL(elapsedChanged(qint64)), SIGNAL(elapsedChanged(qint64))); connect(m_handler, SIGNAL(bitrateChanged(int)), SIGNAL(bitrateChanged(int))); connect(m_handler, SIGNAL(frequencyChanged(quint32)), SIGNAL(frequencyChanged(quint32))); connect(m_handler, SIGNAL(sampleSizeChanged(int)), SIGNAL(sampleSizeChanged(int))); connect(m_handler, SIGNAL(channelsChanged(int)), SIGNAL(channelsChanged(int))); connect(m_handler, SIGNAL(bufferingProgress(int)), SIGNAL(bufferingProgress(int))); connect(QmmpSettings::instance(), SIGNAL(eqSettingsChanged()), SIGNAL(eqSettingsChanged())); connect(QmmpSettings::instance(), SIGNAL(audioSettingsChanged()), m_volumeControl, SLOT(reload())); connect(m_volumeControl, SIGNAL(volumeChanged(int, int)), SIGNAL(volumeChanged(int, int))); } SoundCore::~SoundCore() { stop(); MetaDataManager::destroy(); m_instance = 0; } bool SoundCore::play(const QString &source, bool queue, qint64 offset) { if(!queue) stop(); MetaDataManager::instance(); //create metadata manager InputSource *s = InputSource::create(source, this); s->setOffset(offset); m_sources.enqueue(s); connect(s, SIGNAL(ready()), SLOT(startNextSource())); connect(s, SIGNAL(error()), SLOT(startNextSource())); if(!s->initialize()) { m_sources.removeAll(s); s->deleteLater(); if(m_handler->state() == Qmmp::Stopped || m_handler->state() == Qmmp::Buffering) m_handler->dispatch(Qmmp::NormalError); return false; } if(m_handler->state() == Qmmp::Stopped) m_handler->dispatch(Qmmp::Buffering); return true; } void SoundCore::stop() { qApp->sendPostedEvents(this, 0); m_url.clear(); if(m_engine) { m_engine->stop(); qApp->sendPostedEvents(this, 0); //m_engine->deleteLater(); //m_engine = 0; } qDeleteAll(m_sources); m_sources.clear(); m_nextState = NO_ENGINE; m_volumeControl->reload(); if(state() == Qmmp::NormalError || state() == Qmmp::FatalError || state() == Qmmp::Buffering) StateHandler::instance()->dispatch(Qmmp::Stopped); //clear error and buffering state } void SoundCore::pause() { if(m_engine) m_engine->pause(); } void SoundCore::seek(qint64 pos) { if(m_engine) m_engine->seek(pos); } const QString SoundCore::url() const { return m_url; } bool SoundCore::nextTrackAccepted() const { return m_nextState == SAME_ENGINE; } qint64 SoundCore::totalTime() const { return (m_engine) ? m_engine->totalTime() : 0; } EqSettings SoundCore::eqSettings() const { return QmmpSettings::instance()->eqSettings(); } void SoundCore::setEqSettings(const EqSettings &settings) { QmmpSettings::instance()->setEqSettings(settings); } void SoundCore::setVolume(int L, int R) { L = qBound(0, L, 100); R = qBound(0, R, 100); m_volumeControl->setVolume(L, R); } int SoundCore::leftVolume() { return m_volumeControl->left(); } int SoundCore::rightVolume() { return m_volumeControl->right(); } qint64 SoundCore::elapsed() { return m_handler->elapsed(); } int SoundCore::bitrate() { return m_handler->bitrate(); } quint32 SoundCore::frequency() { return m_handler->frequency(); } int SoundCore::sampleSize() { return m_handler->sampleSize(); } int SoundCore::channels() { return m_handler->channels(); } Qmmp::State SoundCore::state() const { return m_handler->state(); } QMap SoundCore::metaData() const { return m_metaData; } QString SoundCore::metaData(Qmmp::MetaData key) const { return m_metaData[key]; } QHash SoundCore::streamInfo() const { return m_streamInfo; } void SoundCore::startNextSource() { if(m_sources.isEmpty()) return; InputSource *s = m_sources.dequeue(); m_url = s->url(); if(s->ioDevice() && !s->ioDevice()->isOpen() && !s->ioDevice()->open(QIODevice::ReadOnly)) { qWarning("SoundCore: input error: %s", qPrintable(s->ioDevice()->errorString())); m_url.clear(); s->deleteLater(); m_nextState = INVALID_SOURCE; if(m_handler->state() == Qmmp::Stopped || m_handler->state() == Qmmp::Buffering) m_handler->dispatch(Qmmp::NormalError); return; } if(!m_engine) { if((m_engine = AbstractEngine::create(s, this))) { m_engine->play(); m_nextState = NO_ENGINE; return; } else { s->deleteLater(); m_handler->dispatch(Qmmp::NormalError); return; } } else if(m_engine->enqueue(s)) { if(state() == Qmmp::Stopped || state() == Qmmp::Buffering) { m_engine->play(); m_nextState = NO_ENGINE; } else { m_nextState = SAME_ENGINE; } } else { m_sources.prepend(s); //try next engine m_nextState = ANOTHER_ENGINE; if(state() == Qmmp::Stopped || state() == Qmmp::Buffering) { startNextEngine(); } } } void SoundCore::startNextEngine() { switch(m_nextState) { case NO_ENGINE: case SAME_ENGINE: { if(m_sources.isEmpty()) m_nextState = NO_ENGINE; break; } case ANOTHER_ENGINE: { m_nextState = NO_ENGINE; if(m_engine) { m_engine->deleteLater(); m_engine = 0; } if(!m_sources.isEmpty()) { m_handler->dispatch(Qmmp::Buffering); startNextSource(); } break; } case INVALID_SOURCE: m_handler->dispatch(Qmmp::NormalError); } } SoundCore* SoundCore::instance() { return m_instance; } bool SoundCore::event(QEvent *e) { if(e->type() == EVENT_STATE_CHANGED) { Qmmp::State st = ((StateChangedEvent *) e)->currentState(); emit stateChanged(st); if(st == Qmmp::Stopped) { m_streamInfo.clear(); startNextEngine(); } } else if(e->type() == EVENT_METADATA_CHANGED) { m_metaData = ((MetaDataChangedEvent *) e)->metaData(); emit metaDataChanged(); } else if(e->type() == EVENT_STREAM_INFO_CHANGED) { m_streamInfo = ((StreamInfoChangedEvent *) e)->streamInfo(); emit streamInfoChanged(); } else if(e->type() == EVENT_NEXT_TRACK_REQUEST) emit nextTrackRequest(); else if(e->type() == EVENT_FINISHED) emit finished(); else return QObject::event(e); return true; } qmmp-0.7.4/src/qmmp/effect.h0000664000175000017500000000756512256224734014406 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECT_H #define EFFECT_H #include #include #include #include "audioparameters.h" #include "buffer.h" class EffectFactory; /*! @brief The Effect class provides the base interface class of audio effects. * @author Ilya Kotov */ class Effect { public: /*! * Object contsructor. */ Effect(); /*! * Destructor. */ virtual ~Effect(); /*! * Adds audio effect to the buffer \b b. * Subclass should implement this function. */ virtual void applyEffect(Buffer *b) = 0; /*! * Prepares object for usage. * Subclasses that reimplement this function must call the base implementation. * @param srate Sample rate. * @param chan Number of channels. * @param f Audio format. */ virtual void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE); /*! * Returns samplerate. */ quint32 sampleRate(); /*! * Returns channels number. */ int channels(); /*! * Returns audio format. */ Qmmp::AudioFormat format(); /*! * Returns audio parameters for output data. */ const AudioParameters audioParameters() const; /*! * Returns assigned factory object. */ EffectFactory* factory() const; /*! * Creates effect object from \b factory. Returns effect objects if factory is enabled, * otherwise returns \b 0. */ static Effect* create(EffectFactory *factory); /*! * Returns a list of effect factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory Effect plugin factory. */ static QString file(EffectFactory *factory); /*! * Sets whether the effect plugin is enabled. * @param factory Effect plugin factory. * @param enable Plugin enable state (\b true - enable, \b false - disable) */ static void setEnabled(EffectFactory* factory, bool enable = true); /*! * Returns \b true if input plugin is enabled, otherwise returns \b false * @param factory Effect plugin factory. */ static bool isEnabled(EffectFactory* factory); private: EffectFactory *m_factory; quint32 m_freq; int m_chan; Qmmp::AudioFormat m_format; static void checkFactories(); static QList *m_factories; static QHash *m_files; }; #endif qmmp-0.7.4/src/qmmp/qmmpsettings.cpp0000664000175000017500000001744312256224734016234 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "metadatamanager.h" #include "qmmp.h" #include "qmmpsettings.h" QmmpSettings *QmmpSettings::m_instance = 0; QmmpSettings::QmmpSettings(QObject *parent) : QObject(parent) { m_instance = this; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); //replaygain settings settings.beginGroup("ReplayGain"); m_rg_mode = (ReplayGainMode) settings.value("mode", REPLAYGAIN_DISABLED).toInt(); m_rg_preamp = settings.value("preamp", 0.0).toDouble(); m_rg_defaut_gain = settings.value("default_gain", 0.0).toDouble(); m_rg_prevent_clipping = settings.value("prevent_clipping", false).toBool(); settings.endGroup(); //audio settings m_aud_software_volume = settings.value("Output/software_volume", false).toBool(); m_aud_16bit = settings.value("Output/use_16bit", false).toBool(); //cover settings settings.beginGroup("Cover"); m_cover_inc = settings.value("include", (QStringList() << "*.jpg" << "*.png")).toStringList(); m_cover_exclude = settings.value("exclude", (QStringList() << "*back*")).toStringList(); m_cover_depth = settings.value("depth", 0).toInt(); m_cover_use_files = settings.value("use_files", true).toBool(); settings.endGroup(); //network settings m_proxy_enabled = settings.value("Proxy/use_proxy", false).toBool(); m_proxy_auth = settings.value("Proxy/authentication", false).toBool(); m_proxy_url = settings.value("Proxy/url").toUrl(); //buffer m_buffer_size = settings.value("Output/buffer_size", 500).toInt(); //file type determination m_determine_by_content = settings.value("Misc/determine_file_by_content", false).toBool(); } QmmpSettings::~QmmpSettings() { sync(); m_instance = 0; } QmmpSettings::ReplayGainMode QmmpSettings::replayGainMode() const { return m_rg_mode; } double QmmpSettings::replayGainPreamp() const { return m_rg_preamp; } double QmmpSettings::replayGainDefaultGain() const { return m_rg_defaut_gain; } bool QmmpSettings::replayGainPreventClipping() const { return m_rg_prevent_clipping; } void QmmpSettings::setReplayGainSettings(ReplayGainMode mode, double preamp, double def_gain, bool clip) { m_rg_mode = mode; m_rg_preamp = preamp; m_rg_defaut_gain = def_gain; m_rg_prevent_clipping = clip; emit replayGainSettingsChanged(); } bool QmmpSettings::useSoftVolume() const { return m_aud_software_volume; } bool QmmpSettings::use16BitOutput() const { return m_aud_16bit; } void QmmpSettings::setAudioSettings(bool soft_volume, bool use_16bit) { m_aud_software_volume = soft_volume; m_aud_16bit = use_16bit; emit audioSettingsChanged(); } QStringList QmmpSettings::coverNameFilters(bool include) const { return include ? m_cover_inc : m_cover_exclude; } int QmmpSettings::coverSearchDepth() const { return m_cover_depth; } bool QmmpSettings::useCoverFiles() const { return m_cover_use_files; } void QmmpSettings::setCoverSettings(QStringList inc, QStringList exc, int depth, bool use_files) { m_cover_inc = inc; m_cover_exclude = exc; m_cover_depth = depth; m_cover_use_files = use_files; MetaDataManager::instance()->clearCoverChache(); emit coverSettingsChanged(); } bool QmmpSettings::isProxyEnabled() const { return m_proxy_enabled; } bool QmmpSettings::useProxyAuth() const { return m_proxy_auth; } QUrl QmmpSettings::proxy() const { return m_proxy_url; } void QmmpSettings::setNetworkSettings(bool use_proxy, bool auth, const QUrl &proxy) { m_proxy_enabled = use_proxy; m_proxy_auth = auth; m_proxy_url = proxy; emit networkSettingsChanged(); } EqSettings QmmpSettings::eqSettings() const { return m_eq_settings; } void QmmpSettings::setEqSettings(const EqSettings &settings) { m_eq_settings = settings; emit eqSettingsChanged(); } void QmmpSettings::readEqSettings(int bands) { m_eq_settings = EqSettings(bands); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup(QString("Equalizer_%1").arg(bands)); for (int i = 0; i < bands; ++i) m_eq_settings.setGain(i, settings.value("band_"+ QString("%1").arg(i), 0).toDouble()); m_eq_settings.setPreamp(settings.value("preamp", 0).toDouble()); m_eq_settings.setEnabled(settings.value("enabled", false).toBool()); settings.endGroup(); emit eqSettingsChanged(); } int QmmpSettings:: bufferSize() const { return m_buffer_size; } void QmmpSettings::setBufferSize(int msec) { m_buffer_size = msec; } void QmmpSettings::sync() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); //replaygain settings settings.beginGroup("ReplayGain"); settings.setValue("mode", m_rg_mode); settings.setValue("preamp", m_rg_preamp); settings.setValue("default_gain", m_rg_defaut_gain); settings.setValue("prevent_clipping", m_rg_prevent_clipping); settings.endGroup(); //audio settings settings.setValue("Output/software_volume", m_aud_software_volume); settings.setValue("Output/use_16bit", m_aud_16bit); //cover settings settings.beginGroup("Cover"); settings.setValue("include", m_cover_inc); settings.setValue("exclude", m_cover_exclude); settings.setValue("depth", m_cover_depth); settings.setValue("use_files", m_cover_use_files); settings.endGroup(); //network settings settings.setValue("Proxy/use_proxy", m_proxy_enabled); settings.setValue("Proxy/authentication", m_proxy_auth); settings.setValue("Proxy/url", m_proxy_url); //equalizer settings settings.beginGroup(QString("Equalizer_%1").arg(m_eq_settings.bands())); for (int i = 0; i < m_eq_settings.bands(); ++i) settings.setValue("band_"+ QString("%1").arg(i), m_eq_settings.gain(i)); settings.setValue("preamp", m_eq_settings.preamp()); settings.setValue("enabled", m_eq_settings.isEnabled()); settings.endGroup(); //buffer size settings.setValue("Output/buffer_size", m_buffer_size); //file type determination settings.setValue("Misc/determine_file_by_content", m_determine_by_content); } QmmpSettings* QmmpSettings::instance() { if(!m_instance) return new QmmpSettings(qApp); return m_instance; } void QmmpSettings::setDetermineFileTypeByContent(bool enabled) { m_determine_by_content = enabled; } bool QmmpSettings::determineFileTypeByContent() const { return m_determine_by_content; } qmmp-0.7.4/src/qmmp/decoder.cpp0000664000175000017500000001640512256224734015103 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #include #include #include #include #include #include #include #include "effect.h" #include "effectfactory.h" #include "buffer.h" #include "output.h" #include "visual.h" #include "decoderfactory.h" #include "qmmp.h" extern "C" { #include "equ/iir.h" } #include "decoder.h" Decoder::Decoder(QIODevice *input) : m_input(input) { m_hasMetaData = false; } Decoder::~Decoder() {} void Decoder::setReplayGainInfo(const QMap &rg) { m_rg = rg; } void Decoder::configure(quint32 srate, int chan, Qmmp::AudioFormat format) { m_parameters = AudioParameters(srate, chan, format); } void Decoder::next() {} const QString Decoder::nextURL() { return QString(); } AudioParameters Decoder::audioParameters() const { return m_parameters; } QMap Decoder::replayGainInfo() const { return m_rg; } void Decoder::addMetaData(const QMap &metaData) { m_metaData = metaData; m_hasMetaData = true; } QIODevice *Decoder::input() { return m_input; } bool Decoder::hasMetaData() const { return m_hasMetaData; } QMap Decoder::takeMetaData() { m_hasMetaData = false; return m_metaData; } // static methods QList *Decoder::m_factories = 0; QList *Decoder::m_disabledFactories = 0; DecoderFactory *Decoder::m_lastFactory = 0; QHash *Decoder::m_files = 0; //sort factories by priority static bool _decoderLessComparator(DecoderFactory* f1, DecoderFactory* f2) { return f1->properties().priority < f2->properties().priority; } void Decoder::checkFactories() { if (!m_factories) { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QStringList disabledNames = settings.value("Decoder/disabled_plugins").toStringList (); m_factories = new QList; m_disabledFactories = new QList; m_files = new QHash ; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Input"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("Decoder: loaded plugin %s", qPrintable(fileName)); else qWarning("Decoder: %s", qPrintable(loader.errorString ())); DecoderFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); if(disabledNames.contains(factory->properties().shortName)) m_disabledFactories->append(factory); } } //remove physically deleted plugins from disabled list QStringList names; foreach (DecoderFactory *factory, *m_factories) { names.append(factory->properties().shortName); } foreach (QString name, disabledNames) { if (!names.contains(name)) disabledNames.removeAll(name); } settings.setValue("Decoder/disabled_plugins",disabledNames); qSort(m_factories->begin(), m_factories->end(), _decoderLessComparator); } } QString Decoder::file(DecoderFactory *factory) { checkFactories(); return m_files->value(factory); } QStringList Decoder::protocols() { checkFactories(); QStringList protocolsList; foreach(DecoderFactory *f, *m_factories) { if(isEnabled(f)) protocolsList << f->properties().protocols; } protocolsList.removeDuplicates(); return protocolsList; } DecoderFactory *Decoder::findByPath(const QString& source, bool useContent) { checkFactories(); DecoderFactory *fact = m_lastFactory; if(useContent) { QFile file(source); if(!file.open(QIODevice::ReadOnly)) { qWarning("Decoder: file open error: %s", qPrintable(file.errorString())); return 0; } QByteArray array = file.read(8192); QBuffer buffer(&array); buffer.open(QIODevice::ReadOnly); //try last factory with stream based input or local files support if (fact && isEnabled(fact) && (!fact->properties().noInput || fact->properties().protocols.contains("file"))) { if(fact->canDecode(&buffer)) return fact; } foreach(DecoderFactory *fact, *m_factories) { if(fact->properties().noInput && !fact->properties().protocols.contains("file")) continue; if (isEnabled(fact) && fact->canDecode(&buffer)) { return fact; } } } if (fact && fact->supports(source) && isEnabled(fact)) //try last factory return fact; foreach(fact, *m_factories) { if (fact->supports(source) && isEnabled(fact)) { m_lastFactory = fact; return fact; } } return 0; } DecoderFactory *Decoder::findByMime(const QString& type) { if(type.isEmpty()) return 0; checkFactories(); DecoderFactory *fact; foreach(fact, *m_factories) { if (isEnabled(fact) && !fact->properties().noInput && fact->properties().contentTypes.contains(type)) return fact; } return 0; } DecoderFactory *Decoder::findByContent(QIODevice *input) { checkFactories(); foreach(DecoderFactory *fact, *m_factories) { if (isEnabled(fact) && !fact->properties().noInput && fact->canDecode(input)) { return fact; } } return 0; } DecoderFactory *Decoder::findByProtocol(const QString &p) { checkFactories(); foreach(DecoderFactory *fact, *m_factories) { if (isEnabled(fact) && fact->properties().protocols.contains(p)) return fact; } return 0; } void Decoder::setEnabled(DecoderFactory* factory, bool enable) { checkFactories(); if (!m_factories->contains(factory)) return; if(enable == isEnabled(factory)) return; if(enable) m_disabledFactories->removeAll(factory); else m_disabledFactories->append(factory); QStringList disabledNames; foreach(DecoderFactory *f, *m_disabledFactories) { disabledNames << f->properties().shortName; } disabledNames.removeDuplicates(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Decoder/disabled_plugins", disabledNames); } bool Decoder::isEnabled(DecoderFactory* factory) { checkFactories(); return !m_disabledFactories->contains(factory); } QList *Decoder::factories() { checkFactories(); return m_factories; } qmmp-0.7.4/src/qmmp/CMakeLists.txt0000664000175000017500000000657412256224734015540 0ustar useruserproject(libqmmp) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 OLD) cmake_policy(SET CMP0005 OLD) endif(COMMAND cmake_policy) # qt lib ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) ADD_DEFINITIONS(-DLIB_DIR=\\\"\\/${LIB_DIR}\\\") ADD_DEFINITIONS(-DQMMP_INSTALL_PREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\") IF(NOT QMMP_VERSION_STABLE) #add svn revision execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/svn_revision.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE SVN_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE) IF(SVN_REVISION) ADD_DEFINITIONS(-DSVN_REVISION=\\\"${SVN_REVISION}\\\") ENDIF(SVN_REVISION) ENDIF(NOT QMMP_VERSION_STABLE) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(libqmmp_SRCS visual.cpp recycler.cpp decoder.cpp output.cpp outputwriter.cpp fileinfo.cpp equ/iir.c equ/iir_cfs.c equ/iir_fpu.c soundcore.cpp effect.cpp qmmp.cpp statehandler.cpp volumecontrol.cpp metadatamodel.cpp tagmodel.cpp qmmpaudioengine.cpp abstractengine.cpp audioparameters.cpp inputsource.cpp fileinputsource.cpp emptyinputsource.cpp metadatamanager.cpp replaygain.cpp qmmpsettings.cpp audioconverter.cpp eqsettings.cpp qmmpevents.cpp ) SET(libqmmp_HDRS qmmpevents_p.h outputfactory.h decoderfactory.h effectfactory.h equ/iir_cfs.h equ/iir_fpu.h equ/iir.h visualfactory.h recycler_p.h buffer.h effect.h qmmp.h replaygain_p.h fileinfo.h audioconverter_p.h eqsettings.h decoder.h tagmodel.h audioparameters.h inputsourcefactory.h enginefactory.h metadatamanager.h volume.h output.h ) SET(libqmmp_MOC_HDRS visual.h outputwriter_p.h soundcore.h statehandler.h volumecontrol_p.h metadatamodel.h qmmpaudioengine_p.h abstractengine.h inputsource.h fileinputsource_p.h emptyinputsource_p.h qmmpsettings.h ) SET(libqmmp_DEVEL_HDRS abstractengine.h audioparameters.h buffer.h decoderfactory.h decoder.h effectfactory.h effect.h enginefactory.h eqsettings.h fileinfo.h inputsourcefactory.h inputsource.h metadatamanager.h metadatamodel.h outputfactory.h output.h qmmp.h qmmpsettings.h soundcore.h statehandler.h tagmodel.h visualfactory.h visual.h volume.h ) QT4_WRAP_CPP(libqmmp_MOC_SRCS ${libqmmp_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(libqmmp SHARED ${libqmmp_SRCS} ${libqmmp_MOC_SRCS} ${libqmmp_HDRS}) target_link_libraries(libqmmp ${QT_LIBRARIES}) SET_TARGET_PROPERTIES(libqmmp PROPERTIES VERSION ${QMMP_VERSION} SOVERSION ${QMMP_SOVERSION} OUTPUT_NAME qmmp) install(TARGETS libqmmp LIBRARY DESTINATION ${LIB_DIR} RUNTIME DESTINATION bin ARCHIVE DESTINATION ${LIB_DIR}) install(FILES ${libqmmp_DEVEL_HDRS} DESTINATION include/qmmp) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmmp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/qmmp.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmmp.pc DESTINATION ${LIB_DIR}/pkgconfig) qmmp-0.7.4/src/qmmp/statehandler.cpp0000664000175000017500000001454712256224734016161 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "soundcore.h" #include "qmmpevents_p.h" #include "statehandler.h" #define TICK_INTERVAL 250 #define PREFINISH_TIME 7000 StateHandler* StateHandler::m_instance = 0; StateHandler::StateHandler(QObject *parent) : QObject(parent), m_mutex(QMutex::Recursive) { if(m_instance) qFatal("StateHandler: only one instance is allowed"); m_instance = this; m_elapsed = -1; m_bitrate = 0; m_frequency = 0; m_precision = 0; m_channels = 0; m_sendAboutToFinish = true; m_state = Qmmp::Stopped; } StateHandler::~StateHandler() { m_instance = 0; } void StateHandler::dispatch(qint64 elapsed, int bitrate, quint32 frequency, int precision, int channels) { m_mutex.lock(); if (qAbs(m_elapsed - elapsed) > TICK_INTERVAL) { m_elapsed = elapsed; emit (elapsedChanged(elapsed)); if (m_bitrate != bitrate) { m_bitrate = bitrate; emit (bitrateChanged(bitrate)); } if((SoundCore::instance()->totalTime() > PREFINISH_TIME) && (SoundCore::instance()->totalTime() - m_elapsed < PREFINISH_TIME) && m_sendAboutToFinish) { m_sendAboutToFinish = false; if(SoundCore::instance()->totalTime() - m_elapsed > PREFINISH_TIME/2) qApp->postEvent(parent(), new QEvent(EVENT_NEXT_TRACK_REQUEST)); } } if (m_frequency != frequency) { m_frequency = frequency; emit frequencyChanged(frequency); } if (m_precision != precision) { m_precision = precision; emit sampleSizeChanged(precision); } if (m_channels != channels) { m_channels = channels; emit channelsChanged(channels); } m_mutex.unlock(); } void StateHandler::dispatch(const QMap &metaData) { m_mutex.lock(); QMap tmp = metaData; foreach(QString value, tmp.values()) //remove empty keys { if (value.isEmpty() || value == "0") tmp.remove(tmp.key(value)); } if(tmp.isEmpty() || tmp.value(Qmmp::URL).isEmpty()) //skip empty tags { qWarning("StateHandler: empty metadata"); m_mutex.unlock(); return; } if(m_state != Qmmp::Playing && m_state != Qmmp::Paused) { qWarning("StateHandler: metadata is ignored"); m_mutex.unlock(); return; } if(m_metaData.isEmpty() || m_metaData.value(Qmmp::URL) == metaData.value(Qmmp::URL)) { if (m_metaData != tmp) { m_metaData = tmp; qApp->postEvent(parent(), new MetaDataChangedEvent(m_metaData)); } } m_mutex.unlock(); } void StateHandler::dispatch(const QHash &info) { m_mutex.lock(); QHash tmp = info; foreach(QString value, tmp.values()) //remove empty keys { if (value.isEmpty()) tmp.remove(tmp.key(value)); } if(m_streamInfo != tmp) { m_streamInfo = tmp; qApp->postEvent(parent(), new StreamInfoChangedEvent(m_streamInfo)); } m_mutex.unlock(); } void StateHandler::dispatch(Qmmp::State state) { m_mutex.lock(); //clear QList clearStates; clearStates << Qmmp::Stopped << Qmmp::NormalError << Qmmp::FatalError; if (clearStates.contains(state)) { m_elapsed = -1; m_bitrate = 0; m_frequency = 0; m_precision = 0; m_channels = 0; m_metaData.clear(); m_streamInfo.clear(); m_sendAboutToFinish = true; } if (m_state != state) { QStringList states; states << "Playing" << "Paused" << "Stopped" << "Buffering" << "NormalError" << "FatalError"; qDebug("StateHandler: Current state: %s; previous state: %s", qPrintable(states.at(state)), qPrintable(states.at(m_state))); Qmmp::State prevState = state; m_state = state; qApp->postEvent(parent(), new StateChangedEvent(m_state, prevState)); } m_mutex.unlock(); } void StateHandler::dispatchBuffer(int percent) { if(m_state == Qmmp::Buffering) emit bufferingProgress(percent); } qint64 StateHandler::elapsed() { return m_elapsed; } int StateHandler::bitrate() { return m_bitrate; } int StateHandler::frequency() { return m_frequency; } int StateHandler::sampleSize() { return m_precision; } int StateHandler::channels() { return m_channels; } Qmmp::State StateHandler::state() const { return m_state; } void StateHandler::sendNextTrackRequest() { m_mutex.lock(); if(m_sendAboutToFinish) { m_sendAboutToFinish = false; qApp->postEvent(parent(), new QEvent(EVENT_NEXT_TRACK_REQUEST)); } m_mutex.unlock(); } void StateHandler::sendFinished() { qApp->postEvent(parent(), new QEvent(EVENT_FINISHED)); } StateHandler *StateHandler::instance() { return m_instance; } qmmp-0.7.4/src/qmmp/visualfactory.h0000664000175000017500000000632612256224734016037 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VISUALFACTORY_H #define VISUALFACTORY_H class QObject; class QWidget; class QTranslator; class QDialog; class Visual; /*! @brief Helper class to store visual plugin properies. * @author Ilya Kotov */ class VisualProperties { public: /*! * Constructor */ VisualProperties() { hasAbout = false; hasSettings = false; } QString name; /*!< Effect plugin full name */ QString shortName; /*!< Effect plugin short name for internal usage */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise returns \b false */ }; /*! @brief %Visual plugin interface (visual factory). * @author Ilya Kotov */ class VisualFactory { public: /*! * Destructor. */ virtual ~VisualFactory() {} /*! * Returns visual plugin properties. */ virtual const VisualProperties properties() const = 0; /*! * Creates visualization provided by plugin. * @param parent Parent object. */ virtual Visual *create(QWidget *parent) = 0; /*! * Creates configuration dialog. * @param parent Parent widget. * @return Configuration dialog pointer. */ virtual QDialog *createConfigDialog(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return \b 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(VisualFactory, "VisualFactory/1.0"); #endif qmmp-0.7.4/src/qmmp/decoder.h0000664000175000017500000001335312256224734014547 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef DECODER_H #define DECODER_H #include #include #include #include #include #include #include "fileinfo.h" #include "qmmp.h" #include "audioparameters.h" class Decoder; class DecoderFactory; class QIODevice; /*! @brief The Decoder class provides the base interface class of audio decoders. * @author Brad Hughes * @author Ilya Kotov */ class Decoder { public: /*! * Object contsructor. * @param input QIODevice-based input source. */ Decoder(QIODevice *input = 0); /*! * Destructor. */ virtual ~Decoder(); /*! * Prepares decoder for usage. * Subclass should reimplement this function. */ virtual bool initialize() = 0; /*! * Returns the total time in milliseconds. * Subclass should reimplement this function. */ virtual qint64 totalTime() = 0; /*! * Requests a seek to the time \b time indicated, specified in milliseconds. */ virtual void seek(qint64 time) = 0; /*! * Reads up to \b maxSize bytes of decoded audio to \b data * Returns the number of bytes read, or -1 if an error occurred. * In most cases subclass should reimplement this function. */ virtual qint64 read(char *data, qint64 maxSize) = 0; /*! * Returns current bitrate (in kbps). * Subclass should reimplement this function. */ virtual int bitrate() = 0; /*! * Tells decoder that it should play next track. * By default this function does nothing. * Reimplemet it if your decoder can play next track without stop/start cycle. * This may be useful for multitrack formats like cue or cda. */ virtual void next(); /*! * Returns url which decoder can play without stop/start cycle. * By default this function does nothing. * Reimplemet it if your decoder can play next track without stop/start cycle. */ virtual const QString nextURL(); /*! * Returns detected audio parameters. */ AudioParameters audioParameters() const; /*! * Returns ReplayGain information. */ QMap replayGainInfo() const; /*! * Sets ReplayGain information. Use this function before playback. */ void setReplayGainInfo(const QMap &rg); /*! * Returns QIODevice-based input source assigned for this decoder. */ QIODevice *input(); /*! * Informs decoder about new received metadata. * Call of this function is required for all non-local streams/files * @param metaData Metadata map. */ void addMetaData(const QMap &metaData); /*! * Returns \b true when new metadata has received, otherwise returns \b false. */ bool hasMetaData() const; /*! * Takes metadata out of decoder and returns it. * Attention: hasMetaData() should return \b true before use of this fuction. */ QMap takeMetaData(); /*! * Returns DecoderFactory pointer which supports file \b path or 0 if file \b path is unsupported * @param path Full local file path * @param useContent Content-based file type determination (\b true - enabled, \b false - disabled) */ static DecoderFactory *findByPath(const QString &path, bool useContent = false); /*! * Returns DecoderFactory pointer which supports mime type \b mime or \b 0 if mime type \b mime is unsupported */ static DecoderFactory *findByMime(const QString &mime); /*! * Returns DecoderFactory pointer which supports data provided by \b input * or \b 0 if data is unsupported. */ static DecoderFactory *findByContent(QIODevice *input); /*! * Returns DecoderFactory pointer which supports protocol \b p or \b 0 if \b url is not supported. */ static DecoderFactory *findByProtocol(const QString &p); /*! * Returns a list of decoder factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory Decoder plugin factory. */ static QString file(DecoderFactory *factory); /*! * Returns a list of supported protocols (including meta-protocols). * This fuction ignores disabled decoders. */ static QStringList protocols(); /*! * Sets whether the input plugin is enabled. * @param factory Decoder plugin factory. * @param enable Plugin enable state (\b true - enable, \b false - disable) */ static void setEnabled(DecoderFactory* factory, bool enable = true); /*! * Returns \b true if input plugin is enabled, otherwise returns \b false * @param factory Decoder plugin factory. */ static bool isEnabled(DecoderFactory* factory); protected: /*! * Use this function inside initialize() reimplementation to tell other plugins about audio parameters. * @param srate Sample rate. * @param chan Number of channels. * @param f Audio format. */ void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE); private: static void checkFactories(); static QList *m_factories; static QList *m_disabledFactories; static DecoderFactory *m_lastFactory; static QHash *m_files; AudioParameters m_parameters; QIODevice *m_input; bool m_hasMetaData; QMap m_metaData; QMap m_rg; //replay gain information }; #endif // DECODER_H qmmp-0.7.4/src/qmmp/decoderfactory.h0000664000175000017500000001200412256224734016127 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERFACTORY_H #define DECODERFACTORY_H class QObject; class QString; class QIODevice; class QWidget; class QTranslator; class QStringList; class Decoder; class Output; class FileInfo; class MetaDataModel; /*! @brief Helper class to store input plugin properties. * @author Ilya Kotov */ class DecoderProperties { public: /*! * Constructor */ DecoderProperties() { hasAbout = false; hasSettings = false; noInput = false; noOutput = false; priority = 0; } QString name; /*!< Input plugin full name */ QString shortName; /*!< Input plugin short name for internal usage */ QStringList filters; /*!< File filters (example: "*.mp3") */ QString description; /*!< File filters description */ QStringList contentTypes; /*!< Supported content types */ QStringList protocols; /*!< A list of supported protocols. * Should be empty if plugin uses stream input. */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise \b false */ bool noInput; /*!< Should be \b true if plugin has own input, otherwise \b false */ bool noOutput; /*!< Should be \b true if plugin has own output, otherwise \b false */ int priority; /*!< Decoder priority. Decoders with lowest value will be used first */ }; /*! @brief Input plugin interface (decoder factory). * @author Ilya Kotov */ class DecoderFactory { public: /*! * Object destructor. */ virtual ~DecoderFactory() {} /*! * Returns \b true if plugin supports \b source, otherwise returns \b false */ virtual bool supports(const QString &source) const = 0; /*! * Returns \b true if plugin can decode data provided by \b d, otherwise returns \b false */ virtual bool canDecode(QIODevice *d) const = 0; /*! * Returns general plugin properties. */ virtual const DecoderProperties properties() const = 0; /*! * Creates decoder object. * @param path File path * @param input Input data (if required) */ virtual Decoder *create(const QString &path , QIODevice *input = 0) = 0; /*! * Extracts metadata and audio information from file \b path and returns a list of FileInfo items. * One file may contain several playlist items (for example: cda disk or flac with embedded cue) * @param fileName File path. * @param useMetaData Metadata usage (\b true - use, \b - do not use) */ virtual QList createPlayList(const QString &fileName, bool useMetaData) = 0; /*! * Creats metadata object, which provides full access to file tags. * @param path File path. * @param parent Parent object. * @return MetaDataModel pointer. */ virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0; /*! * Shows settings dialog. * @param parent Parent widget. */ virtual void showSettings(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(DecoderFactory, "DecoderFactory/1.0") #endif qmmp-0.7.4/src/qmmp/soundcore.h0000664000175000017500000001545512256224734015150 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SOUNDCORE_H #define SOUNDCORE_H #include #include #include #include #include "decoder.h" #include "output.h" #include "visual.h" #include "qmmp.h" #include "qmmpsettings.h" #include "eqsettings.h" class VolumeControl; class AbstractEngine; class InputSource; /*! \brief The SoundCore class provides a simple interface for audio playback. * @author Ilya Kotov */ class SoundCore : public QObject { Q_OBJECT public: /*! * Object constructor. * @param parent Parent object. */ SoundCore(QObject *parent = 0); /*! * Destructor. */ ~SoundCore(); /*! * Returns length in milliseconds */ qint64 totalTime() const; /*! * Returns equalizer settings */ EqSettings eqSettings() const; /*! * Chages equalizer settings to \b settings. */ void setEqSettings(const EqSettings &settings); /*! * Returns left volume level. */ int leftVolume(); /*! * Returns left volume level. */ int rightVolume(); /*! * Returns the current time (in milliseconds). */ qint64 elapsed(); /*! * Returns current bitrate (in kbps) */ int bitrate(); /*! * Returns current sample rate (in Hz). */ quint32 frequency(); /*! * Returns sample size (in bits). */ int sampleSize(); /*! * Returns channels number. */ int channels(); /*! * Returns the current state. */ Qmmp::State state() const; /*! * Returns all meta data in map. */ QMap metaData() const; /*! * Returns the metdata string associated with the given \b key. */ QString metaData(Qmmp::MetaData key) const; /*! * Returns a hash of stream information if available */ QHash streamInfo() const; /*! * Returns a pointer to the SoundCore instance. */ static SoundCore* instance(); public slots: /*! * Sets volume. * @param left - volume of the left channel \b [0..100]. * @param right - volume of the right channel \b [0..100]. */ void setVolume(int left, int right); /*! * This function plays file or stream with the given path \p source. * Returns \b true if playback has been started successful or source is not a local file, * otherwise returns \b false. Useful for invalid files skipping. */ bool play(const QString &source, bool queue = false, qint64 offset = -1); /*! * Stops playback */ void stop(); /*! * Pauses/resumes playback */ void pause(); /*! * This function sets the current play position to \p pos in milliseconds. */ void seek(qint64 pos); /*! * This function returns file path or stream url. */ const QString url() const; /*! * Indicates that the current active engine will be used for the next queued track. * May be useful for some effect plugins. */ bool nextTrackAccepted() const; signals: /*! * This signal is emitted when the stream reader fills it's buffer. * The argument \b progress indicates the current percentage of buffering completed. */ void bufferingProgress(int progress); /*! * Tracks elapesed time. * @param time New track position in milliseconds. */ void elapsedChanged(qint64 time); /*! * Emitted when bitrate has changed. * @param bitrate New bitrate (in kbps) */ void bitrateChanged(int bitrate); /*! * Emitted when samplerate has changed. * @param frequency New sample rate (in Hz) */ void frequencyChanged(quint32 frequency); /*! * Emitted when sample size has changed. * @param size New sample size (in bits) */ void sampleSizeChanged(int size); /*! * Emitted when channels number has changed. * @param channels New channels number. */ void channelsChanged(int channels); /*! * Emitted when new metadata is available. */ void metaDataChanged (); /*! * Emitted when new stream information is available. */ void streamInfoChanged(); /*! * This signal is emitted when the state of the SoundCore has changed. */ void stateChanged (Qmmp::State newState); /*! * Emitted when playback has finished. */ void finished(); /*! * Emitted when volume has changed. * @param left Left channel volume level. It should be \b [0..100] * @param right Right channel volume level. It should be \b [0..100] */ void volumeChanged(int left, int right); /*! * Emitted when equalizer settings have changed. */ void eqSettingsChanged(); /*! * Emitted before playback ends. Use this signal to append new url to the queue. */ void nextTrackRequest(); private slots: void startNextSource(); void startNextEngine(); private: bool event(QEvent *e); enum NextEngineState { NO_ENGINE = 0, SAME_ENGINE, ANOTHER_ENGINE, INVALID_SOURCE }; QMap m_metaData; QHash m_streamInfo; QString m_url; static SoundCore* m_instance; StateHandler *m_handler; VolumeControl *m_volumeControl; AbstractEngine *m_engine; QQueue m_sources; int m_nextState; }; #endif qmmp-0.7.4/src/qmmp/fileinfo.h0000664000175000017500000000722712256224734014740 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FILEINFO_H #define FILEINFO_H #include #include #include #include "qmmp.h" /*! @brief The FileInfo class stores metadata and audio information about media file or stream. * @author Ilya Kotov */ class FileInfo { public: /*! * Constructs a new empty FileInfo that with file \b path */ FileInfo(const QString &path = QString()); /*! * Constructs a new FileInfo that is a copy of the given \b info */ FileInfo(const FileInfo &info); /*! * Destructor. */ ~FileInfo(); /*! * Makes a copy of the given \b info */ void operator=(const FileInfo &info); /*! * Returns \b true if this FileInfo object refers to \b info; otherwise returns \b false. */ bool operator==(const FileInfo &info); /*! * Returns \b false if this FileInfo object refers to \b info; otherwise returns \b true. */ bool operator!=(const FileInfo &info); /*! * Returnds file duration in seconds. */ qint64 length () const; /*! * Returns the metdata string associated with the given \b key. */ const QString metaData (Qmmp::MetaData key) const; /*! * Returns all meta data in map. */ const QMap metaData () const; /*! * Returns \b true if stream/file has no metadata, otherwise returns \b false */ bool isEmpty() const; /*! * Returns file path or stream url. */ const QString path() const; /*! * Sets file duration to \b length in seconds. */ void setLength(qint64 length); /*! * Sets metadata \b key to \b value */ void setMetaData(Qmmp::MetaData key, const QString &value); /*! * Sets metadata \b key to \b value (integer is converted to string) */ void setMetaData(Qmmp::MetaData key, int value); /*! * Changes all metadata to \b metaData */ void setMetaData(const QMap &metaData); /*! * Sets file path or stream url to \b path */ void setPath(const QString &path); private: QMap m_metaData; qint64 m_length; QString m_path; QList > map; }; #endif qmmp-0.7.4/src/qmmp/audioparameters.cpp0000664000175000017500000000552112256224734016660 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "audioparameters.h" AudioParameters::AudioParameters() { m_srate = 0; m_chan = 0; m_format = Qmmp::PCM_S16LE; } AudioParameters::AudioParameters(const AudioParameters &other) { m_srate = other.sampleRate(); m_chan = other.channels(); m_format = other.format(); } AudioParameters::AudioParameters(quint32 srate, int chan, Qmmp::AudioFormat format) { m_srate = srate; m_chan = chan; m_format = format; } void AudioParameters::operator=(const AudioParameters &p) { m_srate = p.sampleRate(); m_chan = p.channels(); m_format = p.format(); } bool AudioParameters::operator==(const AudioParameters &p) const { return m_srate == p.sampleRate() && m_chan == p.channels() && m_format == p.format(); } bool AudioParameters::operator!=(const AudioParameters &p) const { return !operator==(p); } quint32 AudioParameters::sampleRate() const { return m_srate; } int AudioParameters::channels() const { return m_chan; } Qmmp::AudioFormat AudioParameters::format() const { return m_format; } int AudioParameters::sampleSize() const { return sampleSize(m_format); } int AudioParameters::sampleSize(Qmmp::AudioFormat format) { switch(format) { case Qmmp::PCM_S8: return 1; case Qmmp::PCM_S16LE: case Qmmp::PCM_UNKNOWM: return 2; case Qmmp::PCM_S24LE: case Qmmp::PCM_S32LE: return 4; } return 2; } qmmp-0.7.4/src/qmmp/outputfactory.h0000664000175000017500000000647112256224734016075 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTFACTORY_H #define OUTPUTFACTORY_H class QObject; class QString; class QIODevice; class QWidget; class QTranslator; class Volume; class Decoder; class Output; /*! @brief Helper class to store output plugin properies. * @author Ilya Kotov */ class OutputProperties { public: /*! * Constructor */ OutputProperties() { hasAbout = false; hasSettings = false; } QString name; /*!< Effect plugin full name */ QString shortName; /*!< Effect plugin short name for internal usage */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise returns \b false */ }; /*! @brief %Output plugin interface (output factory). * @author Ilya Kotov */ class OutputFactory { public: /*! * Destructor. */ virtual ~OutputFactory() {} /*! * Returns output plugin properties. */ virtual const OutputProperties properties() const = 0; /*! * Creates output provided by plugin. */ virtual Output *create() = 0; /*! * Creates volume control object provided by plugin. * Returns \b 0 if volume control is not supported by plugin. */ virtual Volume *createVolume() = 0; /*! * Shows settings dialog. * @param parent Parent widget. */ virtual void showSettings(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(OutputFactory, "OutputFactory/1.0") #endif qmmp-0.7.4/src/qmmp/qmmpevents.cpp0000664000175000017500000000504512256224734015673 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "qmmpevents_p.h" StateChangedEvent::StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState) : QEvent(EVENT_STATE_CHANGED) { m_state = currentState; m_prevState = previousState; } StateChangedEvent::~StateChangedEvent(){} Qmmp::State StateChangedEvent::currentState() const { return m_state; } Qmmp::State StateChangedEvent::previousState() const { return m_prevState; } MetaDataChangedEvent::MetaDataChangedEvent(const QMap &metaData) : QEvent (EVENT_METADATA_CHANGED) { m_metaData = metaData; } MetaDataChangedEvent::~MetaDataChangedEvent(){} QMapMetaDataChangedEvent::metaData() const { return m_metaData; } QString MetaDataChangedEvent::metaData(Qmmp::MetaData key) const { return m_metaData.value(key); } StreamInfoChangedEvent::StreamInfoChangedEvent(const QHash &info) : QEvent (EVENT_STREAM_INFO_CHANGED) { m_streamInfo = info; } StreamInfoChangedEvent::~StreamInfoChangedEvent(){} QHashStreamInfoChangedEvent::streamInfo() const { return m_streamInfo; } qmmp-0.7.4/src/qmmp/qmmpevents_p.h0000664000175000017500000000632712256224734015663 0ustar useruser/*************************************************************************** * Copyright (C) 2011-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMPEVENTS_P_H #define QMMPEVENTS_P_H #include #include #include #include "qmmp.h" #define EVENT_STATE_CHANGED (QEvent::Type(QEvent::User)) /*!< @internal */ #define EVENT_NEXT_TRACK_REQUEST (QEvent::Type(QEvent::User + 1)) /*!< @internal */ #define EVENT_FINISHED (QEvent::Type(QEvent::User + 2)) /*!< @internal */ #define EVENT_METADATA_CHANGED (QEvent::Type(QEvent::User + 3)) /*!< @internal */ #define EVENT_STREAM_INFO_CHANGED (QEvent::Type(QEvent::User + 4)) /*!< @internal */ /*! @internal * @author Ilya Kotov */ class StateChangedEvent : public QEvent { public: StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState); virtual ~StateChangedEvent(); Qmmp::State currentState() const; Qmmp::State previousState() const; private: Qmmp::State m_state; Qmmp::State m_prevState; }; /*! @internal * @author Ilya Kotov */ class MetaDataChangedEvent : public QEvent { public: MetaDataChangedEvent(const QMap &metaData); virtual ~MetaDataChangedEvent(); /*! * Returns all meta data in map. */ QMap metaData() const; /*! * Returns the metdata string associated with the given \b key. */ QString metaData(Qmmp::MetaData key) const; private: QMap m_metaData; }; /*! @internal * @author Ilya Kotov */ class StreamInfoChangedEvent : public QEvent { public: StreamInfoChangedEvent(const QHash &info); virtual ~StreamInfoChangedEvent(); /*! * Returns all stream information. */ QHash streamInfo() const; private: QHash m_streamInfo; }; #endif // QMMPEVENTS_P_H qmmp-0.7.4/src/qmmp/tagmodel.cpp0000664000175000017500000000415612256224734015272 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "tagmodel.h" TagModel::TagModel(int f) { m_f = f; } TagModel::~TagModel() {} void TagModel::setValue(Qmmp::MetaData key, int value) { setValue(key, QString::number(value)); } QList TagModel::keys() { QList list; list << Qmmp::TITLE; list << Qmmp::ARTIST; list << Qmmp::ALBUM; list << Qmmp::COMMENT; list << Qmmp::GENRE; list << Qmmp::COMPOSER; list << Qmmp::YEAR; list << Qmmp::TRACK; list << Qmmp::DISCNUMBER; return list; } int TagModel::caps() { return m_f; } bool TagModel::exists() { return true; } void TagModel::create() {} void TagModel::remove() {} void TagModel::save() {} qmmp-0.7.4/src/qmmp/abstractengine.h0000664000175000017500000001053112256224734016126 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ABSTRACTENGINE_H #define ABSTRACTENGINE_H #include //#include #include #include #include "enginefactory.h" #include "qmmpsettings.h" class QIODevice; class InputSource; /*! @brief The AbstractEngine class provides the base interface class of audio audio engines. * @author Ilya Kotov */ class AbstractEngine : public QThread { Q_OBJECT public: /*! * Object contsructor. * @param parent Parent object. */ AbstractEngine(QObject *parent = 0); /*! * Destructor. */ virtual ~AbstractEngine(); /*! * Prepares decoder for usage. * Subclass should reimplement this function. */ virtual bool enqueue(InputSource *source) = 0; /*! * Returns the total time in milliseconds. * Subclass should reimplement this function. */ virtual qint64 totalTime() = 0; /*! * Starts playback. Returns \b true if playback has been started successful, * otherwise returns \b false. */ virtual bool play() = 0; /*! * Requests a seek to the time \b time indicated, specified in milliseconds. */ virtual void seek(qint64 time) = 0; /*! * Requests playback to stop */ virtual void stop() = 0; /*! * Pauses/resumes playback */ virtual void pause() = 0; /*! * Returns mutex pointer. */ QMutex *mutex(); /*! * Creates Engine object. * @param s InputSource object. * @param parent Parent object. * Returns \b 0 if the given source is not supported. */ static AbstractEngine *create(InputSource *s, QObject *parent = 0); /*! * Returns a list of engine factories. */ static QList *factories(); /*! * Returns EngineFactory pointer which supports file \b path or 0 if file \b path is unsupported */ static EngineFactory *findByPath(const QString &path); /*! * Sets whether the engine is enabled. * @param factory Engine plugin factory. * @param enable Plugin enable state (\b true - enable, \b false - disable) */ static void setEnabled(EngineFactory* factory, bool enable = true); /*! * Returns \b true if engine is enabled, otherwise returns \b false * @param factory Engine plugin factory. */ static bool isEnabled(EngineFactory* factory); /*! * Returns plugin file path. * @param factory Engine plugin factory. */ static QString file(EngineFactory *factory); /*! * Returns a list of supported protocols (including meta-protocols). * This fuction ignores disabled engines. */ static QStringList protocols(); private: QMutex m_mutex; static void checkFactories(); static QList *m_factories; static QList *m_disabledFactories; static QHash *m_files; }; #endif // ABSTRACTENGINE_H qmmp-0.7.4/src/qmmp/svn_revision.sh0000775000175000017500000000040112256224734016042 0ustar useruser#!/bin/sh # based on ffmpeg version.sh script # check for SVN revision number MYDIR=$(dirname $0) revision=`cd $MYDIR && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2` test $revision && revision=r$revision test $revision && echo $revision qmmp-0.7.4/src/qmmp/statehandler.h0000664000175000017500000001145112256224734015615 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef STATEHANDLER_H #define STATEHANDLER_H #include #include #include #include #include "abstractengine.h" #include "qmmp.h" /*! @brief The StateHandler class allows to track information about playback progress. * @author Ilya Kotov */ class StateHandler : public QObject { Q_OBJECT public: /*! * Object constructor. * @param parent Parent object. */ StateHandler(QObject *parent = 0); /*! * Destructor. */ ~StateHandler(); /*! * Sends information about playback progress. * @param elapsed Current time (in milliseconds). * @param bitrate Current bitrate (in kbps). * @param frequency Current samplerate (in Hz). * @param precision Sample size (in bits). * @param channels Number of channels. */ void dispatch(qint64 elapsed, int bitrate, quint32 frequency, int precision, int channels); /*! * Sends metadata \b metaData */ void dispatch(const QMap &metaData); /*! * Sends stream information \b info */ void dispatch(const QHash &info); /*! * Sends playback state. */ void dispatch(Qmmp::State state); /*! * Sends buffering progress. * @param percent Indicates the current percentage of buffering completed. */ void dispatchBuffer(int percent); /*! * Returns the current time (in milliseconds). */ qint64 elapsed(); /*! * Returns current bitrate (in kbps) */ int bitrate(); /*! * Returns current sample rate (in Hz). */ int frequency(); /*! * Returns sample size (in bits). */ int sampleSize(); /*! * Returns channels number. */ int channels(); /*! * Returns the current state. */ Qmmp::State state() const; /*! * Sends next track request. */ void sendNextTrackRequest(); /*! * Sends playback finished event. */ void sendFinished(); /*! * Returns a pointer to the first created StateHandler instance. */ static StateHandler* instance(); signals: /*! * Tracks elapesed time. * @param time New track position in milliseconds. */ void elapsedChanged(qint64 time); /*! * Emitted when bitrate has changed. * @param bitrate New bitrate (in kbps) */ void bitrateChanged(int bitrate); /*! * Emitted when samplerate has changed. * @param frequency New sample rate (in Hz) */ void frequencyChanged(quint32 frequency); /*! * Emitted when sample size has changed. * @param size New sample size (in bits) */ void sampleSizeChanged(int size); /*! * Emitted when channels number has changed. * @param channels New channels number. */ void channelsChanged(int channels); /*! * This signal is emitted when the stream reader fills it's buffer. * The argument \b progress indicates the current percentage of buffering completed. */ void bufferingProgress(int progress); private: qint64 m_elapsed; quint32 m_frequency; bool m_sendAboutToFinish; int m_bitrate, m_precision, m_channels; static StateHandler* m_instance; QMap m_metaData; QHash m_streamInfo; Qmmp::State m_state; QMutex m_mutex; }; #endif qmmp-0.7.4/src/qmmp/volumecontrol.cpp0000664000175000017500000001523112256224734016402 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "qmmpsettings.h" #include "output.h" #include "volumecontrol_p.h" VolumeControl::VolumeControl(QObject *parent) : QObject(parent) { m_left = 0; m_right = 0; m_prev_block = false; m_volume = 0; m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), SLOT(checkVolume())); reload(); } VolumeControl::~VolumeControl() { if(m_volume) delete m_volume; } int VolumeControl::left() { return m_left; } void VolumeControl::setVolume(int left, int right) { VolumeSettings v; v.left = left; v.right = right; m_volume->setVolume(v); checkVolume(); } int VolumeControl::right() { return m_right; } void VolumeControl::checkVolume() { VolumeSettings v = m_volume->volume(); int l = v.left; int r = v.right; l = (l > 100) ? 100 : l; r = (r > 100) ? 100 : r; l = (l < 0) ? 0 : l; r = (r < 0) ? 0 : r; if (m_left != l || m_right != r) //volume has been changed { m_left = l; m_right = r; emit volumeChanged(m_left, m_right); } else if(m_prev_block && !signalsBlocked ()) //signals have been unblocked emit volumeChanged(m_left, m_right); m_prev_block = signalsBlocked (); } void VolumeControl::reload() { m_timer->stop(); if(m_volume) { delete m_volume; m_volume = 0; } if(!QmmpSettings::instance()->useSoftVolume() && Output::currentFactory()) { if((m_volume = Output::currentFactory()->createVolume())) m_timer->start(150); } if(!m_volume) { m_volume = new SoftwareVolume; blockSignals(true); checkVolume(); blockSignals(false); QTimer::singleShot(125, this, SLOT(checkVolume())); } } SoftwareVolume *SoftwareVolume::m_instance = 0; SoftwareVolume::SoftwareVolume() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_left = settings.value("Volume/left", 80).toInt(); m_right = settings.value("Volume/right", 80).toInt(); m_scaleLeft = (double)m_left/100.0; m_scaleRight = (double)m_right/100.0; m_instance = this; } SoftwareVolume::~SoftwareVolume() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Volume/left", m_left); settings.setValue("Volume/right", m_right); m_instance = 0; } void SoftwareVolume::setVolume(const VolumeSettings &v) { m_left = v.left; m_right = v.right; m_scaleLeft = (double)m_left/100.0; m_scaleRight = (double)m_right/100.0; } VolumeSettings SoftwareVolume::volume() const { VolumeSettings v; v.left = m_left; v.right = m_right; return v; } void SoftwareVolume::changeVolume(Buffer *b, int chan, Qmmp::AudioFormat format) { int samples = 0; qint32 sample1 = 0; qint32 sample2 = 0; switch(format) { case Qmmp::PCM_S8: samples = b->nbytes; if (chan > 1) { for (int i = 0; i < samples; i+=2) { ((char*)b->data)[i]*= m_scaleLeft; ((char*)b->data)[i+1]*= m_scaleRight; } } else { for (int i = 0; i < samples; i++) ((char*)b->data)[i]*= qMax(m_scaleRight, m_scaleLeft); } case Qmmp::PCM_S16LE: samples = b->nbytes/2; if (chan > 1) { for (int i = 0; i < samples; i+=2) { ((short*)b->data)[i]*= m_scaleLeft; ((short*)b->data)[i+1]*= m_scaleRight; } } else { for (int i = 0; i < samples; i++) ((short*)b->data)[i]*= qMax(m_scaleRight, m_scaleLeft); } break; case Qmmp::PCM_S24LE: samples = b->nbytes/4; if (chan > 1) { for (qint64 i = 0; i < samples; i+=2) { sample1 = ((qint32*)b->data)[i]; sample2 = ((qint32*)b->data)[i+1]; if (sample1 & 0x800000) sample1 |= 0xff000000; if (sample2 & 0x800000) sample2 |= 0xff000000; sample1 *= m_scaleLeft; sample2 *= m_scaleRight; ((qint32*)b->data)[i] = sample1; ((qint32*)b->data)[i+1] = sample2; } } else { for (qint64 i = 0; i < samples; i++) { sample1 = ((qint32*)b->data)[i]; sample1 *= qMax(m_scaleRight, m_scaleLeft); if (sample1 & 0x800000) sample1 |= 0xff000000; ((qint32*)b->data)[i] = sample1; } } break; case Qmmp::PCM_S32LE: samples = b->nbytes/4; if (chan > 1) { for (qint64 i = 0; i < samples; i+=2) { ((qint32*)b->data)[i]*= m_scaleLeft; ((qint32*)b->data)[i+1]*= m_scaleRight; } } else { for (qint64 i = 0; i < samples; i++) ((qint32*)b->data)[i]*= qMax(m_scaleRight, m_scaleLeft); } break; default: ; } } //static SoftwareVolume *SoftwareVolume::instance() { return m_instance; } qmmp-0.7.4/src/qmmp/volumecontrol_p.h0000664000175000017500000000664412256224734016376 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VOLUMECONTROL_P_H #define VOLUMECONTROL_P_H #include #include "qmmp.h" #include "volume.h" #include "buffer.h" class QTimer; class SoftwareVolume; /*! @internal * @brief The VolumeControl class provides volume control access * @author Ilya Kotov */ class VolumeControl : public QObject { Q_OBJECT public: /*! * Object constructor. * @param parent Parent object. */ VolumeControl(QObject *parent = 0); /*! * Destructor. */ ~VolumeControl(); /*! * Setups volume level. * Subclass should reimplement this fucntion. * @param left Left channel volume level. It should be \b 0..100 * @param right Right channel volume level. It should be \b 0..100 */ void setVolume(int left, int right); /*! * Returns left channel volume. */ int left(); /*! * Returns right channel volume. */ int right(); signals: /*! * Emitted when volume is changed. * @param left Left channel volume level. It should be \b 0..100 * @param right Right channel volume level. It should be \b 0..100 */ void volumeChanged(int left, int right); public slots: /*! * Forces the volumeChanged signal to emit. */ void checkVolume(); /*! * Updates volume configuration */ void reload(); private: int m_left, m_right; bool m_prev_block; Volume *m_volume; QTimer *m_timer; }; /*! @internal * @brief The SoftwareVolume class provides access to the software volume control. * @author Ilya Kotov */ class SoftwareVolume : public Volume { public: SoftwareVolume(); ~SoftwareVolume(); void setVolume(const VolumeSettings &v); VolumeSettings volume() const; void changeVolume(Buffer *b, int chan, Qmmp::AudioFormat format); static SoftwareVolume *instance(); private: int m_left, m_right; double m_scaleLeft, m_scaleRight; static SoftwareVolume *m_instance; }; #endif qmmp-0.7.4/src/qmmp/metadatamodel.h0000664000175000017500000000554012256224734015742 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef METADATAMODEL_H #define METADATAMODEL_H #include #include #include #include #include #include "tagmodel.h" /*! @brief The MetaDataModel is the base interface class of metadata access. * @author Ilya Kotov */ class MetaDataModel : public QObject { Q_OBJECT public: /*! * Constructor. * @param parent Parent Object. */ MetaDataModel(QObject *parent = 0); /*! * Destructor. */ virtual ~MetaDataModel(); /*! * Returns an associative array of the audio properties. * Subclass should reimplement this function. Default implementation returns empty array. */ virtual QHash audioProperties(); /*! * Returns an associative array of the long descriptions. * Subclass should reimplement this function. Default implementation returns empty array. */ virtual QHash descriptions(); /*! * Returns a list of available tags. * Subclass should reimplement this function. Default implementation returns empty array. */ virtual QList tags(); /*! * Returns cover pixmap. * Subclass should reimplement this function. Default implementation returns empty pixmap. */ virtual QPixmap cover(); /*! * Returns path to cover pixmap. */ virtual QString coverPath(); }; #endif // METADATAMODEL_H qmmp-0.7.4/src/qmmp/emptyinputsource.cpp0000664000175000017500000000350312256224734017130 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "emptyinputsource_p.h" EmptyInputSource::EmptyInputSource(const QString &url, QObject *parent) : InputSource(url,parent) { m_ok = false; } QIODevice *EmptyInputSource::ioDevice() { return 0; } bool EmptyInputSource::initialize() { m_ok = true; //check decoders if(m_ok) emit ready(); return m_ok; } bool EmptyInputSource::isReady() { return m_ok; } qmmp-0.7.4/src/qmmp/emptyinputsource_p.h0000664000175000017500000000351712256224734017121 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EMPTYINPUTSOURCE_P_H #define EMPTYINPUTSOURCE_P_H #include "inputsource.h" /*! @internal @author Ilya Kotov */ class EmptyInputSource : public InputSource { Q_OBJECT public: EmptyInputSource(const QString &url, QObject *parent = 0); QIODevice *ioDevice(); bool initialize(); bool isReady(); private: bool m_ok; }; #endif // EMPTYINPUTSOURCE_P_H qmmp-0.7.4/src/qmmp/output.h0000664000175000017500000000742112256224734014501 0ustar useruser // Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef OUTPUT_H #define OUTPUT_H #include #include #include #include #include #include #include "visual.h" #include "outputfactory.h" #include "visualfactory.h" #include "statehandler.h" #include "audioparameters.h" class QTimer; class QmmpSettings; /*! @brief The Output class provides the base interface class of audio outputs. * @author Brad Hughes * @author Ilya Kotov */ class Output { public: /*! * Object contsructor. */ Output(); /*! * Destructor. */ virtual ~Output(); /*! * Prepares object for usage and setups required audio parameters. * Subclass should reimplement this function. * @param freq Sample rate. * @param chan Number of channels. * @param format Audio format * @return initialization result (\b true - success, \b false - failure) */ virtual bool initialize(quint32 freq, int chan, Qmmp::AudioFormat format) = 0; /*! * Returns output interface latency in milliseconds. */ virtual qint64 latency() = 0; /*! * Requests playback to pause. If it was paused already, playback should resume. * Subclasses that reimplement this function must call the base implementation. */ /*! * Writes up to \b maxSize bytes from \b data to the output interface device. * Returns the number of bytes written, or -1 if an error occurred. * Subclass should reimplement this function. */ virtual qint64 writeAudio(unsigned char *data, qint64 maxSize) = 0; /*! * Writes all remaining plugin's internal data to audio output device. * Subclass should reimplement this function. */ virtual void drain() = 0; /*! * Drops all plugin's internal data, resets audio device * Subclass should reimplement this function. */ virtual void reset() = 0; /*! * Stops processing audio data, preserving buffered audio data. */ virtual void suspend(); /*! * Resumes processing audio data. */ virtual void resume(); /*! * Returns selected audio parameters. */ AudioParameters audioParameters() const; /*! * Returns samplerate. */ quint32 sampleRate(); /*! * Returns channels number. */ int channels(); /*! * Returns selected audio format. */ Qmmp::AudioFormat format() const; /*! * Returns sample size in bytes. */ int sampleSize() const; /*! * Creates selected output. * @return Output subclass object. */ static Output *create(); /*! * Returns a list of output factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory Output plugin factory. */ static QString file(OutputFactory *factory); /*! * Selects current output \b factory. */ static void setCurrentFactory(OutputFactory* factory); /*! * Returns selected output factory. */ static OutputFactory *currentFactory(); protected: /*! * Use this function inside initialize() reimplementation to tell about accepted audio parameters. * @param freq Sample rate. * @param chan Number of channels. * @param format Audio format. */ void configure(quint32 freq, int chan, Qmmp::AudioFormat format); private: quint32 m_frequency; int m_channels; Qmmp::AudioFormat m_format; static void checkFactories(); static QList *m_factories; static QHash *m_files; }; #endif // OUTPUT_H qmmp-0.7.4/src/qmmp/qmmp.cpp0000664000175000017500000000712212256224734014444 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #ifndef LIB_DIR #define LIB_DIR "/lib" #endif #define DEV_SUFFIX "dev" #include "qmmp.h" QString Qmmp::m_configFile; QString Qmmp::m_langID; const QString Qmmp::configFile() { return m_configFile.isEmpty() ? QDir::homePath() +"/.qmmp/qmmprc" : m_configFile; } void Qmmp::setConfigFile(const QString &path) { m_configFile = path; } const QString Qmmp::strVersion() { QString ver = QString("%1.%2.%3") .arg(QMMP_VERSION_MAJOR) .arg(QMMP_VERSION_MINOR) .arg(QMMP_VERSION_PATCH); #if !QMMP_VERSION_STABLE #ifdef SVN_REVISION ver += "-svn-"SVN_REVISION; #else ver += "-"DEV_SUFFIX; #endif #endif return ver; } const QString Qmmp::pluginsPath() { QByteArray path = qgetenv("QMMP_PLUGINS"); if (!path.isEmpty()) return path; #ifdef QMMP_INSTALL_PREFIX QDir dir(QMMP_INSTALL_PREFIX"/"LIB_DIR"/qmmp"); //qDebug(QMMP_INSTALL_PREFIX"/"LIB_DIR"/qmmp"); #else #if defined(Q_OS_WIN32) && !defined(Q_OS_CYGWIN) QDir dir(qApp->applicationDirPath() + "/plugins"); #else QDir dir(qApp->applicationDirPath() + "/../"LIB_DIR"/qmmp"); #endif #endif return dir.canonicalPath(); } QString Qmmp::systemLanguageID() { if(m_langID.isEmpty()) { m_langID = uiLanguageID(); qDebug("Qmmp: setting ui language to '%s'", qPrintable(m_langID)); } if(m_langID != "auto") return m_langID; #ifdef Q_OS_UNIX QByteArray v = qgetenv ("LC_ALL"); if (v.isEmpty()) v = qgetenv ("LC_MESSAGES"); if (v.isEmpty()) v = qgetenv ("LANG"); if (!v.isEmpty()) return QLocale (v).name(); #endif return QLocale::system().name(); } QString Qmmp::uiLanguageID() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QString langID = settings.value("General/locale", "auto").toString(); langID = langID.isEmpty() ? "auto" : langID; return langID; } void Qmmp::setUiLanguageID(const QString &code) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("General/locale", code); m_langID.clear(); } qmmp-0.7.4/src/qmmp/qmmp.pro0000664000175000017500000000530312256224735014462 0ustar useruserunix:include(../../qmmp.pri) win32:include(../../qmmp.pri) HEADERS += \ buffer.h \ decoder.h \ output.h \ outputfactory.h \ equ/iir_cfs.h \ equ/iir_fpu.h \ equ/iir.h \ decoderfactory.h \ soundcore.h \ visual.h \ visualfactory.h \ effect.h \ effectfactory.h \ statehandler.h \ qmmp.h \ fileinfo.h \ metadatamodel.h \ tagmodel.h \ abstractengine.h \ qmmpaudioengine_p.h \ audioparameters.h \ inputsource.h \ fileinputsource_p.h \ emptyinputsource_p.h \ inputsourcefactory.h \ enginefactory.h \ metadatamanager.h \ replaygain_p.h \ audioconverter_p.h \ qmmpsettings.h \ eqsettings.h \ qmmpevents_p.h \ volume.h \ volumecontrol_p.h \ outputwriter_p.h \ recycler_p.h SOURCES += recycler.cpp \ decoder.cpp \ output.cpp \ equ/iir.c \ equ/iir_cfs.c \ equ/iir_fpu.c \ soundcore.cpp \ visual.cpp \ effect.cpp \ statehandler.cpp \ qmmp.cpp \ fileinfo.cpp \ volumecontrol.cpp \ metadatamodel.cpp \ tagmodel.cpp \ abstractengine.cpp \ qmmpaudioengine.cpp \ audioparameters.cpp \ inputsource.cpp \ fileinputsource.cpp \ emptyinputsource.cpp \ metadatamanager.cpp \ replaygain.cpp \ audioconverter.cpp \ qmmpsettings.cpp \ eqsettings.cpp \ qmmpevents.cpp \ outputwriter.cpp FORMS += unix:TARGET = ../../lib/qmmp win32:TARGET = ../../../bin/qmmp CONFIG += release \ shared \ warn_on \ create_pc create_prl no_install_prl \ qt \ thread TEMPLATE = lib VERSION = $$QMMP_VERSION unix:isEmpty(LIB_DIR):LIB_DIR = /lib unix:DEFINES += LIB_DIR=\\\"$$LIB_DIR\\\" unix { SVN_REVISION = $$system(./svn_revision.sh) !isEmpty(SVN_REVISION) { DEFINES += SVN_REVISION=\\\"$$SVN_REVISION\\\" } } unix { target.path = $$LIB_DIR devel.files += \ abstractengine.h \ audioparameters.h \ buffer.h \ decoderfactory.h \ decoder.h \ effectfactory.h \ effect.h \ enginefactory.h \ eqsettings.h \ fileinfo.h \ inputsourcefactory.h \ inputsource.h \ metadatamanager.h \ metadatamodel.h \ outputfactory.h \ output.h \ qmmp.h \ qmmpsettings.h \ soundcore.h \ statehandler.h \ tagmodel.h \ visualfactory.h \ visual.h \ volume.h devel.path = /include/qmmp INSTALLS += target \ devel DESTDIR = . } INCLUDEPATH += ./ unix { QMAKE_PKGCONFIG_NAME = qmmp QMAKE_PKGCONFIG_DESCRIPTION = qmmp core library QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QMAKE_PKGCONFIG_DESTDIR = pkgconfig } qmmp-0.7.4/src/qmmp/qmmp.h0000664000175000017500000001064612256224752014116 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMP_H #define QMMP_H #include #define QMMP_VERSION_MAJOR 0 #define QMMP_VERSION_MINOR 7 #define QMMP_VERSION_PATCH 4 #define QMMP_VERSION_STABLE 1 #define QMMP_VERSION_INT (QMMP_VERSION_MAJOR<<16 | QMMP_VERSION_MINOR<<8 | QMMP_VERSION_PATCH) /*! @brief The Qmmp class stores global settings and enums. * @author Ilya Kotov */ class Qmmp { public: /*! * Playback state enum */ enum State { Playing = 0, /*!< The player is playing source */ Paused, /*!< The player has currently paused its playback */ Stopped, /*!< The player is ready to play source */ Buffering, /*!< The Player is waiting for data to be able to start playing. */ NormalError, /*!< Input source is invalid or unsupported. Player should skip this file */ FatalError /*!< This means unrecorvable error die audio output problems. Player should abort playback. */ }; /*! * Metadata keys */ enum MetaData { TITLE = 0, /*!< Title */ ARTIST, /*!< Artist */ ALBUM, /*!< Album */ COMMENT, /*!< Comment */ GENRE, /*!< Genre */ COMPOSER, /*!< Composer */ YEAR, /*!< Year */ TRACK, /*!< Track number */ DISCNUMBER,/*!< Disc number */ URL /*!< Stream url or local file path */ }; /*! * Keys of ReplayGain information */ enum ReplayGainKey { REPLAYGAIN_TRACK_GAIN = 0, /*!< track gain */ REPLAYGAIN_TRACK_PEAK, /*!< track peak */ REPLAYGAIN_ALBUM_GAIN, /*!< album gain */ REPLAYGAIN_ALBUM_PEAK /*!< album peak */ }; /*! * Audio formats */ enum AudioFormat { PCM_UNKNOWM = -1, /*!< Unknown format */ PCM_S8 = 0, /*!< Signed 8 bit */ PCM_S16LE, /*!< Signed 16 bit Little Endian */ PCM_S24LE, /*!< Signed 24 bit Little Endian using low three bytes in 32-bit word */ PCM_S32LE /*!< Signed 32 bit Little Endian */ }; /*! * Returns configuration file path. */ static const QString configFile(); /*! * Overrides default configuration file path. */ static void setConfigFile(const QString &path); /*! * Returns %Qmmp library version. */ static const QString strVersion(); /*! * Returns the location of the installed Qmmp plugins. */ static const QString pluginsPath(); /*! * Returns system language if uiLanguageID() is 'auto'. Otherwise returns uiLanguageID(). */ static QString systemLanguageID(); /*! * Returns state of the user interface language option. Code "auto" means autodetection. */ static QString uiLanguageID(); /*! * Sets user interface language. * @param code Language code; code "auto" means autodetection. */ static void setUiLanguageID(const QString &code); private: static QString m_configFile; static QString m_langID; }; #endif qmmp-0.7.4/src/qmmp/buffer.h0000664000175000017500000000171712256224735014415 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef __buffer_h #define __buffer_h #define QMMP_BLOCK_FRAMES 512 /*! @brief Audio buffer class. * @author Brad Hughes */ class Buffer { public: /*! * Constructs an empty buffer object. * @param sz Size in bytes; */ Buffer(unsigned long sz) { data = new unsigned char[sz]; nbytes = 0; rate = 0; size = sz; } /*! * Destructor. */ ~Buffer() { delete[] data; data = 0; nbytes = 0; rate = 0; size = 0; } unsigned char *data; /*!< Audio data */ unsigned long nbytes; /*!< Audio data size */ unsigned long rate; /*!< Buffer bitrate */ unsigned long size; /*!< Buffer size */ }; #endif // __buffer_h qmmp-0.7.4/src/qmmp/abstractengine.cpp0000664000175000017500000001371312256224735016467 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "enginefactory.h" #include "qmmpaudioengine_p.h" #include "statehandler.h" #include "qmmp.h" #include "abstractengine.h" AbstractEngine::AbstractEngine(QObject *parent) : QThread(parent) { } AbstractEngine::~AbstractEngine() { } QMutex *AbstractEngine::mutex() { return &m_mutex; } // static methods QList *AbstractEngine::m_factories = 0; QList *AbstractEngine::m_disabledFactories = 0; QHash *AbstractEngine::m_files = 0; void AbstractEngine::checkFactories() { if (!m_factories) { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QStringList disabledNames = settings.value("Engine/disabled_plugins").toStringList (); m_files = new QHash ; m_factories = new QList; m_disabledFactories = new QList; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Engines"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("AbstractEngine: loaded plugin %s", qPrintable(fileName)); else qWarning("AbstractEngine: %s", qPrintable(loader.errorString ())); EngineFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); if(disabledNames.contains(factory->properties().shortName)) m_disabledFactories->append(factory); } } //remove physically deleted plugins from disabled list QStringList names; foreach (EngineFactory *factory, *m_factories) { names.append(factory->properties().shortName); } foreach (QString name, disabledNames) { if (!names.contains(name)) disabledNames.removeAll(name); } settings.setValue("Engine/disabled_plugins", disabledNames); } } AbstractEngine *AbstractEngine::create(InputSource *s, QObject *parent) { AbstractEngine *engine = new QmmpAudioEngine(parent); //internal engine if(!engine->enqueue(s)) { engine->deleteLater(); engine = 0; } else return engine; checkFactories(); foreach(EngineFactory *f, *m_factories) { if(!isEnabled(f)) continue; engine = f->create(parent); //engine plugin if(!engine->enqueue(s)) { engine->deleteLater(); engine = 0; } else break; } return engine; } QList *AbstractEngine::factories() { checkFactories(); return m_factories; } EngineFactory *AbstractEngine::findByPath(const QString& source) { checkFactories(); foreach(EngineFactory *fact, *m_factories) { if (fact->supports(source) && isEnabled(fact)) return fact; } return 0; } void AbstractEngine::setEnabled(EngineFactory* factory, bool enable) { checkFactories(); if (!m_factories->contains(factory)) return; if(enable == isEnabled(factory)) return; if(enable) m_disabledFactories->removeAll(factory); else m_disabledFactories->append(factory); QStringList disabledNames; foreach(EngineFactory *f, *m_disabledFactories) { disabledNames << f->properties().shortName; } disabledNames.removeDuplicates(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Engine/disabled_plugins", disabledNames); } bool AbstractEngine::isEnabled(EngineFactory* factory) { checkFactories(); return !m_disabledFactories->contains(factory); } QString AbstractEngine::file(EngineFactory *factory) { checkFactories(); return m_files->value(factory); } QStringList AbstractEngine::protocols() { checkFactories(); QStringList protocolsList; foreach(EngineFactory *f, *m_factories) { if(isEnabled(f)) protocolsList << f->properties().protocols; } protocolsList.removeDuplicates(); return protocolsList; } qmmp-0.7.4/src/qmmp/tagmodel.h0000664000175000017500000000657712256224735014751 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TAGMODEL_H #define TAGMODEL_H #include #include #include "qmmp.h" /*! @brief The StateHandler class provides is the base interface class of tag editor. * @author Ilya Kotov */ class TagModel { public: /*! * This enum describes tag editor capabilities */ enum Caps { NoOptions = 0x0, /*!< No capabilities */ CreateRemove = 0x1, /*!< Can create/remove tag */ Save = 0x2, /*!< Can save changes */ }; /*! * Constructor. * @param f Capabilities. */ TagModel(int f = TagModel::CreateRemove | TagModel::Save); /*! * Destructor. */ virtual ~TagModel(); /*! * Returns tag name. * Subclass should reimplement this fucntion. */ virtual const QString name() = 0; /*! * Returns available keys. Default implementations returns all possible keys. */ virtual QList keys(); /*! * Returns the metdata string associated with the given \b key. * Subclass should reimplement this fucntion. */ virtual const QString value(Qmmp::MetaData key) = 0; /*! * Changes metadata string associated with the given \b key to \b value. * Subclass should reimplement this fucntion. */ virtual void setValue(Qmmp::MetaData key, const QString &value) = 0; /*! * Changes metadata string associated with the given \b key to \b value. * Subclass should reimplement this fucntion. */ virtual void setValue(Qmmp::MetaData key, int value); /*! * Returns \b true if this tag exists; otherwise returns \b false. */ virtual bool exists(); /*! * Creates tag. */ virtual void create(); /*! * Removes tag. */ virtual void remove(); /*! * Saves tag. */ virtual void save(); /*! * Returns capability flags. */ int caps(); private: int m_f; }; #endif // TAGMODEL_H qmmp-0.7.4/src/qmmp/enginefactory.h0000664000175000017500000001056012256224735015775 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EMGINEFACTORY_H #define EMGINEFACTORY_H class QObject; class QString; class QIODevice; class QWidget; class QTranslator; class QStringList; class MetaDataModel; class FileInfo; class AbstractEngine; /*! @brief Helper class to store custom audio engine properies. * @author Ilya Kotov */ class EngineProperties { public: /*! * Constructor */ EngineProperties() { hasAbout = false; hasSettings = false; } QString name; /*!< Input plugin full name */ QString shortName; /*!< Input plugin short name for internal usage */ QStringList filters; /*!< File filters (example: "*.mp3,*.ogg") */ QString description; /*!< File filter description */ QStringList contentTypes; /*!< Supported content types */ QStringList protocols; /*!< Supported protocols. Should be empty if plugin uses stream input. */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise returns \b false */ }; /*! @brief Engine plugin interface. * @author Ilya Kotov */ class EngineFactory { public: /*! * Object destructor. */ virtual ~EngineFactory() {} /*! * Returns \b true if plugin supports \b source, otherwise returns \b false */ virtual bool supports(const QString &source) const = 0; /*! * Returns general plugin properties. */ virtual const EngineProperties properties() const = 0; /*! * Creates engine object. * @param parent Parent object File path */ virtual AbstractEngine *create(QObject *parent = 0) = 0; /*! * Extracts metadata and audio information from file \b path and returns a list of FileInfo items. * One file may contain several playlist items (for example: cda disk or flac with embedded cue) * @param fileName File path. * @param useMetaData Metadata usage (\b true - use, \b - do not use) */ virtual QList createPlayList(const QString &fileName, bool useMetaData) = 0; /*! * Creats metadata object, which provides full access to file tags. * @param path File path. * @param parent Parent object. * @return MetaDataModel pointer. */ virtual MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0) = 0; /*! * Shows settings dialog. * @param parent Parent widget. */ virtual void showSettings(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(EngineFactory, "EngineFactory/1.0") #endif qmmp-0.7.4/src/qmmp/eqsettings.cpp0000664000175000017500000000554112256224735015664 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "eqsettings.h" EqSettings::EqSettings(int bands) { if(bands != 10 && bands != 15 && bands != 25 && bands != 31) { qWarning("EqSettings: invalid number of bands (%d), using 10 bands as fallback", bands); bands = 10; } for(int i = 0; i < bands; ++i) m_gains[i] = 0; m_bands = bands; m_preamp = 0; m_is_enabled = false; } bool EqSettings::isEnabled() const { return m_is_enabled; } double EqSettings::gain(int chan) const { return m_gains[chan]; } double EqSettings::preamp() const { return m_preamp; } int EqSettings::bands() const { return m_bands; } void EqSettings::setEnabled(bool enabled) { m_is_enabled = enabled; } void EqSettings::setGain(int band, double gain) { m_gains[band] = gain; } void EqSettings::setPreamp(double preamp) { m_preamp = preamp; } void EqSettings::operator=(const EqSettings &s) { for(int i = 0; i < m_bands; ++i) m_gains[i] = s.m_gains[i]; m_preamp = s.m_preamp; m_is_enabled = s.m_is_enabled; m_bands = s.m_bands; } bool EqSettings::operator==(const EqSettings &s) const { for(int i = 0; i < m_bands; ++i) { if(m_gains[i] != s.m_gains[i]) return false; } return (m_preamp == s.m_preamp) && (m_is_enabled == s.m_is_enabled) && (m_bands == s.m_bands); } bool EqSettings::operator!=(const EqSettings &s) const { return !operator==(s); } qmmp-0.7.4/src/qmmp/effectfactory.h0000664000175000017500000000667312256224735015776 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTFACTORY_H #define EFFECTFACTORY_H #include class QObject; class QWidget; class QTranslator; class Effect; /*! @brief Helper class to store effect plugin properties. * @author Ilya Kotov */ class EffectProperties { public: /*! * This enum describes effect preferd position. */ enum Priority { EFFECT_PRIORITY_LOW = 0, /*!< Low priority */ EFFECT_PRIORITY_DEFAULT, /*!< Default priority */ EFFECT_PRIORITY_HIGH /*!< High priority */ }; /*! * Constructor */ EffectProperties() { hasAbout = false; hasSettings = false; priority = EFFECT_PRIORITY_DEFAULT; } QString name; /*!< Effect plugin full name */ QString shortName; /*!< Effect plugin short name for internal usage */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise returns \b false */ int priority; /*!< Effect priority. Effecs with higher priority will be applied first */ }; /*! @brief Effect plugin interface (effect factory). * @author Ilya Kotov */ class EffectFactory { public: /*! * Returns effect plugin properties. */ virtual const EffectProperties properties() const = 0; /*! * Creates effect provided by plugin. */ virtual Effect *create() = 0; /*! * Shows settings dialog. * @param parent Parent widget. */ virtual void showSettings(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(EffectFactory, "EffectFactory/1.0"); #endif qmmp-0.7.4/src/qmmp/inputsource.h0000664000175000017500000001227712256224735015527 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef INPUTSOURCE_H #define INPUTSOURCE_H #include #include #include #include #include #include #include "qmmp.h" #include "inputsourcefactory.h" /*! @brief The InputSource class provides the base interface class of transports. * @author Ilya Kotov */ class InputSource : public QObject { Q_OBJECT public: /*! * Object contsructor. * @param url Input source path or url. * @param parent Parent object. */ InputSource(const QString &url, QObject *parent = 0); /*! * Returns QIODevice-based object for I/O operations. * Subclass shoud reimplement this function. */ virtual QIODevice *ioDevice() = 0; /*! * Prepares input data source for usage. * Subclass shoud reimplement this function. */ virtual bool initialize() = 0; /*! * Returns \b true if transport is ready for usage; otherwise returns \b false. */ virtual bool isReady() = 0; /*! * Returns content type of the input stream. Default implementation returns empty string. */ virtual QString contentType() const; /*! * Returns input source path or url. */ const QString url() const; /*! * Returns start position in ms; */ qint64 offset() const; /*! * Sets start position to \b offset ms. */ void setOffset(qint64 offset); /*! * Informs input source object about new received metadata. * Call of this function is required for all non-local streams/files * @param metaData Metadata map. */ void addMetaData(const QMap &metaData); /*! * Returns \b true when new metadata has received, otherwise returns \b false. */ bool hasMetaData() const; /*! * Takes metadata out of InputSource object and returns it. * Attention: hasMetaData() should return \b true before use of this fuction. */ QMap takeMetaData(); /*! * Informs input source object about received stream information (for example icy data). * Call of this function is required for all non-local streams/files * @param info Stream information map. */ void addStreamInfo(const QHash &info); /*! * Returns \b true when stream information has received, otherwise returns \b false. */ bool hasStreamInfo() const; /*! * Takes stream information out of InputSource object and returns it. * Attention: hasStreamInfo() should return \b true before use of this fuction. */ QHash takeStreamInfo(); /*! * Creates InputSource object. * @param url Input source path or url. * @param parent Parent object. * Returns \b 0 if the given url is not supported. */ static InputSource *create(const QString &url, QObject *parent = 0); /*! * Returns a list of transport factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory Transport plugin factory. */ static QString file(InputSourceFactory *factory); /*! * Returns a list of supported protocols. */ static QStringList protocols(); signals: /*! * This signal is emitted when transport is ready for usage. */ void ready(); /*! * This signal is emitted after an error occurred. */ void error(); private: QString m_url; qint64 m_offset; QMap m_metaData; QHash m_streamInfo; bool m_hasMetaData, m_hasStreamInfo; static void checkFactories(); static QList *m_factories; static QHash *m_files; }; #endif // INPUTSOURCE_H qmmp-0.7.4/src/qmmp/effect.cpp0000664000175000017500000001212412256224735014725 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "qmmpaudioengine_p.h" #include "qmmp.h" #include "effectfactory.h" #include "effect.h" Effect::Effect() { m_freq = 0; m_chan = 0; m_format = Qmmp::PCM_UNKNOWM; m_factory = 0; } Effect::~Effect() {} void Effect::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_freq = freq; m_chan = chan; m_format = format; } quint32 Effect::sampleRate() { return m_freq; } int Effect::channels() { return m_chan; } Qmmp::AudioFormat Effect::format() { return m_format; } const AudioParameters Effect::audioParameters() const { return AudioParameters(m_freq, m_chan, m_format); } EffectFactory* Effect::factory() const { return m_factory; } bool effectCompareFunc(EffectFactory *e1, EffectFactory *e2) { return e1->properties().priority > e2->properties().priority; } //static members QList *Effect::m_factories = 0; QHash *Effect::m_files = 0; void Effect::checkFactories() { if (!m_factories) { m_factories = new QList; m_files = new QHash ; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Effect"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("Effect: loaded plugin %s", qPrintable(fileName)); else qWarning("Effect: %s", qPrintable(loader.errorString ())); EffectFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } qSort(m_factories->begin(), m_factories->end(), effectCompareFunc); } } Effect* Effect::create(EffectFactory *factory) { checkFactories(); Effect *effect = factory->create(); effect->m_factory = factory; return effect; } QList *Effect::factories() { checkFactories(); return m_factories; } QString Effect::file(EffectFactory *factory) { checkFactories(); return m_files->value(factory); } void Effect::setEnabled(EffectFactory* factory, bool enable) { checkFactories(); if(!m_factories->contains(factory)) return; QString name = factory->properties().shortName; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QStringList effList = settings.value("Effect/enabled_plugins").toStringList(); if(enable) { if (!effList.contains(name)) { effList << name; if(QmmpAudioEngine::instance()) QmmpAudioEngine::instance()->addEffect(factory); } } else if (effList.contains(name)) { effList.removeAll(name); if(QmmpAudioEngine::instance()) QmmpAudioEngine::instance()->removeEffect(factory); } settings.setValue("Effect/enabled_plugins", effList); } bool Effect::isEnabled(EffectFactory* factory) { checkFactories(); if(!m_factories->contains(factory)) return false; QString name = factory->properties().shortName; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QStringList effList = settings.value("Effect/enabled_plugins").toStringList(); return effList.contains(name); } qmmp-0.7.4/src/qmmp/volume.h0000664000175000017500000000460612256224735014453 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VOLUME_H #define VOLUME_H /*! @brief The VolumeSettings structure stores volume levels * @author Ilya Kotov */ struct VolumeSettings { /*! * Constructor */ VolumeSettings() { left = 0; right = 0; } int left /*!< Volume of the left channel. It should be \b 0..100. */; int right /*!< Volume of the left channel It should be \b 0..100. */; }; /*! @brief The Volume class provides asbtract volume interface * @author Ilya Kotov */ class Volume { public: /*! * Destructor. */ virtual ~Volume(){} /*! * Setups volume levels. * Subclass should reimplement this fucntion. * @param volume Structure with required volume levels. */ virtual void setVolume(const VolumeSettings &volume) = 0; /*! * Returns volume level of the \b channel. */ virtual VolumeSettings volume() const = 0; }; #endif // VOLUME_H qmmp-0.7.4/src/qmmp/qmmp.pc.in0000664000175000017500000000043612256224735014673 0ustar useruserprefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@CMAKE_INSTALL_PREFIX@/@LIB_DIR@ includedir=@CMAKE_INSTALL_PREFIX@/include Name: qmmp Description: qmmp core library Version: @QMMP_VERSION@ Requires: QtCore QtGui Libs: -L${libdir} -lqmmp Cflags: -I${includedir} qmmp-0.7.4/src/qmmp/fileinputsource.cpp0000664000175000017500000000347512256224735016722 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "fileinputsource_p.h" FileInputSource::FileInputSource(const QString &url, QObject *parent) : InputSource(url,parent) { m_file = new QFile(url, this); } QIODevice *FileInputSource::ioDevice() { return m_file; } bool FileInputSource::initialize() { emit ready(); return true; } bool FileInputSource::isReady() { return m_file->isOpen(); } qmmp-0.7.4/src/qmmp/fileinputsource_p.h0000664000175000017500000000353412256224735016702 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FILEINPUTSOURCE_P_H #define FILEINPUTSOURCE_P_H #include "inputsource.h" class QFile; /** @internal @author Ilya Kotov */ class FileInputSource : public InputSource { Q_OBJECT public: FileInputSource(const QString &url, QObject *parent = 0); QIODevice *ioDevice(); bool initialize(); bool isReady(); private: QFile *m_file; }; #endif // FILEINPUTSOURCE_P_H qmmp-0.7.4/src/qmmp/fileinfo.cpp0000664000175000017500000000676512256224735015302 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "fileinfo.h" FileInfo::FileInfo(const QString &path) { m_path = path; m_length = 0; m_metaData.insert(Qmmp::URL, path); } FileInfo::FileInfo(const FileInfo &other) { *this = other; } FileInfo::~FileInfo() {} void FileInfo::operator=(const FileInfo &info) { setLength(info.length()); setMetaData(info.metaData()); setPath(info.path()); } bool FileInfo::operator==(const FileInfo &info) { return metaData () == info.metaData () && length () == info.length (); path() == info.path(); } bool FileInfo::operator!=(const FileInfo &info) { return !operator==(info); } qint64 FileInfo::length () const { return m_length; } const QString FileInfo::metaData (Qmmp::MetaData key) const { return m_metaData[key]; } const QMap FileInfo::metaData () const { return m_metaData; } void FileInfo::setMetaData(const QMap &metaData) { m_metaData = metaData; if(m_metaData.value(Qmmp::URL).isEmpty()) m_metaData.insert(Qmmp::URL, m_path); foreach(QString value, m_metaData.values()) //remove empty keys { if (value.isEmpty() || value == "0") m_metaData.remove(m_metaData.key(value)); } } bool FileInfo::isEmpty() const { return m_metaData.isEmpty(); //TODO add correct test } const QString FileInfo::path() const { return m_path; } void FileInfo::setLength(qint64 length) { m_length = length; } void FileInfo::setMetaData(Qmmp::MetaData key, const QString &value) { if (value.isEmpty() || value == "0") return; //extract track number from "Track Number/Total Tracks Number" string if((key == Qmmp::TRACK || key == Qmmp::DISCNUMBER) && value.contains("/")) m_metaData.insert(key, value.section("/",0,0)); else m_metaData.insert(key, value); } void FileInfo::setMetaData(Qmmp::MetaData key, int value) { if(value != 0) m_metaData.insert(key, QString::number(value)); } void FileInfo::setPath(const QString &path) { m_path = path; m_metaData.insert(Qmmp::URL, path); } qmmp-0.7.4/src/qmmp/visual.cpp0000664000175000017500000001603412256224735015000 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "visualfactory.h" #include "output.h" #include "visual.h" Visual::Visual(QWidget *parent) : QWidget(parent) { setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_QuitOnClose, false); m_decoder = 0; m_output = 0; } Visual::~Visual() { qDebug("Visual::~Visual()"); } QMutex *Visual::mutex() { return &m_mutex; } void Visual::closeEvent (QCloseEvent *event) { m_visuals.removeAll(this); if (event->spontaneous () && m_vis_map.key(this)) { VisualFactory *factory = m_vis_map.key(this); m_vis_map.remove(factory); Visual::setEnabled(factory, false); emit closedByUser(); } else { if (m_vis_map.key(this)) { VisualFactory *factory = m_vis_map.key(this); m_vis_map.remove(factory); } } QWidget::closeEvent(event); } //static members QList *Visual::m_factories = 0; QHash *Visual::m_files = 0; QList Visual::m_visuals; QHash Visual::m_vis_map; QWidget *Visual::m_parentWidget = 0; QObject *Visual::m_receiver = 0; const char *Visual::m_member = 0; QList *Visual::factories() { checkFactories(); return m_factories; } QString Visual::file(VisualFactory *factory) { checkFactories(); return m_files->value(factory); } void Visual::setEnabled(VisualFactory* factory, bool enable) { checkFactories(); if (!m_factories->contains(factory)) return; QString name = factory->properties().shortName; QSettings settings ( Qmmp::configFile(), QSettings::IniFormat ); QStringList visList = settings.value("Visualization/enabled_plugins").toStringList(); if (enable) { if (!visList.contains(name)) visList << name; if (!m_vis_map.value(factory) && m_parentWidget) { Visual* visual = factory->create(m_parentWidget); if (m_receiver && m_member) connect(visual, SIGNAL(closedByUser()), m_receiver, m_member); visual->setWindowFlags(Qt::Window); m_vis_map.insert (factory, visual); m_visuals.append(visual); visual->show(); } } else { visList.removeAll(name); if (m_vis_map.value(factory)) { m_visuals.removeAll(m_vis_map.value(factory)); m_vis_map.value(factory)->close(); m_vis_map.remove (factory); } } settings.setValue("Visualization/enabled_plugins", visList); } bool Visual::isEnabled(VisualFactory* factory) { checkFactories(); if (!m_factories->contains(factory)) return false; QString name = factory->properties().shortName; QSettings settings ( Qmmp::configFile(), QSettings::IniFormat ); QStringList visList = settings.value("Visualization/enabled_plugins").toStringList(); return visList.contains(name); } void Visual::add(Visual *visual) { if (!m_visuals.contains(visual)) m_visuals.append(visual); } void Visual::remove(Visual *visual) { m_visuals.removeAll(visual); } void Visual::initialize(QWidget *parent , QObject *receiver, const char *member) { m_receiver = receiver; m_member = member; m_parentWidget = parent; foreach(VisualFactory* factory, *factories()) { if (isEnabled(factory)) { Visual* visual = factory->create(parent); if (m_receiver && m_member) connect(visual, SIGNAL(closedByUser()), m_receiver, m_member); visual->setWindowFlags(Qt::Window); qDebug("Visual: added visualization: %s", qPrintable(factory->properties().name)); m_vis_map.insert (factory, visual); m_visuals.append(visual); visual->show(); } } } QList* Visual::visuals() { return &m_visuals; } void Visual::showSettings(VisualFactory *factory, QWidget *parent) { QDialog *dialog = factory->createConfigDialog(parent); if (!dialog) return; if (dialog->exec() == QDialog::Accepted && m_vis_map.contains(factory)) { Visual *visual = m_vis_map.value(factory); remove(visual); visual->close(); visual = factory->create(m_parentWidget); if (m_receiver && m_member) connect(visual, SIGNAL(closedByUser()), m_receiver, m_member); visual->setWindowFlags(Qt::Window); m_vis_map[factory] = visual; visual->show(); add(visual); } dialog->deleteLater(); } void Visual::checkFactories() { if (!m_factories) { m_factories = new QList; m_files = new QHash ; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("Visual"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("Visual: loaded plugin %s", qPrintable(fileName)); else qWarning("Visual: %s", qPrintable(loader.errorString ())); VisualFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } } } qmmp-0.7.4/src/qmmpui/0000775000175000017500000000000012256224735013323 5ustar useruserqmmp-0.7.4/src/qmmpui/playlistdownloader.h0000664000175000017500000000522712256224735017422 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTDOWNLOADER_H #define PLAYLISTDOWNLOADER_H #include #include class QNetworkAccessManager; class QNetworkReply; /*! @brief The PlayListDownloader class downloads playlist from remote URL and extracts tracks * @author Ilya Kotov */ class PlayListDownloader : public QObject { Q_OBJECT public: /*! * Object constructor. */ explicit PlayListDownloader(QObject *parent = 0); signals: /*! * Emitted when downloading is finished without errors. * @param urls A list of extracted URLs or argument of the \b PlayListDownloader::start() * function if remote URL doesn't contain playlist. */ void done(const QStringList &urls); /*! * Emitted when downloading is finished with error. * @param message Error message. */ void error(const QString &message); public slots: /*! * Starts playlist downloading * @param url URL of remote playlist */ void start(const QUrl &url); private slots: void readResponse(QNetworkReply *reply); private: QNetworkAccessManager *m_manager; QUrl m_redirect_url, m_url; QNetworkReply *m_getReply; QByteArray m_ua; }; #endif // PLAYLISTDOWNLOADER_H qmmp-0.7.4/src/qmmpui/txt/0000775000175000017500000000000012256224735014142 5ustar useruserqmmp-0.7.4/src/qmmpui/txt/translators_it.txt0000664000175000017500000000116612256224735017757 0ustar useruserBrasiliano portoghese: Klaos Lacerda Bruno Gonçalves Cinese tradizionale: lon Cinese semplificato: lon Ceco: Karel Volný Francese: Stanislas Zeller Italiano: Gian Paolo Renello Polacco: Grzegorz Gibas Russo: Ilya Kotov Tedesco: Stefan Koelling Panagiotis Papadopoulos Turco: Mustafa GUNAY Ucraino: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/description_zh_CN.txt0000664000175000017500000000007212256224735020306 0ustar useruser此程序是一个音乐播放器,基于 Qt 库开发。qmmp-0.7.4/src/qmmpui/txt/translators_lt.txt0000664000175000017500000000202112256224735017751 0ustar useruserBrazilų, Portugalų: Klaos Lacerda Bruno Gonçalves Ispanų: Gian Paolo Renello Kinų tradicinis: lon Kinų supaprastintas: lon Lenkų Grzegorz Gibas Olandų: Ronald Uitermark Čekų: Karel Volný Vokiečių: Stefan Koelling Panagiotis Papadopoulos Prancūzų: Stanislas Zeller Rusų: Ilya Kotov Turkų: Mustafa GUNAY Bilgesu Güngör Lietuvių: Algirdas Butkus Lenkų: Grzegorz Gibas Rusų: Ilya Kotov Ispanų: Félix Medrano Turkų: Mustafa GUNAY Bilgesu Güngör Vengrų: Németh Gábor qmmp-0.7.4/src/qmmpui/txt/authors_uk_UA.txt0000664000175000017500000000102312256224735017450 0ustar useruserРозробники ядра: Володимир Кузнєцов (зовнішній вигляд і безліч поліпшень) Ілля Котов (ідея і основний код) Розробники модулів: Юрій Журавльов (модулі jack, oss) Український переклад: Моцьо Геннадій Графіка: Андрій Андрєєв qmmp-0.7.4/src/qmmpui/txt/translators_nl.txt0000664000175000017500000000206312256224735017751 0ustar useruserBraziliaans Portugees: Klaos Lacerda Bruno Gonçalves Traditioneel Chinees: lon Gesimplificeerd Chinees: lon Tsjech: Karel Volný Nederlands: Ronald Uitermark Frans: Stanislas Zeller Duits: Stefan Koelling Panagiotis Papadopoulos Hongaars: Németh Gábor Italiaans: Gian Paolo Renello Japans: Ryota Shimamoto Kazachstaans: Baurzhan Muftakhidinov Litouws: Algirdas Butkus Pools: Grzegorz Gibas Russisch: Ilya Kotov Slowaak: Ján Ďanovský Spaans: Félix Medrano Turks: Mustafa GUNAY Bilgesu Güngör Oekraïens: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/translators_pl.txt0000664000175000017500000000217712256224735017761 0ustar useruserBrazylijski Portugalski: Klaos Lacerda Bruno Gonçalves Chiński Tradycyjny: lon Chiński Uproszczony: lon Czeski: Karel Volný Holenderski: Ronald Uitermark Francuski: Stanislas Zeller Niemiecki: Stefan Koelling Panagiotis Papadopoulos Hebrajski: Genghis Khan Węgierski: Németh Gábor Włoski: Gian Paolo Renello Japoński: Rjota Šimamoto Kazachski: Baurzhan Muftakhidinov Litewski: Algirdas Butkus Polski: Grzegorz Gibas Rosyjski: Ilya Kotov Słowacki: Ján Ďanovský Hiszpański: Félix Medrano Turecki: Mustafa GUNAY Bilgesu Güngör Ukraiński: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/authors_zh_TW.txt0000664000175000017500000000042612256224735017505 0ustar useruser核心開發: Ilya Kotov (idea and base code) Vladimir Kuznetsov (look&feel and many improvements) 插件開發: Yuriy Zhuravlev (jack plugin) 美術: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/translators_ru.txt0000664000175000017500000000270612256224735017772 0ustar useruserБразильский португальский: Klaos Lacerda Bruno Gonçalves Венгерский: Németh Gábor Голландский: Ronald Uitermark Итальянский: Gian Paolo Renello Японский: Рёта Симамото Казахский: Бауржан Муфтахидинов Китайский традиционный: lon Китайский упрощённый: lon Литовский: Algirdas Butkus Польский: Grzegorz Gibas Чешский: Karel Volný Немецкий: Stefan Koelling Panagiotis Papadopoulos Иврит: Genghis Khan Русский: Илья Котов Словацкий: Ján Ďanovský Испанский: Félix Medrano Турецкий: Mustafa GUNAY Bilgesu Güngör Украинский: Геннадий Моцьо Французский: Stanislas Zeller Галисийский: Óscar Pereira qmmp-0.7.4/src/qmmpui/txt/translators_uk_UA.txt0000664000175000017500000000236712256224735020353 0ustar useruserБразильська португальська: Klaos Lacerda Bruno Gonçalves Угорська: Németh Gábor Голландська: Ronald Uitermark Італійська: Gian Paolo Renello Японська: Рета Сімамото Казахська: Бауржан Муфтахідінов Китайська традиційна: lon Китайська спрощена: lon Литовська: Algirdas Butkus Польська: Grzegorz Gibas Чеська: Karel Volný Німецька: Stefan Koelling Panagiotis Papadopoulos Російська: Ілля Котов Іспанська: Félix Medrano Турецька: Mustafa GUNAY Bilgesu Güngör Українська: Геннадій Моцьо Французька: Stanislas Zeller qmmp-0.7.4/src/qmmpui/txt/translators_tr.txt0000664000175000017500000000126612256224735017771 0ustar useruserBrezilya Portekizcesi: Klaos Lacerda Bruno Gonçalves Geleneksel Çince: lon Basitleştirilmiş Çince: lon Çekce: Karel Volný Fransızca: Stanislas Zeller Almanca: Stefan Koelling Panagiotis Papadopoulos İtalyanca: Gian Paolo Renello Polonyaca: Grzegorz Gibas Rusça: Ilya Kotov Türkçe: Mustafa GUNAY Bilgesu Güngör Ukraynaca: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/thanks_uk_UA.txt0000664000175000017500000000342712256224735017265 0ustar useruserПодяки: Вадиму Каліннікову - хостинг проекту Adria Arrufat - повідомлення про помилки Adrian Knoth - виправлення в модулі jack, повідомлення про помилки Anton Petrusevich - покращення випадкового відтворення Avihay Baratz - опції авто-зупинки, виправлення помилок Csaba Hruska - виправлення в модулі ffmpeg Dmitry Kostin - підтримка iso.wv Evgeny Gleyzerman - покращення підтримки cue Геннадій Моцьо - повідомлення про помилки Erik Ölsar - растрові курсори, покращення інтерфейсу користувача Funda Wang - виправлення файлів cmake Михайло Желудков - виправлення в модулі ffmpeg Panagiotis Papadopoulos - покращення інтерфейсу користувача, повідомлення про помилки Pino Toscano - покращення кроссплатформності Karel Volný - різноманітні виправлення Sebastian Pipping - патчі bs2b Stefan Koelling - виправлення збірки Yaakov Selkowitz - підтримка cygwin qmmp-0.7.4/src/qmmpui/txt/description_uk_UA.txt0000664000175000017500000000017612256224735020316 0ustar useruserЦя програма є аудіопрогравачем, написаним за допомогою бібліотеки Qt.qmmp-0.7.4/src/qmmpui/txt/thanks.txt0000664000175000017500000000274012256224735016176 0ustar useruserThanks to: Adria Arrufat - bug reports Adrian Knoth - jack plugin fixes, bug reports Anton Petrusevich - random playback improvements Avihay Baratz - auto stop feature, bug fixes Brice Videau - bug fixes Cristian Rodríguez - scrobbler fixes Csaba Hruska - ffmpeg plugin fixes Dmitry Kostin - iso.wv support Evgeny Gleyzerman - cue parsing improvements Ferdinand Vesely - scrobbler improvements Gennadi Motsyo - bug reports Vadim Kalinnikov - project hosting Erik Ölsar - skinned cursors, ui improvements Funda Wang - cmake files fixes Makis Kalofolias - EAC3, DTS, and Dolby TrueHD support Michail Zheludkov - ffmpeg plugin fixes Michał Grosicki - alsa plugin fixes Panagiotis Papadopoulos - ui fixes, bug reports Pino Toscano - portability patches Karel Volný - various fixes Sebastian Pipping - bs2b patches Stefan Koelling - some build fixes Yaakov Selkowitz - cygwin patches qmmp-0.7.4/src/qmmpui/txt/thanks_de.txt0000664000175000017500000000303112256224735016640 0ustar useruserDank an: Adria Arrufat – Fehlerberichte Adrian Knoth – Korrekturen am JACK-Modul, Fehlerberichte Anton Petrusevich – Verschiedene Verbesserungen der Wiedergabe Avihay Baratz – Autostop-Funktion, Fehlerkorrekturen Csaba Hruska – Korrekturen am FFmpeg-Modul Dmitry Kostin – Unterstützung für iso.wv Evgeny Gleyzerman – Verbesserungen an der CUE-Verarbeitung Gennadi Motsyo – Fehlerberichte Vadim Kalinnikov – Projekt-Hosting Erik Ölsar – Designte Mauszeiger, Verbesserungen an der Oberfläche Funda Wang – Korrekturen an den CMake-Dateien Makis Kalofolias – Unterstützung für EAC3, DTS und Dolby TrueHD Michail Zheludkov – Korrekturen am FFmpeg-Modul Michał Grosicki – Fehlerkorrekturem im ALSA-Modul Panagiotis Papadopoulos – Korrekturen an der Oberfläche, Fehlerberichte Pino Toscano – Verbesserungen der Portabilität Karel Volný – Verschiedene Korrekturen Sebastian Pipping – bs2b-Verbesserungen Stefan Koelling – Kompilierungskorrekturen Yaakov Selkowitz – Cygwin-Verbesserungen qmmp-0.7.4/src/qmmpui/txt/thanks_cs.txt0000664000175000017500000000317512256224735016666 0ustar useruserPoděkování patří: Adria Arrufat - hlášení chyb Adrian Knoth - opravy modulu jack, hlášení chyb Anton Petrusevich - různá vylepšení přehrávání Avihay Baratz - automatické zastavení, opravy chyb Brice Videau - opravy chyb Cristian Rodríguez - opravy scrobbleru Csaba Hruska - opravy modulu fmpeg Dmitry Kostin - podpora iso.wv Evgeny Gleyzerman - vylepšení analýzy cue Ferdinand Vesely - vylepšení scrobbleru Gennadi Motsyo - hlášení chyb Вадим Калинников (Vadim Kalinnikov) - hosting projektu Erik Ölsar - motivy kurzorů, vylepšení uživatelského rozhraní Funda Wang - opravy souborů pro cmake Makis Kalofolias - podpora EAC3, DTS, a Dolby TrueHD Michail Zheludkov - opravy modulu ffmpeg Michał Grosicki - opravy modulu alsa Panagiotis Papadopoulos - opravy uživatelského rozhraní, hlášení chyb Pino Toscano - záplaty pro lepší přenositelnost Karel Volný - různé opravy Sebastian Pipping - záplaty bs2b Stefan Koelling - opravy sestavení Yaakov Selkowitz - záplaty pro cygwin qmmp-0.7.4/src/qmmpui/txt/translators_zh_TW.txt0000664000175000017500000000207612256224735020377 0ustar useruser巴西 葡萄牙語: Klaos Lacerda Bruno Gonçalves 簡體中文: 李紅昆 (lon) 繁體中文: 李紅昆 (lon) 捷克語: Karel Volný 荷蘭語: Ronald Uitermark 法語: Stanislas Zeller 德語: Stefan Koelling Panagiotis Papadopoulos 匈牙利語: Németh Gábor 意大利語: Gian Paolo Renello 日語: 島本良太 (Ryota Shimamoto) 哈薩克語: Baurzhan Muftakhidinov 立陶宛語: Algirdas Butkus 波蘭語: Grzegorz Gibas 俄語: Ilya Kotov 西班牙語: Félix Medrano 土耳其語: Mustafa GUNAY Bilgesu Güngör 烏克蘭語: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/thanks_es.txt0000664000175000017500000000211712256224735016663 0ustar useruserGracias a: Adria Arrufat - reporte de errores Adrian Knoth - arreglos en el módulo jack, reporte de errores Csaba Hruska - arreglos en el módulo ffmpeg Dmitry Kostin - soporte iso.wv Gennadi Motsyo - reporte de errores Vadim Kalinnikov - alojamiento del proyecto Erik Ölsar - temas de cursores, mejoras en el interfaz Funda Wang - arreglos en los archivos cmake Michail Zheludkov - arreglos en el módulo ffmpeg Panagiotis Papadopoulos - arreglos en el interfaz, reporte de errores Pino Toscano - parches de portabilidad Karel Volný - varios arreglos Sebastian Pipping - parches para bs2b Stefan Koelling - algunos arreglos en la compilación Yaakov Selkowitz - parches para cygwin qmmp-0.7.4/src/qmmpui/txt/thanks_zh_TW.txt0000664000175000017500000000231512256224735017307 0ustar useruser感謝: Adria Arrufat <​​swiftscythe@gmail.com> - bug 報告 Adrian Knoth - jack 插件修正,bug 報告 Anton Petrusevich - 隨機播放改進 Avihay Baratz - 自動停放功能,bug 修正 Csaba Hruska - ffmpeg 插件修正 Dmitry Kostin - iso.wv 支持 Evgeny Gleyzerman - cue 解析改進 Gennadi Motsyo - bug 報告 Vadim Kalinnikov - 項目網絡支持 Erik Ölsar - 光標皮膚、用戶界面改進 Funda Wang - cmake 文件修正 Michail Zheludkov - ffmpeg 插件修正 Michał Grosicki - alsa 插件修正 Panagiotis Papadopoulos - 用戶界面修正,bug 報告 Pino Toscano - 可移植性補丁 Karel Volný - 多項修正 Sebastian Pipping - bs2b 補丁 Stefan Koelling - 一些編譯修正 Yaakov Selkowitz - cygwin 補丁 qmmp-0.7.4/src/qmmpui/txt/description_zh_TW.txt0000664000175000017500000000010112256224735020331 0ustar useruser此程式是一個音樂播放器,程式的編寫基於Qt庫。qmmp-0.7.4/src/qmmpui/txt/thanks_he.txt0000664000175000017500000000353612256224735016656 0ustar useruserתודות: דיווחי תקלות Adria Arrufat תיקוניי תוספת jack, דיווחי תקלות Adrian Knoth שיפורי השמעה אקראית חוזרת של פסקול Anton Petrusevich תכונת הפסקה אוטומטית, תיקוניי תקלות Avihay Baratz תיקוניי תקלות Brice Videau תיקוניי scrobbler Cristian Rodríguez תיקוניי תוספת ffmpeg Csaba Hruska תמיכת iso.wv Dmitry Kostin שיפורי ניתוח cue Evgeny Gleyzerman שיפורי scrobbler Ferdinand Vesely דיווחי תקלות Gennadi Motsyo אירוח פרויקט Vadim Kalinnikov סמנים בעלי סקינים, שיפורי ממשק משתמש Erik Ölsar תיקוניי קבצי cmake Funda Wang תמיכה עבור EAC3, DTS, וגם Dolby TrueHD Makis Kalofolias תיקוניי תוספת ffmpeg Michail Zheludkov תיקוניי תוספת alsa Michał Grosicki תיקוניי ממשק משתמש, דיווחי תקלות Panagiotis Papadopoulos טלאיי ניידות Pino Toscano תיקונים שונים Karel Volný טלאיי bs2b Sebastian Pipping תיקוניי build מסוימים Stefan Koelling טלאיי cygwin Yaakov Selkowitz qmmp-0.7.4/src/qmmpui/txt/thanks_ja.txt0000664000175000017500000000317612256224735016654 0ustar useruser協力者: Adria Arrufat - バグ報告 Adrian Knoth - jack プラグイン改修, バグ報告 Anton Petrusevich - シャッフル再生の改良 Avihay Baratz - 自動終止機能, バグ改修 Brice Videau - バグ改修 Cristian Rodríguez - scrobbler 改修 Csaba Hruska - ffmpeg プラグイン改修 Dmitry Kostin - iso.wv サポート Evgeny Gleyzerman - cue 解析の改良 Ferdinand Vesely - scrobbler の改良 Геннадий Моцьо (Gennadi Motsyo) - バグ報告 Вадим Калинников (Vadim Kalinnikov) - ホスト提供 Erik Ölsar - スキン化カーソル, UI 改良 Funda Wang - cmake ファイル改修 Makis Kalofolias - EAC3, DTS, Dolby TrueHD のサポート Михаил Желудков (Michail Zheludkov) - ffmpeg プラグイン改修 Michał Grosicki - alsa プラグイン改修 Panagiotis Papadopoulos - UI 改修, バグ報告 Pino Toscano - 移植適用パッチ Karel Volný - 各種改修 Sebastian Pipping - bs2b パッチ Stefan Koelling - ビルド改修 Yaakov Selkowitz - cygwin パッチ qmmp-0.7.4/src/qmmpui/txt/thanks_it.txt0000664000175000017500000000012412256224735016664 0ustar useruserGrazie a: Vadim Kalinnikov (spazio ospite del progetto) qmmp-0.7.4/src/qmmpui/txt/translators.txt0000664000175000017500000000222512256224735017260 0ustar useruserBrazilian Portuguese: Klaos Lacerda Bruno Gonçalves Chinese Traditional: lon Chinese Simplified: lon Czech: Karel Volný Dutch: Ronald Uitermark French: Stanislas Zeller Galician: Óscar Pereira German: Stefan Koelling Panagiotis Papadopoulos Hebrew: Genghis Khan Hungarian: Németh Gábor Italian: Gian Paolo Renello Japanese: Ryota Shimamoto Kazakh: Baurzhan Muftakhidinov Lithuanian: Algirdas Butkus Polish: Grzegorz Gibas Russian: Ilya Kotov Slovak: Ján Ďanovský Spanish: Félix Medrano Turkish: Mustafa GUNAY Bilgesu Güngör Ukrainian: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/thanks_lt.txt0000664000175000017500000000321212256224735016670 0ustar useruserDėkojame: Adria Arrufat - klaidų pranešimai Adrian Knoth - jack įskiepio pataisymai, klaidų pranešimai Anton Petrusevich - atsitiktinio grojimo patobulinimai Avihay Baratz - automatinio sustabdymo užlopymas Brice Videau - klaidų pataisymai Cristian Rodríguez - scrobbler įskiepio užlopymas Csaba Hruska - ffmpeg įskiepio pataisymai Dmitry Kostin - iso.wv palaikymas Evgeny Gleyzerman - cue extractinimo patobulinimai Ferdinand Vesely - scrobbler įskiepio patobulinimai Gennadi Motsyo - klaidų pranešimai Vadim Kalinnikov - svetainės talpinimas Erik Ölsar - temų kursoriai, ui patobulinimai Funda Wang - cmake bylų pataisymai Makis Kalofolias - EAC3, DTS, ir Dolby TrueHD palaikymas Michail Zheludkov - ffmpeg įskiepio pataisymai Michał Grosicki - alsa įskiepio pataisymai Panagiotis Papadopoulos - ui pataisymai, klaidų pranešimai Pino Toscano - portabilumo pataisymai Karel Volný - įvairūs pataisymai Sebastian Pipping - bs2b užlopymas Stefan Koelling - keletas kompiliavimo pataisymų Yaakov Selkowitz - cygwin užlopymas qmmp-0.7.4/src/qmmpui/txt/thanks_nl.txt0000664000175000017500000000313412256224735016665 0ustar useruserMet dank aan: Adria Arrufat - foutrapporteringen Adrian Knoth - jack module reparatie's, foutrapporteringen Anton Petrusevich - willekeurige verbeteringen in het afspelen Avihay Baratz - automatische stop functie, foutreparatie's Brice Videau - foutreparatie's Csaba Hruska - ffmpeg module reparatie's Dmitry Kostin - iso.wv ondersteuning Evgeny Gleyzerman - verbeteringen interpertatie van cue bestanden Gennadi Motsyo - foutrapporteringen Vadim Kalinnikov - project hosting Erik Ölsar - thematische cursors, verbeteringen in gebruikersinterface Funda Wang - reparatie's in cmake bestanden Makis Kalofolias - EAC3, DTS, en Dolby TrueHD ondersteuning Michail Zheludkov - ffmpeg module reparatie's Michał Grosicki - alsa module reparatie's Panagiotis Papadopoulos - reparatie's in gebruikersinterface, foutrapporteringen Pino Toscano - patches voor compatibiliteit op andere besturingssystemen Karel Volný - willekeurige reperatie's Sebastian Pipping - bs2b module Stefan Koelling - aantal reparatie's in compileersysteem Yaakov Selkowitz - aanpassingen voor cygwin qmmp-0.7.4/src/qmmpui/txt/thanks_pl.txt0000664000175000017500000000322112256224735016664 0ustar useruserPodziękowania: Adria Arrufat - raporty błędów Adrian Knoth - poprawki dla wtyczki jack, raporty błędów Anton Petrusevich - ulepszenia losowego odtwarzania Avihay Baratz - funkcja auto stop, poprawki błędów Brice Videau - poprawki błędów Cristian Rodríguez - poprawki scrobbler'a Csaba Hruska - poprawki dla wtyczki ffmpeg Dmitry Kostin - wsparcie dla iso.wv Evgeny Gleyzerman - usprawnienia przetwarzania cue Ferdinand Vesely - usprawnienia dla scrobbler'a Gennadi Motsyo - raporty błędów Vadim Kalinnikov - hosting projektu Erik Ölsar - wsparcie dla kursorów z motywu, udoskonalenia dla ui Funda Wang - poprawki plików cmake Makis Kalofolias - wsparcie dla EAC3, DTS, oraz Dolby TrueHD Michail Zheludkov - poprawki dla wtyczki ffmpeg Michał Grosicki - poprawki wtyczki alsa Panagiotis Papadopoulos - poprawki ui, raporty błędów Pino Toscano - poprawki dotyczące przenośności programu Karel Volný - różne poprawki Sebastian Pipping - poprawki bs2b Stefan Koelling - poprawki błędów kompilacji Yaakov Selkowitz - poprawki cygwinqmmp-0.7.4/src/qmmpui/txt/description_de.txt0000664000175000017500000000014312256224735017674 0ustar useruserDieses Programm ist ein Audio-Abspielprogramm, der mit Hilfe der Qt-Bibliotheken geschrieben wurde.qmmp-0.7.4/src/qmmpui/txt/description_cs.txt0000664000175000017500000000010612256224735017710 0ustar useruserTento program je zvukový přehrávač napsaný s pomocí knihovny Qt.qmmp-0.7.4/src/qmmpui/txt/thanks_ru.txt0000664000175000017500000000432412256224735016704 0ustar useruserБлагодарности: Adria Arrufat - сообщения об ошибках Adrian Knoth - исправления в модуле jack plugin, сообщения об ошибках Anton Petrusevich - улучшение случайного воспроизведения Avihay Baratz - опции авто-остановки, исправления ошибок Brice Videau - исправления ощибок Cristian Rodríguez - исправление ошибок в модуле scrobbler Csaba Hruska - исправления в модуле ffmpeg Dmitry Kostin - поддержка iso.wv Evgeny Gleyzerman - улучшение поддержки cue Ferdinand Vesely - улучшения модуля scrobbler Геннадий Моцьо - сообщения об ошибках Вадим Калинников - хоcтинг проекта Erik Ölsar - растровые курсоры, улучшения в интерфейсе пользователя Funda Wang - исправления файлов cmake Makis Kalofolias - поддержка EAC3, DTS и Dolby TrueHD Михаил Желудков - исправления в модуле ffmpeg Michał Grosicki - исправления в модуле alsa Panagiotis Papadopoulos - улучшения в интерфейсе пользователя, сообщения об ошибках Pino Toscano - улучшение кроссплатформенности Karel Volný - различные исправления Sebastian Pipping - патчи bs2b Stefan Koelling - исправления сборки Yaakov Selkowitz - поддержка cygwin qmmp-0.7.4/src/qmmpui/txt/authors_gl_ES.txt0000664000175000017500000000063512256224735017445 0ustar useruserDesenvolvedores principais: Ilya Kotov (idea e cdigo base) Vladimir Kuznetsov (estilo e moitas melloras) Desenvolvedores de mdulos: Artur Guzik (mdulo de notificacin kde4, melloras no icono de estado) Yuriy Zhuravlev (mdulos para jack e oss) Material grfico: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/thanks_tr.txt0000664000175000017500000000012112256224735016672 0ustar useruserTeşekkürler: Vadim Kalinnikov (proje barındırma) qmmp-0.7.4/src/qmmpui/txt/description_es.txt0000664000175000017500000000012012256224735017706 0ustar useruserEste programa es un reproductor de audio, escrito con ayuda de la librería Qt. qmmp-0.7.4/src/qmmpui/txt/description_he.txt0000664000175000017500000000012612256224735017701 0ustar useruserתוכנית זו הינה נגן-אודיו, נכתבה בעזרת הספרייה Qt.qmmp-0.7.4/src/qmmpui/txt/authors.txt0000664000175000017500000000057112256224735016373 0ustar useruserCore Developers: Ilya Kotov (idea and base code) Vladimir Kuznetsov (look&feel and many improvements) Plugin Developers: Artur Guzik (kde4 notification plugin, tray icon improvements) Yuriy Zhuravlev (jack & oss plugin) Artwork: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description_ja.txt0000664000175000017500000000016712256224735017704 0ustar useruserこのプログラムは、 Qt ライブラリーの力を借りて作られたオーディオプレイヤーです。 qmmp-0.7.4/src/qmmpui/txt/authors_de.txt0000664000175000017500000000063012256224735017037 0ustar useruserHauptentwickler: Ilya Kotov (Idee und Programmierung) Vladimir Kuznetsov (Look & Feel und viele Verbesserungen) Plugin-Entwickler: Artur Guzik (KDE-4-Benachrichtigungs-Modul, Verbesserungen am Statussymbol-Modul) Yuriy Zhuravlev (JACK- und OSS-Plugin) Design: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/authors_cs.txt0000664000175000017500000000073212256224735017057 0ustar useruserVývojáři programu: Илья Котов (Ilja Kotov) (nápad a základní kód) Владимир Кузнецов (Vladimír Kuzněcov) (vzhled a mnoho vylepšení) Vývojáři zásuvných modulů: Юрий Журавлёв (Jurij Žuravljov) (jack plugin) Grafika: Андрей Адреев (Andrej Adrejev) Český překlad: Karel Volný qmmp-0.7.4/src/qmmpui/txt/description_it.txt0000664000175000017500000000010612256224735017717 0ustar useruserProgramma di riproduzione audio scritto con l'ausilio di librerie QT. qmmp-0.7.4/src/qmmpui/txt/translators_gl_ES.txt0000664000175000017500000000167712256224735020343 0ustar useruserPortugués do Brasil: Klaos Lacerda Bruno Gonçalves Chino tradicional: lon Chino simplificado: lon Checo: Karel Volný Holandés: Ronald Uitermark Francés: Stanislas Zeller Alemán: Stefan Koelling Panagiotis Papadopoulos Húngaro: Németh Gábor Italiano: Gian Paolo Renello Kazaxo: Baurzhan Muftakhidinov Lituano: Algirdas Butkus Polaco: Grzegorz Gibas Ruso: Ilya Kotov Turco: Mustafa GUNAY Bilgesu Güngör Ucraniano: Gennadi Motsyo Galego: Óscar Pereira qmmp-0.7.4/src/qmmpui/txt/authors_es.txt0000664000175000017500000000063712256224735017065 0ustar useruserDesarrolladores principales: Ilya Kotov (idea y cdigo base) Vladimir Kuznetsov (estilo y muchas mejoras) Desarrolladores de mdulos: Artur Guzik (mdulo de notificacin kde4, mejoras en el icono de estado) Yuriy Zhuravlev (mdulos para jack y oss) Material grfico: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description_lt.txt0000664000175000017500000000006712256224735017730 0ustar useruserŠi programa yra audio grotuvas, sukurtas Qt pagrindu. qmmp-0.7.4/src/qmmpui/txt/authors_he.txt0000664000175000017500000000070412256224735017045 0ustar useruserמפתחי ליבה: רעיון וקוד בסיס Ilya Kotov מראה ותחושה וגם שיפורים רבים Vladimir Kuznetsov מפתחי תוספת: תוספת התראה kde4, שיפורים לצלמית מגש Artur Guzik תוספת jack וגם oss Yuriy Zhuravlev אומנות: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/thanks_gl_ES.txt0000664000175000017500000000206312256224735017245 0ustar useruserGrazas a: Adria Arrufat - reporte de erros Adrian Knoth - arreglos no módulo jack, reporte de erros Csaba Hruska - arranxos no módulo ffmpeg Dmitry Kostin - soporte iso.wv Gennadi Motsyo - reporte de erros Vadim Kalinnikov - aloxamento do proxecto Erik Ölsar - temas de cursores, melloras na interface Funda Wang - arranxos nos arquivos cmake Michail Zheludkov - arranxos no módulo ffmpeg Panagiotis Papadopoulos - arranxos na interface, reporte de erros Pino Toscano - parches de portabilidade Karel Volný - varios arranxos Sebastian Pipping - parches para bs2b Stefan Koelling - algúns arranxos na compilación Yaakov Selkowitz - parches para cygwin qmmp-0.7.4/src/qmmpui/txt/description_nl.txt0000664000175000017500000000012012256224735017710 0ustar useruserDit programma is een audio-speler, geschreven met behulp van de Qt bibliotheek. qmmp-0.7.4/src/qmmpui/txt/description_gl_ES.txt0000664000175000017500000000011412256224735020273 0ustar useruserEste programa é un reprodutor de audio, escrito coa axuda da librería Qt. qmmp-0.7.4/src/qmmpui/txt/authors_ja.txt0000664000175000017500000000104012256224735017035 0ustar useruser中心的な開発者: Илья Котов (Ilya Kotov) (発案と基礎コード) Владимир Кузнецов (Vladimir Kuznetsov) (使い勝手及び外見、 数多くの拡張) プラグイン開発者: Artur Guzik (KDE4通知プラグイン、 トレイアイコン拡張) Юрий Журавлёв (Yuriy Zhuravlev) (jack & OSS プラグイン) 美術: Андрей Андреев (Andrey Andreev) qmmp-0.7.4/src/qmmpui/txt/authors_it.txt0000664000175000017500000000047112256224735017066 0ustar useruserSviluppatori del programma base: Ilya Kotov (idea e codice di base) Vladimir Kuznetsov (aspetto e molti miglioramenti) Sviluppatori dei moduli: Yuriy Zhuravlev (moduli & oss jack) Grafica: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description_pl.txt0000664000175000017500000000007612256224735017724 0ustar useruserQmmp to odtwarzacz muzyki napisany przy użyciu biblioteki QT.qmmp-0.7.4/src/qmmpui/txt/authors_lt.txt0000664000175000017500000000062312256224735017070 0ustar useruserProgramos autoriai: Ilya Kotov (Idėja ir pagrindinis kodas) Vladimir Kuznetsov (Išvaizda ir daugybė patobulinimų) Įskiepiai: Artur Guzik (kde4 pranešimų įskiepis, sistemos dėklo ikonos patobulinimai) Yuriy Zhuravlev (Įskiepiai jack, oss) Grafika: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description_ru.txt0000664000175000017500000000023212256224735017731 0ustar useruserДанная программа является аудио-плеером, написанным с использованием библиотеки Qt. qmmp-0.7.4/src/qmmpui/txt/authors_nl.txt0000664000175000017500000000060112256224735017056 0ustar useruserOntwikkelaars: Ilya Kotov (idea and base code) Vladimir Kuznetsov (look&feel and many improvements) Plugin Ontwikkelaars: Artur Guzik (kde4 notification plugin, tray icon improvements) Yuriy Zhuravlev (jack & oss plugin) Artistiek werk: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description_tr.txt0000664000175000017500000000013012256224735017725 0ustar useruserBu program Qt kitaplığı kullaılarak yazılmış bir çoklu ortam oynatıcısıdır. qmmp-0.7.4/src/qmmpui/txt/authors_pl.txt0000664000175000017500000000061312256224735017063 0ustar useruserGłówni programiści: Ilya Kotov (pomysł i właściwy kod) Vladimir Kuznetsov (look&feel oraz wiele usprawnień) Twórcy wtyczek: Artur Guzik (wtyczka powiadamiania KDE4, usprawnienia ikony statusu) Yuriy Zhuravlev (wtyczki jack & oss) Grafika: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/txt.qrc0000664000175000017500000000376212256224735015500 0ustar useruser ../../../COPYING description.txt authors.txt thanks.txt translators.txt authors_uk_UA.txt thanks_uk_UA.txt translators_uk_UA.txt description_uk_UA.txt authors_zh_TW.txt thanks_zh_TW.txt translators_zh_TW.txt description_zh_TW.txt description_cs.txt authors_cs.txt thanks_cs.txt translators_cs.txt authors_ru.txt thanks_ru.txt translators_ru.txt description_ru.txt authors_zh_CN.txt thanks_zh_CN.txt translators_zh_CN.txt description_zh_CN.txt authors_de.txt thanks_de.txt translators_de.txt description_de.txt authors_it.txt thanks_it.txt translators_it.txt description_it.txt authors_tr.txt thanks_tr.txt translators_tr.txt description_tr.txt authors_lt.txt thanks_lt.txt translators_lt.txt description_lt.txt authors_nl.txt thanks_nl.txt translators_nl.txt description_nl.txt authors_ja.txt thanks_ja.txt translators_ja.txt description_ja.txt authors_es.txt thanks_es.txt translators_es.txt description_es.txt authors_he.txt thanks_he.txt translators_he.txt description_he.txt qmmp-0.7.4/src/qmmpui/txt/authors_ru.txt0000664000175000017500000000110712256224735017075 0ustar useruserРазработчики ядра: Владимир Кузнецов (внешний вид и множество улучшений) Илья Котов (идея и основной код) Разработчики модулей: Artur Guzik (модуль уведомлений kde4, улучшения в модуле системного лотка) Юрий Журавлёв (модули jack, oss) Графика: Андрей Андреев qmmp-0.7.4/src/qmmpui/txt/authors_tr.txt0000664000175000017500000000047312256224735017101 0ustar useruserÇekirdek Geliştiriciler: Ilya Kotov (fikirler ve temel kod) Vladimir Kuznetsov (görünüm ve birçok iyileştirme) Eklenti Geliştiricileri: Yuriy Zhuravlev (jack & oss eklentisi) Artwork: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/authors_zh_CN.txt0000664000175000017500000000042512256224735017452 0ustar useruser核心开发: Ilya Kotov (idea and base code) Vladimir Kuznetsov (look&feel and many improvements) 插件开发: Yuriy Zhuravlev (jack plugin) 美术: Andrey Adreev qmmp-0.7.4/src/qmmpui/txt/description.txt0000664000175000017500000000011112256224735017217 0ustar useruserThis program is an audio-player, written with the help of the Qt library.qmmp-0.7.4/src/qmmpui/txt/translators_de.txt0000664000175000017500000000214312256224735017727 0ustar useruserBrasilianisch Portugiesisch: Klaos Lacerda Bruno Gonçalves Chinesisch (Langzeichen): lon Chinesisch (Kurzzeichen): lon Deutsch: Stefan Koelling Panagiotis Papadopoulos Französisch: Stanislas Zeller Italienisch: Gian Paolo Renello Japanisch: Ryota Shimamoto Kasachisch: Baurzhan Muftakhidinov Litauisch: Algirdas Butkus Niederländisch: Ronald Uitermark Polnisch: Grzegorz Gibas Russisch: Ilya Kotov Slowakisch: Ján Ďanovský Spanisch: Félix Medrano Tschechisch: Karel Volný Türkisch: Mustafa GUNAY Bilgesu Güngör Ukrainisch: Gennadi Motsyo Ungarisch: Németh Gábor qmmp-0.7.4/src/qmmpui/txt/translators_cs.txt0000664000175000017500000000225112256224735017744 0ustar useruserBrazilská portugalština: Klaos Lacerda Bruno Gonçalves Tradiční čínština: lon Zjednodušená čínština: lon Čeština: Karel Volný Nizozemština: Ronald Uitermark Francouzština: Stanislas Zeller Němčina: Stefan Koelling Panagiotis Papadopoulos Hebrejština: Genghis Khan Maďarština: Németh Gábor Italština: Gian Paolo Renello Japonština: Ryota Shimamoto Kazaština: Baurzhan Muftakhidinov Litevština: Algirdas Butkus Polština: Grzegorz Gibas Ruština: Ilya Kotov Slovenština: Ján Ďanovský Španělština: Félix Medrano Turečtina: Mustafa GUNAY Bilgesu Güngör Ukrajinština: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/translators_es.txt0000664000175000017500000000160712256224735017752 0ustar useruserPortugués de Brasil: Klaos Lacerda Bruno Gonçalves Chino tradicional: lon Chino simplificado: lon Checo: Karel Volný Holandés: Ronald Uitermark Francés: Stanislas Zeller Alemán: Stefan Koelling Panagiotis Papadopoulos Húngaro: Németh Gábor Italiano: Gian Paolo Renello Kazajo: Baurzhan Muftakhidinov Lituano: Algirdas Butkus Polaco: Grzegorz Gibas Ruso: Ilya Kotov Turco: Mustafa GUNAY Bilgesu Güngör Ucraniano: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/translators_zh_CN.txt0000664000175000017500000000207712256224735020346 0ustar useruser巴西 葡萄牙语: Klaos Lacerda Bruno Gonçalves 简体中文: 李红昆 (lon) 繁体中文: 李红昆 (lon) 捷克语: Karel Volný 荷兰语: Ronald Uitermark 法语: Stanislas Zeller 德语: Stefan Koelling Panagiotis Papadopoulos 匈牙利语: Németh Gábor 意大利语: Gian Paolo Renello 日语: 岛本良太 (Ryota Shimamoto) 哈萨克语: Baurzhan Muftakhidinov 立陶宛语: Algirdas Butkus 波兰语: Grzegorz Gibas 俄语: Ilya Kotov 西班牙语: Félix Medrano 土耳其语: Mustafa GUNAY Bilgesu Güngör 乌克兰语: Gennadi Motsyo qmmp-0.7.4/src/qmmpui/txt/translators_he.txt0000664000175000017500000000230612256224735017734 0ustar useruserאוקראינית: Gennadi Motsyo איטלקית: Gian Paolo Renello ברזילאית פורטוגזית: Klaos Lacerda Bruno Gonçalves גרמנית: Stefan Koelling Panagiotis Papadopoulos הונגרית: Németh Gábor הולנדית: Ronald Uitermark טורקית: Mustafa GUNAY Bilgesu Güngör יפנית: Ryota Shimamoto ליטאית: Algirdas Butkus סינית מסורתית: lon סינית מפושטת: lon סלובקית: Ján Ďanovský ספרדית: Félix Medrano עברית: Genghis Khan פולנית: Grzegorz Gibas צ׳כית: Karel Volný צרפתית: Stanislas Zeller קזכית: Baurzhan Muftakhidinov רוסית: Ilya Kotov qmmp-0.7.4/src/qmmpui/txt/translators_ja.txt0000664000175000017500000000254012256224735017732 0ustar useruserイタリア語: Gian Paolo Renello ウクライナ語: Gennadi Motsyo オランダ語: Ronald Uitermark カザフ語: Baurzhan Muftakhidinov ガリシア語 (スペイン北西部): Óscar Pereira スペイン語: Félix Medrano スロバキア語: Ján Ďanovský チェコ語: Karel Volný ドイツ語: Stefan Koelling Panagiotis Papadopoulos トルコ語: Mustafa GUNAY Bilgesu Güngör ハンガリー語: Németh Gábor ブラジル ポルトガル語: Klaos Lacerda Bruno Gonçalves フランス語: Stanislas Zeller ヘブライ語: Genghis Khan ポーランド語: Grzegorz Gibas リトアニア語: Algirdas Butkus ロシア語: Илья Котов (Ilya Kotov) 簡体字中国語: 李红昆 (lon) 繁体字中国語: 李红昆 (lon) 日本語: 島本良太 qmmp-0.7.4/src/qmmpui/txt/thanks_zh_CN.txt0000664000175000017500000000231212256224735017252 0ustar useruser感谢: Adria Arrufat - bug 报告 Adrian Knoth - jack 插件修正,bug 报告 Anton Petrusevich - 随机播放改进 Avihay Baratz - 自动停放功能,bug 修正 Csaba Hruska - ffmpeg 插件修正 Dmitry Kostin - iso.wv 支持 Evgeny Gleyzerman - cue 解析改进 Gennadi Motsyo - bug 报告 Vadim Kalinnikov - 项目网络支持 Erik Ölsar - 光标皮肤、用户界面改进 Funda Wang - cmake 文件修正 Michail Zheludkov - ffmpeg 插件修正 Michał Grosicki - alsa 插件修正 Panagiotis Papadopoulos - 用户界面修正,bug 报告 Pino Toscano - 可移植性补丁 Karel Volný - 多项修正 Sebastian Pipping - bs2b 补丁 Stefan Koelling - 一些编译修正 Yaakov Selkowitz - cygwin 补丁 qmmp-0.7.4/src/qmmpui/playlistitem.cpp0000664000175000017500000001042612256224735016552 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "metadataformatter.h" #include "qmmpuisettings.h" #include "playlistitem.h" PlayListItem::PlayListItem() : QMap(), m_flag(FREE) { m_info = 0; m_length = 0; m_selected = false; m_current = false; } PlayListItem::PlayListItem(const PlayListItem &other) : QMap(other), m_flag(other.m_flag) { m_title = other.m_title; if (other.m_info) m_info = new FileInfo(*(other.m_info)); else m_info = 0; m_selected = other.m_selected; m_current = other.m_current; m_length = other.m_length; } PlayListItem::PlayListItem(FileInfo *info) : QMap(info->metaData()), m_flag(FREE) { m_length = info->length(); m_selected = false; m_current = false; m_info = info; insert(Qmmp::URL, m_info->path()); } PlayListItem::~PlayListItem() { if (m_info) delete m_info; } void PlayListItem::setSelected(bool yes) { m_selected = yes; } bool PlayListItem::isSelected() const { return m_selected; } void PlayListItem::setCurrent(bool yes) { m_current = yes; } bool PlayListItem::isCurrent() const { return m_current; } void PlayListItem::setFlag(FLAGS f) { m_flag = f; } PlayListItem::FLAGS PlayListItem::flag() const { return m_flag; } void PlayListItem::updateMetaData(const QMap &metaData) { QMap ::operator =(metaData); readMetadata(); } void PlayListItem::updateTags() { if (m_info) { delete m_info; m_info = 0; } QList list = MetaDataManager::instance()->createPlayList(value(Qmmp::URL)); if(!list.isEmpty() && !list.at(0)->path().contains("://")) { m_info = list.at(0); m_length = m_info->length(); QMap ::operator =(m_info->metaData()); insert(Qmmp::URL, m_info->path()); readMetadata(); } while(list.size() > 1) delete list.takeLast(); } const QString PlayListItem::text() { if(m_title.isEmpty()) readMetadata(); return m_title; } void PlayListItem::setText(const QString &title) { m_title = title; } qint64 PlayListItem::length() const { return m_length; } void PlayListItem::setLength(qint64 length) { m_length = length; } const QString PlayListItem::url() const { return value(Qmmp::URL); } void PlayListItem::readMetadata() { MetaDataFormatter f(QmmpUiSettings::instance()->format()); m_title = f.parse(this); if (m_title.isEmpty()) m_title = value(Qmmp::URL).section('/',-1); if (m_info) delete m_info; m_info = 0; if (QmmpUiSettings::instance()->convertUnderscore()) m_title.replace("_", " "); if (QmmpUiSettings::instance()->convertTwenty()) m_title.replace("%20", " "); } qmmp-0.7.4/src/qmmpui/commandlineoption.h0000664000175000017500000000516012256224735017215 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef COMMANDLINEOPTION_H #define COMMANDLINEOPTION_H class CommandLineManager; class QTranslator; class QString; class QObject; class QStringList; /*! @brief Abstract base class of the command line plugins. * @author Vladimir Kuznetsov */ class CommandLineOption { public: /*! * Returns \b true if \b opt_str string can be processed, * otherise \b false */ virtual bool identify(const QString& opt_str)const = 0; /*! * Command line option name */ virtual const QString name()const = 0; /*! * Help string. */ virtual const QString helpString()const = 0; /*! * Parses \b opt_str args(if needed), executes command. * @param opt_str Command to execute * @param args Command arguments * @return Command output */ virtual QString executeCommand(const QString &opt_str, const QStringList &args) = 0; /*! * Creates translator with parent object \b parent */ virtual QTranslator *createTranslator(QObject *parent) = 0; /*! * Object destructor */ virtual ~CommandLineOption() {} }; Q_DECLARE_INTERFACE(CommandLineOption,"CommandLineOptionInterface/1.0") #endif qmmp-0.7.4/src/qmmpui/qmmpui.pc.in0000664000175000017500000000047312256224735015570 0ustar useruserprefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@CMAKE_INSTALL_PREFIX@/@LIB_DIR@ includedir=@CMAKE_INSTALL_PREFIX@/include Name: qmmpui Description: qmmp user interface library Version: @QMMP_VERSION@ Requires: QtCore QtGui QtNetwork qmmp Libs: -L${libdir} -lqmmpui Cflags: -I${includedir} qmmp-0.7.4/src/qmmpui/playlistdownloader.cpp0000664000175000017500000001022612256224735017750 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "playlistdownloader.h" PlayListDownloader::PlayListDownloader(QObject *parent) : QObject(parent) { m_getReply = 0; m_ua = QString("qmmp/%1").arg(Qmmp::strVersion()).toAscii(); m_manager = new QNetworkAccessManager(this); connect(m_manager, SIGNAL(finished (QNetworkReply *)), SLOT(readResponse(QNetworkReply *))); //load global proxy settings QmmpSettings *gs = QmmpSettings::instance(); if (gs->isProxyEnabled()) { QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); if(gs->useProxyAuth()) { proxy.setUser(gs->proxy().userName()); proxy.setPassword(gs->proxy().password()); } m_manager->setProxy(proxy); } } void PlayListDownloader::start(const QUrl &url) { if(!PlayListParser::findByUrl(url)) //is it playlist? { emit done(QStringList() << url.toString()); //just send initial URL return; } m_url = url; QNetworkRequest r; r.setUrl(url); r.setRawHeader("User-Agent", m_ua); m_getReply = m_manager->get(r); m_redirect_url.clear(); } void PlayListDownloader::readResponse(QNetworkReply *reply) { if(reply != m_getReply) { reply->deleteLater(); return; } if(reply->error() != QNetworkReply::NoError) { emit error(reply->errorString() + " (" + reply->error() + ")"); reply->deleteLater(); return; } QUrl url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); if(!url.isEmpty() && url != m_redirect_url) { m_redirect_url = url; qDebug("PlayListDownloader: redirect to %s", qPrintable(url.toString())); QNetworkRequest request(url); request.setRawHeader("User-Agent", m_ua); if(reply == m_getReply) m_getReply = m_manager->get(request); reply->deleteLater(); return; } m_redirect_url.clear(); if(reply == m_getReply) { m_getReply = 0; QString contentType = reply->header(QNetworkRequest::ContentTypeHeader).toString(); qDebug("PlayListDownloader: content type: %s", qPrintable(contentType)); PlayListFormat *fmt = PlayListParser::findByMime(contentType); if(!fmt) fmt = PlayListParser::findByUrl(m_url); if(fmt) { QStringList list = fmt->decode(QString::fromUtf8(reply->readAll())); emit done(list); } else { emit error(tr("Unsupported playlist format")); } } reply->deleteLater(); } qmmp-0.7.4/src/qmmpui/playlistmodel.cpp0000664000175000017500000006217312256224735016722 0ustar useruser/*************************************************************************** * Copyright(C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "playlistparser.h" #include "playlistformat.h" #include "fileloader_p.h" #include "playlistitem.h" #include "playstate_p.h" #include "detailsdialog.h" #include "playlistmodel.h" #define INVALID_ROW -1 TagUpdater::TagUpdater(QObject* o,PlayListItem* item):m_observable(o),m_item(item) { m_item->setFlag(PlayListItem::EDITING); connect(m_observable, SIGNAL(destroyed(QObject *)),SLOT(updateTag())); connect(m_observable, SIGNAL(destroyed(QObject *)),SLOT(deleteLater())); } void TagUpdater::updateTag() { if (m_item->flag() == PlayListItem::SCHEDULED_FOR_DELETION) { delete m_item; m_item = NULL; } else { m_item->updateTags(); m_item->setFlag(PlayListItem::FREE); } } PlayListModel::PlayListModel(const QString &name, QObject *parent) : QObject(parent) , m_selection() { qsrand(time(0)); m_name = name; m_shuffle = 0; m_total_length = 0; m_current = 0; m_is_repeatable_list = false; m_stop_item = 0; m_play_state = new NormalPlayState(this); m_loader = new FileLoader(this); connect(m_loader, SIGNAL(newPlayListItem(PlayListItem*)), SLOT(add(PlayListItem*)), Qt::QueuedConnection); connect(m_loader, SIGNAL(finished()), SLOT(preparePlayState())); connect(m_loader, SIGNAL(finished()), SIGNAL(loaderFinished())); } PlayListModel::~PlayListModel() { blockSignals(true); clear(); delete m_play_state; m_loader->finish(); } QString PlayListModel::name() const { return m_name; } void PlayListModel::setName(const QString &name) { if(m_name != name) { m_name = name; emit nameChanged(name); } } void PlayListModel::add(PlayListItem *item) { if (m_items.isEmpty()) m_currentItem = item; m_total_length += item->length(); m_items << item; m_current = m_items.indexOf(m_currentItem); emit itemAdded(item); emit listChanged(); emit countChanged(); } void PlayListModel::add(QList items) { if(items.isEmpty()) return; if (m_items.isEmpty()) m_currentItem = items.at(0); m_items << items; m_current = m_items.indexOf(m_currentItem); foreach(PlayListItem *item, items) { m_total_length += item->length(); emit itemAdded(item); } emit listChanged(); emit countChanged(); } void PlayListModel::add(const QString &path) { QFileInfo f_info(path); if (f_info.isDir()) m_loader->loadDirectory(path); else { m_loader->loadFile(path); loadPlaylist(path); } } void PlayListModel::add(const QStringList &paths) { foreach(QString str, paths) { add(str); } } int PlayListModel::count() { return m_items.size(); } PlayListItem* PlayListModel::currentItem() { return m_items.isEmpty() ? 0 : m_items.at(qMin(m_items.size() - 1, m_current)); } PlayListItem* PlayListModel::nextItem() { if(m_items.isEmpty() || !m_play_state) return 0; if(m_stop_item && m_stop_item == currentItem()) return 0; if(!isEmptyQueue()) return m_queued_songs.at(0); int index = m_play_state->nextIndex(); if(index < 0 || (index + 1 > m_items.count())) return 0; return m_items.at(index); } int PlayListModel::indexOf(PlayListItem* item) const { return m_items.indexOf(item); } PlayListItem* PlayListModel::item(int index) const { return (index < m_items.size() && index >= 0) ? m_items.at(index) : 0; } int PlayListModel::currentIndex() { return m_current; } bool PlayListModel::setCurrent(int index) { if (index > count()-1 || index < 0) return false; m_current = index; m_currentItem = m_items.at(index); emit currentChanged(); emit listChanged(); return true; } bool PlayListModel::setCurrent(PlayListItem *item) { if(!m_items.contains(item)) return false; return setCurrent(m_items.indexOf(item)); } bool PlayListModel::next() { if(m_stop_item == currentItem()) { m_stop_item = 0; emit listChanged(); return false; } if (!isEmptyQueue()) { setCurrentToQueued(); return true; } if(m_loader->isRunning()) m_play_state->prepare(); return m_play_state->next(); } bool PlayListModel::previous() { if (m_loader->isRunning()) m_play_state->prepare(); return m_play_state->previous(); } void PlayListModel::clear() { m_loader->finish(); m_current = 0; m_currentItem = 0; m_stop_item = 0; while (!m_items.isEmpty()) { PlayListItem* mf = m_items.takeFirst(); if (mf->flag() == PlayListItem::FREE) { delete mf; } else if (mf->flag() == PlayListItem::EDITING) { mf->setFlag(PlayListItem::SCHEDULED_FOR_DELETION); } } m_queued_songs.clear(); m_total_length = 0; m_play_state->resetState(); emit listChanged(); emit countChanged(); } void PlayListModel::clearSelection() { for (int i = 0; isetSelected(false); emit listChanged(); } QStringList PlayListModel::getTitles(int b,int l) { QList m_titles; for (int i = b;(i < b + l) &&(i < m_items.size()); ++i) m_titles << m_items.at(i)->text(); return m_titles; } QStringList PlayListModel::getTimes(int b,int l) { QList m_times; int d = 0; QString str; for (int i = b; (i < b + l) && (i < m_items.size()); ++i) { d = m_items.at(i)->length(); if(d >= 3600) str += QString("%1:%2").arg(d/3600).arg(d%3600/60, 2, 10, QChar('0')); else str += QString("%1").arg(d%3600/60); str += QString(":%1").arg(d%60, 2, 10, QChar('0')); if(!d) str.clear(); m_times << str; str.clear(); } return m_times; } bool PlayListModel::isSelected(int index) { if (m_items.count() > index && index >= 0) return m_items.at(index)->isSelected(); return false; } bool PlayListModel::contains(const QString &url) { foreach (PlayListItem *item, m_items) { if(item->url() == url) return true; } return false; } void PlayListModel::setSelected(int index, bool selected) { if (m_items.count() > index && index >= 0) { m_items.at(index)->setSelected(selected); emit listChanged(); } } void PlayListModel::removeSelected() { removeSelection(false); } void PlayListModel::removeUnselected() { removeSelection(true); } void PlayListModel::removeAt (int i) { if ((i < count()) && (i >= 0)) { PlayListItem* item = m_items.takeAt(i); m_queued_songs.removeAll(item); if(m_stop_item == item) m_stop_item = 0; m_total_length -= item->length(); if (m_total_length < 0) m_total_length = qMin(0, m_total_length); if (item->flag() == PlayListItem::FREE) { delete item; item = NULL; } else if (item->flag() == PlayListItem::EDITING) item->setFlag(PlayListItem::SCHEDULED_FOR_DELETION); if (m_current >= i && m_current != 0) m_current--; if (!m_items.isEmpty()) m_currentItem = m_items.at(m_current); else m_currentItem = 0; m_play_state->prepare(); emit listChanged(); emit countChanged(); } } void PlayListModel::removeItem (PlayListItem *item) { if(m_items.contains(item)) removeAt (m_items.indexOf(item)); } void PlayListModel::removeSelection(bool inverted) { int i = 0; int select_after_delete = -1; while (!m_items.isEmpty() && iisSelected() ^ inverted) { PlayListItem* item = m_items.takeAt(i); m_queued_songs.removeAll(item); if(item == m_stop_item) m_stop_item = 0; m_total_length -= item->length(); if (m_total_length < 0) m_total_length = 0; if (item->flag() == PlayListItem::FREE) { delete item; item = NULL; } else if (item->flag() == PlayListItem::EDITING) item->setFlag(PlayListItem::SCHEDULED_FOR_DELETION); select_after_delete = i; if (m_current >= i && m_current!=0) m_current--; } else i++; } if (!m_items.isEmpty()) m_currentItem = m_items.at(m_current); else m_currentItem = 0; if (select_after_delete >= m_items.count()) select_after_delete = m_items.count() - 1; if(select_after_delete != -1) m_items.at(select_after_delete)->setSelected(true); m_play_state->prepare(); emit listChanged(); emit countChanged(); } void PlayListModel::invertSelection() { for (int i = 0; isetSelected(!m_items.at(i)->isSelected()); emit listChanged(); } void PlayListModel::selectAll() { for (int i = 0; isetSelected(true); emit listChanged(); } void PlayListModel::showDetails(QWidget *parent) { for (int i = 0; iisSelected()) { QDialog *d = new DetailsDialog(m_items.at(i), parent); TagUpdater *updater = new TagUpdater(d, m_items.at(i)); m_editing_items.append(m_items.at(i)); connect(updater, SIGNAL(destroyed(QObject *)),SIGNAL(listChanged())); d->show(); return; } } } int PlayListModel::firstSelectedUpper(int row) { for (int i = row - 1;i >= 0;i--) { if (isSelected(i)) return i; } return -1; } int PlayListModel::firstSelectedLower(int row) { for (int i = row + 1;i < count() ;i++) { if (isSelected(i)) return i; } return -1; } void PlayListModel::moveItems(int from, int to) { // Get rid of useless work if (from == to) return; QList selected_rows = selectedIndexes(); if (!(bottommostInSelection(from) == INVALID_ROW || from == INVALID_ROW || topmostInSelection(from) == INVALID_ROW) ) { if (from > to) foreach(int i, selected_rows) if (i + to - from < 0) break; else m_items.move(i,i + to - from); else for (int i = selected_rows.count() - 1; i >= 0; i--) if (selected_rows[i] + to -from >= m_items.count()) break; else m_items.move(selected_rows[i],selected_rows[i] + to - from); m_current = m_items.indexOf(m_currentItem); emit listChanged(); } } int PlayListModel::topmostInSelection(int row) { if (row == 0) return 0; for (int i = row - 1;i >= 0;i--) { if (isSelected(i)) continue; else return i + 1; } return 0; } int PlayListModel::bottommostInSelection(int row) { if (row >= m_items.count() - 1) return row; for (int i = row + 1;i < count() ;i++) { if (isSelected(i)) continue; else return i - 1; } return count() - 1; } const SimpleSelection& PlayListModel::getSelection(int row) { m_selection.m_top = topmostInSelection(row); m_selection.m_anchor = row; m_selection.m_bottom = bottommostInSelection(row); m_selection.m_selected_indexes = selectedIndexes(); return m_selection; } QList PlayListModel::selectedIndexes() const { QListselected_rows; for (int i = 0;iisSelected()) { selected_rows.append(i); } } return selected_rows; } QList< PlayListItem * > PlayListModel::selectedItems() const { QListselected_items; for (int i = 0;iisSelected()) { selected_items.append(m_items[i]); } } return selected_items; } void PlayListModel::addToQueue() { QList selected_items = selectedItems(); foreach(PlayListItem* file,selected_items) setQueued(file); emit listChanged(); } void PlayListModel::setQueued(PlayListItem* item) { if (isQueued(item)) m_queued_songs.removeAll(item); else m_queued_songs.enqueue(item); emit listChanged(); } bool PlayListModel::isQueued(PlayListItem* f) const { return m_queued_songs.contains(f); } void PlayListModel::setCurrentToQueued() { setCurrent(indexOf(m_queued_songs.dequeue())); } bool PlayListModel::isEmptyQueue() const { return m_queued_songs.isEmpty(); } int PlayListModel::queuedIndex(PlayListItem* item) const { return m_queued_songs.indexOf(item); } int PlayListModel::queueSize() const { return m_queued_songs.size(); } bool PlayListModel::isStopAfter(PlayListItem* item) const { return m_stop_item == item; } void PlayListModel::randomizeList() { for (int i = 0;i < m_items.size();i++) m_items.swap(qrand()%m_items.size(),qrand()%m_items.size()); m_current = m_items.indexOf(m_currentItem); emit listChanged(); } void PlayListModel::reverseList() { for (int i = 0;i < m_items.size()/2;i++) m_items.swap(i,m_items.size() - i - 1); m_current = m_items.indexOf(m_currentItem); emit listChanged(); } ////===============THE BEGINNING OF SORT IMPLEMENTATION =======================//// // First we'll implement bundle of static compare procedures // to sort items in different ways //by title static bool _titleLessComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::TITLE), s2->value(Qmmp::TITLE)) < 0; } static bool _titleGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::TITLE), s2->value(Qmmp::TITLE)) > 0; } //by album+disc static bool _discnumberLessComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::DISCNUMBER), s2->value(Qmmp::DISCNUMBER)) < 0; } static bool _discnumberGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::DISCNUMBER), s2->value(Qmmp::DISCNUMBER)) > 0; } //by album static bool _albumLessComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::ALBUM), s2->value(Qmmp::ALBUM)) < 0; } static bool _albumGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::ALBUM), s2->value(Qmmp::ALBUM)) > 0; } //by artist static bool _artistLessComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::ARTIST), s2->value(Qmmp::ARTIST)) < 0; } static bool _artistGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->value(Qmmp::ARTIST), s2->value(Qmmp::ARTIST)) > 0; } //by path static bool _pathAndFilenameLessComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->url(), s2->url()) < 0; } static bool _pathAndFilenameGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QString::localeAwareCompare (s1->url(), s2->url()) > 0; } //by file name static bool _filenameLessComparator(PlayListItem* s1,PlayListItem* s2) { QFileInfo i_s1(s1->url()); QFileInfo i_s2(s2->url()); return QString::localeAwareCompare (i_s1.baseName(), i_s2.baseName()) < 0; } static bool _filenameGreaterComparator(PlayListItem* s1,PlayListItem* s2) { QFileInfo i_s1(s1->url()); QFileInfo i_s2(s2->url()); return QString::localeAwareCompare (i_s1.baseName(), i_s2.baseName()) > 0; } //by date static bool _dateLessComparator(PlayListItem* s1,PlayListItem* s2) { return s1->value(Qmmp::YEAR).toInt() < s2->value(Qmmp::YEAR).toInt(); } static bool _dateGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return s1->value(Qmmp::YEAR).toInt() > s2->value(Qmmp::YEAR).toInt(); } //by track static bool _trackLessComparator(PlayListItem* s1,PlayListItem* s2) { return s1->value(Qmmp::TRACK).toInt() < s2->value(Qmmp::TRACK).toInt(); } static bool _trackGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return s1->value(Qmmp::TRACK).toInt() > s2->value(Qmmp::TRACK).toInt(); } //by file creation date static bool _fileCreationDateLessComparator(PlayListItem* s1,PlayListItem* s2) { return QFileInfo(s1->value(Qmmp::URL)).created() < QFileInfo(s2->value(Qmmp::URL)).created(); } static bool _fileCreationDateGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QFileInfo(s1->value(Qmmp::URL)).created() > QFileInfo(s2->value(Qmmp::URL)).created(); } //by file modification date static bool _fileModificationDateLessComparator(PlayListItem* s1,PlayListItem* s2) { return QFileInfo(s1->value(Qmmp::URL)).lastModified() < QFileInfo(s2->value(Qmmp::URL)).lastModified(); } static bool _fileModificationDateGreaterComparator(PlayListItem* s1,PlayListItem* s2) { return QFileInfo(s1->value(Qmmp::URL)).lastModified() > QFileInfo(s2->value(Qmmp::URL)).lastModified(); } // This is main sort method void PlayListModel::doSort(int sort_mode,QList& list_to_sort) { QList::iterator begin; QList::iterator end; begin = list_to_sort.begin(); end = list_to_sort.end(); bool(*compareLessFunc)(PlayListItem*,PlayListItem*) = 0; bool(*compareGreaterFunc)(PlayListItem*,PlayListItem*) = 0; switch (sort_mode) { case TITLE: compareLessFunc = _titleLessComparator; compareGreaterFunc = _titleGreaterComparator; break; case DISCNUMBER: compareLessFunc = _discnumberLessComparator; compareGreaterFunc = _discnumberGreaterComparator; break; case ALBUM: compareLessFunc = _albumLessComparator; compareGreaterFunc = _albumGreaterComparator; break; case ARTIST: compareLessFunc = _artistLessComparator; compareGreaterFunc = _artistGreaterComparator; break; case FILENAME: compareLessFunc = _filenameLessComparator; compareGreaterFunc = _filenameGreaterComparator; break; case PATH_AND_FILENAME: compareLessFunc = _pathAndFilenameLessComparator; compareGreaterFunc = _pathAndFilenameGreaterComparator; break; case DATE: compareLessFunc = _dateLessComparator; compareGreaterFunc = _dateGreaterComparator; break; //qWarning("TODO Sort by Date: %s\t%d",__FILE__,__LINE__); case TRACK: compareLessFunc = _trackLessComparator; compareGreaterFunc = _trackGreaterComparator; break; case FILE_CREATION_DATE: compareLessFunc = _fileCreationDateLessComparator; compareGreaterFunc = _fileCreationDateGreaterComparator; break; case FILE_MODIFICATION_DATE: compareLessFunc = _fileModificationDateLessComparator; compareGreaterFunc = _fileModificationDateGreaterComparator; break; default: compareLessFunc = _titleLessComparator; compareGreaterFunc = _titleGreaterComparator; } static bool sorted_asc = false; if (!sorted_asc) { qStableSort(begin,end,compareLessFunc); sorted_asc = true; } else { qStableSort(begin,end,compareGreaterFunc); sorted_asc = false; } m_current = m_items.indexOf(m_currentItem); } void PlayListModel::sortSelection(int mode) { QListselected_items = selectedItems(); QListselected_rows = selectedIndexes(); doSort(mode,selected_items); for (int i = 0;i < selected_rows.count();i++) m_items.replace(selected_rows[i],selected_items[i]); m_current = m_items.indexOf(m_currentItem); emit listChanged(); } void PlayListModel::sort(int mode) { doSort(mode,m_items); emit listChanged(); } ////=============== THE END OF SORT IMPLEMENTATION =======================//// void PlayListModel::prepareForShufflePlaying(bool val) { if (m_play_state) delete m_play_state; if (val) m_play_state = new ShufflePlayState(this); else m_play_state = new NormalPlayState(this); m_shuffle = val; } void PlayListModel::prepareForRepeatablePlaying(bool val) { m_is_repeatable_list = val; } void PlayListModel::doCurrentVisibleRequest() { emit currentChanged(); emit listChanged(); } void PlayListModel::loadPlaylist(const QString &f_name) { PlayListFormat* prs = PlayListParser::findByPath(f_name); if(!prs || !QFile::exists(f_name)) return; QFile file(f_name); if (!file.open(QIODevice::ReadOnly)) { qWarning("PlayListModel: %s", qPrintable(file.errorString())); return; } //clear(); QStringList list = prs->decode(QTextStream(&file).readAll()); if(list.isEmpty()) { qWarning("PlayListModel: error opening %s",qPrintable(f_name)); } for (int i = 0; i < list.size(); ++i) { if(list.at(i).contains("://")) continue; if (QFileInfo(list.at(i)).isRelative()) list[i].prepend(QFileInfo(f_name).canonicalPath () + "/"); list[i].replace("\\","/"); list[i].replace("//","/"); } m_loader->loadFiles(list); file.close(); } void PlayListModel::savePlaylist(const QString & f_name) { PlayListFormat* prs = PlayListParser::findByPath(f_name); if (prs) { QFile file(f_name); if (file.open(QIODevice::WriteOnly)) { QTextStream ts(&file); QList songs; foreach(PlayListItem* item, m_items) songs << item; ts << prs->encode(songs); file.close(); } else qWarning("Error opening %s",f_name.toLocal8Bit().data()); } } bool PlayListModel::isRepeatableList() const { return m_is_repeatable_list; } bool PlayListModel::isShuffle() const { return m_shuffle; } bool PlayListModel::isLoaderRunning() const { return m_loader->isRunning(); } void PlayListModel::preparePlayState() { m_play_state->prepare(); } void PlayListModel::removeInvalidItems() { foreach(PlayListItem *item, m_items) { bool ok = false; if(!item->url().contains("://")) ok = MetaDataManager::instance()->supports(item->url()); else ok = MetaDataManager::instance()->protocols().contains(item->url().section("://",0,0)); if(!ok) removeItem(item); } } void PlayListModel::removeDuplicates() { for(int i = 0; i < m_items.size(); ++i) { int j = m_items.size() - 1; while(j > i) { if(m_items.at(i)->url() == m_items.at(j)->url()) removeItem(m_items.at(j)); j--; } } } void PlayListModel::clearQueue() { m_queued_songs.clear(); m_stop_item = 0; emit listChanged(); } void PlayListModel::stopAfterSelected() { QList selected_items = selectedItems(); if(!m_queued_songs.isEmpty()) { m_stop_item = m_stop_item != m_queued_songs.last() ? m_queued_songs.last() : 0; } else if(selected_items.count() == 1) { m_stop_item = m_stop_item != selected_items.at(0) ? selected_items.at(0) : 0; } else if(selected_items.count() > 1) { addToQueue(); m_stop_item = m_queued_songs.last(); } else return; emit listChanged(); } qmmp-0.7.4/src/qmmpui/detailsdialog.h0000664000175000017500000000464712256224735016314 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DETAILSDIALOG_H #define DETAILSDIALOG_H #include #include #include #include class QTextCodec; class QAbstractButton; class PlayListItem; class MetaDataModel; namespace Ui { class DetailsDialog; } /** @brief The DetailsDialog class provides dialog to show/edit metadata. * @author Ilya Kotov */ class DetailsDialog : public QDialog { Q_OBJECT public: /*! * Constructor. * @param item Playlist item which should be used. * @param parent Parent widget. */ DetailsDialog(PlayListItem *item, QWidget *parent = 0); /*! * Destructor. */ ~DetailsDialog(); private slots: void on_buttonBox_clicked(QAbstractButton *button); void on_directoryButton_clicked(); private: Ui::DetailsDialog *m_ui; void printInfo(); QString m_path; QString formatRow(const QString key, const QString value); MetaDataModel *m_metaDataModel; PlayListItem *m_item; }; #endif qmmp-0.7.4/src/qmmpui/playlistmanager.h0000664000175000017500000002214512256224735016674 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTMANAGER_H #define PLAYLISTMANAGER_H #include #include "playlistmodel.h" class QTimer; /*! @brief The PlayListManager class is used to handle multiple playlists. * @author Ilya Kotov */ class PlayListManager : public QObject { Q_OBJECT public: /*! * Constructor. * @param parent Parent object. */ PlayListManager(QObject *parent); /*! * Destructor. */ ~PlayListManager(); /*! * Returns a pointer to the object's instance. */ static PlayListManager* instance(); /*! * Returns a list of all playlists. */ QList playLists() const; /*! * Returns a names of all playlists. */ QStringList playListNames() const; /*! * Returns selected playlist. */ PlayListModel *selectedPlayList() const; /*! * Returns active playlist. */ PlayListModel *currentPlayList() const; /*! * Returns selected playlist index. */ int selectedPlayListIndex() const; /*! * Returns active playlist index. */ int currentPlayListIndex() const; /*! * Returns a number of playlists. */ int count() const; /*! * Returns the index position of the playlist \b model. */ int indexOf(PlayListModel *model) const; /*! * Returns the playlist at index position \b i in the list. * \b i must be a valid index position in the list (i.e., 0 <= i < count()). */ PlayListModel *playListAt(int i) const; /*! * Returns state of "Repeat All" option. */ bool isRepeatableList() const; /*! * Returns state of "Shuffle" option. */ bool isShuffle() const; signals: /*! * Emitted when current playlist changes. * @param current Current playlist. * @param previous Previous playlist. */ void currentPlayListChanged (PlayListModel *current, PlayListModel *previous); /*! * Emitted when selected playlist changes. * @param selected Selected playlist. * @param previous Previous selected playlist. */ void selectedPlayListChanged (PlayListModel *selected, PlayListModel *previous); /*! * Emitted when the playlist with index \b index is added. */ void playListAdded(int index); /*! * Emitted when the playlist with index \b index is removed. */ void playListRemoved(int index); /*! * Emitted when playlist changes its position from \b i to \b j. */ void playListMoved(int i, int j); /*! * Emitted when the list of playlists is changed. */ void playListsChanged(); /*! * Emitted when state of the "Repeat All" option has changed. * @param state New state of the "Repeat All" option (\b true - enabled, \b false disabled) */ void repeatableListChanged(bool state); /*! * Emitted when state of the "Shuffle" option has changed. * @param state New state of the "Shuffle" option (\b true - enabled, \b false disabled) */ void shuffleChanged(bool state); public slots: /*! * Selects playlist \b model. */ void selectPlayList(PlayListModel *model); /*! * Selects playlist with index \b index. */ void selectPlayList(int index); /*! * Selects playlist with name \b name. */ void selectPlayList(const QString &name); /*! * Selects next playlist if possible. */ void selectNextPlayList(); /*! * Selects previous playlist if possible. */ void selectPreviousPlayList(); /*! * Sets current playlist to \b model. */ void activatePlayList(PlayListModel *model); /*! * Sets current playlist with index \b index. */ void activatePlayList(int index); /*! * Creates new playlist with the given name \b name. */ PlayListModel *createPlayList(const QString &name = QString()); /*! * Removes playlist \b model. */ void removePlayList(PlayListModel *model); /*! * Removes playlist with index \b index. */ void removePlayList(int index); /*! * Moves playlist with index \b i to index \b j. */ void move(int i, int j); /*! * Prepares all playlists for repeatable playing (loop mode). * @param r State of the repeatable mode (\b true - enabled, \b false - disabled) */ void setRepeatableList(bool r); /*! * Prepares all playlists for shuffle playing. * @param s State of the shuffle mode (\b true - enabled, \b false - disabled) */ void setShuffle(bool s); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->clear() */ void clear(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->clearSelection() */ void clearSelection(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->removeSelected() */ void removeSelected(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->removeUnselected() */ void removeUnselected(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->removeAt(i) */ void removeAt (int i); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->removeItem(item) */ void removeItem (PlayListItem *item); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->invertSelection() */ void invertSelection(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->selectAll() */ void selectAll(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->showDetails() */ void showDetails(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->add(paths) */ void add(const QStringList &paths); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->randomizeList() */ void randomizeList(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->reverseList() */ void reverseList(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->sortSelection(mode) */ void sortSelection(int mode); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->sort(mode) */ void sort(int mode); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->addToQueue() */ void addToQueue(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->clearInvalidItems() */ void removeInvalidItems(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->removeDuplicates() */ void removeDuplicates(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->clearQueue() */ void clearQueue(); /*! * This is a convenience function and is the same as calling \b selectedPlayList()->stopAfterSelected() */ void stopAfterSelected(); /*! * Read the relevant settings. */ void readSettings(); private slots: void writePlayLists(); private: void readPlayLists(); void setAutoSavePlayList(); static PlayListManager* m_instance; QList m_models; PlayListModel *m_current; PlayListModel *m_selected; bool m_repeatable, m_shuffle, m_autosave_playlist; QTimer *m_timer; }; #endif // PLAYLISTMANAGER_H qmmp-0.7.4/src/qmmpui/uifactory.h0000664000175000017500000000545512256224735015512 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef UIFACTORY_H #define UIFACTORY_H class QObject; class QTranslator; class QDialog; class QString; class QWidget; class Control; class General; /*! @brief Helper class to store user interface plugin properies. */ class UiProperties { public: /*! * Constructor */ UiProperties() { hasAbout = false; } QString name; /*!< File dialog plugin full name */ QString shortName; /*!< File dialog short name for internal usage */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ }; /*! @brief User interface plugin interface. * @author Ilya Kotov */ class UiFactory { public: /*! * Object destructor. */ virtual ~UiFactory() {} /*! * Returns user interface plugin properties. */ virtual const UiProperties properties() const = 0; /*! * Creates user interface instance. */ virtual QObject *create() = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return \b 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(UiFactory, "UiFactory/1.0") #endif qmmp-0.7.4/src/qmmpui/fileloader.cpp0000664000175000017500000001111712256224735016136 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "fileloader_p.h" #include "qmmpuisettings.h" #include "playlistitem.h" FileLoader::FileLoader(QObject *parent) : QThread(parent) { m_settings = QmmpUiSettings::instance(); m_finished = false; } FileLoader::~FileLoader() {} void FileLoader::addFile(const QString &path) { bool use_meta = m_settings->useMetadata(); QList playList = MetaDataManager::instance()->createPlayList(path, use_meta); foreach(FileInfo *info, playList) emit newPlayListItem(new PlayListItem(info)); } void FileLoader::addDirectory(const QString& s) { QDir dir(s); dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Name); QFileInfoList l = dir.entryInfoList(m_filters); foreach(QFileInfo info, l) { if(checkRestrictFilters(info) && checkExcludeFilters(info)) addFile(info.absoluteFilePath ()); if (m_finished) return; } dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); dir.setSorting(QDir::Name); l.clear(); l = dir.entryInfoList(); if (l.size() > 0) for (int i = 0; i < l.size(); ++i) { QFileInfo fileInfo = l.at(i); addDirectory(fileInfo.absoluteFilePath ()); if (m_finished) return; } } void FileLoader::run() { m_finished = false; while(!m_files.isEmpty() || !m_directories.isEmpty()) { if(!m_files.isEmpty()) { addFile(m_files.dequeue()); continue; } if(!m_directories.isEmpty()) { addDirectory(m_directories.dequeue()); continue; } } } void FileLoader::loadFile(const QString &path) { m_files.enqueue(path); MetaDataManager::instance()->prepareForAnotherThread(); m_filters = MetaDataManager::instance()->nameFilters(); start(QThread::IdlePriority); } void FileLoader::loadFiles(const QStringList &paths) { m_files << paths; MetaDataManager::instance()->prepareForAnotherThread(); m_filters = MetaDataManager::instance()->nameFilters(); start(QThread::IdlePriority); } void FileLoader::loadDirectory(const QString &path) { m_directories.enqueue(path); m_filters = MetaDataManager::instance()->nameFilters(); start(QThread::IdlePriority); } void FileLoader::finish() { m_finished = true; m_files.clear(); m_directories.clear(); wait(); } bool FileLoader::checkRestrictFilters(const QFileInfo &info) { if(m_settings->restrictFilters().isEmpty()) return true; foreach(QString filter, m_settings->restrictFilters()) { QRegExp regexp (filter, Qt::CaseInsensitive, QRegExp::Wildcard); if(regexp.exactMatch(info.absoluteFilePath())) return true; } return false; } bool FileLoader::checkExcludeFilters(const QFileInfo &info) { if(m_settings->excludeFilters().isEmpty()) return true; foreach(QString filter, m_settings->excludeFilters()) { QRegExp regexp (filter, Qt::CaseInsensitive, QRegExp::Wildcard); if(regexp.exactMatch(info.absoluteFilePath())) return false; } return true; } qmmp-0.7.4/src/qmmpui/fileloader_p.h0000664000175000017500000000605612256224735016130 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FILELOADER_H #define FILELOADER_H #include #include #include #include #include class PlayListItem; class QmmpUiSettings; /*! @internal * @brief File loader class. * * This class represents fileloader object that * processes file list in separate thread and emits * \b newPlayListItem(PlayListItem*) signal for every newly * created media file. * @author Ilya Kotov */ class FileLoader : public QThread { Q_OBJECT public: /*! * Constructs FileLoader object. * @param parent QObject parent */ FileLoader(QObject *parent = 0); /*! * Object destructor. */ ~FileLoader(); /*! * Removes files and directories from queue and waits until thread is finished */ void finish(); /*! * Sets file to load */ void loadFile(const QString &path); /*! * Sets files to load */ void loadFiles(const QStringList &paths); /*! * Sets directory to load */ void loadDirectory(const QString &path); signals: /*! * Emitted when new playlist item is available. * @param item Pointer of the new PlayListItem object. */ void newPlayListItem(PlayListItem *item); protected: virtual void run(); void addFile(const QString &path); void addDirectory(const QString &s); private: bool checkRestrictFilters(const QFileInfo &info); bool checkExcludeFilters(const QFileInfo &info); QQueue m_files; QQueue m_directories; QStringList m_filters; QmmpUiSettings *m_settings; bool m_finished; }; #endif qmmp-0.7.4/src/qmmpui/forms/0000775000175000017500000000000012256224735014451 5ustar useruserqmmp-0.7.4/src/qmmpui/forms/templateeditor.ui0000664000175000017500000000516012256224735020034 0ustar useruser TemplateEditor 0 0 372 249 Template Editor 6 6 6 0 0 Reset Insert Qt::Horizontal 124 17 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() TemplateEditor accept() 365 242 157 274 buttonBox rejected() TemplateEditor reject() 365 242 286 274 qmmp-0.7.4/src/qmmpui/forms/tageditor.ui0000664000175000017500000002450612256224735017001 0ustar useruser TagEditor 0 0 444 312 Tag Editor 3 3 3 0 0 Title: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 0 Artist: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 0 Album: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 Composer: false 0 0 Genre: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 0 Track: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true 0 0 ? 0 0 Year: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true 0 0 70 0 ? 2015 0 0 0 Disc number: false ? 0 0 Comment: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true 0 0 false <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Arial'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> Include selected tag in file useCheckBox clicked(bool) tagWidget setEnabled(bool) 56 296 8 277 qmmp-0.7.4/src/qmmpui/forms/detailsdialog.ui0000664000175000017500000000570712256224735017626 0ustar useruser DetailsDialog 0 0 485 390 Details 6 6 6 0 0 true Open the directory containing this file ... true 0 Summary true <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Arial'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> QDialogButtonBox::Close|QDialogButtonBox::Save qmmp-0.7.4/src/qmmpui/forms/addurldialog.ui0000664000175000017500000000375712256224735017457 0ustar useruser AddUrlDialog 0 0 379 58 Enter URL to add 5 true Qt::Horizontal 181 20 &Add &Cancel addButton clicked() AddUrlDialog accept() 248 51 184 72 cancelButton clicked() AddUrlDialog reject() 343 62 392 60 qmmp-0.7.4/src/qmmpui/forms/configdialog.ui0000664000175000017500000007403712256224735017450 0ustar useruser ConfigDialog 0 0 640 469 Qmmp Settings 6 6 6 Qt::Horizontal 0 0 QAbstractItemView::SelectRows 38 38 2 false 0 Playlist :/playlist.png:/playlist.png Plugins :/plugins.png:/plugins.png Advanced :/advanced.png:/advanced.png Connectivity :/network.png:/network.png Audio :/replaygain.png:/replaygain.png 0 0 QFrame::NoFrame QFrame::Raised 0 Metadata 9 6 Load metadata from files Convert underscores to blanks Convert %20 to blanks Title format: ... Directory Scanning Options Restrict files to: Exclude files: Miscellaneous Auto-save playlist when modified Qt::Vertical 20 54 9 5 0 0 6 0 0 Preferences 0 0 Information Qt::Horizontal 101 20 0 0 true QAbstractItemView::SelectRows true false 2 Description Filename Look and Feel Language: 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Playback Continue playback on startup Determine file type by content Add files from command line to this playlist: false Cover Image Retrieve Use separate image files true Include files: Exclude files: Recursive search depth: 6 Qt::Horizontal 40 20 URL Dialog Auto-paste URL from clipboard Qt::Vertical 20 40 9 5 0 0 Proxy false false Enable proxy usage Proxy host name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Proxy port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Use authentication with proxy Proxy user name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Proxy password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Qt::Vertical 20 40 Replay Gain Replay Gain mode: 0 0 Preamp: 0 0 -15.000000000000000 15.000000000000000 0.010000000000000 0 0 dB 0 0 Default gain: 0 0 -15.000000000000000 15.000000000000000 0.010000000000000 0 0 dB Qt::Horizontal 40 20 Use peak info to prevent clipping Audio Buffer size: 0 0 80 0 ms 500 6000 50 Qt::Horizontal 266 20 Use software volume control 16-bit output Qt::Vertical 20 132 QDialogButtonBox::Close enableProxyCheckBox toggled(bool) hostLineEdit setEnabled(bool) 348 38 348 38 enableProxyCheckBox toggled(bool) portLineEdit setEnabled(bool) 348 38 348 38 authProxyCheckBox toggled(bool) proxyUserLineEdit setEnabled(bool) 272 38 272 38 authProxyCheckBox toggled(bool) proxyPasswLineEdit setEnabled(bool) 272 38 272 37 buttonBox rejected() ConfigDialog reject() 657 448 225 421 buttonBox accepted() ConfigDialog accept() 657 448 141 414 defaultPlayListCheckBox toggled(bool) defaultPlayListLineEdit setEnabled(bool) 457 226 580 227 qmmp-0.7.4/src/qmmpui/forms/jumptotrackdialog.ui0000664000175000017500000000757112256224735020545 0ustar useruser JumpToTrackDialog 0 0 487 315 Jump To Track 6 6 6 6 0 Filter QAbstractItemView::NoEditTriggers true QAbstractItemView::SelectRows 0 0 Queue 0 0 Refresh 0 0 Jump To Qt::Horizontal QSizePolicy::MinimumExpanding 40 20 0 0 QDialogButtonBox::Close buttonBox rejected() JumpToTrackDialog close() 457 294 481 279 qmmp-0.7.4/src/qmmpui/forms/aboutdialog.ui0000664000175000017500000001050012256224735017276 0ustar useruser AboutDialog 0 0 523 532 About Qmmp 6 9 6 6 :/logo-qmmp.png Qt::AlignCenter 0 About true Authors true Translators true Thanks To true License Agreement true Qt::Horizontal QDialogButtonBox::Ok buttonBox accepted() AboutDialog accept() 248 254 157 274 buttonBox rejected() AboutDialog reject() 316 260 286 274 qmmp-0.7.4/src/qmmpui/qmmpuisettings.h0000664000175000017500000001452612256224735016575 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QMMPUISETTINGS_H #define QMMPUISETTINGS_H #include #include /*! @brief The QmmpUiSettings class provides access to global libqmmpui library settings. * @author Ilya Kotov */ class QmmpUiSettings : public QObject { Q_OBJECT public: /*! * Constructor. * @param parent Parent object. * This functions is for internal usage only, use QmmpSettings::instance() instead. */ explicit QmmpUiSettings(QObject *parent = 0); /*! * Destructor. */ virtual ~QmmpUiSettings(); /*! * Returns state of the "Convert underscores to blanks" option (\b true - enabled, \b false - disabled). */ bool convertUnderscore() const; /*! * Returns state of the "Convert %20 to blanks" option (\b true - enabled, \b false - disabled). */ bool convertTwenty() const; /*! * Returns the state of metadata usage (\b true - use, \b false - not use). */ bool useMetadata() const; /*! * Returns title format string. */ const QString format() const; /*! * Sets the "Convert underscores to blanks" option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ void setConvertUnderscore(bool enabled); /*! * Sets the "Convert %20 to blanks" option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ void setConvertTwenty(bool enabled); /*! * Sets short title template. * @param format title template. \sa MetaDataFormatter */ void setFormat(const QString &format); /*! * Sets metadata usage option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ void setUseMetadata(bool enabled); /*! * Returns \b true if option "Resume On Startup" is enabled, otherwise returns \b false */ bool resumeOnStartup() const; /*! * Sets the "Resume on startup" option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ void setResumeOnStartup(bool enabled); /*! * Sets the "Use clipboard in the URL dialog" option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ void setUseClipboard(bool enabled); /*! * Returns \b true if option "Use clipboard in the URL dialog" is enabled, otherwise returns \b false */ bool useClipboard() const; /*! * Returns a list of filters which should be used for directory scanning. */ QStringList restrictFilters() const; /*! * Disables all builtin directory scanning filters and sets them to \b filters (Example: *.mp3;*.ogg). */ void setRestrictFilters(const QString &filters); /*! * Returns a list of filters which should be excluded from incoming files while directory scanning. */ QStringList excludeFilters() const; /*! * Sets a list of filters which should be excluded from incoming files while directory scanning. * @param filters A set of filters separated by semicolon (Example: *.cue;*.ogg). */ void setExcludeFilters(const QString &filters); /*! * Returns \b true if defaut playlist is enabled, othewise returns \b false. * Default playlist receives files from command line. */ bool useDefaultPlayList() const; /*! * Returns default playlist name. */ QString defaultPlayListName() const; /*! * Sets default playlist options. * @param name Default playlist name. * @param enabled Default playlist state (\b true - enabled, \b false - disabled). */ void setDefaultPlayList(const QString &name, bool enabled = true); /*! * Enable/disable playlist auto-saving. * @param enabled New setting for the auto-save option (\b true to enable) */ void setAutoSavePlayList(bool enabled); /*! * Return the current setting for the playlist auto-save option. * @return \b true if the playlist should be saved automatically, \b false * otherwise. */ bool autoSavePlayList() const; /*! * Returns a pointer to the QmmpUiSettings instance. */ static QmmpUiSettings* instance(); signals: /*! * Emitted when the playlist settings change. */ void playListSettingsChanged(); public slots: /*! * Writes all unsaved settings to configuration file */ void sync(); private: static QmmpUiSettings* m_instance; //playlist bool m_convertUnderscore, m_convertTwenty; bool m_useMetadata; QString m_format; //general bool m_resume_on_startup; QStringList m_exclude_filters, m_restrict_filters; //default playlist bool m_use_default_pl; QString m_default_pl_name; //playlist auto-save option bool m_autosave_playlist; //url dialog bool m_use_clipboard; }; #endif // QMMPUISETTINGS_H qmmp-0.7.4/src/qmmpui/filedialog.h0000664000175000017500000002452612256224735015604 0ustar useruser/************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FILEDIALOG_H #define FILEDIALOG_H #include #include #include #include #include "filedialogfactory.h" /*! @brief The FileDialog class is the base interface class of the file dialogs. * @author Vladimir Kuznetsov */ class FileDialog : public QObject { Q_OBJECT public: /*! * Returns a list of registered file dialog factories. */ static QList *factories(); /*! * Selects current file dialog factory. */ static void setEnabled(FileDialogFactory *factory); /*! * Returns \b true if file dialog \b factory is used by default, otherwise returns \b false */ static bool isEnabled(FileDialogFactory *factory); /*! * Returns plugin file path. * @param factory File dialog plugin factory. */ static QString file(FileDialogFactory *factory); /*! * Enum of available file dialog modes */ enum Mode { AddFile = 0, /*!< Get existing file */ AddDir, /*!< Get existing directory */ AddFiles, /*!< Get existing files */ AddDirs, /*!< Get existing directories */ AddDirsFiles, /*!< Get existing files and directories */ SaveFile /*!< Get existing or non-existing file */ }; /*! * This is a static function that will open modal file dialog and * return an existing directory selected by the user. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. */ static QString getExistingDirectory(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString()); /*! * This is a static function that will open modal file dialog and * return an existing file selected by the user. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter */ static QString getOpenFileName(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0); /*! * This is a static function that will open modal file dialog and * return an existing file selected by the user. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter. */ static QStringList getOpenFileNames(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0); /*! * This is a static function that will open modal file dialog and * return a file name selected by the user. The file does not have to exist. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter. */ static QString getSaveFileName (QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0); /*! * Opens nonmodal file dialog. Selected file dialog should support nonmodal mode. * Otherwise this function creates modal dialog. * @param parent Parent widget. * @param mode File dialog mode. * @param dir Default directory. * @param receiver Receiver QObject. * @param member Receiver slot. * @param caption Dialog title. * @param filters Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * * Usage: FileDialog::popup(this, FileDialog::AddDirs, &m_lastDir, * m_playListModel, SLOT(addFileList(const QStringList&)), * tr("Choose a directory")); */ static void popup(QWidget *parent = 0, Mode mode = AddFiles, QString *dir = 0, QObject *receiver = 0, const char *member = 0, const QString &caption = QString(), const QString &filters = QString()); signals: /*! * Emitted when the add button has pressed. Subclass should emit this signal. */ void filesAdded(const QStringList&); protected: /*! * Object constructor. */ FileDialog(); /*! * This is a function that will open modal file dialog and * return an existing directory selected by the user. * * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. */ virtual QString existingDirectory(QWidget *parent, const QString &caption, const QString &dir); /*! * This is a function that will open modal file dialog and * return an existing file selected by the user. * Subclass should reimplement this function. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter */ virtual QString openFileName( QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter); /*! * This is a function that will open modal file dialog and * return an existing files selected by the user. * Subclass should reimplement this function. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter */ virtual QStringList openFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter); /*! * This is a function that will open modal file dialog and * return a file name selected by the user. The file does not have to exist. * Subclass should reimplement this function. * @param parent Parent widget. * @param caption Dialog title. * @param dir Default directory. * @param filter Filer used by file dialog * (example: "Audio (*.mp3 *.ogg);;Text files (*.txt);;XML files (*.xml)"). * @param selectedFilter Default selected filter. */ virtual QString saveFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter); /*! * Object destructor */ virtual ~FileDialog(); /*! * Opens nonmodal file dialog. Selected file dialog should support nonmodal mode. * Otherwise this function does nothing. * Nonmodal dialog subclass should reimplement this function. * @param dir Default directory. * @param mode File dialog mode. * @param caption Dialog title. * @param mask Filer used by file dialog */ virtual void raise(const QString &dir = QString(), Mode mode = AddFiles, const QString &caption = QString(), const QStringList &mask = QStringList()); private slots: void updateLastDir(const QStringList&); private: static void checkFactories(); static FileDialog* instance(); static FileDialog* createDefault(); static QList *m_factories; static FileDialogFactory *m_currentFactory; static FileDialog* m_instance; static QHash *m_files; void init(QObject* receiver, const char* member, QString *dir); bool m_initialized; QString *m_lastDir; }; #endif qmmp-0.7.4/src/qmmpui/mediaplayer.cpp0000664000175000017500000001514312256224735016327 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "playlistitem.h" #include "qmmpuisettings.h" #include "mediaplayer.h" MediaPlayer *MediaPlayer::m_instance = 0; MediaPlayer::MediaPlayer(QObject *parent) : QObject(parent) { if(m_instance) qFatal("StateHandler: only one instance is allowed"); m_instance = this; m_pl_manager = 0; m_core = 0; m_skips = 0; m_repeat = false; m_noPlaylistAdvance = false; QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/libqmmpui_") + locale); qApp->installTranslator(translator); m_core = new SoundCore(this); m_settings = new QmmpUiSettings(this); m_pl_manager = new PlayListManager(this); connect(m_core, SIGNAL(nextTrackRequest()), SLOT(updateNextUrl())); connect(m_core, SIGNAL(finished()), SLOT(playNext())); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(processState(Qmmp::State))); connect(m_core, SIGNAL(metaDataChanged()),SLOT(updateMetaData())); } MediaPlayer::~MediaPlayer() { m_instance = 0; } MediaPlayer* MediaPlayer::instance() { return m_instance; } PlayListManager *MediaPlayer::playListManager() { return m_pl_manager; } bool MediaPlayer::isRepeatable() const { return m_repeat; } bool MediaPlayer::isNoPlaylistAdvance() const { return m_noPlaylistAdvance; } void MediaPlayer::play(qint64 offset) { m_pl_manager->currentPlayList()->doCurrentVisibleRequest(); if (m_core->state() == Qmmp::Paused) { m_core->pause(); return; } if (m_pl_manager->currentPlayList()->count() == 0) return; QString s = m_pl_manager->currentPlayList()->currentItem()->url(); if (s.isEmpty()) { m_nextUrl.clear(); return; } if(m_nextUrl == s) { m_nextUrl.clear(); return; } m_core->play(s, false, offset); } void MediaPlayer::stop() { m_core->stop(); m_nextUrl.clear(); m_skips = 0; } void MediaPlayer::next() { bool playNext = m_core->state() != Qmmp::Stopped; stop(); if (m_pl_manager->currentPlayList()->next() && playNext) play(); } void MediaPlayer::previous() { bool playNext = m_core->state() != Qmmp::Stopped; stop(); if (m_pl_manager->currentPlayList()->previous() && playNext) play(); } void MediaPlayer::setRepeatable(bool r) { if (r != m_repeat) { if(r) { disconnect(m_core, SIGNAL(finished()), this, SLOT(playNext())); connect(m_core, SIGNAL(finished()), SLOT(play())); } else { disconnect(m_core, SIGNAL(finished()), this, SLOT(play())); connect(m_core, SIGNAL(finished()), SLOT(playNext())); } m_repeat = r; emit repeatableChanged(r); } } void MediaPlayer::playNext() { if(m_noPlaylistAdvance) { stop(); return; } if (!m_pl_manager->currentPlayList()->next()) { stop(); return; } play(); } void MediaPlayer::setNoPlaylistAdvance(bool enabled) { if (enabled != m_noPlaylistAdvance) { m_noPlaylistAdvance = enabled; emit noPlaylistAdvanceChanged(enabled); } } void MediaPlayer::updateNextUrl() { m_nextUrl.clear(); PlayListItem *item = 0; if(isRepeatable()) item = m_pl_manager->currentPlayList()->currentItem(); else if(!m_noPlaylistAdvance) item = m_pl_manager->currentPlayList()->nextItem(); if(item) { bool ok = m_core->play(item->url(), true); if(ok) { m_nextUrl = item->url(); qDebug("MediaPlayer: next track state: received"); } else qDebug("MediaPlayer: next track state: error"); } else qDebug("MediaPlayer: next track state: unknown"); } void MediaPlayer::processState(Qmmp::State state) { switch ((int) state) { case Qmmp::NormalError: m_core->stop(); m_nextUrl.clear(); if (m_skips <= m_pl_manager->currentPlayList()->count()) { m_skips++; playNext(); } break; case Qmmp::FatalError: m_core->stop(); m_nextUrl.clear(); break; case Qmmp::Playing: m_skips = 0; default: ; } } void MediaPlayer::updateMetaData() { qDebug("===== metadata ======"); qDebug("ARTIST = %s", qPrintable(m_core->metaData(Qmmp::ARTIST))); qDebug("TITLE = %s", qPrintable(m_core->metaData(Qmmp::TITLE))); qDebug("ALBUM = %s", qPrintable(m_core->metaData(Qmmp::ALBUM))); qDebug("COMMENT = %s", qPrintable(m_core->metaData(Qmmp::COMMENT))); qDebug("GENRE = %s", qPrintable(m_core->metaData(Qmmp::GENRE))); qDebug("YEAR = %s", qPrintable(m_core->metaData(Qmmp::YEAR))); qDebug("TRACK = %s", qPrintable(m_core->metaData(Qmmp::TRACK))); qDebug("== end of metadata =="); PlayListModel *pl = m_pl_manager->currentPlayList(); if (pl->currentItem() && pl->currentItem()->url() == m_core->metaData().value(Qmmp::URL)) { pl->currentItem()->updateMetaData(m_core->metaData()); pl->doCurrentVisibleRequest(); } } qmmp-0.7.4/src/qmmpui/uihelper.cpp0000664000175000017500000001737012256224735015654 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include "general.h" #include "generalfactory.h" #include "jumptotrackdialog_p.h" #include "aboutdialog_p.h" #include "addurldialog_p.h" #include "uihelper.h" UiHelper *UiHelper::m_instance = 0; UiHelper::UiHelper(QObject *parent) : QObject(parent) { m_instance = this; m_toolsMenu = 0; m_playlistMenu = 0; m_jumpDialog = 0; General::create(parent); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_lastDir = settings.value("General/last_dir", QDir::homePath()).toString(); //last directory } UiHelper::~UiHelper() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("General/last_dir",m_lastDir); } bool UiHelper::visibilityControl() { GeneralFactory* factory; foreach(factory, *General::factories()) { if (General::isEnabled(factory) && factory->properties().visibilityControl) return true; } return false; } void UiHelper::addAction(QAction *action, MenuType type) { connect(action, SIGNAL(destroyed (QObject *)), SLOT(removeAction(QObject*))); switch ((int) type) { case TOOLS_MENU: if (!m_toolsActions.contains(action)) m_toolsActions.append(action); if (m_toolsMenu && !m_toolsMenu->actions ().contains(action)) m_toolsMenu->addAction(action); break; case PLAYLIST_MENU: if (!m_playlistActions.contains(action)) m_playlistActions.append(action); if (m_playlistMenu && !m_playlistMenu->actions ().contains(action)) m_playlistMenu->addAction(action); } } void UiHelper::removeAction(QAction *action) { m_toolsActions.removeAll(action); if (m_toolsMenu) m_toolsMenu->removeAction(action); m_playlistActions.removeAll(action); if (m_playlistMenu) m_playlistMenu->removeAction(action); } QList UiHelper::actions(MenuType type) { if (type == TOOLS_MENU) return m_toolsActions; else return m_playlistActions; } QMenu *UiHelper::createMenu(MenuType type, const QString &title, QWidget *parent) { switch ((int) type) { case TOOLS_MENU: if (!m_toolsMenu) { m_toolsMenu = new QMenu(title, parent); m_toolsMenu->addActions(m_toolsActions); } else m_toolsMenu->setTitle(title); return m_toolsMenu; case PLAYLIST_MENU: if (!m_playlistMenu) { m_playlistMenu = new QMenu(title, parent); m_playlistMenu->addActions(m_playlistActions); } else m_playlistMenu->setTitle(title); return m_playlistMenu; } return 0; } void UiHelper::addFile(QWidget *parent, PlayListModel *model) { QStringList filters; filters << tr("All Supported Bitstreams")+" (" + MetaDataManager::instance()->nameFilters().join (" ") +")"; filters << MetaDataManager::instance()->filters(); FileDialog::popup(parent, FileDialog::AddDirsFiles, &m_lastDir, model, SLOT(add(const QStringList&)), tr("Select one or more files to open"), filters.join(";;")); } void UiHelper::addDirectory(QWidget *parent, PlayListModel *model) { FileDialog::popup(parent, FileDialog::AddDirs, &m_lastDir, model, SLOT(add(const QStringList&)), tr("Choose a directory")); } void UiHelper::addUrl(QWidget *parent, PlayListModel *model) { AddUrlDialog::popup(parent, model); } void UiHelper::loadPlayList(QWidget *parent, PlayListModel *model) { if(PlayListParser::nameFilters().isEmpty()) { qWarning("UiHelper: There is no registered playlist parsers"); return; } QString mask = tr("Playlist Files") + " (" + PlayListParser::nameFilters().join(" ") + ")"; //TODO use nonmodal dialog and multiplier playlists QString f_name = FileDialog::getOpenFileName(parent ,tr("Open Playlist"), m_lastDir, mask); if (!f_name.isEmpty()) { model->clear(); model->loadPlaylist(f_name); model->setName(QFileInfo(f_name).baseName()); m_lastDir = QFileInfo(f_name).absoluteDir().path(); } } void UiHelper::savePlayList(QWidget *parent, PlayListModel *model) { if(PlayListParser::nameFilters().isEmpty()) { qWarning("UiHelper: There is no registered playlist parsers"); return; } QString ext = PlayListParser::nameFilters().at(0); ext.replace("*.", "."); //extract extension from name filter QString mask = tr("Playlist Files") + " (" + PlayListParser::nameFilters().join(" ") + ")"; QString f_name = FileDialog::getSaveFileName(parent, tr("Save Playlist"),m_lastDir + "/" + model->name() + ext,mask); if (!f_name.isEmpty()) { model->savePlaylist(f_name); m_lastDir = QFileInfo(f_name).absoluteDir().path(); } } void UiHelper::jumpToTrack(QWidget *parent, PlayListModel *model) { if(!m_jumpDialog) { m_jumpDialog = new JumpToTrackDialog(model, parent); } if(m_jumpDialog->isHidden()) { m_jumpDialog->show(); m_jumpDialog->refresh(); } m_jumpDialog->raise(); } void UiHelper::about(QWidget *parent) { AboutDialog *dialog = new AboutDialog(parent); dialog->exec(); dialog->deleteLater(); } void UiHelper::toggleVisibility() { emit toggleVisibilityCalled(); } void UiHelper::exit() { #if QT_VERSION < 0x040700 bool closed = true; QWidget *w; while ((w = qApp->activeModalWidget()) && closed) { if (!w->isVisible()) break; closed = w->close(); } QWidgetList list = qApp->topLevelWidgets(); while (closed && !list.isEmpty()) { w = list.takeLast(); if (w->isVisible() && w->windowType() != Qt::Desktop) { closed = w->close(); list = qApp->topLevelWidgets(); list.removeOne(w); } } #else qApp->closeAllWindows(); #endif qApp->quit(); } UiHelper* UiHelper::instance() { return m_instance; } void UiHelper::removeAction(QObject *action) { removeAction((QAction *) action); } qmmp-0.7.4/src/qmmpui/playstate.cpp0000664000175000017500000001134112256224735016035 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "playstate_p.h" ShufflePlayState::ShufflePlayState(PlayListModel * model) : PlayState(model) { prepare(); } bool ShufflePlayState::next() { int itm_count = m_model->items().count(); if (itm_count > 0) { if (m_shuffled_current >= m_shuffled_indexes.count() - 1) { if (!m_model->isRepeatableList()) return false; else prepare(); } else m_shuffled_current = (m_shuffled_current + 1) % m_shuffled_indexes.count(); return m_model->setCurrent(m_shuffled_indexes.at(m_shuffled_current)); } return false; } int ShufflePlayState::nextIndex() { int itm_count = m_model->items().count(); if(!itm_count) return -1; if (m_shuffled_current >= m_shuffled_indexes.count() - 1) { if (!m_model->isRepeatableList()) return -1; else prepare(); } return m_shuffled_indexes.at((m_shuffled_current + 1) % m_shuffled_indexes.count()); } bool ShufflePlayState::previous() { int itm_count = m_model->items().count(); if (itm_count > 0) { if (m_shuffled_current <= 0) { if (!m_model->isRepeatableList()) return false; else { prepare(); m_shuffled_current = m_shuffled_indexes.count() - 1; } } if (itm_count > 1) m_shuffled_current --; m_model->setCurrent(m_shuffled_indexes.at(m_shuffled_current)); return true; } return false; } void ShufflePlayState::prepare() { resetState(); for(int i = 0;i < m_model->items().count();i++) { if (i != m_model->currentIndex()) m_shuffled_indexes << i; } for (int i = 0; i < m_shuffled_indexes.count(); i++) m_shuffled_indexes.swap(i, qrand()%m_shuffled_indexes.size()); m_shuffled_indexes.prepend(m_model->currentIndex()); } void ShufflePlayState::resetState() { m_shuffled_indexes.clear(); m_shuffled_current = 0; } NormalPlayState::NormalPlayState(PlayListModel * model) : PlayState(model) {} bool NormalPlayState::next() { int itm_count = m_model->items().count(); if (itm_count > 0) { if ( m_model->currentIndex() == itm_count - 1) { if (m_model->isRepeatableList()) return m_model->setCurrent(0); else return false; } return m_model->setCurrent(m_model->currentIndex() + 1); } else return false; } bool NormalPlayState::previous() { int itm_count = m_model->items().count(); if (itm_count > 0) { if ( m_model->currentIndex() < 1 && !m_model->isRepeatableList()) return false; else if (m_model->setCurrent(m_model->currentIndex() - 1)) return true; else if (m_model->isRepeatableList()) return m_model->setCurrent(m_model->items().count() - 1); } return false; } int NormalPlayState::nextIndex() { int itm_count = m_model->items().count(); if(!itm_count) return -1; if (m_model->currentIndex() == itm_count - 1) { if (m_model->isRepeatableList()) return 0; else return -1; } return m_model->currentIndex() + 1; } qmmp-0.7.4/src/qmmpui/playstate_p.h0000664000175000017500000000642712256224735016032 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _PLAYSTATE_H #define _PLAYSTATE_H #include "playlistmodel.h" /*! @internal * @brief Abstract class that represents data model playing states. * @author Vladimir Kuznetsov */ class PlayState { public: /*! Makes single step forward through songs list. * If the step has done returns \b true, otherwise returns \b false */ virtual bool next() = 0; /*! Makes single step back through songs list. * If the step has done returns \b true, otherwise returns \b false */ virtual bool previous() = 0; /*! * Returns next item index. */ virtual int nextIndex() = 0; /*! * Service method, resets state to it's defaults. */ virtual void resetState() { ; } /*! * Service method, can be used for state initializing. */ virtual void prepare() { ; } virtual ~PlayState() { ; } PlayState(PlayListModel* model) : m_model(model) { ; } protected: /// Data model PlayListModel* m_model; }; /*! @internal * @brief Represents normal playing state. * @author Vladimir Kuznetsov */ class NormalPlayState : public PlayState { public: virtual bool next(); virtual bool previous(); virtual int nextIndex(); NormalPlayState(PlayListModel* model); }; /*! @internal * @brief Represents shuffle playing state. * @author Vladimir Kuznetsov */ class ShufflePlayState : public PlayState { public: virtual bool next(); virtual bool previous(); virtual int nextIndex(); virtual void prepare(); ShufflePlayState(PlayListModel* model); virtual void resetState(); private: /// Current shuffled index. int m_shuffled_current; /// List of indexes used for shuffled playing. QList m_shuffled_indexes; }; #endif qmmp-0.7.4/src/qmmpui/playlistitem.h0000664000175000017500000001036412256224735016220 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTITEM_H #define PLAYLISTITEM_H #include #include #include /** @brief The PlayListItem class provides an item for use with the PlayListModel class. * @author Ilya Kotov */ class PlayListItem : public QMap { public: /*! * Current state of playlist item. * FREE - instance is free and may be deleted * EDITING - instance is currently busy in some kind of operation(tags editing etc.) * and can't be deleted at the moment. Set flag SCHEDULED_FOR_DELETION for it * instead of delete operator call. */ enum FLAGS { FREE = 0, /*!< instance is free and may be deleted */ EDITING, /*!< instance is currently busy */ SCHEDULED_FOR_DELETION /*!< instance is sheduled for deletion */ }; /*! * Constructs an empty plalist item. */ PlayListItem(); /*! * Constructs a new PlayListItem that is a copy of the given \b item */ PlayListItem(const PlayListItem &item); /*! * Constructs plalist item with given metadata. * @param info Media file information. */ PlayListItem(FileInfo *info); /*! * Object destructor. */ ~PlayListItem(); /*! * Sets item selection flag to \b select * @param select State of selection (\b true select, \b false unselect) */ void setSelected(bool select); /*! * Return \b true if item is selected, otherwise returns \b false. */ bool isSelected() const; /*! * It is used by PlayListModel class. */ void setCurrent(bool yes); /*! * Returns \b true if the item is the current item; otherwise returns returns \b false. */ bool isCurrent() const; /*! * Returns current state of the playlist item. */ FLAGS flag() const; /*! * Sets state of the playlist item. */ void setFlag(FLAGS); /*! * Returns item short title. */ const QString text(); /*! * Direct access to the item short title. * @param title New short title. */ void setText(const QString &title); /*! * Returns song length in seconds. */ qint64 length() const; /*! * Sets length in seconds. */ void setLength(qint64 length); /*! * Returns song url */ const QString url() const; /*! * Updates current metadata. * @param metaData Map with metadata values. */ void updateMetaData(const QMap &metaData); /*! * Gets new metadata from file (works for local files only). */ void updateTags(); private: void readMetadata(); QString m_title; FileInfo *m_info; bool m_selected; bool m_current; FLAGS m_flag; qint64 m_length; }; #endif qmmp-0.7.4/src/qmmpui/qmmpuisettings.cpp0000664000175000017500000001352712256224735017130 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "playlistmanager.h" #include "qmmpuisettings.h" QmmpUiSettings *QmmpUiSettings::m_instance = 0; QmmpUiSettings::QmmpUiSettings(QObject *parent) : QObject(parent) { m_instance = this; QSettings s (Qmmp::configFile(), QSettings::IniFormat); m_format = s.value("PlayList/title_format", "%p%if(%p&%t, - ,)%t").toString(); m_convertUnderscore = s.value ("PlayList/convert_underscore", true).toBool(); m_convertTwenty = s.value ("PlayList/convert_twenty", true).toBool(); m_useMetadata = s.value ("PlayList/load_metadata", true).toBool(); m_autosave_playlist = s.value("PlayList/autosave", true).toBool(); m_resume_on_startup = s.value("General/resume_on_startup", false).toBool(); m_restrict_filters = s.value("General/restrict_filters").toStringList(); m_exclude_filters = s.value("General/exclude_filters", QStringList() << "*.cue").toStringList(); m_use_default_pl = s.value("General/use_default_pl", false).toBool(); m_default_pl_name = s.value("General/default_pl_name", tr("Playlist")).toString(); m_use_clipboard = s.value("URLDialog/use_clipboard", false).toBool(); } QmmpUiSettings::~QmmpUiSettings() { m_instance = 0; sync(); } const QString QmmpUiSettings::format() const { return m_format; } bool QmmpUiSettings::convertUnderscore() const { return m_convertUnderscore; } bool QmmpUiSettings::convertTwenty() const { return m_convertTwenty; } bool QmmpUiSettings::useMetadata() const { return m_useMetadata; } void QmmpUiSettings::setConvertUnderscore(bool yes) { m_convertUnderscore = yes; } void QmmpUiSettings::setConvertTwenty(bool yes) { m_convertTwenty = yes; } void QmmpUiSettings::setFormat(const QString &format) { if(format != m_format) { m_format = format; //emit settingsChanged(); foreach(PlayListModel *model, PlayListManager::instance()->playLists()) { foreach(PlayListItem *item, model->items()) item->setText(QString()); model->doCurrentVisibleRequest(); } } } void QmmpUiSettings::setUseMetadata(bool yes) { m_useMetadata = yes; } bool QmmpUiSettings::resumeOnStartup() const { return m_resume_on_startup; } void QmmpUiSettings::setResumeOnStartup(bool enabled) { m_resume_on_startup = enabled; } void QmmpUiSettings::setUseClipboard(bool enabled) { m_use_clipboard = enabled; } bool QmmpUiSettings::useClipboard() const { return m_use_clipboard; } void QmmpUiSettings::sync() { QSettings s(Qmmp::configFile(), QSettings::IniFormat); s.setValue("PlayList/title_format", m_format); s.setValue("PlayList/convert_underscore", m_convertUnderscore); s.setValue("PlayList/convert_twenty", m_convertTwenty); s.setValue("PlayList/load_metadata", m_useMetadata); s.setValue("PlayList/autosave", m_autosave_playlist); s.setValue("General/resume_on_startup", m_resume_on_startup); s.setValue("General/restrict_filters", m_restrict_filters); s.setValue("General/exclude_filters", m_exclude_filters); s.setValue("General/use_default_pl", m_use_default_pl); s.setValue("General/default_pl_name", m_default_pl_name); s.setValue("URLDialog/use_clipboard", m_use_clipboard); } QStringList QmmpUiSettings::restrictFilters() const { return m_restrict_filters; } void QmmpUiSettings::setRestrictFilters(const QString &filters) { m_restrict_filters = filters.trimmed().split(";", QString::SkipEmptyParts); } QStringList QmmpUiSettings::excludeFilters() const { return m_exclude_filters; } void QmmpUiSettings::setExcludeFilters(const QString &filters) { m_exclude_filters = filters.trimmed().split(";", QString::SkipEmptyParts); } bool QmmpUiSettings::useDefaultPlayList() const { return m_use_default_pl; } QString QmmpUiSettings::defaultPlayListName() const { return m_default_pl_name; } QmmpUiSettings * QmmpUiSettings::instance() { if(!m_instance) return new QmmpUiSettings(qApp); return m_instance; } void QmmpUiSettings::setDefaultPlayList(const QString &name, bool enabled) { m_use_default_pl = enabled; m_default_pl_name = name; } void QmmpUiSettings::setAutoSavePlayList(bool enabled) { if (autoSavePlayList() != enabled) { m_autosave_playlist = enabled; emit playListSettingsChanged(); } } bool QmmpUiSettings::autoSavePlayList() const { return m_autosave_playlist; } qmmp-0.7.4/src/qmmpui/metadataformatter.h0000664000175000017500000000523212256224735017202 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef METADATAFORMATTER_H #define METADATAFORMATTER_H #include #include #include #include /*! @brief The MetaDataFormatter formats metadata using templates. * @author Ilya Kotov */ class MetaDataFormatter { public: /*! * Constructor. * @param format Metadata template. * Syntax: * %p - artist, * %a - album, * %t - title, * %n - track number, * %NN - 2-digit track number, * %g - genre, * %c - comment, * %C - composer, * %D - disc number, * %f - file name, * %F - full path, * %y - year, * %l - duration, * %if(A,B,C) or %if(A&B&C,D,E) - condition. */ MetaDataFormatter(const QString &format); /*! * Converts metadata of item \b item to one string using template. */ QString parse(PlayListItem *item); /*! * Converts metadata to one string using template. * @param metaData Metadata array. * @param length Length in seconds. */ QString parse(const QMap metaData, qint64 length = 0); private: QString m_format; QString processIfKeyWord(QString title); }; #endif // METADATAFORMATTER_H qmmp-0.7.4/src/qmmpui/CMakeLists.txt0000664000175000017500000000662412256224735016073 0ustar useruserproject(libqmmpui) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 OLD) cmake_policy(SET CMP0005 OLD) endif(COMMAND cmake_policy) SET(QT_USE_QTNETWORK TRUE) INCLUDE(FindQt4) include(${QT_USE_FILE}) # qt lib ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../) link_directories(${CMAKE_INSTALL_PREFIX}/${LIB_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../qmmp) SET(libqmmpui_SRCS general.cpp uihelper.cpp playlistparser.cpp commandlinemanager.cpp filedialog.cpp qtfiledialog.cpp fileloader.cpp playstate.cpp playlistmodel.cpp playlistitem.cpp mediaplayer.cpp detailsdialog.cpp tageditor.cpp playlistmanager.cpp metadataformatter.cpp templateeditor.cpp uiloader.cpp jumptotrackdialog.cpp configdialog.cpp pluginitem.cpp aboutdialog.cpp qmmpuisettings.cpp radioitemdelegate.cpp playlistdownloader.cpp addurldialog.cpp ) SET(libqmmpui_HDRS generalfactory.h playlistformat.h commandlinemanager.h commandlineoption.h filedialogfactory.h playstate_p.h playlistitem.h metadataformatter.h uiloader.h uifactory.h pluginitem_p.h general.h playlistparser.h ) SET(libqmmpui_MOC_HDRS uihelper.h filedialog.h qtfiledialog_p.h fileloader_p.h playlistmodel.h mediaplayer.h detailsdialog.h tageditor_p.h playlistmanager.h templateeditor.h jumptotrackdialog_p.h configdialog.h aboutdialog_p.h qmmpuisettings.h radioitemdelegate_p.h playlistdownloader.h addurldialog_p.h ) SET(libqmmpui_DEVEL_HDRS commandlinemanager.h commandlineoption.h configdialog.h detailsdialog.h filedialogfactory.h filedialog.h generalfactory.h general.h mediaplayer.h metadataformatter.h playlistdownloader.h playlistformat.h playlistitem.h playlistmanager.h playlistmodel.h playlistparser.h qmmpuisettings.h templateeditor.h uifactory.h uihelper.h uiloader.h ) SET(libqmmpui_UIS forms/detailsdialog.ui forms/tageditor.ui forms/templateeditor.ui forms/jumptotrackdialog.ui forms/configdialog.ui forms/aboutdialog.ui forms/addurldialog.ui ) QT4_WRAP_UI(libqmmpui_UIS_H ${libqmmpui_UIS}) QT4_ADD_RESOURCES(libqmmpui_RCC_SRCS translations/libqmmpui_locales.qrc txt/txt.qrc images/qmmpui_images.qrc) QT4_WRAP_CPP(libqmmpui_MOC_SRCS ${libqmmpui_MOC_HDRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(qmmpui SHARED ${libqmmpui_SRCS} ${libqmmpui_MOC_SRCS} ${libqmmpui_RCC_SRCS} ${libqmmpui_UIS_H} ${libqmmpui_HDRS}) target_link_libraries(qmmpui ${QT_LIBRARIES} -lqmmp) add_dependencies(qmmpui libqmmp) SET_TARGET_PROPERTIES(qmmpui PROPERTIES VERSION ${QMMP_VERSION} SOVERSION ${QMMP_SOVERSION}) install(TARGETS qmmpui LIBRARY DESTINATION ${LIB_DIR} RUNTIME DESTINATION bin ARCHIVE DESTINATION ${LIB_DIR}) install(FILES ${libqmmpui_DEVEL_HDRS} DESTINATION include/qmmpui) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmmpui.pc.in ${CMAKE_CURRENT_BINARY_DIR}/qmmpui.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmmpui.pc DESTINATION ${LIB_DIR}/pkgconfig) qmmp-0.7.4/src/qmmpui/playlistmodel.h0000664000175000017500000003227612256224735016370 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTMODEL_H #define PLAYLISTMODEL_H #include #include #include #include #include #include #include #include "playlistitem.h" class FileLoader; class PlayListItem; class PlayState; class PlayListFormat; class PlayListModel; /*! @brief Helper class that keeps track of a view's selected items. * * @author Vladimir Kuznetsov */ struct SimpleSelection { /*! * Constructs an empty selection model. */ SimpleSelection() { ; } /*! * Returns \p true if this selection is valid; otherwise returns returns \p false. */ inline bool isValid()const { return (m_bottom != -1) && (m_anchor != -1) && (m_top != -1); } /*! * Prints object state. */ inline void dump()const { qWarning("top: %d\tbotom: %d\tanchor: %d", m_top, m_bottom, m_anchor); } /*! * Returns number of selected items. */ inline int count()const { return m_bottom - m_top + 1; } int m_bottom; /*!< Bottom of the selection */ int m_top; /*!< Top of the selection */ int m_anchor; /*!< Main index of the selection */ QList m_selected_indexes; /*!< Selected items numbers */ }; /*! @internal * @brief Helper class used for tags update after details dialog closing. * * @author Vladimir Kuznetsov */ class TagUpdater : public QObject { Q_OBJECT QObject* m_observable; PlayListItem* m_item; public: TagUpdater(QObject* o, PlayListItem* item); protected slots: void updateTag(); }; /*! @brief The PlayListModel class provides a data model for the playlist. * * @author Vladimir Kuznetsov * @author Ilya Kotov */ class PlayListModel : public QObject { Q_OBJECT public: /*! * Constructs a playlist model. * @param name Playlist name. * @param parent QObject parent */ PlayListModel(const QString &name, QObject *parent = 0); /*! * Object destructor. */ ~PlayListModel(); /*! * Returns playlist name. */ QString name() const; /*! * Sets the name of the playlist to \b name. */ void setName(const QString &name); /*! * Returns number of items. */ int count(); /*! * Returns the current item. */ PlayListItem* currentItem(); /*! * Returns the next playing item or 0 if next item is unknown. */ PlayListItem* nextItem(); /*! * Returns the row of the \b item */ int indexOf(PlayListItem* item) const; /*! * Returns the item with the index \b index or 0 if item doesn't exist. */ PlayListItem* item(int index) const; /*! * Returns index of the current item. */ int currentIndex(); /*! * Sets current index. * Returns \b false if item with this index doesn't exist, otherwise returns \b true * @param index Number of item. */ bool setCurrent (int index); /*! * Sets current item to \b item. * Returns \b true if success, otherwise returns \b false */ bool setCurrent(PlayListItem *item); /*! * Returns \b true if item with \b index is selected, otherwise returns \b false */ bool isSelected(int index); /*! * Sets the selected state of the item to \b select * @param index Number of item. * @param selected Selection state (\b true - select, \b false - unselect) */ void setSelected(int index, bool selected = true); /*! * Advances to the next item. Returns \b false if next iten doesn't exist, * otherwise returns \b true */ bool next(); /*! * Goes back to the previous item. Returns \b false if previous iten doesn't exist, * otherwise returns \b true */ bool previous(); /*! * Returns a list of the formated titles. * @param first First item. * @param count A number of items. */ QStringList getTitles(int first, int count); /*! * Returns a list of the formatted durations. * @param first First item. * @param last A number of items. */ QStringList getTimes(int first, int count); /*! * Moves the item at index position \b from to index position \b to. */ void moveItems(int from, int to); /*! * Returns \b true if \b f file is in play queue, otherwise returns \b false. */ bool isQueued(PlayListItem* item) const; /*! * Sets current song to the file that is nex in queue, if queue is empty - does nothing */ void setCurrentToQueued(); /*! * Returns \b true if play queue is empty,otherwise returns - \b false. */ bool isEmptyQueue()const; /*! * Returns index of \b f file in queue.e */ int queuedIndex(PlayListItem* item) const; /*! * Returns the number of items in the queue */ int queueSize() const; /*! * Returns \b true if playback stops after \b item, otherwise returns \b false. */ bool isStopAfter(PlayListItem* item) const; /*! * Returns current selection(playlist can contain a lot of selections, * this method returns selection which \b row belongs to) */ const SimpleSelection& getSelection(int row); /*! * Returns list with selected items indexes. */ QList selectedIndexes() const; /*! * Returns list of \b PlayListItem pointers that are selected. */ QList selectedItems() const; /*! * Returns list of all \b PlayListItem pointers. */ QList items() const { return m_items; } /*! * Returns number of first item that selected upper the \b row item. */ int firstSelectedUpper(int row); /*! * Returns number of first item that selected lower the \b row item. */ int firstSelectedLower(int row); /*! * Returns total lenght in seconds of all songs. */ int totalLength()const { return m_total_length; } /*! * Loads playlist with \b f_name name. */ void loadPlaylist(const QString& f_name); /*! * Saves current songs to the playlist with \b f_name name. */ void savePlaylist(const QString& f_name); /*! * Returns state of "Repeat All" option. */ bool isRepeatableList() const; /*! * Returns state of "Shuffle" option. */ bool isShuffle() const; /*! * Returns \b true if the file loader thread is active; otherwise returns \b false. */ bool isLoaderRunning() const; /*! * Returns \b true if the playlist contains an item with URL \b url; otherwise returns \b false. */ bool contains(const QString &url); /*! * Enum of available sort modes */ enum SortMode { TITLE, /*!< by title */ ALBUM, /*!< by album */ DISCNUMBER, /*!< by discnumber */ ARTIST, /*!< by artist */ FILENAME, /*!< by file name */ PATH_AND_FILENAME, /*!< by path and file name */ DATE, /*!< by date */ TRACK, /*!< by track */ FILE_CREATION_DATE, /*!< by file creation date */ FILE_MODIFICATION_DATE /*!< by file modification date */ }; signals: /*! * Emitted when the state of PlayListModel has changed. */ void listChanged(); /*! * Emitted when current item has changed. */ void currentChanged(); /*! * Emitted when new item has added. * @param item New playlist item pointer. */ void itemAdded(PlayListItem *item); /*! * Emitted when playlist name has chanded. * @param name New playlist name. */ void nameChanged(const QString& name); /*! * Emitted when playlist loader thread has finished. */ void loaderFinished(); /*! * Emitted when playlist items are added or removed. */ void countChanged(); public slots: /*! * Adds \b item to the playlist. */ void add(PlayListItem *item); /*! * Adds a list of items to the playlist. * @param items List of items. */ void add(QList items); /*! * Adds a list of files and directories to the playlist * @param path Full path of file or directory. */ void add(const QString &path); /*! * Adds a list of files and directories to the playlist * @param paths Full paths of files and directories. */ void add(const QStringList &paths); /*! * Removes all items. */ void clear(); /*! * Clears selection. */ void clearSelection(); /*! * Removes selected items. */ void removeSelected(); /*! * Removes unselected items. */ void removeUnselected(); /*! * Removes items with \b i index. */ void removeAt (int i); /*! * Removes item \b item from playlist */ void removeItem (PlayListItem *item); /*! * Inverts selection (selects unselected items and unselects selected items) */ void invertSelection(); /*! * Selects all items. */ void selectAll(); /*! * Shows details for the first selected item. * @param parent parent Widget. */ void showDetails(QWidget *parent = 0); /*! * Emits update signals manually. */ void doCurrentVisibleRequest(); /*! * Randomly changes items order. */ void randomizeList(); /*! * Reverces items order. */ void reverseList(); /*! * Prepares model for shuffle playing. \b yes parameter is \b true - model iterates in shuffle mode. */ void prepareForShufflePlaying(bool yes); /*! * Prepares model for shuffle playing. \b yes parameter is true - model iterates in repeat mode. */ void prepareForRepeatablePlaying(bool); /*! * Sorts selected items in \b mode sort mode. */ void sortSelection(int mode); /*! * Sorts items in \b mode sort mode. */ void sort(int mode); /*! * Adds/removes selected items to/from playback queue. */ void addToQueue(); /*! * Adds/removes item \b f to/from playback queue. */ void setQueued(PlayListItem* item); /*! * Removes invalid items from playlist */ void removeInvalidItems(); /*! * Removes duplicate items by URL. */ void removeDuplicates(); /*! * Removes all items from queue. */ void clearQueue(); /*! * Toggles 'stop after selected' feature. */ void stopAfterSelected(); private: /*! * This internal method performs sorting of \b list_to_sort list of items. */ void doSort(int mode,QList& list_to_sort); /*! * Returns topmost row in current selection */ int topmostInSelection(int); /*! * Returns bottommost row in current selection */ int bottommostInSelection(int); /*! * Removes items from model. If \b inverted is \b false - * selected items will be removed, else - unselected. */ void removeSelection(bool inverted = false); private slots: void preparePlayState(); private: QList m_items; QList m_editing_items; PlayListItem* m_currentItem; PlayListItem* m_stop_item; int m_current; SimpleSelection m_selection; /*!< This flyweight object represents current selection. */ QQueue m_queued_songs; /*!< Songs in play queue. */ bool m_is_repeatable_list; /*!< Is playlist repeatable? */ PlayState* m_play_state; /*!< Current playing state (Normal or Shuffle) */ int m_total_length; FileLoader *m_loader; bool m_shuffle; QString m_name; }; #endif qmmp-0.7.4/src/qmmpui/playlistmanager.cpp0000664000175000017500000003351412256224735017231 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "qmmpuisettings.h" #include "playlistmanager.h" PlayListManager *PlayListManager::m_instance = 0; PlayListManager::PlayListManager(QObject *parent) : QObject(parent) { if(m_instance) qFatal("PlayListManager: only one instance is allowed"); m_instance = this; m_current = 0; m_selected = 0; m_repeatable = false; m_shuffle = false; m_autosave_playlist = false; m_timer = new QTimer(this); m_timer->setInterval(5000); m_timer->setSingleShot(true); QmmpUiSettings *ui_settings = QmmpUiSettings::instance(); connect(ui_settings, SIGNAL(playListSettingsChanged()), SLOT(readSettings())); connect(m_timer, SIGNAL(timeout()), SLOT(writePlayLists())); readPlayLists(); //read playlists QSettings settings(Qmmp::configFile(), QSettings::IniFormat); setRepeatableList(settings.value("Playlist/repeatable",false).toBool()); setShuffle(settings.value("Playlist/shuffle",false).toBool()); readSettings(); //read other settings } PlayListManager::~PlayListManager() { writePlayLists(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Playlist/repeatable", m_repeatable); settings.setValue("Playlist/shuffle", m_shuffle); m_instance = 0; } PlayListManager* PlayListManager::instance() { return m_instance; } PlayListModel *PlayListManager::selectedPlayList() const { return m_selected; } PlayListModel *PlayListManager::currentPlayList() const { return m_current; } int PlayListManager::selectedPlayListIndex() const { return indexOf(m_selected); } int PlayListManager::currentPlayListIndex() const { return indexOf(m_current); } QList PlayListManager::playLists() const { return m_models; } QStringList PlayListManager::playListNames() const { QStringList names; foreach(PlayListModel *model, m_models) names << model->name(); return names; } void PlayListManager::selectPlayList(PlayListModel *model) { if(model != m_selected && m_models.contains(model)) { PlayListModel *prev = m_selected; m_selected = model; emit selectedPlayListChanged(model, prev); emit playListsChanged(); } } void PlayListManager::selectPlayList(int i) { if(i > m_models.count() - 1) return; selectPlayList(playListAt(i)); } void PlayListManager::selectPlayList(const QString &name) { int index = playListNames().indexOf(name); if(index >= 0) selectPlayList(playListAt(index)); } void PlayListManager::selectNextPlayList() { int i = m_models.indexOf(m_selected); i++; if( i >= 0 && i < m_models.size()) selectPlayList(i); } void PlayListManager::selectPreviousPlayList() { int i = m_models.indexOf(m_selected); i--; if( i >= 0 && i < m_models.size()) selectPlayList(i); } void PlayListManager::activatePlayList(PlayListModel *model) { if(model != m_current && m_models.contains(model)) { PlayListModel *prev = m_current; m_current = model; emit currentPlayListChanged(model, prev); emit playListsChanged(); } } void PlayListManager::activatePlayList(int index) { activatePlayList(playListAt(index)); } PlayListModel *PlayListManager::createPlayList(const QString &name) { PlayListModel *model = new PlayListModel (name.isEmpty() ? tr("Playlist") : name, this); QString pl_name = model->name(); if(playListNames().contains(pl_name)) { int i = 0; forever { i++; if(!playListNames().contains(pl_name + QString(" (%1)").arg(i))) { pl_name = pl_name + QString(" (%1)").arg(i); break; } } model->setName(pl_name); } m_models.append(model); model->prepareForRepeatablePlaying(m_repeatable); model->prepareForShufflePlaying(m_shuffle); connect(model, SIGNAL(nameChanged(QString)), SIGNAL(playListsChanged())); if (m_autosave_playlist) connect(model, SIGNAL(countChanged()), m_timer, SLOT(start())); emit playListAdded(m_models.indexOf(model)); emit playListsChanged(); return model; } void PlayListManager::removePlayList(PlayListModel *model) { if(m_models.count() < 2 || !m_models.contains(model)) return; int i = m_models.indexOf(model); if(m_current == model) { m_current = m_models.at((i > 0) ? (i - 1) : (i + 1)); emit currentPlayListChanged(m_current, model); } if(m_selected == model) { m_selected = m_models.at((i > 0) ? (i - 1) : (i + 1)); emit selectedPlayListChanged(m_selected, model); } m_models.removeAt(i); model->deleteLater(); emit playListRemoved(i); emit playListsChanged(); } void PlayListManager::removePlayList(int index) { removePlayList(playListAt(index)); } void PlayListManager::move(int i, int j) { if(i < 0 || j < 0 || i == j) return; if(i < m_models.count() && j < m_models.count()) { m_models.move(i,j); emit playListMoved(i,j); emit playListsChanged(); } } void PlayListManager::setRepeatableList(bool r) { if(m_repeatable == r) return; m_repeatable = r; foreach(PlayListModel *model, m_models) model->prepareForRepeatablePlaying(r); emit repeatableListChanged(r); } void PlayListManager::setShuffle(bool s) { if(m_shuffle == s) return; m_shuffle = s; foreach(PlayListModel *model, m_models) model->prepareForShufflePlaying(s); emit shuffleChanged(s); } int PlayListManager::count() const { return m_models.count(); } int PlayListManager::indexOf(PlayListModel *model) const { return m_models.indexOf(model); } PlayListModel *PlayListManager::playListAt(int i) const { if(i >= 0 && i < m_models.count()) return m_models.at(i); return 0; } bool PlayListManager::isRepeatableList() const { return m_repeatable; } bool PlayListManager::isShuffle() const { return m_shuffle; } void PlayListManager::readPlayLists() { QString line, param, value; int s = 0, row = 0, pl = 0; QList items; QFile file(QDir::homePath() +"/.qmmp/playlist.txt"); file.open(QIODevice::ReadOnly); QByteArray array = file.readAll(); file.close(); QBuffer buffer(&array); buffer.open(QIODevice::ReadOnly); while (!buffer.atEnd()) { line = QString::fromUtf8(buffer.readLine()).trimmed(); if ((s = line.indexOf("=")) < 0) continue; param = line.left(s); value = line.right(line.size() - s - 1); if(param == "current_playlist") pl = value.toInt(); else if(param == "playlist") { if(!m_models.isEmpty()) { m_models.last()->add(items); m_models.last()->setCurrent(row); } items.clear(); row = 0; m_models << new PlayListModel(value, this); } else if (param == "current") { row = value.toInt(); } else if (param == "file") { items << new PlayListItem(); items.last()->insert(Qmmp::URL, value); } else if (items.isEmpty()) continue; else if (param == "title") items.last()->insert(Qmmp::TITLE, value); else if (param == "artist") items.last()->insert(Qmmp::ARTIST, value); else if (param == "album") items.last()->insert(Qmmp::ALBUM, value); else if (param == "comment") items.last()->insert(Qmmp::COMMENT, value); else if (param == "genre") items.last()->insert(Qmmp::GENRE, value); else if (param == "composer") items.last()->insert(Qmmp::COMPOSER, value); else if (param == "year") items.last()->insert(Qmmp::YEAR, value); else if (param == "track") items.last()->insert(Qmmp::TRACK, value); else if (param == "disc") items.last()->insert(Qmmp::DISCNUMBER, value); else if (param == "length") items.last()->setLength(value.toInt()); } buffer.close(); if(!m_models.isEmpty()) { m_models.last()->add(items); m_models.last()->setCurrent(row); } else m_models << new PlayListModel(tr("Playlist"),this); if(pl < 0 || pl >= m_models.count()) pl = 0; m_selected = m_models.at(pl); m_current = m_models.at(pl); foreach(PlayListModel *model, m_models) connect(model, SIGNAL(nameChanged(QString)), SIGNAL(playListsChanged())); } void PlayListManager::writePlayLists() { qDebug("PlayListManager: saving playlists..."); QFile file(QDir::homePath() +"/.qmmp/playlist.txt"); if(!file.open(QIODevice::WriteOnly)) { qDebug("PlayListManager: error: %s", qPrintable(file.errorString())); return; } file.write(QString("current_playlist=%1\n").arg(m_models.indexOf(m_current)).toUtf8()); foreach(PlayListModel *model, m_models) { QList items = model->items(); file.write(QString("playlist=%1\n").arg(model->name()).toUtf8()); file.write(QString("current=%1\n").arg(model->currentIndex()).toUtf8()); foreach(PlayListItem* m, items) { file.write(QString("file=%1\n").arg(m->url()).toUtf8()); file.write(QString("title=%1\n").arg(m->value(Qmmp::TITLE)).toUtf8()); file.write(QString("artist=%1\n").arg(m->value(Qmmp::ARTIST)).toUtf8()); file.write(QString("album=%1\n").arg(m->value(Qmmp::ALBUM)).toUtf8()); file.write(QString("comment=%1\n").arg(m->value(Qmmp::COMMENT)).toUtf8()); file.write(QString("genre=%1\n").arg(m->value(Qmmp::GENRE)).toUtf8()); file.write(QString("composer=%1\n").arg(m->value(Qmmp::COMPOSER)).toUtf8()); file.write(QString("year=%1\n").arg(m->value(Qmmp::YEAR)).toUtf8()); file.write(QString("track=%1\n").arg(m->value(Qmmp::TRACK)).toUtf8()); file.write(QString("disc=%1\n").arg(m->value(Qmmp::DISCNUMBER)).toUtf8()); file.write(QString("length=%1\n").arg(m->length()).toUtf8()); } } file.close(); } void PlayListManager::clear() { m_selected->clear(); } void PlayListManager::clearSelection() { m_selected->clearSelection(); } void PlayListManager::removeSelected() { m_selected->removeSelected(); } void PlayListManager::removeUnselected() { m_selected->removeUnselected(); } void PlayListManager::removeAt (int i) { m_selected->removeAt(i); } void PlayListManager::removeItem (PlayListItem *item) { m_selected->removeItem(item); } void PlayListManager::invertSelection() { m_selected->invertSelection(); } void PlayListManager::selectAll() { m_selected->selectAll(); } void PlayListManager::showDetails() { m_selected->showDetails(); } void PlayListManager::add(const QStringList &paths) { m_selected->add(paths); } void PlayListManager::randomizeList() { m_selected->randomizeList(); } void PlayListManager::reverseList() { m_selected->reverseList(); } void PlayListManager::sortSelection(int mode) { m_selected->sortSelection(mode); } void PlayListManager::sort(int mode) { m_selected->sort(mode); } void PlayListManager::addToQueue() { m_selected->addToQueue(); } void PlayListManager::removeInvalidItems() { m_selected->removeInvalidItems(); } void PlayListManager::removeDuplicates() { m_selected->removeDuplicates(); } void PlayListManager::clearQueue() { m_selected->clearQueue(); } void PlayListManager::stopAfterSelected() { m_selected->stopAfterSelected(); } void PlayListManager::readSettings() { QmmpUiSettings *ui_settings = QmmpUiSettings::instance(); bool enabled = ui_settings->autoSavePlayList(); if (m_autosave_playlist != enabled) { m_autosave_playlist = enabled; setAutoSavePlayList(); } } void PlayListManager::setAutoSavePlayList() { if (m_autosave_playlist) { foreach(PlayListModel *model, m_models) { connect(model, SIGNAL(countChanged()), m_timer, SLOT(start()), Qt::UniqueConnection); } } else { foreach(PlayListModel *model, m_models) { disconnect(model, SIGNAL(countChanged()), m_timer, SLOT(start())); } } } qmmp-0.7.4/src/qmmpui/detailsdialog.cpp0000664000175000017500000001601712256224735016641 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include "ui_detailsdialog.h" #include "playlistitem.h" #include "tageditor_p.h" #include "detailsdialog.h" DetailsDialog::DetailsDialog(PlayListItem *item, QWidget *parent) : QDialog(parent) { m_ui = new Ui::DetailsDialog; setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_DeleteOnClose, false); m_metaDataModel = 0; m_item = item; m_ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose); m_path = item->url(); setWindowTitle (m_path.section('/',-1)); m_ui->pathEdit->setText(m_path); m_ui->directoryButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_DirOpenIcon)); m_metaDataModel = MetaDataManager::instance()->createMetaDataModel(item->url(), this); if(m_metaDataModel) { foreach(TagModel *tagModel, m_metaDataModel->tags()) m_ui->tabWidget->addTab(new TagEditor(tagModel, this), tagModel->name()); foreach(QString title, m_metaDataModel->descriptions().keys()) { QTextEdit *textEdit = new QTextEdit(this); textEdit->setReadOnly(true); textEdit->setPlainText(m_metaDataModel->descriptions().value(title)); m_ui->tabWidget->addTab(textEdit, title); } } printInfo(); } DetailsDialog::~DetailsDialog() { delete m_ui; } void DetailsDialog:: on_directoryButton_clicked() { QString dir_path; if(!m_path.contains("://")) //local file dir_path = QFileInfo(m_path).absolutePath(); else if (m_path.contains(":///")) //pseudo-protocol { dir_path = QUrl(m_path).path(); dir_path.replace(QString(QUrl::toPercentEncoding("#")), "#"); dir_path.replace(QString(QUrl::toPercentEncoding("?")), "?"); dir_path.replace(QString(QUrl::toPercentEncoding("%")), "%"); dir_path = QFileInfo(dir_path).absolutePath(); } else return; #ifdef Q_WS_X11 QProcess::execute("xdg-open", QStringList() << dir_path); //works with lxde #else QDesktopServices::openUrl(QUrl::fromLocalFile(dir_path)); #endif } void DetailsDialog::printInfo() { SoundCore *core = SoundCore::instance(); QList flist = MetaDataManager::instance()->createPlayList(m_path, true); QMap metaData; if(!flist.isEmpty() && QFile::exists(m_item->url())) metaData = flist.at(0)->metaData(); else metaData = *m_item; QString formattedText; if(layoutDirection() == Qt::RightToLeft) formattedText.append("
"); else formattedText.append("
"); formattedText.append(""); //tags formattedText += formatRow(tr("Title"), metaData[Qmmp::TITLE]); formattedText += formatRow(tr("Artist"), metaData[Qmmp::ARTIST]); formattedText += formatRow(tr("Album"), metaData[Qmmp::ALBUM]); formattedText += formatRow(tr("Comment"), metaData[Qmmp::COMMENT]); formattedText += formatRow(tr("Genre"), metaData[Qmmp::GENRE]); formattedText += formatRow(tr("Composer"), metaData[Qmmp::COMPOSER]); if(metaData[Qmmp::YEAR] != "0") formattedText += formatRow(tr("Year"), metaData[Qmmp::YEAR]); if(metaData[Qmmp::TRACK] != "0") formattedText += formatRow(tr("Track"), metaData[Qmmp::TRACK]); if(metaData[Qmmp::DISCNUMBER] != "0") formattedText += formatRow(tr("Disc number"), metaData[Qmmp::DISCNUMBER]); //stream information if(core->state() == Qmmp::Playing && core->url() == metaData.value(Qmmp::URL)) { if(!core->streamInfo().isEmpty()) { formattedText.append(""); formattedText.append(""); formattedText.append(""); foreach(QString key, core->streamInfo().keys()) formattedText += formatRow(key, core->streamInfo().value(key)); } } //audio info if(!m_metaDataModel) { formattedText.append("
"); formattedText.append("
"); formattedText.append("
"); formattedText.append("
"); m_ui->textEdit->setHtml(formattedText); return; } QHash ap = m_metaDataModel->audioProperties(); //line if(formattedText.trimmed() != "") { formattedText.append(""); formattedText.append(""); formattedText.append(""); } foreach(QString key, ap.keys()) formattedText += formatRow(key, ap.value(key)); formattedText.append("
"); formattedText.append("
"); formattedText.append("
"); formattedText.append("
"); m_ui->textEdit->setHtml(formattedText); } QString DetailsDialog::formatRow(const QString key, const QString value) { if(value.isEmpty()) return QString(); QString str(""); if(layoutDirection() == Qt::RightToLeft) str.append("" + value + " " + key + ""); else str.append("" + key + " " + value + ""); str.append(""); return str; } void DetailsDialog::on_buttonBox_clicked(QAbstractButton *button) { if(m_ui->buttonBox->standardButton(button) == QDialogButtonBox::Save) { TagEditor *tab = qobject_cast (m_ui->tabWidget->currentWidget()); if(tab) tab->save(); } else reject(); } qmmp-0.7.4/src/qmmpui/configdialog.h0000664000175000017500000000561212256224735016125 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CONFIGDIALOG_H #define CONFIGDIALOG_H #include #include #include #include #include namespace Ui { class ConfigDialog; } class QListWidgetItem; class QTreeWidgetItem; /*! @brief Configuration dialog class. @author Ilya Kotov */ class ConfigDialog : public QDialog { Q_OBJECT public: /*! * Constructor. * @param parent Parent widget */ ConfigDialog(QWidget *parent = 0); /*! * Destructor */ virtual ~ConfigDialog(); /*! * Adds custom page in configuration dialog * @param name Localized name of the custom page * @param widget Custom page instance * @param icon Custom page icon */ void addPage(const QString &name, QWidget *widget, const QIcon &icon = QIcon()); private slots: void on_contentsWidget_currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous); void on_preferencesButton_clicked(); void on_informationButton_clicked(); void addTitleString(QAction *); void saveSettings(); void on_treeWidget_itemChanged (QTreeWidgetItem *item, int column); void on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *); private: void readSettings(); void findSkins(const QString &path); void loadPluginsInfo(); void createMenus(); void loadLanguages(); int m_insert_row; Ui::ConfigDialog *m_ui; }; #endif qmmp-0.7.4/src/qmmpui/general.h0000664000175000017500000000603212256224735015112 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef GENERAL_H #define GENERAL_H #include #include #include #include "generalfactory.h" /*! @brief The General class provides simple access to general plugins * @author Ilya Kotov */ class General { public: /*! * Prepares general plugins for usage. * @param parent Parent object. */ static void create(QObject *parent); /*! * Returns a list of the loaded general plugin factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory General plugin factory. */ static QString file(GeneralFactory *factory); /*! * Sets whether the general plugin is enabled. * @param factory General plugin factory. * @param enable Plugin enable state (\b true - enable, \b false - disable) */ static void setEnabled(GeneralFactory* factory, bool enable = true); /*! * Shows configuration dialog and updates settings automatically. * @param factory General plugin factory. * @param parentWidget Parent widget. */ static void showSettings(GeneralFactory* factory, QWidget* parentWidget); /*! * Returns \b true if general plugin is enabled, otherwise returns \b false * @param factory General plugin factory. */ static bool isEnabled(GeneralFactory* factory); private: static void checkFactories(); static QList *m_factories; static QHash *m_generals; static QHash *m_files; static QObject *m_parent; }; #endif qmmp-0.7.4/src/qmmpui/configdialog.cpp0000664000175000017500000004150412256224735016460 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ui_configdialog.h" #include "pluginitem_p.h" #include "radioitemdelegate_p.h" #include "generalfactory.h" #include "general.h" #include "uihelper.h" #include "uiloader.h" #include "filedialog.h" #include "mediaplayer.h" #include "qmmpuisettings.h" #include "playlistmodel.h" #include "configdialog.h" ConfigDialog::ConfigDialog (QWidget *parent) : QDialog (parent) { m_ui = new Ui::ConfigDialog; m_ui->setupUi (this); m_insert_row = 0; setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_DeleteOnClose, false); m_ui->preferencesButton->setEnabled(false); m_ui->informationButton->setEnabled(false); m_ui->treeWidget->setItemDelegate(new RadioItemDelegate(this)); connect (this, SIGNAL(rejected()),SLOT(saveSettings())); m_ui->replayGainModeComboBox->addItem (tr("Track"), QmmpSettings::REPLAYGAIN_TRACK); m_ui->replayGainModeComboBox->addItem (tr("Album"), QmmpSettings::REPLAYGAIN_ALBUM); m_ui->replayGainModeComboBox->addItem (tr("Disabled"), QmmpSettings::REPLAYGAIN_DISABLED); readSettings(); loadPluginsInfo(); loadLanguages(); createMenus(); //setup icons m_ui->preferencesButton->setIcon(QIcon::fromTheme("configure")); m_ui->informationButton->setIcon(QIcon::fromTheme("dialog-information")); } ConfigDialog::~ConfigDialog() { delete m_ui; } void ConfigDialog::addPage(const QString &name, QWidget *widget, const QIcon &icon) { m_ui->stackedWidget->insertWidget(m_insert_row, widget); m_ui->contentsWidget->insertItem (m_insert_row, name); m_ui->contentsWidget->item(m_insert_row)->setIcon(icon); m_ui->contentsWidget->setCurrentRow(0); m_insert_row++; } void ConfigDialog::readSettings() { if (MediaPlayer::instance()) { //playlist options QmmpUiSettings *guis = QmmpUiSettings::instance(); m_ui->formatLineEdit->setText(guis->format()); m_ui->metadataCheckBox->setChecked(guis->useMetadata()); m_ui->underscoresCheckBox->setChecked(guis->convertUnderscore()); m_ui->per20CheckBox->setChecked(guis->convertTwenty()); //resume playback on startup m_ui->continuePlaybackCheckBox->setChecked(guis->resumeOnStartup()); //directory filters m_ui->dirRestrictLineEdit->setText(guis->restrictFilters().join(";").trimmed()); m_ui->dirExcludeLineEdit->setText(guis->excludeFilters().join(";").trimmed()); //default playlist m_ui->defaultPlayListCheckBox->setChecked(guis->useDefaultPlayList()); m_ui->defaultPlayListLineEdit->setText(guis->defaultPlayListName()); //playlist auto-save when modified m_ui->autoSavePlayListCheckBox->setChecked(guis->autoSavePlayList()); //url dialog m_ui->clipboardCheckBox->setChecked(guis->useClipboard()); } //proxy settings QmmpSettings *gs = QmmpSettings::instance(); m_ui->enableProxyCheckBox->setChecked(gs->isProxyEnabled()); m_ui->authProxyCheckBox->setChecked(gs->useProxyAuth()); m_ui->hostLineEdit->setText(gs->proxy().host()); if (gs->proxy().port(0)) m_ui->portLineEdit->setText(QString::number(gs->proxy().port(0))); m_ui->proxyUserLineEdit->setText(gs->proxy().userName()); m_ui->proxyPasswLineEdit->setText(gs->proxy().password()); m_ui->hostLineEdit->setEnabled(m_ui->enableProxyCheckBox->isChecked()); m_ui->portLineEdit->setEnabled(m_ui->enableProxyCheckBox->isChecked()); m_ui->proxyUserLineEdit->setEnabled(m_ui->authProxyCheckBox->isChecked()); m_ui->proxyPasswLineEdit->setEnabled(m_ui->authProxyCheckBox->isChecked()); //file type determination m_ui->byContentCheckBox->setChecked(gs->determineFileTypeByContent()); //cover options m_ui->coverIncludeLineEdit->setText(gs->coverNameFilters(true).join(",")); m_ui->coverExcludeLineEdit->setText(gs->coverNameFilters(false).join(",")); m_ui->coverDepthSpinBox->setValue(gs->coverSearchDepth()); m_ui->useCoverFilesCheckBox->setChecked(gs->useCoverFiles()); //replay gain m_ui->clippingCheckBox->setChecked(gs->replayGainPreventClipping()); m_ui->replayGainModeComboBox->setCurrentIndex(m_ui->replayGainModeComboBox->findData(gs->replayGainMode())); m_ui->preampDoubleSpinBox->setValue(gs->replayGainPreamp()); m_ui->defaultGainDoubleSpinBox->setValue(gs->replayGainDefaultGain()); //audio m_ui->softVolumeCheckBox->setChecked(gs->useSoftVolume()); m_ui->use16BitCheckBox->setChecked(gs->use16BitOutput()); m_ui->bufferSizeSpinBox->setValue(gs->bufferSize()); //geometry QSettings settings (Qmmp::configFile(), QSettings::IniFormat); resize(settings.value("ConfigDialog/window_size", QSize(700,470)).toSize()); QList var_sizes = settings.value("ConfigDialog/splitter_sizes").toList(); if(var_sizes.count() != 2) { var_sizes.clear(); var_sizes << 180 << width()-180; } QList sizes; sizes << var_sizes.first().toInt() << var_sizes.last().toInt(); m_ui->splitter->setSizes(sizes); } void ConfigDialog::on_contentsWidget_currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous) { if (!current) current = previous; m_ui->stackedWidget->setCurrentIndex (m_ui->contentsWidget->row (current)); } void ConfigDialog::loadPluginsInfo() { m_ui->treeWidget->blockSignals(true); /* load transport plugin information */ QTreeWidgetItem *item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Transports")); foreach(InputSourceFactory *factory, *InputSource::factories()) { new PluginItem (item, factory, InputSource::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load input plugins information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Decoders")); foreach(DecoderFactory *factory, *Decoder::factories()) { new PluginItem (item, factory, Decoder::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load audio engines information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Engines")); foreach(EngineFactory *factory, *AbstractEngine::factories()) { new PluginItem (item, factory, AbstractEngine::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load effect plugin information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Effects")); foreach(EffectFactory *factory, *Effect::factories()) { new PluginItem (item, factory, Effect::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load visual plugin information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Visualization")); foreach(VisualFactory *factory, *Visual::factories()) { new PluginItem (item, factory, Visual::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load general plugin information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("General")); foreach(GeneralFactory *factory, *General::factories()) { new PluginItem (item, factory, General::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load output plugins information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("Output")); foreach(OutputFactory *factory, *Output::factories()) { new PluginItem (item, factory, Output::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load file dialogs information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("File Dialogs")); foreach(FileDialogFactory *factory, *FileDialog::factories()) { new PluginItem (item, factory, FileDialog::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); /* load user interfaces information */ item = new QTreeWidgetItem (m_ui->treeWidget, QStringList() << tr("User Interfaces")); foreach(UiFactory *factory, *UiLoader::factories()) { new PluginItem (item, factory, UiLoader::file(factory)); } m_ui->treeWidget->addTopLevelItem(item); item->setExpanded(true); m_ui->treeWidget->blockSignals(false); m_ui->treeWidget->resizeColumnToContents(0); m_ui->treeWidget->resizeColumnToContents(1); } void ConfigDialog::on_preferencesButton_clicked() { QTreeWidgetItem *item = m_ui->treeWidget->currentItem(); if(item && item->type() >= PluginItem::TRANSPORT) dynamic_cast(item)->showSettings(this); } void ConfigDialog::on_informationButton_clicked() { QTreeWidgetItem *item = m_ui->treeWidget->currentItem(); if(item && item->type() >= PluginItem::TRANSPORT) dynamic_cast(item)->showAbout(this); } void ConfigDialog::createMenus() { QMenu *menu = new QMenu(this); menu->addAction(tr("Artist"))->setData("%p"); menu->addAction(tr("Album"))->setData("%a"); menu->addAction(tr("Title"))->setData("%t"); menu->addAction(tr("Track number"))->setData("%n"); menu->addAction(tr("Two-digit track number"))->setData("%NN"); menu->addAction(tr("Genre"))->setData("%g"); menu->addAction(tr("Comment"))->setData("%c"); menu->addAction(tr("Composer"))->setData("%C"); menu->addAction(tr("Disc number"))->setData("%D"); menu->addAction(tr("File name"))->setData("%f"); menu->addAction(tr("File path"))->setData("%F"); menu->addAction(tr("Year"))->setData("%y"); menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); m_ui->titleButton->setMenu(menu); m_ui->titleButton->setPopupMode(QToolButton::InstantPopup); connect(menu, SIGNAL(triggered (QAction *)), SLOT(addTitleString(QAction *))); } void ConfigDialog::loadLanguages() { QMap l; l["auto"] = tr(""); l["pt_BR"] = tr("Brazilian Portuguese"); l["zh_CN"] = tr("Chinese Simplified"); l["zh_TW"] = tr("Chinese Traditional"); l["cs"] = tr("Czech"); l["nl"] = tr("Dutch"); l["en_US"] = tr("English"); l["fr"] = tr("French"); l["gl_ES"] = tr("Galician"); l["de"] = tr("German"); l["he"] = tr("Hebrew"); l["hu"] = tr("Hungarian"); l["it"] = tr("Italian"); l["ja"] = tr("Japanese"); l["kk"] = tr("Kazakh"); l["lt"] = tr("Lithuanian"); l["pl_PL"] = tr("Polish"); l["ru_RU"] = tr("Russian"); l["sk"] = tr("Slovak"); l["es"] = tr("Spanish"); l["tr"] = tr("Turkish"); l["uk_UA"] = tr("Ukrainian"); foreach(QString code, l.keys()) { QString title = code != "auto" ? l.value(code) + " (" + code + ")" : l.value(code); m_ui->langComboBox->addItem(title, code); } QString code = Qmmp::uiLanguageID(); int index = m_ui->langComboBox->findData(code); if(index < 0) index = m_ui->langComboBox->findData("auto"); m_ui->langComboBox->setCurrentIndex(index); } void ConfigDialog::addTitleString(QAction * a) { if (m_ui->formatLineEdit->cursorPosition () < 1) m_ui->formatLineEdit->insert(a->data().toString()); else m_ui->formatLineEdit->insert(" - "+a->data().toString()); } void ConfigDialog::saveSettings() { if (QmmpUiSettings *guis = QmmpUiSettings::instance()) { guis->setFormat(m_ui->formatLineEdit->text().trimmed()); guis->setUseMetadata(m_ui->metadataCheckBox->isChecked()); guis->setConvertUnderscore(m_ui->underscoresCheckBox->isChecked()); guis->setConvertTwenty(m_ui->per20CheckBox->isChecked()); guis->setResumeOnStartup(m_ui->continuePlaybackCheckBox->isChecked()); guis->setRestrictFilters(m_ui->dirRestrictLineEdit->text()); guis->setExcludeFilters(m_ui->dirExcludeLineEdit->text()); guis->setDefaultPlayList(m_ui->defaultPlayListLineEdit->text(), m_ui->defaultPlayListCheckBox->isChecked()); guis->setAutoSavePlayList(m_ui->autoSavePlayListCheckBox->isChecked()); guis->setUseClipboard(m_ui->clipboardCheckBox->isChecked()); guis->sync(); } QmmpSettings *gs = QmmpSettings::instance(); //proxy QUrl proxyUrl; proxyUrl.setHost(m_ui->hostLineEdit->text()); proxyUrl.setPort(m_ui->portLineEdit->text().toUInt()); proxyUrl.setUserName(m_ui->proxyUserLineEdit->text()); proxyUrl.setPassword(m_ui->proxyPasswLineEdit->text()); gs->setNetworkSettings(m_ui->enableProxyCheckBox->isChecked(), m_ui->authProxyCheckBox->isChecked(), proxyUrl); gs->setCoverSettings(m_ui->coverIncludeLineEdit->text().split(","), m_ui->coverExcludeLineEdit->text().split(","), m_ui->coverDepthSpinBox->value(), m_ui->useCoverFilesCheckBox->isChecked()); int i = m_ui->replayGainModeComboBox->currentIndex(); gs->setReplayGainSettings((QmmpSettings::ReplayGainMode) m_ui->replayGainModeComboBox->itemData(i).toInt(), m_ui->preampDoubleSpinBox->value(), m_ui->defaultGainDoubleSpinBox->value(), m_ui->clippingCheckBox->isChecked()); gs->setAudioSettings(m_ui->softVolumeCheckBox->isChecked(), m_ui->use16BitCheckBox->isChecked()); gs->setBufferSize(m_ui->bufferSizeSpinBox->value()); gs->setDetermineFileTypeByContent(m_ui->byContentCheckBox->isChecked()); gs->sync(); QList var_sizes; var_sizes << m_ui->splitter->sizes().first() << m_ui->splitter->sizes().last(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue("ConfigDialog/splitter_sizes", var_sizes); settings.setValue("ConfigDialog/window_size", size()); //User interface language int index = m_ui->langComboBox->currentIndex(); if(index >= 0) Qmmp::setUiLanguageID(m_ui->langComboBox->itemData(index).toString()); } void ConfigDialog::on_treeWidget_itemChanged (QTreeWidgetItem *item, int column) { if(column == 0 && item->type() >= PluginItem::TRANSPORT) dynamic_cast(item)->setEnabled(item->checkState(0) == Qt::Checked); } void ConfigDialog::on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *) { if(current->type() >= PluginItem::TRANSPORT) { m_ui->preferencesButton->setEnabled(dynamic_cast(current)->hasSettings()); m_ui->informationButton->setEnabled(dynamic_cast(current)->hasAbout()); } else { m_ui->preferencesButton->setEnabled(false); m_ui->informationButton->setEnabled(false); } } qmmp-0.7.4/src/qmmpui/commandlinemanager.cpp0000664000175000017500000000743712256224735017663 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include "commandlinemanager.h" using namespace std; QList *CommandLineManager::m_options = 0; QHash *CommandLineManager::m_files = 0; void CommandLineManager::checkOptions() { if (!m_options) { m_options = new QList; m_files = new QHash; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("CommandLineOptions"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) /*qDebug("CommandLineManager: loaded plugin %s", qPrintable(fileName))*/; else qWarning("CommandLineManager: %s", qPrintable(loader.errorString ())); CommandLineOption *option = 0; if (plugin) option = qobject_cast(plugin); if (option) { m_options->append(option); m_files->insert(option, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(option->createTranslator(qApp)); } } } } QString CommandLineManager::executeCommand(const QString& opt_str, const QStringList &args) { checkOptions(); if(!UiHelper::instance() || !SoundCore::instance() || !MediaPlayer::instance()) { qWarning("CommandLineManager: player objects are not created"); return QString(); } foreach(CommandLineOption *opt, *m_options) { if (opt->identify(opt_str)) { return opt->executeCommand(opt_str, args); } } return QString(); } bool CommandLineManager::hasOption(const QString &opt_str) { checkOptions(); foreach(CommandLineOption *opt, *m_options) { if (opt->identify(opt_str)) return true; } return false; } void CommandLineManager::printUsage() { checkOptions(); foreach(CommandLineOption *opt, *m_options) cout << qPrintable(opt->helpString()); } qmmp-0.7.4/src/qmmpui/images/0000775000175000017500000000000012256224735014570 5ustar useruserqmmp-0.7.4/src/qmmpui/images/network.png0000664000175000017500000000267112256224735016775 0ustar useruserPNG  IHDR&&sBITO pHYs /LtEXtSoftwarewww.inkscape.org<4PLTE______bbbfffggggggeeedddddd``` '''((()))...000111222333444555666:::;;;<<<===???@@@BBBCCCDDDFFFHHHLLLMMMNNNOOOPPPQQQSSSUUUVVVYYYZZZ\\\]]]^^^___```aaabbbdddeeeggghhhiiijjjkkklllmmmnnnooopppqqqrrrsssvvvxxxyyyzzz{{{|||}}}~~~; tRNS(YH[IDAToUe}Ϲ_R>"F FQk$Xtqp1Le'0abKJDĂikBZn/yȍEu-HzXt@nm ;;g eQL.]9؊{wۡ"^ZVmS)@[*ީ}} :% .~pq|fj必v7${.♝v?zroVJ\qgiuĠ@}zxmOofq&xitc(''*@Љ`}{;%@ *G￵Zэ0x82k4""P޼:Q'  <9z )qD  ~wAz%K=# Pfפģcs@3 4"<1!IR@:z2<3"gfvd@DZB :2i("z7Ofի@ }$?\MPoV'uf[P@>x;^=! ص=^L 2`ceDPaBޗ wJ}/Q,ρP.r_J98k@>>???AAACCCEEEFFFGGGHHHJJJKKKLLLNNNOOORRRTTTUUUVVVWWWXXXYYY[[[\\\]]]^^^___```aaabbbfffggghhhjjjkkklllnnnooopppqqqrrruuuvvvwwwxxxzzz{{{|||}}}7! tRNS(YH[IDAT8mWQ}̲lR"2[(#-33L+-I$wvD1DfyZٛox7saXVn~E&ŔfabRO ‹ s0, ?Mmm:X1 jEX^)tw6H )+ @+|/ETsW$DS 3*g t19#ex7W18-|ca'35r}{o:B0dhd4p&\נv7jK5F?Õ1DkYx>>qQų{ sPZhYlso±[zׇГ'/6fʸo@W/v;VfE0D25]xQD}y4q hG;79-ַAtPՎauSI׼@K  [: aؑwEI#Z mpӽN1  X>R\gYP 04ͽ}u #Ϟ!+\mwՈDaF$G68~QW Kj_v3Z:I Ģd)֪?)# Ra8Z2sy LvLJBlp1(Eu$c0bVzGdE$|D-GsqIENDB`qmmp-0.7.4/src/qmmpui/images/logo-qmmp.png0000664000175000017500000004767312256224735017227 0ustar useruserPNG  IHDRk%sRGBbKGD#2 pHYsnrtIME !  IDATxwuy rDNLbhZV%[î䕩]{eY֊DDQ"EDJ &AGݮP]= ԙG{֭pUY}$_|\DA'_.'!/>}y_|Ň/RWrESK]@<+e|NTR{sCJ`"OӇ|%pWT6D/3F}_ odT//`K9bUEot1tεY+}K}V\V_zL۽|go1+{X.;)6R_JFj=8!;ezS.Y5eb-_NQ`b={xw?O?ik[l^#‡|] xk6ytKͲחQ11üOiWYJ8i}n$,[yQpʌ}$F>ìLpgq FDhݬc m>ߋWg(T;>{bVqT1g3 aqt5mgD9#6 郾.1Nйww(/0Z,e%7YqlS(U5\[gY2f-[— "6hl|hWX 唿x A,g0|;_r3ڿZ< O*":Ӑ>+3;2r{!aɌB2߉ @R:gS(/|ƾwΧR]B'3 My >gϮU=u M4sqګcN+S>Ba?Ws,/3+]2V~V$3Yg`V޲)2/!:ʲ{J^_f V,~Be%5a1Qf> O }Ȼt@тHce4sEP/Ğ>*ܷ9SQesgU@98 d9w>/3lp]409'iN/b4>sE$I`3.8K7 & t#dc6~ÓHɻKOGXY7[}b?ͲnS@߃⓴_Mf{Z\ii"p$)2g'Ś"'B#,A$@&[S˸r>5Sz'9tVM&Yn; e=A>q%iR9vi !|T1>&A8˸Qz"%Ic 0NȾ 10d4:x 8!;w-WיV~rA6 2 39EY^{5΄A NttZhQc{g!Fhcʸp{7J 8SdD$&**`7\.gcepdy:sQ{PȐpggH1qOvlQޓf_\ E4W^z$TMγߔa]6N沄,;&E` Au<'J6N!u>\=Һ 5gl5ZUTGF'HbpiL᥃@B*A1M \BV2|7cƕv4Ǵ uq~Ot` 'N4%wػٍO-&MpJ!MJszW H3NqΑ!àLY^Nv<ʮ$01ECE$@U5ĻjYǁh13 LΰikԺY 0(cbDb)).Ic(c 0hN`#%L"e{1͞sq&B -2#q~ȵ .2L$tBi%+J3g8WQQO%lbAZЎ C($H".p* bl48`1&Cài$qG:vS( &PոC~nY/s1h"CB0y%c7G 4j6ֵ32qᵟ0}/@lf5 lK ۹u._9E?0 :&:&"2N]OVO(_yX3% uy-{ 0߶NVޘW m\"L(ΕsWO-7df>/1r*&忳^qg$igxo3P.׻xʾAeN0iFJtMl+:Fy}SHŧ 1B@ ݨDȺ, ]"@1i"J nvVxϖoe[ق|ߛ^E<'4S,u?V>Ct2((2/(Ȓi >fVdt)R6H|Ai;Eѹs{Y 9A˜yluCByYY1@&I q"pg,CEh蘘vAg fV>^Gv~dlGE4Zu~.;?S~Gxy`JR>tB9_KM$H AL (O <يf:ů5dOu L~ǿfv`` |7v2&T Tg S^$ #,U}>QYD 2BVs|zY7Y1ĝ<)wCEbSy~{OW<.7yP>?ʝ+83|㜨<^q [Sxüh0vbm|,դ0q vN sbB2:vP%ܭвfBl{h ›0!Y>(W6s2g 5r=C.C#}|}O`dM7R3Q/k$M B$'ʮlp=8?9T1PDy$x # r$ c>3<ي"\G)"E@O%F3=w WfGkotQM k46o"F+PIU#;(69 Vx59ZEE0}Y:FI~PR.Bn~Mat`K1$H DXMiV}&`|w+G5 A>J&q\z*tn Lդ~NO?YNVk$q&gdOy'%e" w p 5SLhUZi$'.z%sǺLA &(^#8"ߠ&InmyvU/p5cdd)TYHh\--RǧY>AC(Gv6F y\c23@0,&[kCrnqyAZig<=*#ՓҴG_nD^d5uIL"9\V6R..ҥQhlX5%=N?1Ta$C8'dك0P008,S II&NVT4 DyZT^F&l-y7Nl +¯e!{+ʪN _nq|0sj׳-J%]ɜn92-&>mrwF^+.rF6r/|b!Ȼ]mX=up݄\+CE~nB訄 'OMT֮a!9~îeΠܫLi1yKhif)itp.Z;Yt汀|{,؏pask/:x_hy7k_fD8agI}FVhLdc T3?AfREЄkjt^" "ls z<=>LJ"bsP1q"*Q0ΰA:%lBYc9@sq˜r3mt1N&:FuTlucӴ2q#7r0 Ͻ_GNJsFgk.dC;NsR_y)&zq*C2l(^>]WvU8$38iVֽ{ vGc@گ#+fyK#(G&]$ s1y+0u6 c,"F ζ2F Π0\i&Ca26du\L5 ٱْ fCyʆr8fg[Sb?ȑ)V+"Lo!#oâ̒^'?yLC$1Nm-9kx qSy#E3UA^[zJ/gq EJ/dGa w)Fh!@[Yh@)d: ]0σJ uLmoeRBwД>79KR >ʵ 'YOqqrkUޓ`S +?M8*P!eqUV^^89? OB@܎' /c,#@C'EM.0F8GME؞~2B݋M 8lLfos153ֆ|1;PqO"Ve2 1 px:GO%UBS׸Ѣ9ؙ`o[b3q&H$!Dhchzrp8IG%  /jn/+ yvv )A d/@?d a4s q @ t+iB)CRoA4ƈ!Hc{$UB2xqK6 0/Hp"‰펝\BIəfYqek '8Az4˯2!RSUe6+%&897(I>="ǝXY" 9NsVM;j=/]8lёHF9 8?DBa̻,D%M+a9fs4c"@.61ry$b̡A&2YH :C\' `EދJvC\p&6>(AuaF 䑂k[~_hJa tUW1d/<(,^klD0IyCip:(kdκ|ПttB,-Rb8YB4ky/_b+ =9%L0IFi'bdd?_+3O8+"le̥SymLM.T1+S,NH Kp+s$v90hmEc%t\9qkBV ٔ%c Y@8pA~'&*!u| yh!YGB;*)b 7^TH$[Sc7E|!8ï m涡xxs0엳!ƘO8 q 1 bFYe~ꖴuS ~vͳn)ʕVZe&4YNK0Vp K /PX\T SC啮o:-y%.{KE'װ3q8.Y-E"*O0:{ݤp5wو)Sh1"'y4|w!i+@82ag;NgD n(>S#Nx|iV~ᴼ c/1NqӜ!^nl]9I?VakU>kK A'(zutCj:*.ЋJB+s`AQ֎ ;j?>tr?1N($I&1t~8?p8}M,(a(W>A8Љ0)9rnE-"RHS,dgy<|ob{ⴝ39Y̧E,d@ӳxkUz⥬/e- 8C?À狣18" 7E* ?. ?]y"KaLπ|o&%$Z &2*KIp.¤P1 T44I Tt4@'?)c]% g="Mla Be>eu)NFc1W{:e\nYO(".,&H=qYyww *b #@+` IDAT4eDQ>k%x Qia>!HN!ZHD'[e+jI {|w>k~M3ґ2(xUXh*e2c+Y+K!C1>@%HKBNyU%"8\Њ4ӊ*LDV nvs0AtV+9BV^LcH  t(}lA̱zv *?"x,tV&P:ֹEU1ِS+, {NJlk_&@Q`ЄJj# @ЉJ-eMByc{3$DfS$c8ZyvޝtxGs.7hVz|i>DLV^chb=X=Yqv@,&JFB 0qRdH>3MҺI.!HN)7=[*C9]ŝ5l= 7zL~ X(aX Z+8BS^{kzΐBg ' aЄYv7 z$@hAHOzH+hr ) xлxf“G ?iQz飗~RE,Y%ӷT^<&#hS: (rBD!Lߎ1N@#"{09ȓa7 $.C-yY4Oh@.;qA'AzcԩqDw{"~% KhrIozs6MY MbP$ BarUCy=37}t̡v:K4M7;xp.GKGTI;=TIȀ >V8~cUp,EvTЈIY @gX*#"`ϗ\V)ȖVc#%}fiqHwѭWSBc(,`7o@!.佒pHΪ})V1J3s9=a6 s>@գ;丕q /fp+Y }+UW Utб+FDЌF jR᪫-8v]@swmFǥQm.S+4lBX4qWsƖY)Wy:ԗ-HmDi+R}KT"Sofe}i>QUq9.V߹ևûQ?Yu!oϝo0>C&ߪQӷ}O`Lן 75t6Լz{߮UO6!u9(~wt8d\8 w<)κף4\IWC@^"Qѓ|L?TF{1C6q}=8,}/b8;l6+RSUc-.AbV) %7x'[phA-6rcgx}T^n b/iW9yO@Uh}%|=U ~^1?y{rTp//_OE-|eUyЌ"8]t(4񚆳}%}y3%΄78K(Di #${7tvfX}j?eV}_f F)sFR| \(g`qN<4ѲY2~9XyY+fV t7kwu^}Eg.MfӗRQdx3Ґ&Vz~T&Awwh27=lyME Зctױap@ <v y}5QV_ơrW4t?:W ~b m\S]דsQ[z~JHZub}P%M,/D{ϗֹܩ:SL2 $Yx+hT Xε41x˛4sOt HAt΀V HNKm5L,j1gOCT<;Zm-CEޡV1঑2: uI'[3b9F7UV_q@^44C 'Bt2-Z0bmX}+vi 4B0+ýThLbXsukR)|\Rv7qIAÆ*s)6-Ք$U򗆲y~]덱nLtߪ?:,Y̊C޷Ɋ~Nid00T4T|~Fo#ABNލw*Aew5Xl/7 ^Q$HTVkQ_qyhDu\h9QjrKlxb?ai!E4xfI7&ӍN3^#- k:]NQ_a\>#OfZF)EaY7H"VEE'@%50P,)irl}]_ 4*|5/4c(QstAҐ7Bc50HѲOBj W!`H\T %Epq|Q hD6S}cB~lH fZ& (3\R(CLz57;V!$){A> Vk͵Kb?;9uK3c-ZL35"%W]Sb?Si(c2:1#Nq RE4#T_V:?0D"%A{E.nj\b_ۣTs̫0HIgh@^{QD%\V2pZ؞؋Y"_*1ttuY<\q.gW^)jEՀY_~ԏY'jJ~D"DCzuf tWb_ .9NC/wfv̲-S9P;|O}#xs_)Nc;rkH$t"G'' 4<.8JB 2ѹ3 FK#/*>;ap4p,Gh8; VI-U+5g؛{u&ʁܻ n{U]+2Ei/!#lݏ]sHY9yVF#XKW T y vUL1jbWq[b_{R+(uJ}F$ݝ' `c:Y-ػ'Յ#3y֜w<@!TCvjZ~^k45M*U\qmA$,l={wL̹05duV A Qg'هkb/\AWfTHԾA|x0$^|Kb_!1vCu.: f7/Gc}[;8ӥ8k{/﨔2Nԉ|{[ŵ2>U(U>n.6VRQ#bJW -9 VV={(,Q(o/}5l-7=-)jMv՛®1 ޼rAޛ1Օkyd}Yy/w <Z'(3,*n0~tQ~p;4Q35N̾|mwZj u_R>vP<|2RzH(A ʻ~>,: j2%'gF!V`Ě01^78JݦDFAȱZyK=}idQQsl!%FAJ'_́Rb+HZ(Q4r++v* 䣰`)}J2o Dr%7O1#$I܈,c]@+휵޺0K8*U*;yW:X5 @XxMƻc;SW|IYa2-J=U }s QD;(G4wzϗ߶*& 4Dq1BpdKƬLgUDxFH?g/ %g6;@7Ao?I1Y0̈Cx B%-> a¨S&xxfdvPXzUe+\EeyW#@QVN$H'T I5ɀu !uu ĥB yAd3V!̓_11I$Y@*)209@{s{kIiR(R d"t%nuB4A!!v\*/P011|ddX޲-lhH96'#* ش"9]aGi7IҤI*2z/+nU u| 1Rh r *9pT/ݭ>w̦*@3g-۱f-apC*{?0D !9Oޡx_RAː CJ;df@"4фBpD A"NRQZdHưzBsiL;a&KX KE}'MH H&Zi%*/&c[%-dMie>҂>@!DEL"@'HK09J֜iJ@-:kTLA#ބ΋ɐA2P00PJeaʿUMO@F!A=$ T"ԑJTP]3͘F&zhDYL#3!BvuXV)2yf "b;qKVI$ O2tDdT\GED !Bl&Vbad00 !L0H"#L7mDJZr̛Žc FT"H⒫LB>^ 1[?ɘt¦0Lh$= $y*GoJ&(g@+#9GV*ʤz>0N@lH>= !VBޗZx01i"*`D!FQ$PXDh"Fba_T&F bȠ&L(1g9BAT,Òhk !iB'BGGCІʯ%&VⳖKzCHe 'H AdGTt"v%@, C7Bj!jF9O Av4LB5#N4*^HH!Vq"8wN66%Le I+A:~Q"Ĉ0vHA5 1\CX!H !Z 1[ħ8L u#Ljn^y5o1ѤX;Y"q~ѶVBCFL2D!:"&*"F>I HN` ! a!/sEZ3HWZ[(<qLTBDy5o vTYHSҎ7Fn!z10pqhV65i*TB4}@ 뀓0e !H3ZB}|ɭDIqȫ2"Tzlb#NBe!O Wv9"h"*=yrQR܌G{.a"tA|e -tKx ϣV Zy%[  4\kx_ ~N}w":ACEcuBgӨtrˁ8W38ĤvYA;F (wM~lh8 O9gh,*!$l@q# d`po  D}:se[1ch'H?A"DHs-s覃$8JazndH|ȫϥc*:YJ?-41yTtd!#f4 IzDzr?qIĈ0\d7dC/@A9 G8 L2O3A}4gp%p@W{1P8nR!%<ɧs(U?T҈H*RQ!BpPR%00 6s}|<93p{CӐF5gYgkk'`ZVT ]WayOEb3FoMxXnZ|<klTkVXZ uSN-:ZۆഌFc{"e#S\"aLW p,"vLTs63/V{6<'2yѢ,3KJLZ*?NPW j&y+(Z ZTaW楦g|_o O*znזQѰfD6`4>f}"iIێLcJ>L]pWkx)ls%VcĠ4)؉rFmϫMzhw \e^@d֜u:Mw,ɚJs!p:c rK^0Pځrqpv p6 )]:n da)y&3~y'R[j[w-x(Rԥ>, %}Ά6_=ZkԾf6m(ug2zقcVʶg@v{6pDK>Fe|X6K"FWK]}r=8"~^.BFyC.œyTwۨ|we]ge"%}EvK=P؉'|nWfƋ0%1=wpYmO)17 ,vZ* Rێq?ws>!BB97IlO*P!⫸/SME6r]?]m]~_ж I6a?;ѕgmeX}fsܲ g[m+#X+qk|pv\i92<|N[GmyRچo_3r5[뙶 eֿk7b.g),ïY/X;}N{ε!٨Tک_)׳ ׊|^on7"{tK~vO6g3Pw`}Q3*;Y{տzSv9K!|D$K}7],2 z8\sī:kV}^>琶.ܯP[GpծY컎5kTK^rsX_&L8d:Œ5ͦBBkQl_H]Ue u{ܢ|f=hK|֡`AGUrBv|s*px\vDᯕ0J2ʟf RݘҷK%{Ԣ[.ם~;6j9bاԒJ+l5 xD#v7{"+.?8T%~=l8?Ff~NQ*d@;ihTY8]d<ZMx6io6QIOڤMD'm&m6i%''i \TCVlIENDB`qmmp-0.7.4/src/qmmpui/images/qmmpui_images.qrc0000664000175000017500000000040712256224735020135 0ustar useruser playlist.png advanced.png plugins.png network.png logo-qmmp.png replaygain.png qmmp-0.7.4/src/qmmpui/images/advanced.png0000664000175000017500000000203612256224735017044 0ustar useruserPNG  IHDR&&sBITO pHYs /LtEXtSoftwarewww.inkscape.org<PLTE______bbbfffggggggeeedddddd```OOO]]]___cccdddfffiiijjjkkklllmmmnnnrrruuuwwwxxx|||~~~M6I{ tRNS(YH[IDAT8˭?oA] ϊ B -D|,>m!P!(h@F# 37 [4}j jy#^AO\7t:?_?LH T096őyPKU $O0ׯmWbfd^ػ]B:aهL@ڻ[jΧ[%%jz^:zs u qf:`9L}j"kꚡ:CF/AfcIENDB`qmmp-0.7.4/src/qmmpui/images/playlist.png0000664000175000017500000000134712256224735017144 0ustar useruserPNG  IHDR&&sBITO pHYs /LtEXtSoftwarewww.inkscape.org<PLTE______bbbfffggggggeeedddddd```KKKLLLNNNOOOXXXZZZ]]]^^^___```aaahhhkkkmmmvvv||| tRNS(YH[,IDAT8R0t+.Z[V T+V-ēdȉsgk"SπrՀ rl@)J(UJnz斀gKaHl1|2 >OkT${W[c:۝lv( Yp[Uai 3 ~4E7e8f1p֒RuzE͕#Kn*O.tX|^,pl:@MdG]Kp)]W`=+ur¤]3q7S9\39| c2yIENDB`qmmp-0.7.4/src/qmmpui/jumptotrackdialog.cpp0000664000175000017500000001275112256224735017560 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "jumptotrackdialog_p.h" #include "playlistmanager.h" #include "mediaplayer.h" #include #include #include #include #include #include JumpToTrackDialog::JumpToTrackDialog(PlayListModel *model, QWidget* parent) : QDialog (parent) { setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_DeleteOnClose, true); m_model = model; m_pl_manager = PlayListManager::instance(); m_listModel = new QStringListModel(this); m_proxyModel = new QSortFilterProxyModel(this); m_proxyModel->setDynamicSortFilter(true); m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); m_proxyModel->setSourceModel(m_listModel); songsListView->setModel(m_proxyModel); connect(songsListView,SIGNAL(doubleClicked(const QModelIndex &)), this,SLOT(jumpTo(const QModelIndex&))); connect(songsListView,SIGNAL(activated(const QModelIndex &)), this,SLOT(jumpTo(const QModelIndex&))); connect(songsListView,SIGNAL(activated(const QModelIndex &)), this,SLOT(accept())); connect(songsListView->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex&,const QModelIndex&)), this,SLOT(queueUnqueue(const QModelIndex&,const QModelIndex&))); connect(m_model, SIGNAL(destroyed()), SLOT(close())); new QShortcut(tr("Q"),this,SLOT(on_queuePushButton_clicked())); new QShortcut(tr("J"),this,SLOT(on_jumpToPushButton_clicked())); new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked())); QAction *selectSongViewAction = new QAction(filterLineEdit); selectSongViewAction->setShortcut(Qt::Key_Down); selectSongViewAction->setShortcutContext(Qt::WidgetShortcut); filterLineEdit->addAction(selectSongViewAction); connect(selectSongViewAction, SIGNAL(triggered()),songsListView, SLOT(setFocus())); //setup icons refreshPushButton->setIcon(QIcon::fromTheme("view-refresh")); jumpToPushButton->setIcon(QIcon::fromTheme("go-top")); } JumpToTrackDialog::~JumpToTrackDialog() { } void JumpToTrackDialog::on_refreshPushButton_clicked() { refresh(); } void JumpToTrackDialog::on_queuePushButton_clicked() { QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); if (!mi_list.isEmpty()) { int selected = (m_proxyModel->mapToSource(mi_list.at(0))).row(); m_model->setQueued(m_model->item(selected)); if (m_model->isQueued(m_model->item(selected))) queuePushButton->setText(tr("Unqueue")); else queuePushButton->setText(tr("Queue")); } } void JumpToTrackDialog::on_jumpToPushButton_clicked() { QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); if (!mi_list.isEmpty()) { jumpTo(mi_list.at(0)); } } void JumpToTrackDialog::refresh() { filterLineEdit->clear(); QStringList titles = m_model->getTitles(0, m_model->count()); m_listModel->setStringList(titles); filterLineEdit->setFocus(); } void JumpToTrackDialog::on_filterLineEdit_textChanged(const QString &str) { m_proxyModel->setFilterFixedString(str); if (m_proxyModel->hasIndex(0,0)) songsListView->setCurrentIndex (m_proxyModel->index (0,0)); } void JumpToTrackDialog::on_filterLineEdit_returnPressed () { QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); if (!mi_list.isEmpty()) { jumpTo(mi_list.at(0)); accept(); } } void JumpToTrackDialog::jumpTo(const QModelIndex & index) { int selected = (m_proxyModel->mapToSource(index)).row(); m_model->setCurrent(selected); SoundCore::instance()->stop(); m_pl_manager->activatePlayList(m_model); MediaPlayer::instance()->play(); } void JumpToTrackDialog::queueUnqueue(const QModelIndex& curr,const QModelIndex&) { int row = m_proxyModel->mapToSource(curr).row(); if (m_model->isQueued(m_model->item(row))) queuePushButton->setText(tr("Unqueue")); else queuePushButton->setText(tr("Queue")); } qmmp-0.7.4/src/qmmpui/jumptotrackdialog_p.h0000664000175000017500000000465612256224735017551 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef JUMPTOTRACKDIALOG_P_H #define JUMPTOTRACKDIALOG_P_H #include #include "ui_jumptotrackdialog.h" class QStringListModel; class QSortFilterProxyModel; class PlayListManager; class PlayListModel; /** @internal @author Vladimir Kuznetsov */ class JumpToTrackDialog : public QDialog, private Ui::JumpToTrackDialog { Q_OBJECT public: JumpToTrackDialog(PlayListModel *model, QWidget* parent = 0); ~JumpToTrackDialog(); void refresh(); private slots: void on_refreshPushButton_clicked(); void on_queuePushButton_clicked(); void on_jumpToPushButton_clicked(); void on_filterLineEdit_textChanged(const QString&); void on_filterLineEdit_returnPressed (); void jumpTo(const QModelIndex&); void queueUnqueue(const QModelIndex&,const QModelIndex&); private: QStringListModel* m_listModel; QSortFilterProxyModel* m_proxyModel; PlayListManager *m_pl_manager; PlayListModel *m_model; }; #endif //JUMPTOTRACKDIALOG_P_H qmmp-0.7.4/src/qmmpui/uiloader.cpp0000664000175000017500000000704012256224735015634 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "uiloader.h" QList *UiLoader::m_factories = 0; QHash *UiLoader::m_files = 0; void UiLoader::checkFactories() { if (!m_factories) { m_factories = new QList; m_files = new QHash ; QDir pluginsDir(Qmmp::pluginsPath()); pluginsDir.cd("Ui"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("UiLoader: loaded plugin %s", qPrintable(fileName)); else qWarning("UiLoader: %s", qPrintable(loader.errorString())); UiFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } } } QList *UiLoader::factories() { checkFactories(); return m_factories; } QString UiLoader::file(UiFactory *factory) { checkFactories(); return m_files->value(factory); } void UiLoader::select(UiFactory* factory) { checkFactories(); if (!m_factories->contains(factory)) return; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Ui/current_plugin", factory->properties().shortName); } UiFactory *UiLoader::selected() { checkFactories(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QString name = settings.value("Ui/current_plugin", "skinned").toString(); foreach(UiFactory *factory, *m_factories) { if (factory->properties().shortName == name) return factory; } if (!m_factories->isEmpty()) return m_factories->at(0); return 0; } qmmp-0.7.4/src/qmmpui/uiloader.h0000664000175000017500000000452312256224735015304 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef UI_H #define UI_H #include #include #include "uifactory.h" /*! @brief The UiLoader provides user interface plugins access * @author Ilya Kotov */ class UiLoader { public: /*! * Returns a list of the loaded ui plugin factories. */ static QList *factories(); /*! * Returns plugin file path. * @param factory User interface plugin factory. */ static QString file(UiFactory *factory); /*! * Selects active user interface factory. * @param factory Ui plugin factory. */ static void select(UiFactory* factory); /*! * Returns \b true if general plugin is enabled, otherwise returns \b false */ static UiFactory *selected(); private: static QList *m_factories; static QHash *m_files; static void checkFactories(); }; #endif //UI_H qmmp-0.7.4/src/qmmpui/mediaplayer.h0000664000175000017500000000775412256224735016005 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MEDIAPLAYER_H #define MEDIAPLAYER_H #include #include #include "playlistmanager.h" class QmmpUiSettings; /*! @brief The MediaPlayer class provides a simple way to use SoundCore and PlayListModel together. * @author Ilya Kotov */ class MediaPlayer : public QObject { Q_OBJECT public: /*! * Object constructor, * @param parent Parent object */ MediaPlayer(QObject *parent = 0); /*! * Destructor */ ~MediaPlayer(); /*! * Returns a pointer to the object's instance. */ static MediaPlayer* instance(); /*! * Returns playlist manager pointer */ PlayListManager *playListManager(); /*! * Returns \b true if "Repeate Track" option is enabled, otherwise returns \b false */ bool isRepeatable() const; /*! * Returns \b true if "No playlist advance" option is enabled, otherwise returns \b false */ bool isNoPlaylistAdvance() const; public slots: /*! * Starts playback. */ void play(qint64 offset = -1); /*! * Stops playback. */ void stop(); /*! * Sets next playlist item for playing. */ void next(); /*! * Sets previous playlist item for playing. */ void previous(); /*! * Toggles the current track repeat. * @param enable Repeate state of the current track (\b true - to repeat, \b false - to stop repeating) */ void setRepeatable(bool enable); /*! * When finished playing a song, don't automatically advance to the next * @param enable State of the 'No playlist advance' option * (\b true - enabled, \b false - normal playback) */ void setNoPlaylistAdvance(bool enable); signals: /*! * Tracks current track repeat state; * @param enabled New repeate state of the current track (\b true - enabled, \b false - disabled) */ void repeatableChanged(bool enabled); /*! * Emitted when state of the "No playlist advance" option changes. * @param enabled New state of this option (\b true - no playlist advance, * \b false - normal playlist behaviour) */ void noPlaylistAdvanceChanged(bool enabled); private slots: void playNext(); void updateNextUrl(); void processState(Qmmp::State state); void updateMetaData(); private: QmmpUiSettings *m_settings; PlayListManager *m_pl_manager; SoundCore *m_core; static MediaPlayer* m_instance; bool m_repeat; bool m_noPlaylistAdvance; int m_skips; QString m_nextUrl; }; #endif qmmp-0.7.4/src/qmmpui/translations/0000775000175000017500000000000012256224735016044 5ustar useruserqmmp-0.7.4/src/qmmpui/translations/libqmmpui_zh_CN.ts0000664000175000017500000010153112256224735021475 0ustar useruser AboutDialog About Qmmp 关于 Qmmp About 关于 License Agreement 许可协议 Authors 作者 Thanks To 感谢 Qt-based Multimedia Player (Qmmp) 基于 Qt 的多媒体播放器 (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: 输入插件: Output plugins: 输出插件 Visual plugins: 可视化插件 Effect plugins: 特效插件: General plugins: 常规插件: Translators 翻译 AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description 描述 Filename 文件名 Artist 艺术家 Album 专辑 Track 音轨 Disabled Transports Decoders Engines Output File Dialogs User Interfaces Title 标题 Track number 音轨编号 Two-digit track number 两位数音轨编号 Disc number 光盘编号 Condition 条件 <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre 流派 Composer 作曲 File name 文件名 File path 文件路径 Year 年代 Comment 备注 Qmmp Settings Qmmp 设置 ... ... Metadata 元数据 Load metadata from files 从文件载入元数据 Title format: 标题格式: Preferences 参数设置 Information 信息 Playlist 播放列表 Plugins 插件 Advanced 高级 16-bit output Connectivity 连接 Visualization 可视化 Effects 特效 General 常规 Audio 音频 Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control 使用软设备音量控制 Cover Image Retrieve Use separate image files Include files: Exclude files: Recursive search depth: Playback Continue playback on startup Determine file type by content Proxy 代理 Enable proxy usage 启用代理 Proxy host name: 主机名: Proxy port: 端口: Use authentication with proxy 需要身份验证 Proxy user name: 用户名: Proxy password: 密码: Convert underscores to blanks 转换下划线为空格 Convert %20 to blanks 转换 %20 为空格 DetailsDialog Title 标题 Artist 艺术家 Album 专辑 Comment 备注 Genre 流派 Composer 作曲 Year 年代 Track 音轨 Disc number 光盘编号 Details 详细资料 Open the directory containing this file 打开该文件所在的文件夹 ... ... Summary 摘要 JumpToTrackDialog Jump To Track 跳到音轨 Filter 过滤 Queue 加入队列 Refresh 刷新 Jump To 跳到 Q Q J J F5 Unqueue 移出队列 PlayListDownloader Unsupported playlist format PlayListManager Playlist 播放列表 QmmpUiSettings Playlist 播放列表 QtFileDialogFactory Qt File Dialog Qmmp 文件对话 TagEditor Title: 标题: Artist: 艺术家: Album: 专辑: Composer: 作曲: Genre: 流派: Disc number: 光盘编号 ? Track: 音轨: Year: 年代: Tag Editor 标签编辑 Comment: 备注: Include selected tag in file 包含文件中的已选标签 TemplateEditor Reset 重设 Insert 插入 Template Editor 模板编辑 Artist 艺术家 Album 专辑 Title 标题 Track number 音轨编号 Two-digit track number 两位数音轨编号 Genre 流派 Comment 备注 Composer 作曲 Duration 持续时间 Disc number 光盘编号 File name 文件名 File path 文件路径 Year 年代 Condition 条件 UiHelper All Supported Bitstreams 支持的全部文件 Select one or more files to open 选择打开一个或更多文件 Choose a directory 选择一个目录 Playlist Files 播放列表文件 Open Playlist 打开播放列表 Save Playlist 保存播放列表 qmmp-0.7.4/src/qmmpui/translations/libqmmpui_zh_TW.ts0000664000175000017500000010143212256224735021527 0ustar useruser AboutDialog About Qmmp 關於 Qmmp About 關於 License Agreement 許可協定 Authors 作者 Thanks To 感謝 Qt-based Multimedia Player (Qmmp) 基於 Qt 的多媒體播放器 (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: 匯入插件: Output plugins: 匯出插件 Visual plugins: 可視化插件 Effect plugins: 特效插件: General plugins: 常規插件: Translators 翻譯 AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description 說明 Filename 檔名 Artist 藝術家 Album 專輯 Track 音軌 Disabled Transports Decoders Engines Output File Dialogs User Interfaces Title 標題 Track number 音軌編號 Two-digit track number 兩位數音軌編號 Disc number 光槃編號 Condition 條件 <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre 流派 Composer 作曲 File name 文件名 File path 文件路徑 Year 年代 Comment 備註 Qmmp Settings Qmmp 設定 ... ... Metadata 元資料 Load metadata from files 從檔案載入元資料 Title format: 標題格式: Preferences 引數設定 Information 資訊 Playlist 播放清單 Plugins 插件 Advanced 進階 16-bit output Connectivity 連線 Visualization 可視化 Effects 特效 General 常規 Audio 聲訊 Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control 使用軟裝置音量控制 Cover Image Retrieve Use separate image files Include files: Exclude files: Recursive search depth: Playback Continue playback on startup Determine file type by content Proxy 代理 Enable proxy usage 啟用代理 Proxy host name: 主機名: Proxy port: 通訊埠: Use authentication with proxy 需要身份驗證 Proxy user name: 用戶名: Proxy password: 密碼: Convert underscores to blanks 轉換底線為空格 Convert %20 to blanks 轉換 %20 為空格 DetailsDialog Title 標題 Artist 藝術家 Album 專輯 Comment 備註 Genre 流派 Composer 作曲 Year 年代 Track 音軌 Disc number 光槃編號 Details 詳細資料 Open the directory containing this file 打開該文件所在的文件夾 ... Summary 摘要 JumpToTrackDialog Jump To Track 跳到音軌 Filter 過濾 Queue 加入佇列 Refresh 刷新 Jump To 跳到 Q Q J J F5 Unqueue 移出佇列 PlayListDownloader Unsupported playlist format PlayListManager Playlist 播放清單 QmmpUiSettings Playlist 播放清單 QtFileDialogFactory Qt File Dialog Qmmp 檔案會話 TagEditor Title: 標題: Artist: 藝術家: Album: 專輯: Composer: 作曲: Genre: 流派: Disc number: 光槃編號 ? Track: 音軌 Year: Tag Editor 標簽編輯 Comment: 備註 Include selected tag in file 包含文件中的已選標簽 TemplateEditor Reset 重設 Insert 插入 Template Editor 模板編輯 Artist 藝術家 Album Title 標題 Track number 音軌編號 Two-digit track number 兩位數音軌編號 Genre 流派 Comment 備註 Composer 作曲 Duration 持續時間 Disc number 光槃編號 File name 文件名 File path 文件路徑 Year 年代 Condition 條件 UiHelper All Supported Bitstreams 支援的全部檔案 Select one or more files to open 選取開啟一個或更多檔案 Choose a directory 選取一個目錄 Playlist Files 播放清單檔案 Open Playlist 開啟播放清單 Save Playlist 儲存播放清單 qmmp-0.7.4/src/qmmpui/translations/libqmmpui_gl_ES.ts0000664000175000017500000010135412256224735021470 0ustar useruser AboutDialog About Qmmp Sobre Qmmp About Sobre Authors Autores Translators Tradutores Thanks To Agradecementos a License Agreement Acordo de licenza Qt-based Multimedia Player (Qmmp) Reprodutor multimedia basado en Qt (qmmp) Version: %1 Versión: %1 Using Qt %1 (compiled with Qt %2) Usando Qt %1 (compilado con Qt %2) (c) %1-%2 Qmmp Development Team (c) %1-%2 Equipo de desenvolvemento de Qmmp Input plugins: Engadidos de entrada: Output plugins: Engadidos de saída: Visual plugins: Engadidos de visualización: Effect plugins: Engadidos de efectos: General plugins: Engadidos xerais: AddUrlDialog Enter URL to add Introduza URL para engadir &Add &Engadir &Cancel &Cancelar Error Erro ConfigDialog Qmmp Settings Opcións de Qmmp Playlist Lista de reprodución Plugins Engadidos Advanced Avanzado Connectivity Conectividade Audio Audio Metadata Metadatos Load metadata from files Cargar os metadatos dende os arquivos Convert underscores to blanks Converter os guións baixos en espazos en branco Convert %20 to blanks Converter %20 en espazos en branco Title format: Formato de título: ... ... Directory Scanning Options Opcións de escaneado de directorios Restrict files to: Restrinxir arquivos a: Exclude files: Excluír ficheiros: Miscellaneous Miscelánea Auto-save playlist when modified Autogardar a lista de reprodución cando se modifique Preferences Preferencias Information Información Description Descrición Filename Nome do ficheiro Look and Feel Look and Feel Language: Idioma: Playback Reprodución Continue playback on startup Continuar a reprodución no inicio Determine file type by content Determinar o tipo de ficheiro polo contido Add files from command line to this playlist: Engadir ficheiros dende a liña de comandos a esta lista de reprodución: Cover Image Retrieve Obter a imaxe de portada Use separate image files Usar ficheiros de imaxe separados Include files: Incluír ficheiros: Recursive search depth: Busca recursiva: URL Dialog Diálogo URL Auto-paste URL from clipboard Autopegar URL do portarretallos Proxy Proxy Enable proxy usage Activar uso de proxy Proxy host name: Nome do host proxy: Proxy port: Porto proxy: Use authentication with proxy Usar autentificación con proxy Proxy user name: Nome de usuario proxy: Proxy password: Contrasinal proxy: Replay Gain Ganancia de reprodución Replay Gain mode: Modo de ganancia: Preamp: Preamp: dB dB Default gain: Ganancia por defecto: Use peak info to prevent clipping Usar información de pico para evitar clipping Buffer size: Tamaño buffer: ms ms Use software volume control Usar control de volume de software 16-bit output Saída de 16 bit Track Pista Album Álbum Disabled Desactivado Transports Transportes Decoders Decodificadores Engines Motores Effects Efectos Visualization Visualización General Xeral Output Saída File Dialogs Diálogos de ficheiro User Interfaces Interfaces de usuario Artist Artista Title Título Track number Número de pista Two-digit track number Número de pista de dous díxitos Genre Xénero Comment Comentario Composer Compositor Disc number Número de disco File name Nome de ficheiro File path Ruta do ficheiro Year Ano Condition Condición <Autodetect> <Autodetectar> Brazilian Portuguese Portugués do Brasil Chinese Simplified Chino simplificado Chinese Traditional Chino tradicional Czech Checo Dutch Holandés English Inglés French Francés Galician Galego German Alemán Hebrew Hebreo Hungarian Húngaro Italian Italiano Japanese Xaponés Kazakh Kazaxo Lithuanian Lituano Polish Polaco Russian Ruso Slovak Eslovaco Spanish Español Turkish Turco Ukrainian Ucraniano DetailsDialog Details Detalles Open the directory containing this file Abrir o directorio que contén o ficheiro ... ... Summary Resumo Title Título Artist Artista Album Álbum Comment Comentario Genre Xénero Composer Compositor Year Ano Track Pista Disc number Número de disco JumpToTrackDialog Jump To Track Saltar a pista Filter Filtro Queue Cola Refresh Refrescar Jump To Saltar a Q Q J J F5 F5 Unqueue Sacar da cola PlayListDownloader Unsupported playlist format Formato de lista non soportado PlayListManager Playlist Lista de reproducción QmmpUiSettings Playlist Lista de reprodución QtFileDialogFactory Qt File Dialog Diálogo de ficheiro Qt TagEditor Tag Editor Editor de etiquetas Title: Título: Artist: Artista: Album: Álbum: Composer: Compositor: Genre: Xénero: Track: Pista: ? ? Year: Ano: Disc number: Número de disco: Comment: Comentarios: Include selected tag in file Incluír a etiqueta seleccionada no ficheiro TemplateEditor Template Editor Editor de plantillas Reset Restablecer Insert Insertar Artist Artista Album Álbum Title Título Track number Número de pista Two-digit track number Número de pista de dous díxitos Genre Xénero Comment Comentarios Composer Compositor Duration Duración Disc number Número de disco File name Nome do ficheiro File path Ruta ó ficheiro Year Ano Condition Condición UiHelper All Supported Bitstreams Tódolos bitstreams soportados Select one or more files to open Selecciona un ou máis ficheiros para abrir Choose a directory Escolla un directorio Playlist Files Arquivos de lista de reprodución Open Playlist Abrir lista de reprodución Save Playlist Gardar a lista de reprodución qmmp-0.7.4/src/qmmpui/translations/libqmmpui_locales.qrc0000664000175000017500000000135512256224735022260 0ustar useruser libqmmpui_ru.qm libqmmpui_uk_UA.qm libqmmpui_zh_CN.qm libqmmpui_zh_TW.qm libqmmpui_tr.qm libqmmpui_cs.qm libqmmpui_pt_BR.qm libqmmpui_de.qm libqmmpui_pl_PL.qm libqmmpui_fr.qm libqmmpui_it.qm libqmmpui_kk.qm libqmmpui_lt.qm libqmmpui_hu.qm libqmmpui_nl.qm libqmmpui_ja.qm libqmmpui_sk.qm libqmmpui_es.qm libqmmpui_he.qm libqmmpui_gl_ES.qm qmmp-0.7.4/src/qmmpui/translations/libqmmpui_uk_UA.ts0000664000175000017500000010474612256224735021513 0ustar useruser AboutDialog About Qmmp Про Qmmp About Про програму License Agreement Ліцензія Authors Автори Thanks To Подяки Qt-based Multimedia Player (Qmmp) Мультимедійний програвач на базі Qt (Qmmp) Version: %1 Версія: %1 Using Qt %1 (compiled with Qt %2) Використовується Qt %1 (зібрано з Qt %2) (c) %1-%2 Qmmp Development Team (c) %1-%2 Команда розробників Qmmp Input plugins: Модулі введення: Output plugins: Модулі виведення: Visual plugins: Модулі візуалізації: Effect plugins: Модулі ефектів: General plugins: Загальні модулі: Translators Перекладачі AddUrlDialog Enter URL to add Введіть адресу для додавання &Add &Додати &Cancel &Відміна Error Помилка ConfigDialog Description Пояснення Filename Ім'я файлу Artist Виконавець Album Альбом Track Трек Disabled Вимкнено Transports Транспорти Decoders Декодери Engines Зовнішні програвачі Output Вивід File Dialogs Файлові діалоги User Interfaces Інтерфейси користувача Title Назва Track number Номер треку Two-digit track number 2- розрядний номер трека Disc number Номер диску Condition Умова <Autodetect> <Автоматично> Brazilian Portuguese Бразильська португальська Chinese Simplified Китайська спрощена Chinese Traditional Китайська традиційна Czech Чеська Dutch Голландська English Англійська French Французька Galician German Німецька Hebrew Іврит Hungarian Угорська Italian Італійська Japanese Японська Kazakh Казахська Lithuanian Литовська Polish Польська Russian Російська Slovak Словацька Spanish Іспанська Turkish Турецька Ukrainian Українська Genre Жанр Composer Композитор File name Ім'я файлу File path Шлях файлу Year Рік Comment Коментар Qmmp Settings Налаштування Qmmp ... ... Metadata Метадані Load metadata from files Зчитувати метадані з файлів Title format: Формат назви: Preferences Налаштування Information Інформація Playlist Список Plugins Модулі Advanced Додатково 16-bit output 16-бітний вивід Connectivity Мережа Visualization Візуалізація Effects Ефекти General Загальне Audio Звук Directory Scanning Options Опції сканування тек Restrict files to: Обмежити вибір файлів до: Miscellaneous Різне Auto-save playlist when modified Автозбереження переліку після зміни Look and Feel Параметри інтерфейсу Language: Мова: Add files from command line to this playlist: Додавати файли з командного рядка в цей список: URL Dialog URL-діалог Auto-paste URL from clipboard Автоматично додавати URL з буферу обміну Replay Gain Нормалізація гучності Replay Gain mode: Режим нормалізації гучності: Preamp: Преамплітуда: dB Default gain: Нормалізація за умовчанням: Use peak info to prevent clipping Використовувати інформацію піків для запобігання відсікання Buffer size: Розмір буферу: ms мс Use software volume control Використовувати програмний контроль гучності Cover Image Retrieve Пошук обладинки альбома Use separate image files Використовувати окремі файли зображень Include files: Включити файли: Exclude files: Виключити файли: Recursive search depth: Глибина рекурсивного пошуку: Playback Відтворення Continue playback on startup Продовжити відтворення при запуску Determine file type by content Визначати тип файлу за вмістом Proxy Проксі Enable proxy usage Використосувати проксі Proxy host name: Сервер проксі: Proxy port: Порт проксі: Use authentication with proxy Використовувати авторизацію на проксі Proxy user name: Ім'я користвача проксі: Proxy password: Пароль проксі: Convert underscores to blanks Конвертувати підкреслювання в пробіл Convert %20 to blanks Конвертувати %20 в пробіл DetailsDialog Title Заголовок Artist Виконавець Album Альбом Comment Коментар Genre Жанр Composer Композитор Year Рік Track Доріжка Disc number Номер диску Details Подробиці Open the directory containing this file Відкрити теку, яка містить цей файл ... Summary Підсумок JumpToTrackDialog Jump To Track Перейти до треку Filter Фільтр Queue В чергу Refresh Поновити Jump To Перейти до Q J F5 Unqueue Зняти з черги PlayListDownloader Unsupported playlist format Формат списку не підтримується PlayListManager Playlist Список QmmpUiSettings Playlist Список QtFileDialogFactory Qt File Dialog Файловий діалог Qt TagEditor Title: Заголовок: Artist: Виконавець: Album: Альбом: Composer: Композитор: Genre: Жанр: Disc number: Номер диску: ? Track: Доріжка: Year: Рік: Tag Editor Редактор тегів Comment: Коментар: Include selected tag in file Включити вибраний тег у файл TemplateEditor Reset Скинути Insert Вставити Template Editor Редактор шаблонів Artist Виконавець Album Альбом Title Заголовок Track number Номер треку Two-digit track number 2-розрядний номер треку Genre Жанр Comment Коментар Composer Композитор Duration Тривалість Disc number Номер диску File name Ім'я файла File path Шлях до файла Year Рік Condition Умова UiHelper All Supported Bitstreams Усі формати Select one or more files to open Виберіть один чи кілька файлів Choose a directory Виберіть теку Playlist Files Файли списків Open Playlist Відкрити список Save Playlist Зберегти список qmmp-0.7.4/src/qmmpui/translations/libqmmpui_pl_PL.ts0000664000175000017500000010075012256224735021504 0ustar useruser AboutDialog About Qmmp O programie About O programie Authors Autorzy Translators Tłumaczenie Thanks To Podziękowania License Agreement Licencja Qt-based Multimedia Player (Qmmp) Oparty na bibliotekach QT odtwarzacz (Qmmp) Version: %1 Wersja: %1 Using Qt %1 (compiled with Qt %2) Używa Qt %1 (kompilowany z Qt %2) (c) %1-%2 Qmmp Development Team (c) %1-%2 Zespół programistyczny Qmmp Input plugins: Wtyczki wejściowe: Output plugins: Wtyczki wyjściowe: Visual plugins: Wizualizacje: Effect plugins: Wtyczki efektów: General plugins: Wtyczki ogólne: AddUrlDialog Enter URL to add Wipsz URL do dodania &Add Dod&aj &Cancel Anuluj Error Błąd ConfigDialog Description Opis Filename Nazwa pliku Artist Artysta Album Album Track Utwór Disabled Wyłączone Transports Transporty Decoders Dekodery Engines Silniki Output Wyjście File Dialogs Okno dialogowe User Interfaces Interfejs użytkownika Title Tytuł Track number Numer utworu Two-digit track number Dwuznakowy numer utworu Disc number Numer albumu Condition Warunek <Autodetect> <Automatyczne> Brazilian Portuguese Brazylijski Portugalski Chinese Simplified Chiński Uproszczony Chinese Traditional Chiński Tradycyjny Czech Czeski Dutch Holenderski English Angielski French Francuski Galician German Niemiecki Hebrew Hebrajski Hungarian Węgierski Italian Włoski Japanese Japoński Kazakh Kazaski Lithuanian Litewski Polish Polski Russian Rosyjski Slovak Słowacki Spanish Hiszpański Turkish Turecki Ukrainian Ukraiński Genre Gatunek Composer Kompozytor File name Nazwa pliku File path Lokalizacja Year Rok Comment Komentarz Qmmp Settings Ustawienia Qmmp ... ... Metadata Metadane Load metadata from files Załaduj metadane z pliku Title format: Format tytułu: Preferences Ustawienia Information Informacje Playlist Lista odtwarzania Plugins Wtyczki Advanced Zaawansowane 16-bit output 16-bitowe odtwarzanie Connectivity Sieć Visualization Wizualizacje Effects Efekty General Ogólne Audio Dźwięk Directory Scanning Options Opcje skanowania katalogów Restrict files to: Ogranicz pliki do: Miscellaneous Różne Auto-save playlist when modified Automatyczny zapis listy odtwarzania przy modyfikacji Look and Feel Wygląd i zachowanie Language: Język: Add files from command line to this playlist: Dodaj pliki z linii poleceń do listy odtwarzania: URL Dialog Okno dialogowe URL Auto-paste URL from clipboard Automatycznie wklejaj URL ze schowka Replay Gain Replay Gain mode: Tryb Replay Gain: Preamp: dB Default gain: Domyślne wzmocnienie: Use peak info to prevent clipping Użyj informacji peak by zapobiec "klipnięciom" Buffer size: Rozmiar bufora: ms ms Use software volume control Użyj programowej regulacji głośności Cover Image Retrieve Pobieranie okładek Use separate image files Użyj oddzielnych obrazków Include files: Użyj plików: Exclude files: Wyłącz pliki: Recursive search depth: Głębokość rekursywnego przeszukiwania: Playback Odtwarzanie Continue playback on startup Wznów odtwarzanie po uruchomieniu programu Determine file type by content Określ typ pliku po zawartości Proxy Proxy Enable proxy usage Włącz proxy Proxy host name: Nazwa hosta proxy: Proxy port: Port proxy: Use authentication with proxy Użyj autoryzacji z proxy Proxy user name: Nazwa użytkownika: Proxy password: Hasło: Convert underscores to blanks Konwertuj podkreślenia na spacje Convert %20 to blanks Konwertuj sekwencje %20 na spacje DetailsDialog Title Tytuł Artist Artysta Album Album Comment Komentarz Genre Gatunek Composer Kompozytor Year Rok Track Ścieżka Disc number Numer płyty Details Szczegóły Open the directory containing this file Otwórz katalog zawierający ten plik ... ... Summary Informacje JumpToTrackDialog Jump To Track Skocz do utworu Filter Filtr Queue Kolejkuj Refresh Odśwież Jump To Skocz do Q Q J J F5 F5 Unqueue Wykolejkuj PlayListDownloader Unsupported playlist format Niewspierane listy odtwarzania PlayListManager Playlist Lista odtwarzania QmmpUiSettings Playlist Lista odtwarzania QtFileDialogFactory Qt File Dialog Okno dialogowe QT TagEditor Title: Tytuł: Artist: Artysta: Album: Album: Composer: Kompozytor: Genre: Gatunek: Disc number: Numer albumu: ? Track: Ścieżka: Year: Rok: Tag Editor Edytor tagów Comment: Komentarz: Include selected tag in file Dołącz wybrany tag do pliku TemplateEditor Reset Wyczyść Insert Wstaw Template Editor Edytor szablonów Artist Artysta Album Album Title Tytuł Track number Numer utworu Two-digit track number Dwucyfrowy numer utworu Genre Gatunek Comment Komentarz Composer Kompozytor Duration Długość Disc number Numer płyty File name Nazwa pliku File path Ścieżka pliku Year Rok Condition Warunek UiHelper All Supported Bitstreams Wszystkie wspierane formaty Select one or more files to open Wybierz jeden lub więcej plików do otwarcia Choose a directory Wybierz katalog Playlist Files Pliki listy odtwarzania Open Playlist Otwórz listę odtwarzania Save Playlist Zapisz listę odtwarzania qmmp-0.7.4/src/qmmpui/translations/libqmmpui_de.ts0000664000175000017500000010130312256224735021061 0ustar useruser AboutDialog About Qmmp Über Qmmp About Info Authors Autoren Thanks To Dank an License Agreement Lizenz Qt-based Multimedia Player (Qmmp) Qt-basierter Multimedia-Player (Qmmp) Version: %1 Version: %1 Using Qt %1 (compiled with Qt %2) Unter Einsatz von Qt %1 (kompiliert mit Qt %2) (c) %1-%2 Qmmp Development Team © %1–%2 Qmmp-Entwicklerteam Input plugins: Eingabe-Module: Output plugins: Ausgabe-Module: Visual plugins: Visualisierungsmodule: Effect plugins: Effekt-Module: General plugins: Sonstige Module: Translators Übersetzer AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Beschreibung Filename Dateiname Artist Interpret Album Album Track Stück Disabled Deaktiviert Transports Transporte Decoders Dekoder Engines Output File Dialogs User Interfaces Title Titel Track number Stücknummer Two-digit track number Zweistellige Stücknummer Disc number CD-Nummer Condition Zustand <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre Genre Composer Komponist File name Dateiname File path Dateipfad Year Jahr Comment Kommentar Qmmp Settings Einstellungen Playlist Wiedergabeliste Plugins Module Advanced Erweitert Replay Gain Replay Gain ... ... Metadata Metadaten Load metadata from files Metadaten aus Dateien laden Title format: Titelformat: Preferences Konfiguration Information Information Cover Image Retrieve Holen von Cover-Bildern Use separate image files Separate Bilddateien verwenden Include files: Einzubeziehende Dateien: Exclude files: Auszuschließende Dateien: Recursive search depth: Rekursive Suchtiefe: Playback Wiedergabe Continue playback on startup Wiedergabe beim Start fortsetzen Determine file type by content Dateityp anhand des Inhalts bestimmen Directory Scanning Options Einstellungen zum Durchsuchen von Ordnern Restrict files to: Dateien beschränken auf: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: Von der Befehlszeile hinzugefügte Dateien zu dieser Wiedergabeliste hinzufügen: URL Dialog Auto-paste URL from clipboard Replay Gain mode: Replay-Gain-Modus: Preamp: Vorverstärkung: dB dB Default gain: Use peak info to prevent clipping Peak-Informationen verwenden, um Clipping zu verhindern Buffer size: Puffergröße: ms ms 16-bit output 16-Bit-Ausgabe Connectivity Verbindung Proxy Proxyserver Enable proxy usage Proxyserver verwenden Proxy host name: Name des Proxyservers: Proxy port: Port: Use authentication with proxy Authentisierung verwenden Proxy user name: Benutzername: Proxy password: Passwort: Visualization Visualisierung Effects Effekte General Sonstige Audio Audio Use software volume control Softwaregesteuerte Lautstärkeregelung Convert underscores to blanks Unterstriche in Leerzeichen umwandeln Convert %20 to blanks %20 in Leerzeichen umwandeln DetailsDialog Title Titel Artist Interpret Album Album Comment Kommentar Genre Genre Composer Komponent Year Jahr Track Stück Disc number CD-Nummer Details Details Open the directory containing this file Das Verzeichnis öffnen, in dem sich diese Datei befindet ... Summary Zusammenfassung JumpToTrackDialog Jump To Track Zu Titel springen Filter Filter Queue In Warteschlange Refresh Aktualisieren Jump To Springen zu Q Q J J F5 F5 Unqueue Aus Warteschlange entfernen PlayListDownloader Unsupported playlist format PlayListManager Playlist Wiedergabeliste QmmpUiSettings Playlist Wiedergabeliste QtFileDialogFactory Qt File Dialog Qt Datei-Dialog TagEditor Title: Titel: Artist: Interpret: Album: Album: Composer: Komponist: Genre: Genre: Disc number: CD-Nummer: ? ? Track: Stück: Year: Jahr: Tag Editor Tag-Editor Comment: Kommentar: Include selected tag in file Ausgewählten Tag in Datei einbeziehen TemplateEditor Reset Zurücksetzen Insert Einfügen Template Editor Vorlagen-Editor Artist Interpret Album Album Title Titel Track number Stücknummer Two-digit track number Zweistellige Stücknummer Genre Genre Comment Kommentar Composer Komponent Duration Abspieldauer Disc number CD-Nummer File name Dateiname File path Dateipfad Year Jahr Condition Zustand UiHelper All Supported Bitstreams Alle unterstützten Formate Select one or more files to open Dateien hinzufügen Choose a directory Verzeichnis wählen Playlist Files Wiedergabelisten Open Playlist Wiedergabeliste öffnen Save Playlist Wiedergabeliste speichern qmmp-0.7.4/src/qmmpui/translations/libqmmpui_cs.ts0000664000175000017500000010160412256224735021102 0ustar useruser AboutDialog About Qmmp O Qmmp About O aplikaci Authors Autoři Thanks To Poděkování License Agreement Licence Qt-based Multimedia Player (Qmmp) Qt-based Multimedia Player (Qmmp) Version: %1 Verze: %1 Using Qt %1 (compiled with Qt %2) Používá se Qt %1 (zkompilováno s Qt %2) (c) %1-%2 Qmmp Development Team © %1—%2 Tým vývojářů Qmmp Input plugins: Vstupní moduly: Output plugins: Výstupní moduly: Visual plugins: Vizualizační moduly: Effect plugins: Efektové moduly: General plugins: Obecné moduly: Translators Překladatelé AddUrlDialog Enter URL to add Vložte URL, které se má přidat &Add Přid&at &Cancel &Zrušit Error Chyba ConfigDialog Description Popis Filename Soubor Artist Umělec Album Album Track Stopa Disabled Vypnuto Transports Protokoly Decoders Dekodéry Engines Přehrávače Output Výstup File Dialogs Souborové dialogy User Interfaces Uživatelská rozhraní Title Název Track number Číslo stopy Two-digit track number Dvoumístné číslo stopy Disc number Číslo disku Condition Stav <Autodetect> <Autodetekce> Brazilian Portuguese Brazilská portugalština Chinese Simplified Zjednodušená čínština Chinese Traditional Tradiční čínština Czech Čeština Dutch Nizozemština English Angličtina French Francouzština Galician German Němčina Hebrew Hebrejština Hungarian Maďarština Italian Italština Japanese Japonština Kazakh Kazaština Lithuanian Litevština Polish Polština Russian Ruština Slovak Slovenština Spanish Španělština Turkish Turečtina Ukrainian Ukrajinština Composer Skladatel File name Název souboru File path Cesta k souboru Genre Žánr Year Rok Comment Poznámka Qmmp Settings Nastavení Qmmp Playlist Seznam skladeb Plugins Moduly Advanced Pokročilé Replay Gain Zisk při přehrávání ... ... Metadata Metadata Load metadata from files Číst ze souborů metadata Title format: Formát titulku: Preferences Nastavení Information Informace Cover Image Retrieve Získat obrázek obalu Use separate image files Použít samostatné obrázky Include files: Zahrnout soubory: Exclude files: Vynechat soubory: Recursive search depth: Hloubka rekurzivního hledání: Playback Přehrávání Continue playback on startup Po startu pokračovat v přehrávání Determine file type by content Zjistit formát souboru dle obsahu Directory Scanning Options Možnosti prohledávání adresářů Restrict files to: Omezit soubory na: Miscellaneous Různé Auto-save playlist when modified Automaticky uložit seznam skladeb, je-li změněn Look and Feel ... sakra jak se tohle překládá :-( Vzhled a chování Language: Jazyk: Add files from command line to this playlist: Přidat soubory z příkazové řádky do tohoto seznamu: URL Dialog Dialog URL Auto-paste URL from clipboard Automaticky vložit URL ze schránky Replay Gain mode: Režim úpravy zisku při přehrávání: Preamp: Předzesílení: dB dB Default gain: Výchozí zisk: Use peak info to prevent clipping Použít informaci o vrcholu k zabránění ořezu Buffer size: Velikost vyrovnávací paměti: ms ms 16-bit output 16bitový výstup Connectivity Síť Proxy Proxy Enable proxy usage Povolit používání proxy Proxy host name: Adresa proxy: Proxy port: Port proxy: Use authentication with proxy Použít autorizaci pro proxy Proxy user name: Uživatelské jméno: Proxy password: Heslo: Visualization Vizualizace Effects Efekty General Obecné Audio Zvuk Use software volume control Používat softwarové ovládání hlasitosti Convert underscores to blanks Převést podtržítka na mezery Convert %20 to blanks Převést %20 na mezery DetailsDialog Title Název Artist Umělec Album Album Comment Poznámka Genre Žánr Composer Skladatel Year Rok Track Stopa Disc number Číslo disku Details Podrobnosti Open the directory containing this file Otevřít adresář obsahující tento soubor ... ... Summary Přehled JumpToTrackDialog Jump To Track Přeskočit na skladbu Filter Filtr Queue Zařadit Refresh Obnovit Jump To zkrácno, nevejde se na buttonek Přeskočit Q Q J J F5 F5 Unqueue Vyřadit PlayListDownloader Unsupported playlist format Nepodporovaný formát seznamu skladeb PlayListManager Playlist Seznam skladeb QmmpUiSettings Playlist Seznam skladeb QtFileDialogFactory Qt File Dialog Souborový dialog Qt TagEditor Title: Název: Artist: Umělec: Album: Album: Composer: Skladatel: Genre: Žánr: Disc number: Číslo disku: ? ? Track: Stopa: Year: Rok: Tag Editor Editor tagu Comment: Poznámka: Include selected tag in file Vložit vybraný tag do souboru TemplateEditor Reset Vyčistit Insert Vložit Template Editor Editor šablony Artist Umělec Album Album Title Název Track number Číslo stopy Two-digit track number Dvoumístné číslo stopy Genre Žánr Comment Poznámka Composer Skladatel Duration Délka Disc number Číslo disku File name Název souboru File path Cesta k souboru Year Rok Condition Stav UiHelper All Supported Bitstreams au, proč tam Ilja cpe nesmysl jako "bitstream" ... Všechny podporované formáty Select one or more files to open Vyberte jeden či více souborů k otevření Choose a directory Výberte adresář Playlist Files Seznamy skladeb Open Playlist Načíst seznam skladeb Save Playlist Uložit seznam skladeb qmmp-0.7.4/src/qmmpui/translations/libqmmpui_es.ts0000664000175000017500000010221212256224735021100 0ustar useruser AboutDialog About Qmmp Acerca de Qmmp About Acerca de License Agreement Contrato de licencia Authors Autores Thanks To Gracias a Qt-based Multimedia Player (Qmmp) Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Módulos de entrada: Output plugins: Módulos de salida: Visual plugins: Módulos visuales: Effect plugins: Módulos de efectos: General plugins: Módulos generales: Translators Traductores AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Descripción Filename Nombre del archivo Artist Intérprete Album Album Track Pista Disabled Deshabilitado Transports Transportes Decoders Decodificadores Engines Motores Output File Dialogs User Interfaces Title Título Track number Número de pista Two-digit track number Número de pista con dos cifras Disc number Número de disco Condition Condición <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre Género Composer Compositor File name Nombre del archivo File path Ruta del archivo Year Año Comment Comentario Qmmp Settings Configuración de Qmmp ... ... Metadata Metainformación Load metadata from files Cargar la metainformación de los archivos Title format: Formato del título: Preferences Preferencias Information Información Playlist Lista de reproducción Plugins Módulos Advanced Avanzado 16-bit output Salida de 16 bits Connectivity Conectividad Visualization Visualización Effects Efectos General General Audio Sonido Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Normalización Replay Gain mode: Método de normalización: Preamp: Preamp: dB dB Default gain: Normalización predeterminada: Use peak info to prevent clipping Procesar picos para evitar cortes Buffer size: Tamaño del buffer: ms ms Use software volume control Usar control de volumen por software Cover Image Retrieve Obtener las imagenes de carátula Use separate image files Usar archivos de imágen separados Include files: Incluir archivos: Exclude files: Excluir archivos: Recursive search depth: Profundidad de la búsqueda recursiva: Playback Reproducción Continue playback on startup Continuar la reproducción al iniciar Determine file type by content Proxy Proxy Enable proxy usage Habilitar el uso de proxy Proxy host name: Nombre del servidor proxy: Proxy port: Puerto del proxy: Use authentication with proxy Usar autentificación con el proxy Proxy user name: Usuario del proxy: Proxy password: Contraseña del proxy: Convert underscores to blanks Convertir los guiones bajos en espacios Convert %20 to blanks Convertir los %20 en espacios DetailsDialog Title Título Artist Intérprete Album Album Comment Comentario Genre Género Composer Compositor Year Año Track Pista Disc number Número de disco Details Detalles Open the directory containing this file Abrir el directorio que contiene este archivo ... ... Summary Sumario JumpToTrackDialog Jump To Track Saltar hasta pista Filter Filtrar Queue Encolar Refresh Actualizar Jump To Saltar a Q Q J J F5 F5 Unqueue Desencolar PlayListDownloader Unsupported playlist format PlayListManager Playlist Lista de reproducción QmmpUiSettings Playlist Lista de reproducción QtFileDialogFactory Qt File Dialog Diálogo de archivos Qt TagEditor Title: Título: Artist: Intérprete: Album: Album: Composer: Compositor: Genre: Género: Disc number: Número de disco: ? ? Track: Pista: Year: Año: Tag Editor Editor de etiquetas Comment: Comentario: Include selected tag in file Incluir la etiqueta seleccionada en el archivo TemplateEditor Reset Restaurar Insert Insertar Template Editor Editor de plantillas Artist Intérprete Album Album Title Título Track number Número de pista Two-digit track number Número de pista (2 dígitos) Genre Género Comment Comentario Composer Compositor Duration Duración Disc number Número de disco File name Nombre del archivo File path Ruta del archivo Year Año Condition Condición UiHelper All Supported Bitstreams Todos los flujos soportados Select one or more files to open Seleccione uno o más archivos para abrir Choose a directory Seleccione un directorio Playlist Files Archivos a reproducir Open Playlist Abrir la lista de reproducción Save Playlist Guardar la lista de reproducción qmmp-0.7.4/src/qmmpui/translations/libqmmpui_fr.ts0000664000175000017500000010230412256224735021102 0ustar useruser AboutDialog About Qmmp About Authors Translators Thanks To License Agreement Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Output plugins: Visual plugins: Effect plugins: General plugins: AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Qmmp Settings Playlist Plugins Advanced Connectivity Audio Metadata Load metadata from files Convert underscores to blanks Convert %20 to blanks Title format: ... Directory Scanning Options Restrict files to: Exclude files: Cover Image Retrieve Use separate image files Include files: Recursive search depth: Preferences Miscellaneous Auto-save playlist when modified Information Description Filename Look and Feel Language: Playback Continue playback on startup Determine file type by content Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Proxy Enable proxy usage Proxy host name: Proxy port: Use authentication with proxy Proxy user name: Proxy password: Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control 16-bit output Track Album Disabled Transports Decoders Engines Effects Visualization General Output File Dialogs User Interfaces Artist Title Track number Two-digit track number Genre Comment Composer Disc number File name File path Year Condition <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian DetailsDialog Details Open the directory containing this file ... Summary Title Artist Album Comment Genre Composer Year Track Disc number JumpToTrackDialog Jump To Track Filter Queue Refresh Jump To Q J F5 Unqueue PlayListDownloader Unsupported playlist format PlayListManager Playlist QmmpUiSettings Playlist QtFileDialogFactory Qt File Dialog TagEditor Tag Editor Title: Artist: Album: Composer: Genre: Track: ? Year: Disc number: Comment: Include selected tag in file TemplateEditor Template Editor Reset Insert Artist Album Title Track number Two-digit track number Genre Comment Composer Duration Disc number File name File path Year Condition UiHelper All Supported Bitstreams Select one or more files to open Choose a directory Playlist Files Open Playlist Save Playlist qmmp-0.7.4/src/qmmpui/translations/libqmmpui_he.ts0000664000175000017500000010253612256224735021076 0ustar useruser AboutDialog About Qmmp אודות Qmmp About אודות Authors מחברים Translators מתרגמים Thanks To תודות License Agreement הסכם רישוי Qt-based Multimedia Player (Qmmp) נגן מולטימדיה מבוסס ‏Qt ‏(Qmmp) Version: %1 גירסה: %1 Using Qt %1 (compiled with Qt %2) משתמש בספריית Qt %1 (הודר בעזרת Qt %2) (c) %1-%2 Qmmp Development Team ‏(c) ‏%1-%2 נבחרת הפיתוח של Qmmp Input plugins: תוספות קלט: Output plugins: תוספות פלט: Visual plugins: תוספות חזותיות: Effect plugins: תוספות אפקט: General plugins: תוספות כלליות: AddUrlDialog Enter URL to add הזנת URL להוספה &Add &הוסף &Cancel &ביטול Error שגיאה ConfigDialog Qmmp Settings הגדרות Qmmp Playlist רשימת השמעה Plugins תוספות Advanced מתקדמות Connectivity קישוריות Audio שמע Metadata מידע-מוצמד Load metadata from files טען מידע-מוצמד מן קבצים Convert underscores to blanks המר הדגשות אל תווי רווח Convert %20 to blanks המר ‎%20 אל תווי רווח Title format: פורמט כותרת: ... Directory Scanning Options אפשרויות סריקת מדור Restrict files to: הגבל קבצים אל: Exclude files: הוצא קבצים: Miscellaneous שונות Auto-save playlist when modified שמור אוטומטית רשימת השמעה כאשר משתנה Look and Feel מראה ותחושה Language: שפה: Cover Image Retrieve אחזור תמונת כיסוי Use separate image files השתמש בקבצי תמונה פרודים Include files: הכלל קבצים: Recursive search depth: חיפוש עומק רקורסיבי: Preferences העדפות Information מידע Description תיאור Filename שם קובץ Playback פס קול Continue playback on startup המשך ניגון פס קול בעת הפעלה Determine file type by content קבע טיפוס קובץ על פי תוכן Add files from command line to this playlist: הוסף קבצים מן שורת פקודה אל רשימת השמעה זו: URL Dialog דו שיח URL Auto-paste URL from clipboard הדבק אוטומטית URL מן לוח גזירה Proxy פרוקסי Enable proxy usage אפשר שימוש בפרוקסי Proxy host name: שם מארח פרוקסי: Proxy port: פורט פרוקסי: Use authentication with proxy השתמש באימות עם פרוקסי Proxy user name: שם משתמש פרוקסי: Proxy password: סיסמת פרוקסי: Replay Gain הגברת שמע Replay Gain mode: מצב הגברת שמע: Preamp: מגבר קדמי: dB דציבל Default gain: מגבר משתמט: Use peak info to prevent clipping השתמש במידע שיא למניעת קיצץ Buffer size: שיעור אגירה: ms מ״ש Use software volume control נצל בקרת שמע של תוכנה 16-bit output פלט 16 סיביות Track רצועה Album אלבום Disabled מנוטרלת Transports מובילים Decoders מפענחים Engines מנועים Effects אפקטים Visualization חיזוי General כללי Output פלט File Dialogs תיבות דו שיח קובץ User Interfaces ממשקי משתמש Artist אמן Title כותרת Track number מספר רצועה Two-digit track number מספר רצועה דו ספרתי Genre ז'אנר Comment הערה Composer מלחין Disc number מספר תקליטור File name שם קובץ File path נתיב קובץ Year שנה Condition תנאי <Autodetect> <איתור אוטומטי> Brazilian Portuguese ברזילאית פורטוגזית Chinese Simplified סינית מפושטת Chinese Traditional סינית מסורתית Czech צ׳כית Dutch הולנדית English אנגלית French צרפתית Galician German גרמנית Hebrew עברית Hungarian הונגרית Italian איטלקית Japanese יפנית Kazakh קזחית Lithuanian ליטאית Polish פולנית Russian רוסית Slovak סלובקית Spanish ספרדית Turkish טורקית Ukrainian אוקראינית DetailsDialog Details פרטים Open the directory containing this file פתח את המדור שמכיל את קובץ זה ... Summary סיכום Title כותרת Artist אמן Album אלבום Comment הערה Genre ז'אנר Composer מלחין Year שנה Track רצועה Disc number מספר תקליטור JumpToTrackDialog Jump To Track קפוץ אל רצועה Filter סינון Queue תור Refresh רענן Jump To קפוץ אל Q J F5 Unqueue הוצא מן תור PlayListDownloader Unsupported playlist format פורמט רשימת השמעה לא נתמך PlayListManager Playlist רשימת השמעה QmmpUiSettings Playlist רשימת השמעה QtFileDialogFactory Qt File Dialog דו שיח קובץ Qt TagEditor Tag Editor עורך תגית Title: כותרת: Artist: אמן: Album: אלבום: Composer: מלחין: Genre: ז'אנר: Track: רצועה: ? Year: שנה: Disc number: מספר תקליטור: Comment: הערה: Include selected tag in file הכלל תגית נבחרת בקובץ TemplateEditor Template Editor עורך תבנית Reset איפוס Insert שיבוץ Artist אמן Album אלבום Title כותרת Track number מספר רצועה Two-digit track number מספר רצועה דו ספרתי Genre ז'אנר Comment הערה Composer מלחין Duration משך Disc number מספר תקליטור File name שם קובץ File path נתיב קובץ Year שנה Condition תנאי UiHelper All Supported Bitstreams כל זרמי הסביות הנתמכים Select one or more files to open בחר קובץ אחד או יותר לפתיחה Choose a directory בחר מדור Playlist Files קבצי רשימת השמעה Open Playlist פתח רשימת השמעה Save Playlist שמור רשימת השמעה qmmp-0.7.4/src/qmmpui/translations/libqmmpui_hu.ts0000664000175000017500000010230412256224735021107 0ustar useruser AboutDialog About Qmmp About Authors Translators Thanks To License Agreement Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Output plugins: Visual plugins: Effect plugins: General plugins: AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Qmmp Settings Playlist Plugins Advanced Connectivity Audio Metadata Load metadata from files Convert underscores to blanks Convert %20 to blanks Title format: ... Directory Scanning Options Restrict files to: Exclude files: Cover Image Retrieve Use separate image files Include files: Recursive search depth: Preferences Miscellaneous Auto-save playlist when modified Information Description Filename Look and Feel Language: Playback Continue playback on startup Determine file type by content Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Proxy Enable proxy usage Proxy host name: Proxy port: Use authentication with proxy Proxy user name: Proxy password: Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control 16-bit output Track Album Disabled Transports Decoders Engines Effects Visualization General Output File Dialogs User Interfaces Artist Title Track number Two-digit track number Genre Comment Composer Disc number File name File path Year Condition <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian DetailsDialog Details Open the directory containing this file ... Summary Title Artist Album Comment Genre Composer Year Track Disc number JumpToTrackDialog Jump To Track Filter Queue Refresh Jump To Q J F5 Unqueue PlayListDownloader Unsupported playlist format PlayListManager Playlist QmmpUiSettings Playlist QtFileDialogFactory Qt File Dialog TagEditor Tag Editor Title: Artist: Album: Composer: Genre: Track: ? Year: Disc number: Comment: Include selected tag in file TemplateEditor Template Editor Reset Insert Artist Album Title Track number Two-digit track number Genre Comment Composer Duration Disc number File name File path Year Condition UiHelper All Supported Bitstreams Select one or more files to open Choose a directory Playlist Files Open Playlist Save Playlist qmmp-0.7.4/src/qmmpui/translations/libqmmpui_ja.ts0000664000175000017500000010300712256224735021066 0ustar useruser AboutDialog About Qmmp QMMP について About QMMP について Authors 作者 Translators 翻訳者 Thanks To 協力者 License Agreement 使用許諾契約 Qt-based Multimedia Player (Qmmp) Qt 製マルティミディアプレイヤー QMMP Version: %1 バージョン: %1 Using Qt %1 (compiled with Qt %2) Qt %1 を現在使用しています (コンパイルは Qt %2 で行われました) (c) %1-%2 Qmmp Development Team (c) %1-%2 Qmmp Development Team (開発者チーム) Input plugins: 入力側プラグイン: Output plugins: 出力側プラグイン: Visual plugins: 視覚効果プラグイン: Effect plugins: 音響効果プラグイン: General plugins: 一般プラグイン: AddUrlDialog Enter URL to add 追加したい URL をここに記入 &Add 追加(&A) &Cancel キャンセル(&C) Error 事故 ConfigDialog Qmmp Settings QMMP 設定 Playlist プレイリスト Plugins プラグイン Advanced 上級 Connectivity 接続 Audio 音響 ... ... Metadata メタデータ Load metadata from files ファイルからメタデータを読み込む Title format: タイトルの表示形式: Convert underscores to blanks 下線記号 _ を空白文字で表示 Convert %20 to blanks %20 を空白文字で表示 Preferences プラグイン調整 Information 情報 Description プラグイン分類 Filename ファイル名 Cover Image Retrieve アルバム表紙画像の取得 Use separate image files 分割された画像ファイルを利用 Include files: 対象ファイル形式: Exclude files: 除外ファイル形式: Recursive search depth: 再帰検索の深度: Playback 再生 Continue playback on startup 前回終了時の曲から継続して再生 Determine file type by content ファイル内容をみて形式を判断 Directory Scanning Options ディレクトリ探査のオプション Restrict files to: ファイルを限定(拡張子による): Miscellaneous その他いろいろ Auto-save playlist when modified プレイリストの変更を自動保存 Look and Feel 外観と感触 Language: 言語: Add files from command line to this playlist: コマンド行からファイルを追加できるプレイリスト: URL Dialog URL ダイアログ Auto-paste URL from clipboard クリップボードから URL を自動取り込み Proxy 代理 Enable proxy usage 代理を利用する Proxy host name: 代理ホスト名: Proxy port: 代理ポート: Use authentication with proxy 代理経由の認証を利用 Proxy user name: 代理者ユーザー名: Proxy password: 代理者パスワード: Replay Gain リプレイゲイン Replay Gain mode: リプレイゲインモード: Preamp: プリアンプ: dB dB Default gain: デフォルトゲイン: Use peak info to prevent clipping クリッピング現象を抑えるためピーク情報を使う Buffer size: バッファーサイズ: ms ミリ秒 Use software volume control ソフトウェアによる音量制御を利用 16-bit output 16ビット出力 Track トラック Album アルバム Disabled 無効 Transports 転送 Decoders デコーダー Engines エンジン Effects 音響効果 Visualization 視覚効果 General 一般 Output 出力 File Dialogs ファイルダイアログ User Interfaces ユーザーインターフェイス Artist アーティスト Title タイトル Track number トラック番号 Two-digit track number トラック番号 数字2桁 Genre ジャンル Comment コメント Composer 作曲者 Disc number ディスク番号 File name ファイル名 File path ファイルパス Year Condition 定番 <Autodetect> <自動判定> Brazilian Portuguese ブラジル ポルトガル語 Chinese Simplified 簡体字中国語 Chinese Traditional 繁体字中国語 Czech チェコ語 Dutch オランダ語 English 英語 French フランス語 Galician ガリシア語 German ドイツ語 Hebrew ヘブライ語 Hungarian ハンガリー語 Italian イタリア語 Japanese 日本語 Kazakh カザフ語 Lithuanian リトアニア語 Polish ポーランド語 Russian ロシア語 Slovak スロバキア語 Spanish スペイン語 Turkish トルコ語 Ukrainian ウクライナ語 DetailsDialog Details 詳細 Open the directory containing this file このファイルが保管されているディレクトリを開く ... ... Summary あらまし Title タイトル Artist アーティスト Album アルバム Comment コメント Genre ジャンル Composer 作曲者 Year Track トラック Disc number ディスク番号 JumpToTrackDialog Jump To Track トラックを指定して即刻再生 Filter フィルター Queue キューに入れる Refresh 再実行 Jump To この曲に跳ぶ Q Q J J F5 F5 Unqueue キューから除く PlayListDownloader Unsupported playlist format サポート外のプレイリスト書式です PlayListManager Playlist プレイリスト QmmpUiSettings Playlist プレイリスト QtFileDialogFactory Qt File Dialog Qt ファイルダイアログ TagEditor Tag Editor タグエディター Title: タイトル: Artist: アーティスト: Album: アルバム: Composer: 作曲者: Genre: ジャンル: Disc number: ディスク番号: ? ? Comment: コメント: Year: 年: Track: トラック: Include selected tag in file 記入したタグをファイルに保存してよい TemplateEditor Template Editor テンプレートエディター Reset リセット Insert 挿入 Artist アーティスト Album アルバム Title タイトル Track number トラック番号 Two-digit track number トラック番号 数字2桁 Genre ジャンル Comment コメント Composer 作曲者 Duration 演奏時間 Disc number ディスク番号 File name ファイル名 File path ファイルパス Year Condition 定番 UiHelper All Supported Bitstreams サポート対象のすべてのデジタル録音物 Select one or more files to open 開きたいファイルを選ぶ (複数可) Choose a directory ディレクトリを選択 Playlist Files プレイリストファイル Open Playlist プレイリストを開く Save Playlist プレイリストを保存 qmmp-0.7.4/src/qmmpui/translations/libqmmpui_it.ts0000664000175000017500000010171412256224735021113 0ustar useruser AboutDialog About Qmmp Informazioni su Qmmp About Info License Agreement Contratto di licenza Authors Autori Thanks To Ringraziamenti Qt-based Multimedia Player (Qmmp) Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Moduli d'entrata: Output plugins: Moduli d'uscita : Visual plugins: Moduli di visualizzazione: Effect plugins: Мoduli per gli effetti: General plugins: Moduli generali: Translators Traduttori AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Descrizione Filename File Artist Interprete Album Album Track Traccia Disabled Disabilitato Transports Protocolli di trasporto Decoders Decodificatori Engines Meccanismi Output File Dialogs User Interfaces Title Titolo Track number Traccia n° Two-digit track number Traccia n° a due cifre Disc number Disco n° Condition Condizione <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre Genere Composer Compositore File name Nome file File path Percorso file Year Anno Comment Commento Qmmp Settings Configurazione di Qmmp ... ... Metadata Metadati Load metadata from files Carica i metadati dai brani Title format: Formato del titolo : Preferences Impostazioni preferite Information Informazioni Playlist Lista dei brani Plugins Moduli Advanced Avanzato 16-bit output uscita a 16 bit Connectivity Connettività Visualization Visualizzazione Effects Effetti General Generale Audio Audio Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Normalizzazione Replay Gain mode: Metodo di normalizzazione Preamp: Preamp: dB dB Default gain: Normalizzazione predefinita Use peak info to prevent clipping Utilizza informazioni di picco per evitare tagli Buffer size: ms ms Use software volume control Utilizza il controllo volume del programma Cover Image Retrieve Trova immagine copertina Use separate image files Usa immagini separate Include files: Includi i file: Exclude files: Escludi i file: Recursive search depth: Profondità ricerca ricorsiva: Playback Riproduzione Continue playback on startup Continua la riproduzione all'avvio Determine file type by content Proxy Proxy Enable proxy usage Attiva il proxy Proxy host name: Nome del server : Proxy port: Porta del server : Use authentication with proxy Usa autenticazione con il proxy Proxy user name: Utente: Proxy password: Password : Convert underscores to blanks Converti il carattere « _ » in spazi Convert %20 to blanks Converti il carattere « %20 » in spazi DetailsDialog Title Titolo Artist Interprete Album Album Comment Commento Genre Genere Composer Compositore Year Anno Track Traccia Disc number Disco n° Details Dettagli Open the directory containing this file ... ... Summary Sommario JumpToTrackDialog Jump To Track Vai alla traccia Filter Filtra Queue Metti in coda Refresh Aggiorna Jump To Vai a Q Q J J F5 F5 Unqueue Elimna dalla coda PlayListDownloader Unsupported playlist format PlayListManager Playlist Lista esecuzione QmmpUiSettings Playlist QtFileDialogFactory Qt File Dialog Menu brani Qt TagEditor Title: Titolo: Artist: Interprete: Album: Album: Composer: Compositore Genre: Genere: Disc number: Disco numero: ? ? Track: Traccia: Year: Anno: Tag Editor Editor etichette Comment: Commento: Include selected tag in file Includi le etichette selezionate nel file TemplateEditor Reset Reimposta Insert Inserisci Template Editor Modello Artist Interprete Album Album Title Titolo Track number Traccia n° Two-digit track number Numero traccia su due cifre Genre Genere Comment Commento Composer Compositore Duration Durata Disc number Disco n° File name Nome documento File path Percorso documento Year Anno Condition Condizione UiHelper All Supported Bitstreams Elenco di tutti i tipi di flusso accettati Select one or more files to open Seleziona uno o più brani da aprire Choose a directory Scegliere una cartella Playlist Files Brani della lista Open Playlist Apri lista di brani Save Playlist Salva lista di brani qmmp-0.7.4/src/qmmpui/translations/libqmmpui_kk.ts0000664000175000017500000010230412256224735021100 0ustar useruser AboutDialog About Qmmp About Authors Translators Thanks To License Agreement Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Output plugins: Visual plugins: Effect plugins: General plugins: AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Qmmp Settings Playlist Plugins Advanced Connectivity Audio Metadata Load metadata from files Convert underscores to blanks Convert %20 to blanks Title format: ... Directory Scanning Options Restrict files to: Exclude files: Cover Image Retrieve Use separate image files Include files: Recursive search depth: Preferences Miscellaneous Auto-save playlist when modified Information Description Filename Look and Feel Language: Playback Continue playback on startup Determine file type by content Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Proxy Enable proxy usage Proxy host name: Proxy port: Use authentication with proxy Proxy user name: Proxy password: Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control 16-bit output Track Album Disabled Transports Decoders Engines Effects Visualization General Output File Dialogs User Interfaces Artist Title Track number Two-digit track number Genre Comment Composer Disc number File name File path Year Condition <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian DetailsDialog Details Open the directory containing this file ... Summary Title Artist Album Comment Genre Composer Year Track Disc number JumpToTrackDialog Jump To Track Filter Queue Refresh Jump To Q J F5 Unqueue PlayListDownloader Unsupported playlist format PlayListManager Playlist QmmpUiSettings Playlist QtFileDialogFactory Qt File Dialog TagEditor Tag Editor Title: Artist: Album: Composer: Genre: Track: ? Year: Disc number: Comment: Include selected tag in file TemplateEditor Template Editor Reset Insert Artist Album Title Track number Two-digit track number Genre Comment Composer Duration Disc number File name File path Year Condition UiHelper All Supported Bitstreams Select one or more files to open Choose a directory Playlist Files Open Playlist Save Playlist qmmp-0.7.4/src/qmmpui/translations/libqmmpui_lt.ts0000664000175000017500000010153512256224735021117 0ustar useruser AboutDialog About Qmmp Apie Qmmp About Apie License Agreement Licenzija Authors Autoriai Thanks To Dėkojame Qt-based Multimedia Player (Qmmp) Version: %1 Versija: %1 Using Qt %1 (compiled with Qt %2) Naudojama Qt %1 (sukompiliuota su Qt %2) (c) %1-%2 Qmmp Development Team (c) %1-%2 Qmmp Kūrėjų Komanda Input plugins: Įeinantys: Output plugins: Išeinantys: Visual plugins: Vizualizacijos: Effect plugins: Efektai: General plugins: Bendriniai įskiepiai: Translators Vertėjai AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Aprašymas Filename Bylos pavadinimas Artist Atlikėjas Album Albumas Track Takelis Disabled Išjungta Transports Transportas Decoders Dekoderiai Engines Varikliai Output File Dialogs User Interfaces Title Pavadinimas Track number Takelio numeris Two-digit track number Dviejų skaičių takelio numeris Disc number Disko numeris Condition Būklė <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Composer Autorius File name Bylos pavadinimas File path Bylos kelias Genre Žanras Year Metai Comment Komentaras Qmmp Settings Qmmp nustatymai ... ... Metadata Meta duomenys Load metadata from files Įkelti metaduomenis iš bylų Title format: Pavadinimo formatas: Preferences Nustatymai Information Informacija Playlist Grojaraštis Plugins Įskiepiai Advanced Papildomi 16-bit output 16 bitų išvestis Connectivity Tinklas Visualization Vizualizacija Effects Efektai General Bendri Audio Audio Directory Scanning Options Aplanko skenavimo pasirinkimai Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: Į šį grojaraštį įkelti bylas iš komandinės eilutės: URL Dialog Auto-paste URL from clipboard Replay Gain Neįsivaizduoju kaip verst Replay Gain Replay Gain mode: Replay Gain metodas: Preamp: Išankstinis stiprinimas: dB dB Default gain: Stiprinimas pagal nutylėjima: Use peak info to prevent clipping Naudoti pikų informaciją trūkinėjimo išvengimui Buffer size: Buferio dydis: ms ms Use software volume control Naudoti programinį garso valdymą Cover Image Retrieve Parsiųsti cd viršelį Use separate image files Naudoti atskiras paveiksliukų bylas Include files: Įtraukti bylas Exclude files: Išskirti bylas Recursive search depth: Rekursinės paieškos gylis Playback Grojimas Continue playback on startup Tęsti grojimą įjungus Determine file type by content Nustatyti bylos tipą pagal turinį Proxy Proxy Enable proxy usage Įjungti proxy palaikymą Proxy host name: Proxy serveris: Proxy port: Proxy portas: Use authentication with proxy Naudoti proxy autentifikavimą Proxy user name: Proxy vartotojo vardas: Proxy password: Proxy slaptažodis: Convert underscores to blanks Paversti brūkšnius į tarpus Convert %20 to blanks Paversti %20 į tarpus DetailsDialog Title Pavadinimas Artist Atlikėjas Album Albumas Comment Komentaras Genre Žanras Composer Autorius Year Metai Track Takelis Disc number Disko numeris Details Apie Open the directory containing this file Atverti aplanką, kuriame yra ši byla ... ... Summary Takelio informacija JumpToTrackDialog Jump To Track Pereiti prie takelio Filter Filtras Queue Į eilę Refresh Atnaujinti Jump To Prereiti prie Q J F5 Unqueue Pašalinti iš eilės PlayListDownloader Unsupported playlist format PlayListManager Playlist Grojaraštis QmmpUiSettings Playlist Grojaraštis QtFileDialogFactory Qt File Dialog Qt bylų langas TagEditor Title: Pavadinimas: Artist: Atlikėjas: Album: Albumas: Composer: Autorius Genre: Žanras: Disc number: Disko numeris ? Track: Takelis Year: Metai Tag Editor Meta informacijos redaktorius Comment: Komentaras: Include selected tag in file Įtraukti meta informaciją į bylą TemplateEditor Reset Ištrinti Insert Įkelti Template Editor Šablonų redaktorius Artist Atlikėjas Album Albumas Title Pavadinimas Track number Takelio numeris Two-digit track number Dviejų skaičių takelio numeris Genre Žanras Comment Komentaras Composer Autorius Duration Trukmė Disc number Disko numeris File name Bylos pavadinimas File path Bylos kelias Year Metai Condition Būklė UiHelper All Supported Bitstreams Palaikomi bylų tipai Select one or more files to open Pasirinkite vieną ar kelias bylas atvėrimui Choose a directory Pasirinkite aplanką Playlist Files Grojaraščio bylos Open Playlist Atverti grojaraštį Save Playlist Išsaugoti grojaraštį qmmp-0.7.4/src/qmmpui/translations/libqmmpui_nl.ts0000664000175000017500000010104712256224735021107 0ustar useruser AboutDialog About Qmmp Over Qmmp About Over Authors Auteurs Translators Vertalers Thanks To Met dank aan License Agreement Licentie Overeenkomst Qt-based Multimedia Player (Qmmp) Qt gebasseerde multimediaspeler (Qmmp) Version: %1 Versie: %1 Using Qt %1 (compiled with Qt %2) Gebruikt Qt %1 (gecompileerd met Qt %2) (c) %1-%2 Qmmp Development Team (c) %1-%2 Qmmp Ontwikkelingsteam Input plugins: Invoer plugins: Output plugins: Uitvoer plugins: Visual plugins: Visuele plugins: Effect plugins: Effect plugins: General plugins: Algemene plugins: AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Beschrijving Filename Bestandsnaam Artist Artiest Album Album Track Nummer Disabled Uitgeschakeld Transports Protocols Decoders Decoders Engines Output File Dialogs User Interfaces Title Naam Track number Liednummer Two-digit track number Liednummer (twee cijfer formaat) Disc number CD nummer Condition Staat <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Composer Componist File name Bestandsnaam File path Bestandspad Genre Year Jaar Comment Commentaar Qmmp Settings Qmmp Instellingen Playlist Afspeellijst Plugins Modules Advanced Geavanceerd Replay Gain ... Metadata Load metadata from files Laad metadata van bestanden Title format: Titel formaat: Preferences Voorkeuren Information Informatie Cover Image Retrieve Gebruik afbeeldingshoes Use separate image files Gebruik aparte afbeeldingsbestanden Include files: Inclusief de bestanden: Exclude files: Exclusief de bestanden: Recursive search depth: Recursieve zoekdiepte: Playback Afspelen Continue playback on startup Verdergaan met afspelen bij opstarten Determine file type by content Bepaal bestandstype op basis van inhoud Directory Scanning Options Opties voor het scannen van mappen Restrict files to: Gebruikte bestandsformaten: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: Voeg bestanden van het commando prompt toe aan de afspeellijst: URL Dialog Auto-paste URL from clipboard Replay Gain mode: Replay Gain modus: Preamp: Voorversterking: dB Default gain: Standaard verhoging: Use peak info to prevent clipping Gebruik piek info om stotteren te voorkomen Buffer size: Buffer-grootte: ms 16-bit output 16bit uitvoer Connectivity Connectiviteit Proxy Enable proxy usage Gebruik proxy Proxy host name: Proxy host naam: Proxy port: Proxy poort: Use authentication with proxy Gebruik authenticatie bij proxy Proxy user name: Proxy gebruikersnaam: Proxy password: Proxy wachtwoord: Visualization Visualisatie Effects Effecten General Algemeen Audio Use software volume control Gebruik software volume Convert underscores to blanks Zet lage strepen om in spaties Convert %20 to blanks Zet %20 om in spaties DetailsDialog Title Naam Artist Artiest Album Album Comment Commentaar Genre Composer Componist Year Jaar Track Nummer Disc number CD nummer Details Details Open the directory containing this file Open de bijbehorende map van dit bestand ... Summary Samenvatting JumpToTrackDialog Jump To Track Ga Naar Nummer Filter Filter Queue Rij Refresh Herlaad Jump To Ga Naar Q J F5 Unqueue Verwijder uit lijst PlayListDownloader Unsupported playlist format PlayListManager Playlist Afspeellijst QmmpUiSettings Playlist Afspeellijst QtFileDialogFactory Qt File Dialog Qt Bestandsdialoog TagEditor Title: Naam: Artist: Artiest: Album: Album: Composer: Componist: Genre: Disc number: CD nummer: ? Track: Nummer: Year: Jaar: Tag Editor Tag bewerker Comment: Commentaar: Include selected tag in file Voeg geselecteerde tag toe aan bestand TemplateEditor Reset Terugdraaien Insert Invoegen Template Editor Layout Bewerker Artist Artiest Album Album Title Naam Track number Liednummer Two-digit track number Liednummer (twee cijfer formaat) Genre Comment Commentaar Composer Componist Duration Duur Disc number CD nummer File name Bestandsnaam File path Bestandspad Year Jaar Condition Staat UiHelper All Supported Bitstreams Alle Ondersteunde Bitstromen Select one or more files to open Kies één of meerdere bestanden om te openen Choose a directory Kies een map Playlist Files Afspeellijst Bestanden Open Playlist Open Afspeellijst Save Playlist Bewaar Afspeellijst qmmp-0.7.4/src/qmmpui/translations/libqmmpui_ru.ts0000664000175000017500000010531612256224735021127 0ustar useruser AboutDialog About Qmmp О Qmmp About О программе License Agreement Лицензия Authors Авторы Thanks To Благодарности Qt-based Multimedia Player (Qmmp) Version: %1 Версия: %1 Using Qt %1 (compiled with Qt %2) Используется Qt %1 (собрано с Qt %2) (c) %1-%2 Qmmp Development Team (с) %1-%2 Команда разработчиков Qmmp Input plugins: Модули ввода: Output plugins: Модули вывода: Visual plugins: Модули визуализации: Effect plugins: Модули эффектов: General plugins: Общие модули: Translators Переводчики AddUrlDialog Enter URL to add Введите адрес для добавления &Add &Добавить &Cancel &Отмена Error Ошибка ConfigDialog Description Описание Filename Имя файла Artist Исполнитель Album Альбом Track Дорожка Disabled Отключено Transports Транспорты Decoders Декодеры Engines Внешние проигрыватели Output Вывод File Dialogs Файловые диалоги User Interfaces Пользовательские интерфейсы Title Название Track number Номер трека Two-digit track number 2-x разрядный номер трека Disc number Номер диска Condition Условие <Autodetect> <aвтоопределение> Brazilian Portuguese бразильский португальский Chinese Simplified китайский упрощённый Chinese Traditional китайский традиционный Czech чешский Dutch голландский English английский French французский Galician галисийский German немецкий Hebrew иврит Hungarian венгерский Italian итальянский Japanese японский Kazakh казахский Lithuanian литовский Polish польский Russian русский Slovak словацкий Spanish испанский Turkish турецкий Ukrainian украинский Genre Жанр Composer Композитор File name Имя файла File path Путь к файлу Year Год Comment Комментарий Qmmp Settings Настройки Qmmp ... ... Metadata Метаданные Load metadata from files Считывать метаданные из файлов Title format: Формат названия: Preferences Настройки Information Информация Playlist Список Plugins Модули Advanced Дополнительно 16-bit output 16-битный вывод Connectivity Сеть Visualization Визуализация Effects Эффекты General Общие Audio Аудио Directory Scanning Options Опции сканирования директорий Restrict files to: Ограничить выбор файлов до: Miscellaneous Разное Auto-save playlist when modified Автоматически сохранять список после изменения Look and Feel Параметры интерфейса Language: Язык: Add files from command line to this playlist: Добавлять файлы из командной строки в этот список: URL Dialog URL-диалог Auto-paste URL from clipboard Автоматически вставлять URL из буфера обмена Replay Gain Выравнивание громкости (Replay Gain) Replay Gain mode: Режим Replay Gain: Preamp: Предусиление: dB дБ Default gain: Усиление по умолчанию: Use peak info to prevent clipping Использовать пиковое значение для предотвращения срезания Buffer size: Размер буфера: ms мс Use software volume control Использовать программную регулировку громкости Cover Image Retrieve Поиск обложки альбома Use separate image files Использовать отдельные файлы с изображениями Include files: Включить файлы: Exclude files: Исключить файлы: Recursive search depth: Глубина рекурсивного поиска: Playback Воспроизведение Continue playback on startup Продолжить воспроизведение после запуска Determine file type by content Определять тип файла по содержимому Proxy Прокси Enable proxy usage Использовать прокси Proxy host name: Прокси сервер: Proxy port: Прокси порт: Use authentication with proxy Использовать авторизацию на прокси Proxy user name: Имя пользователя прокси: Proxy password: Пароль прокси: Convert underscores to blanks Преобразовывать подчёркивание в пробел Convert %20 to blanks Преобразовывать %20 в пробел DetailsDialog Title Название Artist Исполнитель Album Альбом Comment Комментарий Genre Жанр Composer Композитор Year Год Track Дорожка Disc number Номер диска Details Информация Open the directory containing this file Открыть директорию, содержащую файл ... ... Summary Общая информация JumpToTrackDialog Jump To Track Перейти к треку Filter Фильтр Queue В очередь Refresh Обновить Jump To Перейти к Q J F5 Unqueue Снять с очереди PlayListDownloader Unsupported playlist format Неподдерживаемый формат списка воспроизведения PlayListManager Playlist Список QmmpUiSettings Playlist Список QtFileDialogFactory Qt File Dialog Файловый диалог Qt TagEditor Title: Название: Artist: Исполнитель: Album: Альбом: Composer: Композитор: Genre: Жанр: Disc number: Номер диска: ? ? Track: Дорожка: Year: Год: Tag Editor Редактор тегов Comment: Комментарий: Include selected tag in file Включить выбранный тег в файл TemplateEditor Reset Сбросить Insert Вставить Template Editor Редактор шаблонов Artist Исполнитель Album Альбом Title Название Track number Номер трека Two-digit track number 2-х разрядный номер трека Genre Жанр Comment Комментарий Composer Композитор Duration Длительность Disc number Номер диска File name Имя файла File path Путь к файлу Year Год Condition Условие UiHelper All Supported Bitstreams Все форматы Select one or more files to open Выберите один или несколько файлов Choose a directory Выберите директорию Playlist Files Файлы списков Open Playlist Открыть список Save Playlist Сохранить список qmmp-0.7.4/src/qmmpui/translations/libqmmpui_sk.ts0000664000175000017500000010251212256224735021111 0ustar useruser AboutDialog About Qmmp O Qmmp About O progarme Authors Autori Thanks To Poďakovanie License Agreement Licencia Qt-based Multimedia Player (Qmmp) Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Vstupné moduly: Output plugins: Výstupné moduly: Visual plugins: Vizualizačné moduly: Effect plugins: Moduly efektov: General plugins: Všebecné moduly: Translators Prekladatelia AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Popis Filename Názov súboru Artist Interprét Album Album Track Skladba Disabled Zakázané Transports Protokoly Decoders Dekodéry Engines Prehrávače Output File Dialogs User Interfaces Title Názov Track number Číslo skladby Two-digit track number Dvojmiestne číslo skladby Disc number Číslo disku Condition Stav <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Composer Skladateľ File name Názov súboru File path Cesta k súboru Genre Žáner Year Rok Comment Poznámka Qmmp Settings Qmmp nastavenia Playlist Playlist Plugins Moduly Advanced Pokročilé Replay Gain Zisk pri prehrávaní ... ... Metadata Metadáta Load metadata from files Čítať metadáta zo súborov Title format: Formát titulku: Preferences Nastavenia Information Informácie Cover Image Retrieve Získať obrázok obalu Use separate image files Používať samostatné súbory obrázkov Include files: Zahrnúť súbory: Exclude files: Vynechať súbory: Recursive search depth: Hĺbka rekurzívneho hľadania: Playback Prehrávanie Continue playback on startup Pri štarte pokračovať v prehrávaní Determine file type by content Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain mode: Režim úpravy zisku pri prehrávaní: Preamp: Predzosilnenie: dB dB Default gain: Východzý zisk: Use peak info to prevent clipping Použiť informáciu o vrchole k zabráneniu orezu Buffer size: Veľkosť bufferu: ms ms 16-bit output 16bitový výstup Connectivity Pripojenie k sieti Proxy Proxy Enable proxy usage Povoliť používanie proxy Proxy host name: Adresa proxy: Proxy port: Port proxy: Use authentication with proxy Použiť autentifikáciu s proxy Proxy user name: Proxy použivateľské meno: Proxy password: Proxy heslo: Visualization Vizualizácie Effects Efekty General Všeobecné Audio Zvuk Use software volume control Používať softwarové ovládanie hlasitosti Convert underscores to blanks Previesť podčiarknutia na medzery Convert %20 to blanks Previesť %20 na mdezery DetailsDialog Details Open the directory containing this file ... ... Summary Title Názov Artist Interprét Album Album Comment Poznámka Genre Žáner Composer Skladateľ Year Rok Track Skladba Disc number Číslo disku JumpToTrackDialog Q Q J J F5 F5 Unqueue Vyradiť Queue Zaradiť Jump To Track Preskočiť na skladbu Filter Filter Refresh Obnoviť Jump To Preskočiť na PlayListDownloader Unsupported playlist format PlayListManager Playlist Playlist QmmpUiSettings Playlist Playlist QtFileDialogFactory Qt File Dialog TagEditor Tag Editor Title: Artist: Album: Composer: Genre: Track: ? Year: Disc number: Comment: Include selected tag in file TemplateEditor Template Editor Reset Zresetovať Insert Vložiť Artist Interprét Album Album Title Názov Track number Číslo skladby Two-digit track number Dvojmiestne číslo skladby Genre Žáner Comment Poznámka Composer Skladateľ Duration Dĺžka Disc number Číslo disku File name Názov súboru File path Cesta k súboru Year Rok Condition Stav UiHelper All Supported Bitstreams Všetky podporované formáty Select one or more files to open Vyberte jeden alebo viac súborov na otvorenie Choose a directory Vyberte priečinok Playlist Files Súbory playlistov Open Playlist Otvoriť playlist Save Playlist Uložiť playlist qmmp-0.7.4/src/qmmpui/translations/libqmmpui_tr.ts0000664000175000017500000010265512256224735021131 0ustar useruser AboutDialog About Qmmp Qmmp Hakkında About Hakkında License Agreement Lisans Anlaşması Authors Yazarlar Thanks To Teşekkürler Qt-based Multimedia Player (Qmmp) Qt tabanlı Çokluortam Oynatıcısı (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Girdi eklentileri: Output plugins: Çıktı eklentileri: Visual plugins: Görsel eklentiler: Effect plugins: Efekt eklentileri: General plugins: Genel eklentiler: Translators Çevirmenler AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Açıklama Filename Dosya adı Artist Sanatçı Album Albüm Track Disabled Transports Decoders Engines Output File Dialogs User Interfaces Title Başlık Track number Two-digit track number Disc number Condition <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre Tarz Composer File name File path Year Yıl Comment Yorum Qmmp Settings Qmmp Ayarları ... ... Metadata Veri bilgisi Load metadata from files Veri bilgisini dosyadan yükle Title format: Başlık formatı: Preferences Tercihler Information Bilgi Playlist Çalma Listesi Plugins Eklentiler Advanced Gelişmiş 16-bit output Connectivity Bağlanırlık Visualization Görsellik Effects Efektler General Genel Audio Ses Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control Yazılımsal ses kontrolünü kullan Cover Image Retrieve Use separate image files Include files: Exclude files: Recursive search depth: Playback Continue playback on startup Determine file type by content Proxy Vekil sunucu Enable proxy usage Vekil sunucu kullanımını etkinleştir Proxy host name: Vekil sunucu adı: Proxy port: Vekil sunucu portu: Use authentication with proxy Vekil sunucu yetkilendirmesi kullan Proxy user name: Vekil sunucu kullanıcı adı: Proxy password: Vekil sunucu parolası: Convert underscores to blanks Alt çizgileri boşluğa çevir Convert %20 to blanks %20 yi boşluğa çevir DetailsDialog Title Başlık Artist Sanatçı Album Albüm Comment Yorum Genre Tarz Composer Year Yıl Track Disc number Details Open the directory containing this file ... ... Summary JumpToTrackDialog Jump To Track Parçaya Git Filter Filtre Queue Kuyruk Refresh Yenile Jump To Git Q Q J J F5 Unqueue Kuyrukta Değil PlayListDownloader Unsupported playlist format PlayListManager Playlist Çalma Listesi QmmpUiSettings Playlist Çalma Listesi QtFileDialogFactory Qt File Dialog Qt Dosya Diyaloğu TagEditor Title: Başlık: Artist: Artist: Album: Albüm: Composer: Genre: Tür: Disc number: ? Track: Year: Tag Editor Comment: Yorum: Include selected tag in file TemplateEditor Reset Insert Template Editor Artist Sanatçı Album Albüm Title Başlık Track number Two-digit track number Genre Tarz Comment Yorum Composer Duration Disc number File name File path Year Yıl Condition UiHelper All Supported Bitstreams Tüm Desteklenen Bitstreamler Select one or more files to open Açmak için bir yada daha çok dosya seçin Choose a directory Bir dizin seçin Playlist Files Çalma Listesi Dosyaları Open Playlist Çalma Listesini Aç Save Playlist Çalma Listesini Kaydet qmmp-0.7.4/src/qmmpui/translations/libqmmpui_pt_BR.ts0000664000175000017500000010332212256224735021502 0ustar useruser AboutDialog About Qmmp Sobre QMMP About Sobre License Agreement Concordância com a Licença Authors Autores Thanks To Agradecimentos para Qt-based Multimedia Player (Qmmp) Version: %1 Using Qt %1 (compiled with Qt %2) (c) %1-%2 Qmmp Development Team Input plugins: Output plugins: Visual plugins: Effect plugins: General plugins: Translators AddUrlDialog Enter URL to add &Add &Cancel Error ConfigDialog Description Descrição Filename Nome do Arquivo Artist Artista Album Álbum Track Disabled Transports Decoders Engines Output File Dialogs User Interfaces Title Título Track number Two-digit track number Disc number Condition <Autodetect> Brazilian Portuguese Chinese Simplified Chinese Traditional Czech Dutch English French Galician German Hebrew Hungarian Italian Japanese Kazakh Lithuanian Polish Russian Slovak Spanish Turkish Ukrainian Genre Gênero Composer File name File path Year Ano Comment Comentário Qmmp Settings Configurações ... ... Metadata MetaData Load metadata from files Carregar arquivo MetaData Title format: Tipo de Formato: Preferences Preferências Information Informações Playlist Lista de músicas Plugins Plugins Advanced Avançado 16-bit output Connectivity Visualization Effects General Audio Directory Scanning Options Restrict files to: Miscellaneous Auto-save playlist when modified Look and Feel Language: Add files from command line to this playlist: URL Dialog Auto-paste URL from clipboard Replay Gain Replay Gain mode: Preamp: dB Default gain: Use peak info to prevent clipping Buffer size: ms Use software volume control Cover Image Retrieve Use separate image files Include files: Exclude files: Recursive search depth: Playback Continue playback on startup Determine file type by content Proxy Enable proxy usage Proxy host name: Proxy port: Use authentication with proxy Proxy user name: Proxy password: Convert underscores to blanks Convert %20 to blanks DetailsDialog Title Título Artist Artista Album Álbum Comment Comentário Genre Gênero Composer Year Ano Track Disc number Details Open the directory containing this file ... ... Summary JumpToTrackDialog Jump To Track Pular de faixa Filter Filtro Queue Faixa na Fila Refresh Recarregar Jump To Pular para Q J F5 Unqueue Sem Faixa na Fila PlayListDownloader Unsupported playlist format PlayListManager Playlist Lista de músicas QmmpUiSettings Playlist Lista de músicas QtFileDialogFactory Qt File Dialog TagEditor Title: Artist: Album: Composer: Genre: Disc number: ? Track: Year: Tag Editor Comment: Include selected tag in file TemplateEditor Reset Insert Template Editor Artist Artista Album Álbum Title Título Track number Two-digit track number Genre Gênero Comment Comentário Composer Duration Disc number File name File path Year Ano Condition UiHelper All Supported Bitstreams Select one or more files to open Selecionar um ou mais arquivos Choose a directory Escolher o diretorio Playlist Files ФArquivos de lista de músicas Open Playlist Abrir Playlist Save Playlist Salvar Playlist qmmp-0.7.4/src/qmmpui/addurldialog.cpp0000664000175000017500000001026012256224735016461 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "playlistparser.h" #include "playlistformat.h" #include "playlistmodel.h" #include "playlistdownloader.h" #include "qmmpuisettings.h" #include "addurldialog_p.h" #define HISTORY_SIZE 10 AddUrlDialog::AddUrlDialog(QWidget *parent) : QDialog(parent) { setupUi(this); setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_QuitOnClose, false); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_history = settings.value("URLDialog/history").toStringList(); urlComboBox->addItems(m_history); m_downloader = new PlayListDownloader(this); connect(m_downloader, SIGNAL(done(QStringList)), SLOT(add(QStringList))); connect(m_downloader, SIGNAL(error(QString)), SLOT(showError(QString))); if(QmmpUiSettings::instance()->useClipboard()) { QUrl url(QApplication::clipboard()->text().trimmed()); if(url.isValid() && MetaDataManager::instance()->protocols().contains(url.scheme())) urlComboBox->setEditText(QApplication::clipboard()->text().trimmed()); } } AddUrlDialog::~AddUrlDialog() { while (m_history.size() > HISTORY_SIZE) m_history.removeLast(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("URLDialog/history", m_history); } QPointer AddUrlDialog::m_instance = 0; void AddUrlDialog::popup(QWidget* parent, PlayListModel* model) { if (!m_instance) { m_instance = new AddUrlDialog(parent); m_instance->setModel(model); } m_instance->show(); m_instance->raise(); } void AddUrlDialog::accept() { addButton->setEnabled(false); if(urlComboBox->currentText().isEmpty()) { QDialog::accept(); return; } QString s = urlComboBox->currentText().trimmed(); if(!s.startsWith("http://") && !s.contains("://")) s.prepend("http://"); if(!MetaDataManager::instance()->protocols().contains(QUrl(s).scheme())) { qWarning("AddUrlDialog: unsupported protocol"); QDialog::accept(); return; } m_history.removeAll(s); m_history.prepend(s); if (s.startsWith("http://")) //try to download playlist { m_downloader->start(QUrl(s)); return; } m_model->add(s); QDialog::accept(); } void AddUrlDialog::setModel(PlayListModel *m) { m_model = m; } void AddUrlDialog::add(const QStringList &urls) { addButton->setEnabled(true); m_model->add(urls); QDialog::accept(); } void AddUrlDialog::showError(const QString &message) { QMessageBox::warning(this, tr("Error"), message); addButton->setEnabled(true); } qmmp-0.7.4/src/qmmpui/metadataformatter.cpp0000664000175000017500000001007712256224735017540 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ /* Syntax: %p - artist %a - album %t - title %n - track, %NN - 2-digit track %g - genre %c - comment %C - composer %D - disc number %f - file name %F - full path %y - year %l - duration %if(A,B,C) %if(A&B&C,D,E) */ #include #include #include "metadataformatter.h" MetaDataFormatter::MetaDataFormatter(const QString &format) { m_format = format; } QString MetaDataFormatter::parse(PlayListItem *item) { return parse(*item, item->length()); } QString MetaDataFormatter::parse(const QMap metaData, qint64 length) { QString title = m_format; title.replace("\\(", "%28"); title.replace("\\)", "%29"); title.replace(")", "%)"); title.replace("&", "%&"); title.replace(",", "%,"); title.replace("%p", metaData[Qmmp::ARTIST]); title.replace("%a", metaData[Qmmp::ALBUM]); title.replace("%t", metaData[Qmmp::TITLE]); title.replace("%n", metaData[Qmmp::TRACK]); title.replace("%NN", QString("%1").arg(metaData[Qmmp::TRACK],2,'0')); title.replace("%g", metaData[Qmmp::GENRE]); title.replace("%c", metaData[Qmmp::COMMENT]); title.replace("%C", metaData[Qmmp::COMPOSER]); title.replace("%D", metaData[Qmmp::DISCNUMBER]); title.replace("%f", metaData[Qmmp::URL].section('/',-1)); title.replace("%F", metaData[Qmmp::URL]); title.replace("%y", metaData[Qmmp::YEAR]); if(title.contains("l")) { if (length) { QString time; int l = length; if(l >= 3600) time = QString("%1:%2:%3").arg(l/3600,2,10,QChar('0')) .arg(l%3600/60,2,10,QChar('0')).arg(l%60,2,10,QChar('0')); else time = QString("%1:%2").arg(l/60,2,10,QChar('0')).arg(l%60,2,10,QChar('0')); title.replace("%l",time); } else title.replace("%l",""); } if(title.contains("%if")) title = processIfKeyWord(title); title.replace("%28", "("); title.replace("%29", ")"); return title; } QString MetaDataFormatter::processIfKeyWord(QString title) { int pos = title.lastIndexOf("%if("); int size = title.indexOf("%)",pos) - pos; QStringList args = title.mid (pos + 4, size - 4).split("%,"); if(args.count() < 3) { qWarning("TitleFormatter: invalid title format"); return title; } //process condition bool cond = true; foreach(QString arg, args.at(0).split("%&")) { cond &= !arg.isEmpty(); } QString r_str = cond ? args.at(1) : args.at(2); title.replace (pos, size + 2, r_str); if(title.contains("%if")) return processIfKeyWord(title); return title; } qmmp-0.7.4/src/qmmpui/addurldialog_p.h0000664000175000017500000000437012256224735016452 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ADDURLDIALOG_P_H #define ADDURLDIALOG_P_H #include #include #include #include "ui_addurldialog.h" class QNetworkAccessManager; class QNetworkReply; class PlayListModel; class PlayListDownloader; /*! @internal @author Vladimir Kuznetsov */ class AddUrlDialog : public QDialog , private Ui::AddUrlDialog { Q_OBJECT public: static void popup(QWidget* parent ,PlayListModel*); private slots: void add(const QStringList &urls); void showError(const QString &message); private: AddUrlDialog(QWidget *parent); ~AddUrlDialog(); void accept(); void setModel(PlayListModel*); static QPointer m_instance; PlayListModel *m_model; PlayListDownloader *m_downloader; QStringList m_history; }; #endif //ADDURLDIALOG_P_H qmmp-0.7.4/src/qmmpui/templateeditor.h0000664000175000017500000000611712256224735016523 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TEMPLATEEDITOR_H #define TEMPLATEEDITOR_H #include namespace Ui { class TemplateEditor; } class QAction; /*! @brief The TemplateEditor class provides simple template editor dialog. * @author Ilya Kotov */ class TemplateEditor : public QDialog { Q_OBJECT public: /*! * Constructor. * @param parent Parent widget. */ explicit TemplateEditor(QWidget *parent = 0); /*! * Returns current template from editor. */ QString currentTemplate() const; /*! * Sets template which is placed in the text edit to \b text. */ void setTemplate(const QString &text = QString()); /*! * Sets default template to \b text. * This template will be placed in the text edit if the user pressed Reset */ void setDefaultTemplate(const QString &text); /*! * Static convenience function to get a template from the user. * @param parent Parent widget. * @param title Window title. * @param text Template which is placed in the text edit. * @param default_template This template will be placed in the text edit if the user pressed Reset. * @param ok This varible will be set to \b true (\b false) if the user pressed OK (Cancel). */ static QString getTemplate (QWidget *parent, const QString &title, const QString &text = QString(), const QString &default_template = QString(), bool *ok = 0); private slots: void insertExpression(QAction *a); void on_resetButton_clicked(); private: void createMenu(); Ui::TemplateEditor *m_ui; QString m_defaultTemplate; }; #endif // TEMPLATEEDITOR_H qmmp-0.7.4/src/qmmpui/filedialogfactory.h0000664000175000017500000000605112256224735017165 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FILEDIALOGFACTORY_H #define FILEDIALOGFACTORY_H class QObject; class QTranslator; class FileDialog; class QWidget; class QString; /*! @brief Helper class to store file dialog plugin properties. */ class FileDialogProperties { public: /*! * Constructor */ FileDialogProperties() { hasAbout = false; modal = true; } bool hasAbout; /*!< Should be \b true if the file dialog plugin has about dialog, * otherwise should be \b false */ QString name; /*!< File dialog plugin full name */ QString shortName; /*!< File dialog short name for internal usage */ bool modal; /*!< Should be \b true if the file dialog doesn't support nonmodal mode, * otherwise should be \b false */ }; /*! @brief File dialog plugin interface. * @author Vladimir Kuznetsov */ class FileDialogFactory { public: /*! * Object destructor. */ virtual ~FileDialogFactory() {} /*! * Creates file dialog object. */ virtual FileDialog* create() = 0; /*! * Returns file dialog plugin properties. */ virtual const FileDialogProperties properties() const = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(FileDialogFactory, "FileDialogFactory/1.0") #endif qmmp-0.7.4/src/qmmpui/templateeditor.cpp0000664000175000017500000000736712256224735017066 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "ui_templateeditor.h" #include "templateeditor.h" TemplateEditor::TemplateEditor(QWidget *parent) : QDialog(parent), m_ui(new Ui::TemplateEditor) { m_ui->setupUi(this); createMenu(); } QString TemplateEditor::currentTemplate() const { return m_ui->textEdit->toPlainText (); } void TemplateEditor::setTemplate(const QString &text) { m_ui->textEdit->setPlainText(text); } void TemplateEditor::setDefaultTemplate(const QString &text) { m_defaultTemplate = text; } void TemplateEditor::createMenu() { QMenu *menu = new QMenu(this); menu->addAction(tr("Artist"))->setData("%p"); menu->addAction(tr("Album"))->setData("%a"); menu->addAction(tr("Title"))->setData("%t"); menu->addAction(tr("Track number"))->setData("%n"); menu->addAction(tr("Two-digit track number"))->setData("%NN"); menu->addAction(tr("Genre"))->setData("%g"); menu->addAction(tr("Comment"))->setData("%c"); menu->addAction(tr("Composer"))->setData("%C"); menu->addAction(tr("Duration"))->setData("%l"); menu->addAction(tr("Disc number"))->setData("%D"); menu->addAction(tr("File name"))->setData("%f"); menu->addAction(tr("File path"))->setData("%F"); menu->addAction(tr("Year"))->setData("%y"); menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); m_ui->insertButton->setMenu(menu); connect(menu, SIGNAL(triggered (QAction *)), SLOT(insertExpression(QAction *))); } void TemplateEditor::insertExpression(QAction *a) { m_ui->textEdit->insertPlainText(a->data().toString()); } void TemplateEditor::on_resetButton_clicked() { m_ui->textEdit->setPlainText(m_defaultTemplate); } QString TemplateEditor::getTemplate (QWidget *parent, const QString &title, const QString &text, const QString &default_template, bool *ok) { TemplateEditor *editor = new TemplateEditor(parent); editor->setWindowTitle(title); editor->setTemplate(text); editor->setDefaultTemplate(default_template); if(editor->exec() == QDialog::Accepted) { if(ok) *ok = true; QString t = editor->currentTemplate(); editor->deleteLater(); return t; } else { if(ok) *ok = false; editor->deleteLater(); return QString(); } } qmmp-0.7.4/src/qmmpui/playlistformat.h0000664000175000017500000000525612256224735016556 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PALYLISTFORMAT_H #define PALYLISTFORMAT_H #include class PlayListItem; /*! @brief Helper structure to store playlist format properies. * @author Ilya Kotov */ struct PlayListFormatProperties { QString shortName; /*!< Unique name of the playlist format for internal usage */ QStringList filters; /*!< File filters (example: "*.m3u") */ QStringList contentTypes; /*!< Supported content types */ }; /*! @brief Abstract interface for playlist formats. * @author Vladimir Kuznetsov */ class PlayListFormat { public: /*! * Object destructor */ virtual ~PlayListFormat() {} /*! * Returns playlist format properties. */ virtual const PlayListFormatProperties properties() const = 0; /*! * Takes raw contents of playlist file, should return string list of * ready file pathes to fill the playlist. */ virtual QStringList decode(const QString& contents) = 0; /*! * Takes the list of AbstractPlaylistItem objects, should return string of * encoded playlist file */ virtual QString encode(const QList& contents) = 0; }; Q_DECLARE_INTERFACE(PlayListFormat,"PlayListFormat/1.0") #endif qmmp-0.7.4/src/qmmpui/playlistparser.cpp0000664000175000017500000000674212256224735017116 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "playlistformat.h" #include "playlistparser.h" QList *PlayListParser::m_formats = 0; QList *PlayListParser::formats() { checkFormats(); return m_formats; } QStringList PlayListParser::nameFilters() { checkFormats(); QStringList filters; foreach(PlayListFormat* format, *m_formats) { filters << format->properties().filters; } return filters; } PlayListFormat *PlayListParser::findByMime(const QString &mime) { checkFormats(); foreach(PlayListFormat* format, *m_formats) { if(format->properties().contentTypes.contains(mime)) return format; } return 0; } PlayListFormat *PlayListParser::findByPath(const QString &filePath) { checkFormats(); foreach(PlayListFormat* format, *m_formats) { foreach(QString filter, format->properties().filters) { QRegExp r(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if(r.exactMatch(filePath)) return format; } } return 0; } PlayListFormat *PlayListParser::findByUrl(const QUrl &url) { QString path = url.encodedPath(); return findByPath(path); } void PlayListParser::checkFormats() { if (m_formats) return; m_formats = new QList(); QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("PlayListFormats"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("PlayListParser: loaded plugin %s", qPrintable(fileName)); else qWarning("PlayListParser: %s", qPrintable(loader.errorString ())); PlayListFormat *fmt = 0; if (plugin) fmt = qobject_cast(plugin); if (fmt) m_formats->append(fmt); } } qmmp-0.7.4/src/qmmpui/qtfiledialog.cpp0000664000175000017500000000675312256224735016506 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "qtfiledialog_p.h" FileDialog* QtFileDialogFactory::create() { qDebug("QtFileDialogFactory::create()"); return new QtFileDialog(); } const FileDialogProperties QtFileDialogFactory::properties() const { FileDialogProperties properties; properties.name = tr("Qt File Dialog"); properties.shortName = "qt_dialog"; properties.hasAbout = false; properties.modal = true; return properties; } void QtFileDialogFactory::showAbout(QWidget*){} QTranslator *QtFileDialogFactory::createTranslator(QObject *parent) { Q_UNUSED(parent) return 0; } QtFileDialog::~QtFileDialog() { qDebug("QtFileDialog::~QtFileDialog()"); } QString QtFileDialog::existingDirectory(QWidget *parent, const QString &caption, const QString &dir) { return QFileDialog::getExistingDirectory(parent,caption,dir, QFileDialog::ShowDirsOnly); } QString QtFileDialog::openFileName(QWidget *parent, const QString &caption, const QString &dir,const QString &filter, QString *selectedFilter) { Q_UNUSED(selectedFilter); return QFileDialog::getOpenFileName(parent,caption,dir,filter); } QStringList QtFileDialog::openFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { return QFileDialog::getOpenFileNames(parent,caption,dir,filter,selectedFilter); } QString QtFileDialog::saveFileName (QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { return QFileDialog::getSaveFileName(parent,caption,dir,filter,selectedFilter); } qmmp-0.7.4/src/qmmpui/qtfiledialog_p.h0000664000175000017500000000561712256224735016470 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef QTFILEDIALOG_H #define QTFILEDIALOG_H #include #include "filedialog.h" class QTranslator; /*! @internal * @author Vladimir Kuznetsov */ class QtFileDialogFactory : public QObject, public FileDialogFactory { Q_OBJECT Q_INTERFACES(FileDialogFactory) public: QtFileDialogFactory(){} FileDialog* create(); const FileDialogProperties properties() const; void showAbout(QWidget*); QTranslator *createTranslator(QObject*); virtual ~QtFileDialogFactory() { ; } }; class QtFileDialog : public FileDialog { public: virtual ~QtFileDialog(); QString existingDirectory(QWidget *parent , const QString & , const QString &dir); QString openFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter); QStringList openFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter); QString saveFileName (QWidget *parent, const QString &caption, const QString & dir, const QString &filter, QString *selectedFilter); }; #endif qmmp-0.7.4/src/qmmpui/playlistparser.h0000664000175000017500000000520712256224735016556 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTPARSER_H #define PLAYLISTPARSER_H #include #include #include "playlistformat.h" /*! @brief The PlaylistParser class provides a simple api to access playlist format plugins. * @author Ilya Kotov */ class PlayListParser { public: /*! * Returns a list of the installed playlist formats. */ static QList *formats(); /*! * Returns a list of the supported files name filters, i.e. "*.m3u *.pls" */ static QStringList nameFilters(); /*! * Returns PlayListFormat pointer which supports mime type \b mime * or \b 0 if mime type \b mime is unsupported */ static PlayListFormat *findByMime(const QString &mime); /*! * Finds playlist format by file path \b filePath * Returns \b 0 if file \b filePath is unsupported. */ static PlayListFormat *findByPath(const QString &filePath); /*! * Finds playlist format by url path \b url * Returns \b 0 if file \b filePath is unsupported. */ static PlayListFormat *findByUrl(const QUrl &url); private: PlayListParser(){} static void checkFormats(); static QList *m_formats; }; #endif qmmp-0.7.4/src/qmmpui/general.cpp0000664000175000017500000001206412256224735015447 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "general.h" QList *General::m_factories = 0; QHash *General::m_files = 0; QHash *General::m_generals = 0; QObject *General::m_parent = 0; void General::checkFactories() { if (!m_factories) { m_factories = new QList; m_files = new QHash ; QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("General"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("General: loaded plugin %s", qPrintable(fileName)); else qWarning("General: %s", qPrintable(loader.errorString ())); GeneralFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, pluginsDir.absoluteFilePath(fileName)); qApp->installTranslator(factory->createTranslator(qApp)); } } } } void General::create(QObject *parent) { if(m_generals) return; m_generals = new QHash (); m_parent = parent; checkFactories(); foreach(GeneralFactory* factory, *General::factories()) { if (General::isEnabled(factory)) { QObject *general = factory->create(parent); m_generals->insert(factory, general); } } } QList *General::factories() { checkFactories(); return m_factories; } QString General::file(GeneralFactory *factory) { checkFactories(); return m_files->value(factory); } void General::setEnabled(GeneralFactory* factory, bool enable) { checkFactories(); if (!m_factories->contains(factory)) return; QString name = factory->properties().shortName; QSettings settings ( Qmmp::configFile(), QSettings::IniFormat ); QStringList genList = settings.value("General/enabled_plugins").toStringList(); if (enable) { if (!genList.contains(name)) genList << name; } else genList.removeAll(name); settings.setValue("General/enabled_plugins", genList); if(!m_generals) return; if (enable == m_generals->keys().contains(factory)) return; if (enable) { QObject *general = factory->create(m_parent); m_generals->insert(factory, general); } else { delete m_generals->value(factory); m_generals->remove(factory); } } void General::showSettings(GeneralFactory* factory, QWidget* parentWidget) { QDialog *dialog = factory->createConfigDialog(parentWidget); if (!dialog) return; if (m_generals && dialog->exec() == QDialog::Accepted && m_generals->keys().contains(factory)) { delete m_generals->value(factory); QObject *general = factory->create(m_parent); m_generals->insert(factory, general); } dialog->deleteLater(); } bool General::isEnabled(GeneralFactory* factory) { checkFactories(); if (!m_factories->contains(factory)) return false; QSettings settings (Qmmp::configFile(), QSettings::IniFormat ); QStringList genList = settings.value("General/enabled_plugins").toStringList(); return genList.contains(factory->properties().shortName); } qmmp-0.7.4/src/qmmpui/tageditor.cpp0000664000175000017500000001025612256224735016015 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "tageditor_p.h" #include "ui_tageditor.h" TagEditor::TagEditor(TagModel *tagModel, QWidget *parent) : QWidget(parent), m_ui(new Ui::TagEditor) { m_ui->setupUi(this); m_tagModel = tagModel; //check available keys m_ui->titleLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::TITLE)); m_ui->artistLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ARTIST)); m_ui->albumLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::ALBUM)); m_ui->composerLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::COMPOSER)); m_ui->genreLineEdit->setEnabled(m_tagModel->keys().contains(Qmmp::GENRE)); m_ui->commentBrowser->setEnabled(m_tagModel->keys().contains(Qmmp::COMMENT)); m_ui->discSpinBox->setEnabled(m_tagModel->keys().contains(Qmmp::DISCNUMBER)); m_ui->yearSpinBox->setEnabled(m_tagModel->keys().contains(Qmmp::YEAR)); m_ui->trackSpinBox->setEnabled(m_tagModel->keys().contains(Qmmp::TRACK)); readTag(); } TagEditor::~TagEditor() { delete m_ui; } void TagEditor::save() { if(m_ui->useCheckBox->isChecked()) { if(!m_tagModel->exists()) m_tagModel->create(); m_tagModel->setValue(Qmmp::TITLE, m_ui->titleLineEdit->text()); m_tagModel->setValue(Qmmp::ARTIST, m_ui->artistLineEdit->text()); m_tagModel->setValue(Qmmp::ALBUM, m_ui->albumLineEdit->text()); m_tagModel->setValue(Qmmp::COMPOSER, m_ui->composerLineEdit->text()); m_tagModel->setValue(Qmmp::GENRE, m_ui->genreLineEdit->text()); m_tagModel->setValue(Qmmp::COMMENT, m_ui->commentBrowser->toPlainText ()); m_tagModel->setValue(Qmmp::DISCNUMBER, m_ui->discSpinBox->value()); m_tagModel->setValue(Qmmp::YEAR, m_ui->yearSpinBox->value()); m_tagModel->setValue(Qmmp::TRACK, m_ui->trackSpinBox->value()); } else m_tagModel->remove(); m_tagModel->save(); readTag(); } void TagEditor::readTag() { m_ui->tagWidget->setEnabled(m_tagModel->exists()); m_ui->useCheckBox->setChecked(m_tagModel->exists()); m_ui->useCheckBox->setVisible(m_tagModel->caps() & TagModel::CreateRemove); m_ui->titleLineEdit->setText(m_tagModel->value(Qmmp::TITLE)); m_ui->artistLineEdit->setText(m_tagModel->value(Qmmp::ARTIST)); m_ui->albumLineEdit->setText(m_tagModel->value(Qmmp::ALBUM)); m_ui->composerLineEdit->setText(m_tagModel->value(Qmmp::COMPOSER)); m_ui->genreLineEdit->setText(m_tagModel->value(Qmmp::GENRE)); m_ui->commentBrowser->setText(m_tagModel->value(Qmmp::COMMENT)); m_ui->discSpinBox->setValue(m_tagModel->value(Qmmp::DISCNUMBER).toInt()); m_ui->yearSpinBox->setValue(m_tagModel->value(Qmmp::YEAR).toInt()); m_ui->trackSpinBox->setValue(m_tagModel->value(Qmmp::TRACK).toInt()); } qmmp-0.7.4/src/qmmpui/tageditor_p.h0000664000175000017500000000355212256224735016002 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TAGEDITOR_H #define TAGEDITOR_H #include namespace Ui { class TagEditor; } class TagModel; /*! @internal * @author Ilya Kotov */ class TagEditor : public QWidget { Q_OBJECT public: TagEditor(TagModel *tagModel, QWidget *parent = 0); ~TagEditor(); void save(); private: void readTag(); Ui::TagEditor *m_ui; TagModel *m_tagModel; }; #endif // TAGEDITOR_H qmmp-0.7.4/src/qmmpui/pluginitem.cpp0000664000175000017500000002221512256224735016206 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "radioitemdelegate_p.h" #include "pluginitem_p.h" PluginItem::PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), TRANSPORT) { m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), DECODER) { setCheckState(0, Decoder::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), ENGINE) { setCheckState(0, AbstractEngine::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), EFFECT) { setCheckState(0, Effect::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), VISUAL) { setCheckState(0, Visual::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), GENERAL) { setCheckState(0, General::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; } PluginItem::PluginItem(QTreeWidgetItem *parent, OutputFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), OUTPUT) { setCheckState(0, (Output::currentFactory() == factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = factory->properties().hasSettings; m_factory = factory; setData(0, RadioButtonRole, true); } PluginItem::PluginItem(QTreeWidgetItem *parent, FileDialogFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), FILE_DIALOG) { setCheckState(0, FileDialog::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = false; m_factory = factory; setData(0, RadioButtonRole, true); } PluginItem::PluginItem(QTreeWidgetItem *parent, UiFactory *factory, const QString &path) : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), USER_INTERFACE) { setCheckState(0, (UiLoader::selected() == factory) ? Qt::Checked : Qt::Unchecked); m_has_about = factory->properties().hasAbout; m_has_config = false; m_factory = factory; setData(0, RadioButtonRole, true); } PluginItem::~PluginItem() {} bool PluginItem::hasAbout() const { return m_has_about; } bool PluginItem::hasSettings() const { return m_has_config; } void PluginItem::showAbout(QWidget *parent) { switch(type()) { case PluginItem::TRANSPORT: static_cast(m_factory)->showAbout(parent); break; case PluginItem::DECODER: static_cast(m_factory)->showAbout(parent); break; case PluginItem::ENGINE: static_cast(m_factory)->showAbout(parent); break; case PluginItem::EFFECT: static_cast(m_factory)->showAbout(parent); break; case PluginItem::VISUAL: static_cast(m_factory)->showAbout(parent); break; case PluginItem::GENERAL: static_cast(m_factory)->showAbout(parent); break; case PluginItem::OUTPUT: static_cast(m_factory)->showAbout(parent); break; case PluginItem::FILE_DIALOG: static_cast(m_factory)->showAbout(parent); break; case PluginItem::USER_INTERFACE: static_cast(m_factory)->showAbout(parent); break; default: ; } } void PluginItem::showSettings(QWidget *parent) { switch(type()) { case PluginItem::TRANSPORT: static_cast(m_factory)->showSettings(parent); break; case PluginItem::DECODER: static_cast(m_factory)->showSettings(parent); break; case PluginItem::ENGINE: static_cast(m_factory)->showSettings(parent); break; case PluginItem::EFFECT: static_cast(m_factory)->showSettings(parent); break; case PluginItem::VISUAL: Visual::showSettings(static_cast(m_factory), parent); break; case PluginItem::GENERAL: General::showSettings(static_cast(m_factory), parent); break; case PluginItem::OUTPUT: static_cast(m_factory)->showSettings(parent); break; default: ; } } void PluginItem::setEnabled(bool enabled) { switch(type()) { case PluginItem::TRANSPORT: //dynamic_cast(m_factory) break; case PluginItem::DECODER: Decoder::setEnabled(static_cast(m_factory), enabled); break; case PluginItem::ENGINE: AbstractEngine::setEnabled(static_cast(m_factory), enabled); break; case PluginItem::EFFECT: Effect::setEnabled(static_cast(m_factory), enabled); break; case PluginItem::VISUAL: Visual::setEnabled(static_cast(m_factory), enabled); break; case PluginItem::GENERAL: General::setEnabled(static_cast(m_factory), enabled); break; case PluginItem::OUTPUT: if(enabled) { Output::setCurrentFactory(static_cast(m_factory)); } break; case PluginItem::FILE_DIALOG: if(enabled) { FileDialog::setEnabled(static_cast(m_factory)); } break; case PluginItem::USER_INTERFACE: if(enabled) { UiLoader::select(static_cast(m_factory)); } break; default: ; } } qmmp-0.7.4/src/qmmpui/pluginitem_p.h0000664000175000017500000000613012256224735016170 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLUGINITEM_P_H #define PLUGINITEM_P_H #include /** @author Ilya Kotov */ class QWidget; class InputSourceFactory; class DecoderFactory; class EngineFactory; class OutputFactory; class VisualFactory; class EffectFactory; class GeneralFactory; class OutputFactory; class FileDialogFactory; class UiFactory; class PluginItem : public QTreeWidgetItem { public: PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, OutputFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, FileDialogFactory *factory, const QString &path); PluginItem(QTreeWidgetItem *parent, UiFactory *factory, const QString &path); ~PluginItem(); enum PluginType { TRANSPORT = QTreeWidgetItem::UserType, DECODER, ENGINE, EFFECT, VISUAL, GENERAL, OUTPUT, FILE_DIALOG, USER_INTERFACE }; bool hasAbout() const; bool hasSettings() const; void showAbout(QWidget *parent); void showSettings(QWidget *parent); void setEnabled(bool enabled); private: bool m_has_about; bool m_has_config; void *m_factory; }; #endif qmmp-0.7.4/src/qmmpui/generalfactory.h0000664000175000017500000000657112256224735016512 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef GENERALFACTORY_H #define GENERALFACTORY_H class QObject; class QTranslator; class QDialog; class QString; class QWidget; class Control; class General; /*! @brief Helper class to store general plugin properies. */ class GeneralProperties { public: /*! * Constructor */ GeneralProperties() { hasAbout = false; hasSettings = false; visibilityControl = false; } QString name; /*!< File dialog plugin full name */ QString shortName; /*!< File dialog short name for internal usage */ bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ bool hasSettings; /*!< Should be \b true if plugin has settings dialog, otherwise returns \b false */ bool visibilityControl; /*!< Should be \b true if plugin can show/hide main window of the player, * otherwise returns \b false */ }; /*! @brief %General plugin interface. * @author Ilya Kotov */ class GeneralFactory { public: /*! * Object destructor. */ virtual ~GeneralFactory() {} /*! * Returns general plugin properties. */ virtual const GeneralProperties properties() const = 0; /*! * Creates object of the General class. */ virtual QObject *create(QObject *parent) = 0; /*! * Creates configuration dialog. * @param parent Parent widget. * @return Configuration dialog pointer. */ virtual QDialog *createConfigDialog(QWidget *parent) = 0; /*! * Shows about dialog. * @param parent Parent widget. */ virtual void showAbout(QWidget *parent) = 0; /*! * Creates QTranslator object of the system locale. Should return \b 0 if translation doesn't exist. * @param parent Parent object. */ virtual QTranslator *createTranslator(QObject *parent) = 0; }; Q_DECLARE_INTERFACE(GeneralFactory, "GeneralFactory/1.0") #endif qmmp-0.7.4/src/qmmpui/radioitemdelegate.cpp0000664000175000017500000001142612256224735017503 0ustar useruser/*************************************************************************** * Copyright (C) 2012-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "radioitemdelegate_p.h" RadioItemDelegate::RadioItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { } void RadioItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (hasRadioButton(index)) { QStyleOptionViewItemV4 opt = option; initStyleOption(&opt, index); QStyleOptionButton buttonOption; buttonOption.rect = option.rect; buttonOption.text = index.data(Qt::DisplayRole).toString(); buttonOption.state |= QStyle::State_Enabled; if (index.data(Qt::CheckStateRole) == Qt::Checked) { buttonOption.state |= QStyle::State_On; buttonOption.state &=~ QStyle::State_Off; } else { buttonOption.state |= QStyle::State_Off; buttonOption.state &=~ QStyle::State_On; } buttonOption.palette = opt.palette; if(opt.state.testFlag(QStyle::State_Selected)) { buttonOption.palette.setBrush(QPalette::ButtonText, opt.palette.brush(QPalette::HighlightedText)); qApp->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter); } qApp->style()->drawControl(QStyle::CE_RadioButton, &buttonOption, painter); } else { QStyledItemDelegate::paint(painter, option, index); } } QSize RadioItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const { QSize size = QStyledItemDelegate::sizeHint(option, index); if (hasRadioButton(index)) { int buttonHeight = qApp->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight, &option); size.setHeight(qMax(size.height(), buttonHeight)); } return size; } bool RadioItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) { if (event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::KeyPress) { if (hasRadioButton(index)) { if(event->type() == QEvent::MouseButtonRelease) { QRect checkRect = qApp->style()->subElementRect(QStyle::SE_RadioButtonIndicator, &option); QMouseEvent *mouseEvent = dynamic_cast(event); if(!checkRect.contains(mouseEvent->pos())) return true; } if (!index.data(Qt::CheckStateRole).toBool()) { model->setData(index, Qt::Checked, Qt::CheckStateRole); QModelIndex parentItem = index.parent(); for (int i = 0; i < model->rowCount(parentItem); ++i) { QModelIndex childIndex = parentItem.child(i,0); if (childIndex != index) model->setData(childIndex, Qt::Unchecked, Qt::CheckStateRole); } } return true; } } return QStyledItemDelegate::editorEvent(event,model,option,index); } bool RadioItemDelegate::hasRadioButton(const QModelIndex &index) const { return index.flags().testFlag(Qt::ItemIsUserCheckable) && index.data(RadioButtonRole).toBool(); } qmmp-0.7.4/src/qmmpui/radioitemdelegate_p.h0000664000175000017500000000430412256224735017464 0ustar useruser/*************************************************************************** * Copyright (C) 2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef RADIOITEMDELEGATE_P_H #define RADIOITEMDELEGATE_P_H #include #include #define RadioButtonRole (Qt::UserRole + 1) /*! @internal * @author Ilya Kotov */ class RadioItemDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit RadioItemDelegate(QObject *parent = 0); void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index); bool hasRadioButton(const QModelIndex &index) const; }; #endif // RADIOITEMDELEGATE_P_H qmmp-0.7.4/src/qmmpui/qmmpui.pro0000664000175000017500000000715412256224735015364 0ustar useruserinclude(../../qmmp.pri) unix:TARGET = ../../lib/qmmpui win32:TARGET = ../../../bin/qmmpui CONFIG += release \ warn_on \ shared \ create_pc create_prl no_install_prl \ qt \ thread QMAKE_LIBDIR += ../../lib \ qmmpui LIBS += -Wl,-rpath,./ unix:LIBS += -L../../lib \ -lqmmp win32:LIBS += -L../../bin \ -lqmmp0 INCLUDEPATH += ../ TEMPLATE = lib unix:isEmpty(LIB_DIR):LIB_DIR = /lib VERSION = $$QMMP_VERSION unix:target.path = $$LIB_DIR QT += network HEADERS += general.h \ generalfactory.h \ playlistformat.h \ playlistparser.h \ commandlinemanager.h \ commandlineoption.h \ filedialog.h \ filedialogfactory.h \ qtfiledialog_p.h \ playlistitem.h \ playlistmodel.h \ playstate_p.h \ fileloader_p.h \ mediaplayer.h \ detailsdialog.h \ tageditor_p.h \ playlistmanager.h \ metadataformatter.h \ templateeditor.h \ uifactory.h \ uiloader.h \ uihelper.h \ jumptotrackdialog_p.h \ configdialog.h \ pluginitem_p.h \ aboutdialog_p.h \ qmmpuisettings.h \ radioitemdelegate_p.h \ playlistdownloader.h \ addurldialog_p.h SOURCES += general.cpp \ playlistparser.cpp \ commandlinemanager.cpp \ filedialog.cpp \ qtfiledialog.cpp \ playlistmodel.cpp \ playstate.cpp \ playlistitem.cpp \ fileloader.cpp \ mediaplayer.cpp \ detailsdialog.cpp \ tageditor.cpp \ playlistmanager.cpp \ metadataformatter.cpp \ templateeditor.cpp \ uiloader.cpp \ uihelper.cpp \ jumptotrackdialog.cpp \ configdialog.cpp \ pluginitem.cpp \ aboutdialog.cpp \ qmmpuisettings.cpp \ radioitemdelegate.cpp \ playlistdownloader.cpp \ addurldialog.cpp FORMS += forms/detailsdialog.ui \ forms/tageditor.ui \ forms/templateeditor.ui \ forms/jumptotrackdialog.ui \ forms/configdialog.ui \ forms/aboutdialog.ui \ forms/addurldialog.ui unix:DESTDIR = . RESOURCES += translations/libqmmpui_locales.qrc \ images/qmmpui_images.qrc \ txt/txt.qrc TRANSLATIONS = translations/libqmmpui_ru.ts \ translations/libqmmpui_tr.ts \ translations/libqmmpui_zh_CN.ts \ translations/libqmmpui_cs.ts \ translations/libqmmpui_pt_BR.ts \ translations/libqmmpui_uk_UA.ts \ translations/libqmmpui_zh_TW.ts \ translations/libqmmpui_de.ts \ translations/libqmmpui_it.ts \ translations/libqmmpui_lt.ts \ translations/libqmmpui_pl_PL.ts \ translations/libqmmpui_nl.ts \ translations/libqmmpui_ja.ts \ translations/libqmmpui_es.ts \ translations/libqmmpui_sk.ts unix { devel.files += commandlinemanager.h \ commandlineoption.h \ configdialog.h \ detailsdialog.h \ filedialogfactory.h \ filedialog.h \ generalfactory.h \ general.h \ mediaplayer.h \ metadataformatter.h \ playlistdownloader.h \ playlistformat.h \ playlistitem.h \ playlistmanager.h \ playlistmodel.h \ playlistparser.h \ qmmpuisettings.h \ templateeditor.h \ uifactory.h \ uihelper.h \ uiloader.h devel.path = /include/qmmpui INSTALLS += target \ devel } unix { QMAKE_PKGCONFIG_NAME = qmmpui QMAKE_PKGCONFIG_DESCRIPTION = qmmp user interface library QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui QtNetwork qmmp QMAKE_PKGCONFIG_DESTDIR = pkgconfig } qmmp-0.7.4/src/qmmpui/uihelper.h0000664000175000017500000001340112256224735015310 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef UiHelper_H #define UiHelper_H #include #include #include #include #include #include #include #include "playlistmanager.h" #include "playlistmodel.h" class QAction; class QMenu; class QWidget; class General; class GeneralFactory; class JumpToTrackDialog; /*! @brief The UiHelper class provides simple api to access general plugins and some gui features. * @author Ilya Kotov */ class UiHelper : public QObject { Q_OBJECT public: /*! * Object constructor, * @param parent Parent object */ UiHelper(QObject *parent = 0); /*! * Destructor */ ~UiHelper(); /*! * Enum of menu type */ enum MenuType { TOOLS_MENU = 0, /*!< tools menu */ PLAYLIST_MENU /*!< playlist context menu */ }; /*! * Returns \b true if one of the general plugin can change visibility, otherwise returns \b false */ bool visibilityControl(); /*! * Adds the newly created action to the menu with type \b type. * Menu with type \b type should be created first. * @param action Pointer of action. * @param type Menu type. */ void addAction(QAction *action, MenuType type = TOOLS_MENU); /*! * Removes action \b action from created menus. */ void removeAction(QAction *action); /*! * Returns a list of actions of the menu type \b type */ QList actions(MenuType type = TOOLS_MENU); /*! * Creates menu with type \b type * @param type Menu type. * @param title Menu title. * @param parent Parent widget */ QMenu *createMenu(MenuType type, const QString &title = QString(), QWidget *parent = 0); /*! * Opens 'Add File' dialog * @param parent Parent widget * @param model Destination playlist model */ void addFile(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Opens 'Add Directory' dialog * @param parent Parent widget * @param model Destination playlist model */ void addDirectory(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Opens 'Add URL' dialog * @param parent Parent widget * @param model Destination playlist model */ void addUrl(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Opens 'Load Playlist' dialog * @param parent Parent widget * @param model Destination playlist model */ void loadPlayList(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Opens 'Save Playlist' dialog * @param parent Parent widget * @param model Destination playlist model */ void savePlayList(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Opens 'Jump To Track' dialog * @param parent Parent widget * @param model Destination playlist model */ void jumpToTrack(QWidget *parent = qApp->activeWindow(), PlayListModel *model = PlayListManager::instance()->selectedPlayList()); /*! * Shows about dialog * @param parent Parent widget */ void about(QWidget *parent = 0); /*! * Returns a pointer to the object's instance. */ static UiHelper* instance(); public slots: /*! * Toggles player window visibility. */ void toggleVisibility(); /*! * Tells the player to exit. */ void exit(); signals: /*! * Emitted when some general plugin requires to toggle visibility. * Use it to show/hide player's window. */ void toggleVisibilityCalled(); private slots: void removeAction(QObject *action); private: QMap m_generals; QList m_toolsActions; QList m_playlistActions; QPointer m_toolsMenu; QPointer m_playlistMenu; QString m_lastDir; QPointer m_jumpDialog; static UiHelper* m_instance; }; #endif qmmp-0.7.4/src/qmmpui/aboutdialog.cpp0000664000175000017500000001307312256224735016325 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "aboutdialog_p.h" AboutDialog::AboutDialog(QWidget* parent, Qt::WFlags fl) : QDialog( parent, fl ) { setupUi(this); setAttribute(Qt::WA_QuitOnClose, false); licenseTextBrowser->setPlainText(getStringFromResource(":COPYING")); aboutTextBrowser->setHtml(loadAbout()); authorsTextBrowser->setPlainText(getStringFromResource(":authors")); thanksToTextBrowser->setPlainText(getStringFromResource(":thanks")); translatorsTextBrowser->setPlainText(getStringFromResource(":translators")); } AboutDialog::~AboutDialog() {} /*$SPECIALIZATION$*/ QString AboutDialog::loadAbout() { QString text; text.append(""); text.append(""); text.append(""); if(layoutDirection() == Qt::RightToLeft) text.append("
"); else text.append("
"); text.append("

"+tr("Qt-based Multimedia Player (Qmmp)")+"

"); text.append("

"+getStringFromResource(":description")+"

"); text.append("

"+tr("Version: %1").arg(Qmmp::strVersion()) + "
"); text.append(tr("Using Qt %1 (compiled with Qt %2)" ).arg(qVersion()).arg(QT_VERSION_STR) + "

"); text.append("

"); text.append(tr("(c) %1-%2 Qmmp Development Team").arg(2006).arg(2013)+"
"); text.append("http://qmmp.ylsoftware.com/
"); text.append("http://code.google.com/p/qmmp/"); text.append("

"); text.append("
"+tr("Input plugins:")+"
"); text.append("
    "); foreach(DecoderFactory *fact, *Decoder::factories()) { text.append("
  • "); text.append(fact->properties().name); text.append("
  • "); } text.append("
"); text.append("
"+tr("Output plugins:")+"
"); text.append("
    "); foreach(OutputFactory *fact, *Output::factories()) { text.append("
  • "); text.append(fact->properties().name); text.append("
  • "); } text.append("
"); text.append("
"+tr("Visual plugins:")+"
"); text.append("
    "); foreach(VisualFactory *fact, *Visual::factories()) { text.append("
  • "); text.append(fact->properties().name); text.append("
  • "); } text.append("
"); text.append("
"+tr("Effect plugins:")+"
"); text.append("
    "); foreach(EffectFactory *fact, *Effect::factories()) { text.append("
  • "); text.append(fact->properties().name); text.append("
  • "); } text.append("
"); text.append("
"+tr("General plugins:")+"
"); text.append("
    "); foreach(GeneralFactory *fact, *General::factories()) { text.append("
  • "); text.append(fact->properties().name); text.append("
  • "); } text.append("
"); text.append("
"); return text; } QString AboutDialog::getStringFromResource(const QString& res_file) { QString ret_string; QStringList paths; paths << res_file + "_" + Qmmp::systemLanguageID() + ".txt"; if(Qmmp::systemLanguageID().contains(".")) paths << res_file + "_" + Qmmp::systemLanguageID().split(".").at(0) + ".txt"; if(Qmmp::systemLanguageID().contains("_")) paths << res_file + "_" + Qmmp::systemLanguageID().split("_").at(0) + ".txt"; paths << res_file + ".txt"; paths << res_file; foreach(QString path, paths) { QFile file(path); if (file.open(QIODevice::ReadOnly)) { QTextStream ts(&file); ts.setCodec("UTF-8"); ret_string = ts.readAll(); file.close(); return ret_string; } } return ret_string; } qmmp-0.7.4/src/qmmpui/aboutdialog_p.h0000664000175000017500000000353712256224735016315 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ABOUTDIALOG_P_H #define ABOUTDIALOG_P_H #include #include "ui_aboutdialog.h" /** @internal @author Vladimir Kuznetsov */ class AboutDialog : public QDialog, private Ui::AboutDialog { Q_OBJECT public: AboutDialog(QWidget* parent = 0, Qt::WFlags fl = 0 ); ~AboutDialog(); private: QString loadAbout(); QString getStringFromResource(const QString& res_file); }; #endif qmmp-0.7.4/src/qmmpui/commandlinemanager.h0000664000175000017500000000454112256224735017321 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef COMMANDLINEMANAGER_H #define COMMANDLINEMANAGER_H #include #include "general.h" #include "commandlineoption.h" /*! @brief Helper class used for handle command line plugins * @author Ilya Kotov */ class CommandLineManager { public: /*! * Executes command \b opt_str * @param opt_str Command line option string * @param args Command arguments * @return Command output result */ static QString executeCommand(const QString& opt_str, const QStringList &args = QStringList()); /*! * Return \b true if command \b opt_str is supported, otherwise returns \b false */ static bool hasOption(const QString &opt_str); /*! * Prints usage to stdout */ static void printUsage(); private: static void checkOptions(); static QList *m_options; static QHash *m_files; }; #endif qmmp-0.7.4/src/qmmpui/filedialog.cpp0000664000175000017500000002253612256224735016136 0ustar useruser/************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "filedialog.h" #include "qtfiledialog_p.h" //static functions FileDialog* FileDialog::m_instance = 0; QList *FileDialog::m_factories = 0; QHash *FileDialog::m_files = 0; FileDialogFactory *FileDialog::m_currentFactory = 0; void FileDialog::checkFactories() { if(m_factories) return; m_factories = new QList; m_files = new QHash ; m_factories->append(new QtFileDialogFactory); QDir pluginsDir (Qmmp::pluginsPath()); pluginsDir.cd("FileDialogs"); foreach (QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); QObject *plugin = loader.instance(); if (loader.isLoaded()) qDebug("FileDialog: loaded plugin %s", qPrintable(fileName)); else qWarning("FileDialog: %s",qPrintable(loader.errorString())); FileDialogFactory *factory = 0; if (plugin) factory = qobject_cast(plugin); if (factory) { m_factories->append(factory); m_files->insert(factory, fileName); qApp->installTranslator(factory->createTranslator(qApp)); } } #ifndef Q_OS_WIN32 #if (QT_VERSION >= 0x040500 && QT_VERSION < 0x040600) //load native kde dialog QStringList paths; paths << "/usr/lib/kde4/kio_file.so"; paths << "/usr/lib64/kde4/kio_file.so"; paths << "/usr/local/kde4/lib/kde4/kio_file.so"; foreach(QString path, paths) { if(QFile::exists(path)) { QLibrary *l = new QLibrary(path, qApp); l->load(); break; } } #endif #endif } QList *FileDialog::factories() { checkFactories(); return m_factories; } void FileDialog::setEnabled(FileDialogFactory *factory) { checkFactories(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue("FileDialog", factory->properties().shortName); } bool FileDialog::isEnabled(FileDialogFactory *factory) { checkFactories(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QString name = settings.value("FileDialog", "qt_dialog").toString(); return factory->properties().shortName == name; } QString FileDialog::file(FileDialogFactory *factory) { checkFactories(); return m_files->value(factory); } QString FileDialog::getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir) { return instance()->existingDirectory(parent,caption,dir); } QString FileDialog::getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { return instance()->openFileName(parent,caption,dir,filter,selectedFilter); } QStringList FileDialog::getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir,const QString &filter, QString *selectedFilter) { return instance()->openFileNames(parent,caption,dir,filter,selectedFilter); } QString FileDialog::getSaveFileName (QWidget *parent, const QString &caption, const QString& dir, const QString &filter, QString *selectedFilter) { return instance()->saveFileName(parent,caption,dir,filter,selectedFilter); } void FileDialog::popup(QWidget *parent, Mode m, QString *dir, QObject *receiver, const char *member, const QString &caption, const QString &filters) { if (!dir) qFatal("FileDialog: empty last dir pointer"); FileDialog* inst = instance(); inst->setParent(parent); inst->init(receiver, member, dir); if (!m_currentFactory->properties().modal) inst->raise(*dir, m, caption, filters.split(";;")); else { QStringList files; if (m == AddFiles || m == AddFile || m == AddDirsFiles) { QString selectedFilter; files = getOpenFileNames(parent, caption, *dir, filters, &selectedFilter); } else if (m == AddDirs || m == AddDir) { QString path = getExistingDirectory(parent, caption, *dir); if (!path.isEmpty()) files << path; } QMetaObject::invokeMethod(inst, "filesAdded", Q_ARG(QStringList, files)); } } FileDialog* FileDialog::instance() { checkFactories(); FileDialogFactory *selected = 0; QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QString name = settings.value("FileDialog", "qt_dialog").toString(); foreach(FileDialogFactory *factory, *m_factories) { if(factory->properties().shortName == name) { selected = factory; break; } } if(!selected) selected = m_factories->at(0); if(selected == m_currentFactory && m_instance) return m_instance; if(m_instance) { delete m_instance; m_instance = 0; } m_currentFactory = selected; m_instance = m_currentFactory->create(); return m_instance; } FileDialog* FileDialog::createDefault() { return m_factories->at(0)->create(); } //base implementation FileDialog::FileDialog() : QObject(), m_initialized(false) { m_lastDir = 0; } FileDialog::~FileDialog() {} void FileDialog::raise(const QString &dir, Mode mode, const QString &caption, const QStringList &mask) { Q_UNUSED(dir); Q_UNUSED(mode); Q_UNUSED(caption); Q_UNUSED(mask); } QString FileDialog::existingDirectory(QWidget *parent, const QString &caption, const QString &dir) { FileDialog *instance = FileDialog::createDefault(); QString dir_path = instance->existingDirectory(parent, caption, dir); delete instance; return dir_path; } QString FileDialog::openFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { FileDialog *instance = FileDialog::createDefault(); QString file_path = instance->openFileName(parent, caption, dir, filter, selectedFilter); delete instance; return file_path; } QStringList FileDialog::openFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { FileDialog *instance = FileDialog::createDefault(); QStringList list = instance->openFileNames(parent, caption, dir, filter, selectedFilter); delete instance; return list; } QString FileDialog::saveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter) { FileDialog *instance = FileDialog::createDefault(); QString file_path = instance->saveFileName(parent, caption, dir, filter, selectedFilter); delete instance; return file_path; } void FileDialog::init(QObject* receiver, const char* member, QString *dir) { m_lastDir = dir; if (m_initialized) disconnect(); if (receiver && member) { connect(this,SIGNAL(filesAdded(const QStringList&)), receiver, member); connect(this,SIGNAL(filesAdded(const QStringList&)), SLOT(updateLastDir(const QStringList&))); m_initialized = true; } } void FileDialog::updateLastDir(const QStringList& list) { if (!list.isEmpty() && m_lastDir) { QString path = list[0]; if (path.endsWith('/')) path.remove(path.size()-1, 1); *m_lastDir = path.left(path.lastIndexOf ('/')); } } qmmp-0.7.4/src/plugins/0000775000175000017500000000000012256224736013475 5ustar useruserqmmp-0.7.4/src/plugins/Ui/0000775000175000017500000000000012256224735014051 5ustar useruserqmmp-0.7.4/src/plugins/Ui/Ui.pro0000664000175000017500000000014612256224735015151 0ustar useruserinclude(../../../qmmp.pri) TEMPLATE = subdirs contains(CONFIG, WITH_SKINNED){ SUBDIRS += skinned } qmmp-0.7.4/src/plugins/Ui/CMakeLists.txt0000664000175000017500000000020712256224735016610 0ustar useruserSET(USE_SKINNED TRUE CACHE BOOL "enable/disable skinned user interface") IF(USE_SKINNED) add_subdirectory(skinned) ENDIF(USE_SKINNED) qmmp-0.7.4/src/plugins/Ui/skinned/0000775000175000017500000000000012256224735015504 5ustar useruserqmmp-0.7.4/src/plugins/Ui/skinned/playlistslider.cpp0000664000175000017500000000772412256224735021266 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "skin.h" #include "playlistslider.h" #include "pixmapwidget.h" PlayListSlider::PlayListSlider(QWidget *parent) : QWidget(parent) { m_skin = Skin::instance(); m_moving = false; m_pressed = false; m_min = 0; m_max = 0; m_value = 0; pos = 0; connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); } PlayListSlider::~PlayListSlider() {} void PlayListSlider::paintEvent(QPaintEvent *) { int sy = (height()-58)/29; int p=int(ceil(double(m_value-m_min)*(height()-18)/(m_max-m_min))); QPainter paint(this); paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_RFILL)); paint.drawPixmap(0,29,m_skin->getPlPart(Skin::PL_RFILL)); for (int i = 0; igetPlPart(Skin::PL_RFILL)); } if (m_pressed) paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_P)); else paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_N)); m_pos = p; } void PlayListSlider::mousePressEvent(QMouseEvent *e) { m_moving = true; m_pressed = true; press_pos = e->y(); if (m_posy() && e->y()ratio()) { press_pos = e->y()-m_pos; } else { m_value = convert(qMax(qMin(height()-18*m_skin->ratio(),e->y()-9*m_skin->ratio()),0)); press_pos = 9*m_skin->ratio(); if (m_value!=m_old) { emit sliderMoved(m_value); m_old = m_value; //qDebug ("%d",m_value); } } update(); } void PlayListSlider::mouseReleaseEvent(QMouseEvent*) { m_moving = false; m_pressed = false; update(); } void PlayListSlider::mouseMoveEvent(QMouseEvent* e) { if (m_moving) { int po = e->y(); po = po - press_pos; if (0<=po && po<=height()-18*m_skin->ratio()) { m_value = convert(po); update(); if (m_value!=m_old) { m_old = m_value; emit sliderMoved(m_value); } } } } void PlayListSlider::setPos(int p, int max) { m_max = max; m_value = p; if(m_moving) return; update(); } void PlayListSlider::updateSkin() { update(); setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); } int PlayListSlider::convert(int p) { return int(floor(double(m_max-m_min)*(p)/(height()-18*m_skin->ratio())+m_min)); } qmmp-0.7.4/src/plugins/Ui/skinned/playlistcontrol.h0000664000175000017500000000377012256224735021126 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _PALYLISTCONTROL_H #define _PALYLISTCONTROL_H #include "pixmapwidget.h" class QMouseEvent; class PaintEvent; class Skin; /** @author Vladimir Kuznetsov */ class PlaylistControl : public PixmapWidget { Q_OBJECT public: PlaylistControl(QWidget* parent = 0); signals: void previousClicked(); void nextClicked(); void pauseClicked(); void playClicked(); void stopClicked(); void ejectClicked(); private slots: void updateSkin(); private: void mouseReleaseEvent(QMouseEvent*); int m_ratio; Skin* m_skin; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/popupsettings.h0000664000175000017500000000370712256224735020610 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_popupsettings.h" class Action; /** @author Ilya Kotov */ class PopupSettings : public QDialog { Q_OBJECT public: PopupSettings(QWidget *parent = 0); ~PopupSettings(); public slots: virtual void accept(); private slots: void insertExpression(QAction *); void on_resetButton_clicked(); private: void createMenu(); Ui::PopupSettings ui; QMap m_buttons; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/titlebarcontrol.cpp0000664000175000017500000000524712256224735021427 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "skin.h" #include "titlebarcontrol.h" TitleBarControl::TitleBarControl(QWidget *parent) : QWidget(parent) { //setAutoFillBackground(true); m_ratio = Skin::instance()->ratio(); resize(m_ratio*57, m_ratio*10); connect(Skin::instance(), SIGNAL(skinChanged()),SLOT(updateSkin())); } TitleBarControl::~TitleBarControl() { } void TitleBarControl::mousePressEvent (QMouseEvent *) {} void TitleBarControl::mouseReleaseEvent (QMouseEvent * event) { QPoint pt = event->pos(); if(QRect(0,0,m_ratio*8,m_ratio*10).contains(pt)) emit previousClicked(); else if(QRect(m_ratio*8,0,m_ratio*11,m_ratio*10).contains(pt)) emit playClicked(); else if(QRect(m_ratio*19,0,m_ratio*10,m_ratio*10).contains(pt)) emit pauseClicked(); else if(QRect(m_ratio*29,0,m_ratio*8,m_ratio*10).contains(pt)) emit stopClicked(); else if(QRect(m_ratio*37,0,m_ratio*10,m_ratio*10).contains(pt)) emit nextClicked(); else if(QRect(m_ratio*47,0,m_ratio*10,m_ratio*10).contains(pt)) emit ejectClicked(); } void TitleBarControl::mouseMoveEvent(QMouseEvent*) {} void TitleBarControl::updateSkin() { m_ratio = Skin::instance()->ratio(); resize(m_ratio*57, m_ratio*10); } qmmp-0.7.4/src/plugins/Ui/skinned/mainvisual.cpp0000664000175000017500000004422112256224735020363 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include "skin.h" #include "fft.h" #include "inlines.h" #include "mainvisual.h" #define VISUAL_NODE_SIZE 512 //samples #define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) MainVisual *MainVisual::m_instance = 0; MainVisual *MainVisual::instance() { if (!m_instance) qFatal ("MainVisual: this object is not created!"); return m_instance; } MainVisual::MainVisual (QWidget *parent) : Visual (parent), m_vis (0) { m_skin = Skin::instance(); m_ratio = m_skin->ratio(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(readSettings())); m_timer = new QTimer (this); connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); m_buffer = new short[VISUAL_BUFFER_SIZE]; m_buffer_at = 0; m_instance = this; m_update = false; createMenu(); readSettings(); } MainVisual::~MainVisual() { writeSettings(); if (m_vis) { delete m_vis; m_vis = 0; } delete [] m_buffer; m_instance = 0; } void MainVisual::setVisual (VisualBase *newvis) { m_timer->stop(); if (m_vis) delete m_vis; m_vis = newvis; if (m_vis) m_timer->start(); else { m_pixmap.fill (Qt::transparent); update(); } } void MainVisual::clear() { m_buffer_at = 0; if (m_vis) m_vis->clear(); m_pixmap = m_bg; update(); } void MainVisual::add (unsigned char *data, qint64 size, int chan) { if (!m_timer->isActive () || !m_vis) return; if(VISUAL_BUFFER_SIZE == m_buffer_at) { m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_buffer, m_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); return; } int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); if (chan >= 2) { mono16_from_multichannel(m_buffer + m_buffer_at, (short *) data, frames, chan); } else { memcpy(m_buffer + m_buffer_at, (short *) data, frames << 1); } m_buffer_at += frames; } void MainVisual::timeout() { mutex()->lock (); if(m_buffer_at < VISUAL_NODE_SIZE) { mutex()->unlock (); return; } if (m_vis) { m_vis->process (m_buffer); m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_buffer, m_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); m_pixmap = m_bg; QPainter p(&m_pixmap); m_vis->draw (&p); } mutex()->unlock (); update(); } void MainVisual::paintEvent (QPaintEvent *) { QPainter painter (this); painter.drawPixmap (0,0, m_pixmap); } void MainVisual::hideEvent (QHideEvent *) { m_timer->stop(); } void MainVisual::showEvent (QShowEvent *) { if (m_vis) m_timer->start(); } void MainVisual::mousePressEvent (QMouseEvent *e) { if (e->button() == Qt::RightButton) m_menu->exec(e->globalPos()); else { m_pixmap = m_bg; if (!m_vis) setVisual(new mainvisual::Analyzer); else if (m_vis->name() == "Analyzer") setVisual(new mainvisual::Scope); else if (m_vis->name() == "Scope") setVisual(0); QString str = m_vis ? m_vis->name() : "Off"; foreach(QAction *act, m_visModeGroup->actions ()) { if (str == act->data().toString()) { act->setChecked(true); break; } } writeSettings(); } } void MainVisual::drawBackGround() { m_bg = QPixmap (76 * m_ratio, 16 * m_ratio); if (m_transparentAction->isChecked()) { m_bg.fill (Qt::transparent); return; } QPainter painter(&m_bg); for (int x = 0; x < 76 * m_ratio; x += 2) { painter.setPen(m_skin->getVisColor(0)); painter.drawLine(x + 1, 0, x + 1, 16 *m_ratio); for (int y = 0; y < 16 *m_ratio; y += 2) { painter.setPen(m_skin->getVisColor(0)); painter.drawPoint(x,y); painter.setPen(m_skin->getVisColor(1)); painter.drawPoint(x,y + 1); } } } void MainVisual::writeSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); QAction *act = m_peaksFalloffGroup->checkedAction (); settings.setValue("vis_peaks_falloff", act ? act->data().toDouble() : 0.2); act = m_analyzerFalloffGroup->checkedAction (); settings.setValue("vis_analyzer_falloff", act ? act->data().toDouble() : 2.2); settings.setValue("vis_show_peaks", m_peaksAction->isChecked()); act = m_analyzerModeGroup->checkedAction(); settings.setValue("vis_analyzer_mode", act ? act->data().toInt() : 0); act = m_analyzerTypeGroup->checkedAction(); settings.setValue("vis_analyzer_type", act ? act->data().toInt() : 1); settings.setValue("vis_transparent_bg", m_transparentAction->isChecked()); act = m_visModeGroup->checkedAction (); settings.setValue("vis_type", act ? act->data().toString() : "Off"); act = m_fpsGroup->checkedAction(); settings.setValue("vis_rate", act ? act->data().toInt() : 25); } void MainVisual::createMenu() { m_menu = new QMenu (this); connect(m_menu, SIGNAL(triggered (QAction *)),SLOT(writeSettings())); connect(m_menu, SIGNAL(triggered (QAction *)),SLOT(readSettings())); QMenu *visMode = m_menu->addMenu(tr("Visualization Mode")); m_visModeGroup = new QActionGroup(this); m_visModeGroup->setExclusive(true); m_visModeGroup->addAction(tr("Analyzer"))->setData("Analyzer"); m_visModeGroup->addAction(tr("Scope"))->setData("Scope"); m_visModeGroup->addAction(tr("Off"))->setData("Off"); foreach(QAction *act, m_visModeGroup->actions ()) { act->setCheckable(true); visMode->addAction(act); } QMenu *analyzerMode = m_menu->addMenu(tr("Analyzer Mode")); m_analyzerModeGroup = new QActionGroup(this); m_analyzerTypeGroup = new QActionGroup(this); m_analyzerModeGroup->addAction(tr("Normal"))->setData(0); m_analyzerModeGroup->addAction(tr("Fire"))->setData(1); m_analyzerModeGroup->addAction(tr("Vertical Lines"))->setData(2); m_analyzerTypeGroup->addAction(tr("Lines"))->setData(0); m_analyzerTypeGroup->addAction(tr("Bars"))->setData(1); foreach(QAction *act, m_analyzerModeGroup->actions ()) { act->setCheckable(true); analyzerMode->addAction(act); } analyzerMode->addSeparator (); foreach(QAction *act, m_analyzerTypeGroup->actions ()) { act->setCheckable(true); analyzerMode->addAction(act); } analyzerMode->addSeparator (); m_peaksAction = analyzerMode->addAction(tr("Peaks")); m_peaksAction->setCheckable(true); QMenu *refreshRate = m_menu->addMenu(tr("Refresh Rate")); m_fpsGroup = new QActionGroup(this); m_fpsGroup->setExclusive(true); m_fpsGroup->addAction(tr("50 fps"))->setData(50); m_fpsGroup->addAction(tr("25 fps"))->setData(25); m_fpsGroup->addAction(tr("10 fps"))->setData(10); m_fpsGroup->addAction(tr("5 fps"))->setData(5); foreach(QAction *act, m_fpsGroup->actions ()) { act->setCheckable(true); refreshRate->addAction(act); } QMenu *analyzerFalloff = m_menu->addMenu(tr("Analyzer Falloff")); m_analyzerFalloffGroup = new QActionGroup(this); m_analyzerFalloffGroup->setExclusive(true); m_analyzerFalloffGroup->addAction(tr("Slowest"))->setData(1.2); m_analyzerFalloffGroup->addAction(tr("Slow"))->setData(1.8); m_analyzerFalloffGroup->addAction(tr("Medium"))->setData(2.2); m_analyzerFalloffGroup->addAction(tr("Fast"))->setData(2.4); m_analyzerFalloffGroup->addAction(tr("Fastest"))->setData(2.8); foreach(QAction *act, m_analyzerFalloffGroup->actions ()) { act->setCheckable(true); analyzerFalloff->addAction(act); } QMenu *peaksFalloff = m_menu->addMenu(tr("Peaks Falloff")); m_peaksFalloffGroup = new QActionGroup(this); m_peaksFalloffGroup->setExclusive(true); m_peaksFalloffGroup->addAction(tr("Slowest"))->setData(0.05); m_peaksFalloffGroup->addAction(tr("Slow"))->setData(0.1); m_peaksFalloffGroup->addAction(tr("Medium"))->setData(0.2); m_peaksFalloffGroup->addAction(tr("Fast"))->setData(0.4); m_peaksFalloffGroup->addAction(tr("Fastest"))->setData(0.8); foreach(QAction *act, m_peaksFalloffGroup->actions ()) { act->setCheckable(true); peaksFalloff->addAction(act); } QMenu *background = m_menu->addMenu(tr("Background")); m_transparentAction = background->addAction(tr("Transparent")); m_transparentAction->setCheckable(true); update(); } void MainVisual::readSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); QString vis_name = settings.value("vis_type","Analyzer").toString(); if(!m_update) { m_update = true; foreach(QAction *act, m_visModeGroup->actions ()) { if (vis_name == act->data().toString()) act->setChecked(true); } m_peaksAction->setChecked(settings.value("vis_show_peaks", true).toBool()); int fps = settings.value("vis_rate", 25).toInt(); foreach(QAction *act, m_fpsGroup->actions ()) { if (fps == act->data().toInt()) act->setChecked(true); } int mode = settings.value("vis_analyzer_mode", 0).toInt(); foreach(QAction *act, m_analyzerModeGroup->actions ()) { if (mode == act->data().toInt()) act->setChecked(true); } int type = settings.value("vis_analyzer_type", 1).toInt(); foreach(QAction *act, m_analyzerTypeGroup->actions ()) { if (type == act->data().toInt()) act->setChecked(true); } double speed = settings.value("vis_peaks_falloff", 0.2).toDouble(); foreach(QAction *act, m_peaksFalloffGroup->actions ()) { if (speed == act->data().toDouble()) act->setChecked(true); } speed = settings.value("vis_analyzer_falloff", 2.2).toDouble(); foreach(QAction *act, m_analyzerFalloffGroup->actions ()) { if (speed == act->data().toDouble()) act->setChecked(true); } m_transparentAction->setChecked(settings.value("vis_transparent_bg", false).toBool()); //update settings from previous version if(!m_analyzerFalloffGroup->checkedAction() || !m_peaksFalloffGroup->checkedAction()) { m_analyzerFalloffGroup->actions()[2]->setChecked(true); m_peaksFalloffGroup->actions()[2]->setChecked(true); writeSettings(); } } m_ratio = m_skin->ratio(); drawBackGround(); m_pixmap = m_bg; QAction *act = m_fpsGroup->checkedAction (); m_timer->setInterval (act ? 1000 / act->data().toInt() : 25); if (vis_name == "Analyzer") setVisual(new mainvisual::Analyzer); else if (vis_name == "Scope") setVisual(new mainvisual::Scope); else setVisual(0); resize(76 * m_ratio, 16 * m_ratio); update(); } using namespace mainvisual; Analyzer::Analyzer() { clear(); m_skin = Skin::instance(); m_size = QSize(76*m_skin->ratio(), 16*m_skin->ratio()); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); m_peaks_falloff = settings.value("vis_peaks_falloff", 0.2).toDouble(); m_analyzer_falloff = settings.value("vis_analyzer_falloff", 2.2).toDouble(); m_show_peaks = settings.value("vis_show_peaks", true).toBool(); m_lines = settings.value("vis_analyzer_type", 1).toInt() == 0; m_mode = settings.value("vis_analyzer_mode", 0).toInt(); } Analyzer::~Analyzer() {} void Analyzer::clear() { for (int i = 0; i< 75; ++i) { m_intern_vis_data[i] = 0; m_peaks[i] = 0; } } bool Analyzer::process (short *l) { static fft_state *state = 0; if (!state) state = fft_init(); short dest[256]; static const int xscale_long[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 61, 66, 71, 76, 81, 87, 93, 100, 107, 114, 122, 131, 140, 150, 161, 172, 184, 255 }; static const int xscale_short[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 20, 27, 36, 47, 62, 82, 107, 141, 184, 255 }; calc_freq (dest, l); const double y_scale = 3.60673760222; /* 20.0 / log(256) */ int max = m_lines ? 75 : 19, y, j; for (int i = 0; i < max; i++) { if (m_lines) for (j = xscale_long[i], y = 0; j < xscale_long[i + 1]; j++) { if (dest[j] > y) y = dest[j]; } else for (j = xscale_short[i], y = 0; j < xscale_short[i + 1]; j++) { if (dest[j] > y) y = dest[j]; } y >>= 7; int magnitude = 0; if (y != 0) { magnitude = int(log (y) * y_scale); if (magnitude > 15) magnitude = 15; if (magnitude < 0) magnitude = 0; } m_intern_vis_data[i] -= m_analyzer_falloff; m_intern_vis_data[i] = magnitude > m_intern_vis_data[i] ? magnitude : m_intern_vis_data[i]; if (m_show_peaks) { m_peaks[i] -= m_peaks_falloff; m_peaks[i] = magnitude > m_peaks[i] ? magnitude : m_peaks[i]; } } return true; } void Analyzer::draw (QPainter *p) { int r = m_skin->ratio(); if (m_lines) for (int j = 0; j < 75; ++j) { for (int i = 0; i <= m_intern_vis_data[j]; ++i) { if (m_mode == 0) p->setPen (m_skin->getVisColor (18-i)); else if (m_mode == 1) p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); else p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); p->drawPoint (j*r, m_size.height() - r*i); if(r == 2) p->drawPoint (j*r+1, m_size.height() - r*i); } p->setPen (m_skin->getVisColor (23)); if (m_show_peaks) { p->drawPoint (j*r, m_size.height() - r*m_peaks[j]); if(r == 2) p->drawPoint (j*r+1, m_size.height() - r*m_peaks[j]); } } else for (int j = 0; j < 19; ++j) { for (int i = 0; i <= m_intern_vis_data[j]; ++i) { if (m_mode == 0) p->setPen (m_skin->getVisColor (18-i)); else if (m_mode == 1) p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); else p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); p->drawLine (j*4*r,m_size.height()-r*i, (j*4+2)*r,m_size.height()-r*i); if(r == 2) p->drawLine (j*4*r, m_size.height()-r*i +1, (j*4+2)*r,m_size.height()-r*i+1); } p->setPen (m_skin->getVisColor (23)); if (m_show_peaks) { p->drawLine (j*4*r,m_size.height()-r*m_peaks[j], (j*4+2)*r,m_size.height()-r*m_peaks[j]); if(r == 2) p->drawLine (j*4*r,m_size.height()-r*m_peaks[j]+1, (j*4+2)*r,m_size.height()-r*m_peaks[j]+1); } } } Scope::Scope() { clear(); m_skin = Skin::instance(); m_ratio = m_skin->ratio(); } void Scope::clear() { for (int i = 0; i< 76; ++i) m_intern_vis_data[i] = 5; } Scope::~Scope() {} bool Scope::process(short *l) { int step = (VISUAL_NODE_SIZE << 8)/76; int pos = 0; for (int i = 0; i < 76; ++i) { pos += step; m_intern_vis_data[i] = (l[pos >> 8] >> 12); if (m_intern_vis_data[i] > 4) m_intern_vis_data[i] = 4; else if (m_intern_vis_data[i] < -4) m_intern_vis_data[i] = -4; } return true; } void Scope::draw(QPainter *p) { for (int i = 0; i<75; ++i) { int h1 = 8 - m_intern_vis_data[i]; int h2 = 8 - m_intern_vis_data[i+1]; if (h1 > h2) qSwap(h1, h2); p->setPen (m_skin->getVisColor(18 + qAbs(8 - h2))); p->drawLine(i*m_ratio, h1*m_ratio, (i+1)*m_ratio, h2*m_ratio); } for (int i = 0; i< 76; ++i) m_intern_vis_data[i] = 0; } qmmp-0.7.4/src/plugins/Ui/skinned/cursorimage.cpp0000664000175000017500000001071212256224735020531 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Erik Ölsar * * erlk.ozlr@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "cursorimage.h" QCursor createCursor(QString path) { if (path.isEmpty()) return QCursor(); // read file headers QFile curFile(path); curFile.open(QIODevice::ReadOnly); QDataStream curStream(&curFile); curStream.setByteOrder(QDataStream::LittleEndian); struct { quint16 zero; quint16 type; quint16 icons; } header2; curStream >> header2.zero >> header2.type >> header2.icons; struct { quint8 width; quint8 height; quint8 ncolours; quint8 zero; quint16 xhot; quint16 yhot; quint32 bytes; quint32 dibOffset; } directory2; curStream >> directory2.width >> directory2.height >> directory2.ncolours >> directory2.zero >> directory2.xhot >> directory2.yhot >> directory2.bytes >> directory2.dibOffset; curFile.seek(directory2.dibOffset); // prepare a .bmp for delegating decoding to qt struct { unsigned char magic[2]; quint32 size; quint32 zero; quint32 rdataOffset; } bmpHeader; int bmpHeaderSize = (2+4+4+4); struct { quint32 hdrSize; quint32 width; quint32 height; quint16 planes; quint16 bpp; quint32 compression; quint32 dataSize; quint32 unused1; quint32 unused2; quint32 unused3; quint32 unused4; } dibHeader; int dibHeaderSize = (4+4+4+2+2+4+4+4+4+4+4); bmpHeader.magic[0] = 'B'; bmpHeader.magic[1] = 'M'; bmpHeader.zero = 0; bmpHeader.size = bmpHeaderSize + directory2.bytes; bmpHeader.rdataOffset = bmpHeaderSize + dibHeaderSize + directory2.ncolours * 4; curStream >> dibHeader.hdrSize >> dibHeader.width >> dibHeader.height >> dibHeader.planes >> dibHeader.bpp >> dibHeader.compression >> dibHeader.dataSize >> dibHeader.unused1 >> dibHeader.unused2 >> dibHeader.unused3 >> dibHeader.unused4; dibHeader.height >>= 1; // the bmp bytes are in 'bmpData' QByteArray bmpData; QDataStream bmpStream(&bmpData, QIODevice::WriteOnly); bmpStream.setByteOrder(QDataStream::LittleEndian); bmpStream.writeRawData((char*) bmpHeader.magic, 2); bmpStream << bmpHeader.size << bmpHeader.zero << bmpHeader.rdataOffset; bmpStream << dibHeader.hdrSize << dibHeader.width << dibHeader.height << dibHeader.planes << dibHeader.bpp << dibHeader.compression << dibHeader.dataSize << dibHeader.unused1 << dibHeader.unused2 << dibHeader.unused3 << dibHeader.unused4; bmpData.append(curFile.read(directory2.bytes - dibHeaderSize)); // decode the image into 'pix' int width = directory2.width; int height = directory2.height; QImage image; image.loadFromData(bmpData); //qDebug() << image.rect() << path; QPixmap pix = QPixmap::fromImage(image); // now we need the mask (transparency) QByteArray maskData = bmpData.right((width * height) / 8); QImage maskImage = QBitmap::fromData(QSize(width, height), (const uchar*) maskData.constData(), QImage::Format_Mono).toImage().mirrored(false, true); maskImage.invertPixels(); pix.setMask(QBitmap::fromImage(maskImage)); return QCursor(pix, directory2.xhot, directory2.yhot); } qmmp-0.7.4/src/plugins/Ui/skinned/default/0000775000175000017500000000000012256224735017130 5ustar useruserqmmp-0.7.4/src/plugins/Ui/skinned/default/playpaus.png0000664000175000017500000000102612256224735021473 0ustar useruserPNG  IHDR* DsBIT|d pHYs ׆tEXtSoftwarewww.inkscape.org<IDAT8R1Eo. @`xwRZ*HBv[jL8o,*t -Kc۫o \񿥵u( "kmHۗm?5jfx`Ǐ#NS%DU#(3 `A1sXkab(u]X-"H?SPymt 煛aPӃ:8DAe} '$kVYS8WH, *"T*"9GPcf.9Za+ރbnšwhhji%zGG XCN$ A9G}CWQT @q"Ϩ_G\@RNa balance.png eqmain.png numbers.png pledit.txt text.png volume.png cbuttons.png main.png playpaus.png posbar.png titlebar.png eq_ex.png monoster.png pledit.png shufrep.png viscolor.txt qmmp-0.7.4/src/plugins/Ui/skinned/default/volume.png0000664000175000017500000000624512256224735021154 0ustar useruserPNG  IHDRC]"hsBITO pHYs B(xtEXtSoftwarewww.inkscape.org<XPLTEڹ}}}uuu]]]VVVWWWJJJKKKOOOAAABBBCCCDDDEEEGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~:&tRNSEaŠ IDATx_{j%E "$h#h`5b5\`PkHkEmH41/!B`wgga."ݙ9g~/|/fsyΜ}H?mذ>&q3B11(Rc[u|&e 98Ik)"%紹1/_*9 s(Q[L1RkPcNJTr))4Uz\ dԐqi0h1΢9F+1z*T eXD{[[ _fTk%Ҵ?Ӷ2 3{MQݗ6d8[IXLpj!}ڿclFk-6u?wڿ*/*4$j_u߶zd!dpa~? QCCV9߫3)F ~߬3O^ӵXݗ1.oaǸwp/3bXsoA/R9EODÕۦwݷ͂N7"b)w_H21.(@7NS?F?4W˯iH a>M*/kq0UMC0Ok*:vK, c#|< 9xc Oq#he1]wP?͈c!:%o'u?y4~U[c^3ik 2vsǟ1[{>9>?1'~-Gv;E*;߃]4fNf''vd553 \_ aag-B ӮL/WfәOs]]?o's]6-s߲d׏q߼W6ck@? 1sshcc+_m?:\_ůDzsy\Z[EJLz}/*2ʹrs+;?h#7q[H˼z}7_}3F/!ckہ0&1G95?+c܏FEǮ_:oۂq?^pe2:8F?[q?1h[YsZTgRstH ;9Tt:9-[ݷm9b}y8y[91c/K sK]Sy:X{> ! Mˆ 8c ؄ڤח:8ߩx}.>]Sh 8_q+b,ImIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/monoster.png0000664000175000017500000000241312256224735021504 0ustar useruserPNG  IHDR:W]͂sBITO pHYs ׆tEXtSoftwarewww.inkscape.org<PLTE{{{}}}onoqqq퐐ssspop|{|yyy]]]^]^^^^_^____\[\]\]fefYYYZYZ[Z[WVWXWXYXYlknwvz!!!&&&(((+++---111666777888999:::;;;<<<===???@@@BBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPRRRSSSTTTUUUVUVVVVWVWXXXZZZ[[[\\\]\]^^^___bbbcccdddeeegfgggghghhhhihiiiijijjjjkjklkllllmlmmlommmnmnnnnonoooopopqqqrrrsrsssststtttutuuuuvvvwvwwwwxwxxxxyxyyyyzzz{{{|{||||}}}~}~~~~XK+tRNSMHQIDAT8˥[Pq7KnP B(CĈdr!c9lo76|cpgmp 6͖r;J+ڕIetJ' j3F8AСYg;]=fzE:VN *_MPq$rCus8oNW*5==Qߢ^PPʹ}00EQz ?5Ĝ搜*Is$Jl$kMHCz(:*%fz y<<ou}^?u>eesr 33?yPZ{VT񊊊%%o߼YWQ^8楤~]AFF~vvWBBnKM-+,:ZE☠6,7S;;g_TC޿9${s昙Μt>0jIwpL3Y+,usKa*۷irI>c{+]7^5VtVGG˩SdԨ ~R~:NqnnSMM 2d#&nqtIHB&ȱ)/-Ms\k.#G]bźu|#"UzNRK u6l,X|r)ΩDgGM8jNNNK,>{7IwBB&ױcGccc [w'b~jjo=zٳ-ZOΝ;jԨUiCdǯ700ON:o޼K:;;{zz07:r=kaa ?` 5ԃs{d ɎOʕ+Gx{{o߾(ۻT|\Aa̙x B]+-lTKep{m>$%)B>|8w.l xzbW I&͚5kΝϟ?C1Bc/]cCٶEXg؄UC 0^zk"Yծ]~g]FP*nݺ.VQ&+>ި_ݻ4$υ [ f!m\QbCյuP^T=UfllloРo"LO(`x>==9oaK %:(WK儠a|k&RøٸӡmVlO򟰼/\Ti;6m›BDYY&0XA $4iٳv]ƧB/ĕ+W4)kvh%<{!c###aE!}۶UzݡC Va Z߅ hG\­%Fz"-f,HK.69~F*=~)))F^֩ ^c i{ +;vLHyf˖-~}dDE)4nڴiS 0S2BpugСU9Ŏ:uB\}}\Ml0ei`ka ۷o`` v4(49d26nܘ @WF")!h$ c?!kҢEc x4a3fĈ̸8k,Ҁ>3w^Dh:j4c\yRv(iBR[ۼ׫`Cd:z4U@R a ?y&'sM&^ ,}c%D+­nnn|_`%Jzyfe${MoܸA_.IKNV.\k}4\K dQ\7i:w(F6*<䥐p][6Km*iH<ӰaC(RUA J`)XG}LBKtz5B@MNF| 79,L93⹬^M?3ЪܥcǤW9TЗdZ5^å:U Ugb2{bا<)3tQA^J TC8L4ʛG|}%8X2,4+%LZuHfl þmoݪ^DFbm%*0]ch+-~z<&8Q^H暙ff*uǏ뺔;8oެ9s/.=vVZ%K2cbjtY\|ĉ cVO+$_3l[qFZL11.yI9ݲ=ܴIOgg^HIH@i:uR##iT$ObH2LF;z[zCcb/[P:tN_ uqu)Sju]8¢o * L#2F'6MpZTI_߭WYZX_DF*p]Q}}ݜXY}͞=7²jD) ;>>) >$nŠjn54t潮+W.Çq=WOܵqPFQ}?͐S-I7ij l^Q휸&<_oRµkhb222jߧvG/gϞtSNي.f:773g䳉ɤIk@IIի(8Hj --mرcƌXYY=:Aӊ СC*Fdd$0' M0Ӊ N2e؛S3#a7{bqF۷t䢺#GtTLMMg͚K񂫫;,yLLL޽#6Pʕ+7o9Æ {<̰}UnrJ=ΐ(Ɯϟ'''Y){Ř̐Jkb|r5[l$nВp{gժU]tILLxTTbmѢEi&'psCpXϞ=AH T%5k H!CMؑm7|CڵkQk*|gnCڵc-ڵ hb{^C@`ĝ.ZuQl !"w7'&:V... #IIT.IA02l(]Jb_@:+J. S DpݚhE4W{wyҍP*IPmpp ʬҒP,:>} )?{OE!@]@ JxL!$J ~L RZNT(OYfB$IΩi a>S3g9-++ v|4?G7I^/6$#-4RAҴRZV x jIAcio?RZ2JD;5lQt+* 2M1< c֭+l*V:c  IZWROQO?VZ!f֭[ +(5n(1^GZ^CqF(&ǿE4Wc{b*-4ݶvlxS&=c–GAG:@r£9Guo+H]K&I#=HQz$Uq(Q82[khT,Do9`*t-e/ motF*"Uvzb4j(Έ]e5PV `FݫI(ZO{- W) %44IJȧP.Fm4s4OـT.J 6;}Zš /AP;}_!@go~Gۿ>xpzoRn7EIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/viscolor.txt0000664000175000017500000000114012256224735021525 0ustar useruser152,152,152, // Bg 152,152,152, // Dots 255,128,0, // Analyzer 240,128,16, // Analyzer 225,128,32, // Analyzer 210,128,48, // Analyzer 195,128,64, // Analyzer 180,128,80, // Analyzer 165,128,96, // Analyzer 150,128,112, // Analyzer 128,128,128, // Analyzer 110,110,110, // Analyzer 92,92,92, // Analyzer 74,74,74, // Analyzer 56,56,56, // Analyzer 38,38,38, // Analyzer 20,20,20, // Analyzer 2,2,2, // Analyzer 2,2,2, // Osc 20,20,20, // Osc 20,20,20, // Osc 38,38,38, // Osc 38,38,38, // Osc 255,255,255, // Peakqmmp-0.7.4/src/plugins/Ui/skinned/default/main.png0000664000175000017500000002364012256224735020567 0ustar useruserPNG  IHDRw @sRGB pHYs B(xtIME -VۃbKGD' IDATxwxU]W]uWUAEE\ XC$SHBB қޤ`@ tu_ߖw>dLf&亾Ly9Oa͚52yd0ӻwN7{2$gL0A-Z${'NXYY!;vLfϚ-cnjAI)dgH>}e2eY`ܐ~'\;H6m  Ǐ%Kȑ#GsХK/Ǐ[YEN:1[͝'cF~IZjk-14wL:U/ZlabtYptMڴi#͛7ZkNz%,h&otzCrrrdڴi|r9xصkJFdܹ2x`{t&N!U^=ҥ={VJLL6C߿[N222'M_5jNΟ?_-l"qqqҸqcyw SNҢE 8p̙3G֮]kemnΚ5Kz-OPvFcۻwom}vxaB_~2i$ywŻ~{&gΜKpkrwd\rұcGY`T\Yԩ#u֕KӦMs^*UG!Ch~ҤIIKKyx@ng}Vf̘!]vnM6m5)))$|IYmܸQ{x /^ nݵb _W3!{n-\;, &uww7Ƀ>z' 0La>_~}VCj  eoР{/dV%QPnwG,a'DeΝ$Z Lz衻*VX&ZrV|馛.N:w$ѣG f͚^KW.++VJ+֭[Hߥ%.uwt]r} &/pP< 'LNU?Ndff+?~rrN"϶RZdaC&4_nܿYtixanfW a x@F5#F1[!JSlRHk~V60a4{kӺ9M &6l)LL RV-ZjDaB{[nE5k}G\~V%Rtoθb!xb 0DdH0uܸq\0پm{a2y\0 L_M %}WZbvoЙ.<`90.f.8U0 |>С7vXM^+h>}QJ7x ᚸr,il۶-09y~ǎzH 9 GZYEN#޿LLJM[ ִab0վeb|zz23C. s<0ˀJL4Ͽ0b+"V ͛7,;W, D۷geHs(He̅5x ,1iG `(XK'X  Vge= 7~0W'* Bp)e,B'#ą"Dtu" }@Bp* a=)غ/D"F4&f()om) JU@ViC UBUWM71#Te&Xf.Bn`)E;[TΑ[6fHTifR BTq JZVU"QtFt(H)XxBU` .J]Vw " 62e݊@"HϪd*u HGgJL[\Enz[9k ^nNXBf482 " b޽{]eu^EYy+q=}"!&IRQ (ˢ#A Ĭ*)*Ğ͓(LOr8 XjdB!ҟ&UU([\`d*YR0aOe˖y,duM/6F8 ~VVȽue ; wIzkbY7K2 eKkQ062DK {R|'%x] >S/0*h,A#aM^񚜯 = j+D%S޳٬C#aBFa)MDϡǞ6fa6O@ TL/Ud@av3Y``p# 8 d?͝Y isN4䥬6-,J9LŽ?ii'P &T6.+ t"oA;7yp0)LM_|k}{?,L&VE5j+ {#". ezMgfdW(+]gabeU5qUb,33ʔuP:]q8y4}9eѤ)s9x/%%%ỹ9ŞD=mg^cL 9I䐡CAoYcǎҸYCiؤtLdiֲ4mT 4?mVSk5r|?.xjJZl) 6d7nZɑ|ּߠA"P8ѣV֞/Lj9|!{„ro xQR4| Ps^¤ kT :Pu=.jJyW~Ɏp`No_Bg;ϧԩAҾ}NëQz\a- j#Fl<H1aٝ|0v`k46@\Ձ0-0g3tzZQ#f͚WBޒ/,T+4u*_]@U+w<ƍKJ\05ur^(#<I4ݼ&& =TKDC+^Ն\Oy.%2jZCCŪ^n^D(L}2uԫWO-Е\:qo03}?P 0!o;p/o7}\IXxDM7w*z-!`G O1sh*8aY2t$v#+10|W^~ܤmžQl0qu-73)'q8ႄZYlż&U{.%%&ؤhAҳGψ(3#Su(KkoL^FF6ҹXjJ+))$ ڦW`aRaBE0emena#~ְIxxo+UE=cdxXB6+i&پ}Oq?ڶm[GwGZQ8q:Xb,_Ͷ ,LJ`y˖-r{˗R&&Q#&gr+mܹszQ xbT|={6 aXɑ#Gdڵ2y$xҘѣy@;wK.yM<ا:/&e32GL`-qh :м3 =T0͓K-se:TVRoZ7l(=uC] 4*MJj+%EzTni0)%lM9>u:`º"oGLhYq*L8QZ4k& y Z>rE89嗮4٣Kb;;W/ ysF&DM%g50Ky3UΔyy =4RŌA\<^zj-͕ bԫ^]ӯϿئO'My!x/N@~9_UKB[P&p8]ٔ~x&Mӷ8P1+(c70bHS`()??_*xǮy&Ѥ_=`cd% LBhv`-;_?d%XZn@1WvꎠlUR0ڽ{,Q]j{#:f90&S5FB2hPFcѮ$'w 11r&\uu(f՘1 ݥKDnhJ͖-O?4*`ڴi] &x%XoB\dwT2b *͚4t t'4۶69+-ZlgFt]Xt9io"fΔ7\{[nq6.l4V p&VVV%kUt„E<@pc ٛleU aAM,M*0a:FR,貲 ^nRQj`#)= ^,&Q@kODaILK.*t:}tل|`eeUD1m4Y$ GF&nleeUPV5L `[YIkVVV&&VV&&VVV&VVV&VVV&&VVV&VVV&/\Ӈ˱O?SW!L;&\lP?s۽[~T0J6L,azIb6ҴaCIi^r{3+ؼ|Wa:Тv&yshC T>+>|d%&J זKFvNݰ!(&~ OҴ^=yzu+#z͋i=ˠ,iHZUXQ^%)SVP7٢3֭޽rԩG-I-L[ؿqdu$>z뀄IOOݻKbǎ2@AeW ? 2̞R^Mr:}ge_Y.om+׬ET䩧uJ2vvS, *yFir8{lWUV-{gq巭JՔQqp栽hTᇥ"QeЪs)oyIA%S>J\SgbTi^Jyiy5k֔q岺w6ƣHJVFH|+F^}祇 q@6t#NWbbb\yE@L7Fsl׮"JRp|XyCoyQgz) ŋu¤p娮5}SX AFc|! J PT(?筂c4Uu]RremT^۹sH0t@`nF?@P-kU *HU+j*ݽ?)dÆ Po>XD;=K2O>ӧkW\)kh)xcj mϭJucjt^R]=<OWZl=}*9M)O馛ne^8s&(\P<  ~_zu.׿tϑzP57m0CL(2 +rwτC0H3_ 7ܠ; <+V[q ZxLƒʞի=tD۵SZ0p0Hٳgk8tǫ}AA7#VH]T;pغn4g˂8 {Vp ʈ.7N X^yG\8~GӔtĉ+FÇG&WLFnp7o˕?@7>12յkWouzbr|K@m&x |ޛ}-τפcʸܽb)|i`xi`hw7Yu(SiӴwfҥk<3>W(a\Ǩ0!]> oܲ%p\,ykĜD~/IAGr"9sMq*Q8%/^|9~_04.^v ڜW&aQ]*-%p:*":+Z2aǑ 2T^0@@# ;C#n/P- s/܇B;]"M L(@}~؃35}V+cu+t ^p:PH3UN51F׏w6]- :.{ C_+ϋ)w_NwX21bQÆ^OجiSi~W-]x@c4y;w7?Xgk[..>ɹs'SFK)u KC_TV\„I]u )/{A s)x@-ZDX;bq<̌ mD~{`D}1Gn*{[~r5@v -n!oGʗ ' !:@'e2mR L3] GyYsen Qr̙@ &*PEfӝ3(wǍ{nr^'Iݴ`8u)k\BZNUw(c&@>HMIB㡃=w̄"0!nS&a¨IW^ `h-%K\z6UeR!0“?~62[arighur;MlK.TSl{Hy1nصkvIJc~*ʄ0rwL'f)/d_0Kɜ'ŵ{6MMH3eK)׷US6aBkH8JGQOSnVs<8Mfs0= ʣ8mtlڤG~ӟt _F`TEyE6c9t^t++mR]lzͻ"qӕ1<Α"J ?k<(! Žhڸ6Ϻů"0Lh5 )E>qE"OU\{еE,(<ǰ7[-ҭ;iZ< 1C< ȳ?{tߐ/ʼk0jbD1Iki4D6]+4vI"Xΰ9{Mv,^.<ҥoUBa~=Z"-,;0Лp| &.nr u㫯z;77%7ٯfݱC:m?R~>[ص9%~2n@{\?W]07墟 Ϙ+º 0 O]]GVIX\b7je AK~+@LK[x'Vă]AmV~y^\kܦe eo0!v½ܵNHlUfK6$- )vJcP.>&F1cd2v\=yyzJxNn!6VdeBzR?N{\TµK*]D|`W#KgdHj|Qnl= Uy2MyӇ[7u;#OJ.lȊMʓ=&\5%f GRZab3Nk@_0M#1.h%OF㼟#VVvF+++ +++ +++  +++ +++ +++  ++  +++ ++Bazj ++ 0:uI7={z)m9AQFi`hJ6L.X(ߞ(o }K%KS09s|{xJGJJ'lZYY9Oj^XRPZ1*Uտ(Tڢ@)A;#?5LIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/pledit.png0000664000175000017500000001543612256224735021130 0ustar useruserPNG  IHDRp^osBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<IDATxyPTWǭc&dff,UTvw {܁ * Ȧ˾ ʾ"[\q!nQcx~{3Mt7 ȡ[~nsϽ!w領4ruu%GGGZ|9QRRЕWO?I_uTwp:]6zf]{ *--I)tM(y{y-2eFTUUE/K߹h'!,4d޽JkǗ=kZEkBPbB"mٲ._s%o2kZi_c}']7oR9Wudr=zTohTWWckW`͝;W/JOO_JHH{0;v젵kv,f t7O>VZESLٴi͟?y~fef ӁD׈À1*`BBBh۶mOYZZÇU&..ONFyQIIIgKeffv9~CC)ʕ+~zQ֘1chtAjll^{?>hPĉŠQh޻w֬YC{vgϊ:ˀa0ƍ7As[d W+Ljj*۷?.ӟRmm .~X=vP?~Ù3gxK. =ڄo3}0x]r4JIz%//\M..wԴ#Yn.8G۴tR[W^ ``ITYYͩI)##y~ېǗSٶtb~N;w۷i dn>SjhCW2֮T tߛ8qb'43uT0a-[Lti`YXYYu6 .${{{W\P{Ύ>C~}Ѯ15tH. `RϥT\TL׮^(`"2>}NÀ(P+Vt:x!D礠K%*lLp2D)gA9a%axyyQ@J111l0 LttގwU3 ] c@XBwѢEj>  g0  Àa0`0 ŀa0`X  Àa080, YAA復MO<..ƍȸw۶m.]"]:]^n߾ 'OJE͛e_l޼NVV֭ԴIIIWYٟoοS^^EZZK i|-]ixzxRpp0I.uH}ɭz',f#YJ;t.#Iz k^` pTX0EXπay:z(555X #`!Vرc  k)Fǂo{&MWVVFWA]B0 ~eGTz u˛h#GzS[X*E੓ R^3`0,uӟ3Z e9rrycF!*"`Aڵk?$W_DC :ujPyp:T,J55bT32"À1.`MF?E',JwQ|:/RgT't3|pP.ɧD@ϑClc_beϰ vt62M2C_ɓȶME6"A&Ys3loR5cjOLL,ٲeACH㩡-iR!Q'Ⱦ VAo\깔BC:c]]].TKQ6)" oÒg^3 axwn{<ք5-"ؾ}jn\]vi;v0v4ad21CÆYCz*CƎ,"|, ӏ3g< tJKF !̀a1`0H5 dee0HC|0,L&2330 0@ 8e0 AD Hz c-)H3`X #&:5S0  w\ypʄ/ F `w8>>ڵW~_'$$|m۶Z`ʠ}K߳uo m-ƂDag0=bb(0pt 7Z`1Ml&2pXF"#ןlmh֬b:X?M̃a00nƏX0XZ؊w3`X ~ HpȑxaeUWUUUTm,//(LN?UJJItQBBI: [r5SNEuu5ܸX `4X A3f33&?~29r#Si, CʶWyk0, L`oH>>~alHjnnQyEyɯ̀a1`c`pttի ^ GS0  À82rssc0 50 p À`8ŀa0`X LLbb8gbcc0, F<ŀ1`֭[gTxxxҚ5aFH`ˀa1`zJ:uLdi߭J"ڵbj9t0eڨEk:uJGcDv[(L\:r}z)!!Q<&%.6s ɉ asKۋ|!T^OZ >ҺLCW\Q{Za1LCG3#}D!5`JJJƦW! 9Gz[&ͨήW֞e666LD+up©za3AN} 3gΐh7Ud5 # ^ 9_4=Y}e撕Uk\&P(S݂o'>lF0dccS{jmmyZEEEʅ´iZ&, ZڜҥKiѢEΝ;Ֆb*21MR%A]`K;\`MhJg 5R/Ю=`xf֬Y* |,nݪj=Ois;wn f>R;{&L,F(%%UX3tJMMq}zD^v>OUu&$$S...*E h SL>6 PxM˄d̙= sM˄E2!!*++5/X`!a|shPdUX)Y TY>8ypb U§ɓ'w$s%{FV/5TUUӧV05-wԩj5g1\'탑M˄2=Ҹ)//׸cǎUrr6$Ӿ}}-:E:Kuuݾ~x'MM0p(46rx*0T,y͘1CpfLXH@$n-dU)++·~(%M9?TAhH)U+o?\cbbTA 8s9Oh#}8GW@ `3`4JxxM>[ #htTWp   kQg<133fiOp'`-6mD(Wa,xΜ,/"oo*< !x,' +1tHa @ЀZ]!c8yQ6׾:h#LWyz.AA@ٺHa4V4`рLdd^NZM@Gib˄2Ve|:11bsd6nL;DIIQ= sgd:I2[RܧW'pt>QX)')55~rb {zB. KfSSS={V 577LLӦL)iXa@S#'h]\iiKDaax (B0d,pFFRpȢѣi8۔)Rc]L^c?` 0h*p. 1zq;%`Ska0aVXUݽ)Ad31+^!LS K 03n$~6X8NNRث q;zh:u)Smۊ|d,< 1cN\v̀"wIO3ߥr1l O qٍt;ODB#"/]H+{5 %|z >9m0`XzI>UZZFYTK%B%`UAHx}f޼Rc*{*+凨R2+uEnڴ"p2q̠5jOq>̠޽-"LVeFuqߵ+n*ޗ>Y55˗? N^4ԡk󴶶NQf?Y[ ? #PG[w.  9F`-!*))3)g/F: 2***`F3R˒/2`-6tHR{x)70,B Stbb(""ڠsuɿ0\)Y,^b0,Àa0 ŀaX0UUU++++-ۢoWeEÚꚇϟ tb >my)w !!O:;9?`4<>>???@@@AAABBB%%%&&&'''((()))***+++,,,---...///000111222333444 !!!"""###$$$%%%tRNSEy>bKGDx IDATHSgqzey۪/`SUB0-AK .. 6Zc&1$r_t:zol\{v١mfvDKٌSz禙g$1${;,s7)$Ek8. cx2-*"jlz[O t.t 㝑3Fp[}l0WX|Ӽ!5aTgO(b`'h$IeiIBT Բ#ZdCJ4 ͪVA?J?ʫAf>Gk % .i)u(4eU硽ez!Ćzn[{<SESbfGzھSq#O+z*ǎi03r-Hl}Yts" OPnTt]d@Zп4/@UT~|斨rȮw ijˀRjO~+'@Y?0V.99|N ]P/X7 },Be SBb p隕IENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/eq_ex.png0000664000175000017500000000543612256224735020747 0ustar useruserPNG  IHDR7/,sRGB pHYs B(xtIMEybKGD IDATxyWi83`+(*N ABE%aAE O=gF󞮜JRԊ{ z[s (UJ#tQvV6UTTPsS3ݺu/l6ۗCQ^n%'} O'twuPrR2ڹo}{QfF&UW`C Ia?C 8ȝ:yV 1`FGG)<,n߾M###ލL}\p^ze_ou 455hݹilltڞ]l Xq /8vAbBqqqTLg^!ˡ5 BrrreTiPpp0]x!]n!7?N1N;n^uhBڟ_tB{]L&E&9 ۱C:"P EN'I<\r:> bydKRQa` EIGR_gg'  aq}JNNv@ 2ӎTHkuB 63 #` j {b1B?Cl]_4ɗ!-b?D0!܉Iݱ}g(/ RdNLV}}} |OIU!&R0bHn#U%&(ޓG?H<ҕaV kĉ4xrsr@0V%*&[`$1EC>T0$&L:t۷oEtnF&ӢGGD#77rpYʢ?o fgJo"K-sUR WK-vZ *W.G{~zY۸ P~7-6A/(W)))j9=='a]4jq91FqqdlTWb֣*QPJ'؎@;*B,MÆn"&.-\ c{NܯJ?9(ԋE CBCBD\'{zݳS)333`/ PZ˴Y׻E*pgWVź́3Q<+LuE8> wXʂ@m?pgAЗ$&&F􍴴8D{ogN!×/&(@P+bSTor5e G]J}>!!#0 m6pեoݦ͖""mݲU)RAteEi0/&+h{EiQ*QFIP 4=#6xa1.&x^WiN~~d1a?-<΄a?f1ańa5΄ńa3a1aǙ0 q&,& ð0 L~SOB4 Q9H>M/:od2q2LjײHIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/readme.txt0000664000175000017500000000010312256224735021120 0ustar useruserErgo created for QMMP project by Andrey Andreev andreev00@gmail.comqmmp-0.7.4/src/plugins/Ui/skinned/default/eqmain.png0000664000175000017500000003023712256224735021115 0ustar useruserPNG  IHDR;~sRGB pHYs B(xtIME;bKGD0IDATx UŹYf61Qc$F5}>gާv]W_M_U_?bū͛b9KfX7=oެ͝3w WkgΘ|m/7oyq^LF\ٳg'N(3IReʡCO9?i$.]ۼyٺu Ӽys3a„_8!CsW\qٿyWM $I (4=Xf͚U (A͟?4k;4{yg1CUf_ŋ{`34|ꫯ6w>Z:u1M Pn&SF s%H*P-Z`Ѻuks饗ctȑ@ϜJ/ǣG.B!z)3IRUn1X=CiӦ%eݺuJLTEB+Fͭ 4ȜysΧ[~M͚5]S*s-8й$IP;vLEIIEE$E$E$E@$I@$I@$I@P$I@P$IP$IP$IPIIIE*wyoٲ~ۿ;?l֬YS`$T,_qfk1~u]>0檫23g46_~v -Z9۷;w)Yv]ng(>`o/IRe]f>w̮۷/v̕W^a׮]N+yM۶m$fWc77mڴ)?MxwMgܹSI2P,sc6Q_dIl?ZV-wfg}vM;~e$I@ٸqܫGn3toŮM="\|nta\۝JREY);ЯCS$E$E$E$E@$I@$I@$I@P$IP$IP$IP$IPIIIE$E$E$E$%ˁ]l3ÇK&awd}ה)S̶m\*#IRJ^^s&iӍ76sa2XN4ԭ[mաC#(#IRUk^ ѣGO9?uTJ޽1 (#IDsFc޽ԬY}LzE@a06Qk(#IR%֭[M˖-׿ и]׆ R ss.̋/7|e&I@p04ݻ䭷*>(د_?woP|*3IRhرuq/'9c5jΡet :} ^yP$I@I(VZ_ (woL4(8s_mof@gqN}C'{yAۙ1cճiڤiդqctn&ÇNdޕ{?aO<ݾ?aߕg?nЮ#NڡE8sz l23pӲEҵO ӯo_}Šp}mxWg [Ñ1/R6=3ߎXz0,O6϶M {؂Ѿ/ǹT` f Ǐ3aÍloP8q;W6Eih! tm~ݾ;&ww%|:Lb ? +p$JЏs8~XpظޟߕC]|Wjcӛ9S> Mq+͇6o=xʕE1"bmü9bԺuks=Y)]?ᙟ_i-YĽ+M<tHˬ v/?XBH1[ё \ȀL3 v{i ڴi  V ]Mh<>9܂Z2^b=n ~݄ 㿛֚Y?m3!|`X9f{׷ma+-.,4 рhka}Pfgm8fI"s_]s,(o:!ScIss-d߇tYW- PnZ69SC@p~%޻ qSf09@ψfE]ާm2w}wNy,a'-*)NYy-?a >VP`(f& qlf+ ({Xj`aS7'U,%@}V"d ,&Mibxc>6fZmM[m\kRf0@ѲV|ζ헓SB,VKo&5ok[` # ͞dx2oRxo+:_IwB`<F%~+ 54(܈k5KOYb\@gxŊEMw%'f1:֖΁c`)w}ZP'0v Ï QYנ2pZ<%Ml+ ([l)!&Yma{2DCY,khzj)H@mH J 9~7j뭅E-&^mhȑ=UP|B[`Gz ^\=:4O!0ڳئѣ]_ʳ]b %(cvͤs};6w/?5#MŁ5v 8HklIfw#UQHx7M-yʷg ǘ|WW>/~F!hYQ!>O40ŋ<3m 6ɓO 6QyWߔe'-xW򵫼2 (Ml7 FX5Z"$TYLZ`~a- )`Z0$`XЗ;9|A[ZryWFbxמڙ9L߰"\~ex9I,PaSi&RIWC58% > [9qeXb^4?.l| KӏtFxrYiJiǝ4{lg=F`'~'`kZDJeh|-2 ɻ2Rm":Y(8aH7?NɊp0!}Vo)0DӕʂtqQÊp>tR&]yN`F84XFELn~$i*h0V!`.eĶx@ytbyQS1<8s>h%R{$j%jD;LFޕtI<"ᓩ>li,]aE&Oh6j+ EK&lC[n1ժU+PB2ftYzuw_Vivv|wbҀu1}y& /3N_r3)}) ^s_-{Yg[B-~,(AWwL<;wv@Rnbz ȑ0'$3K:}/]E¬h] 6<@y7Mm&\~5R԰a4fpCUW]厁 Yi_\V a*n|{s`I(,꫋= >kibsRԬYˬ_12PhF&N\w0@lȐvf7oe6m!%~1hZ (9~ >>|GBS鱀:(NnFw. -PhŞ_|5kiڷdA֪iSa7y0%0qz:J!R(89s;La,~E@X Lpyi%`1b ߄aO/(' ct!P웇"d(sM7N/u/^|΅ )I=pTE6 . QiPhc&'~khő8?qx2fKfa "I$H4Ky`$E^˳ea,zi>-Mfqn>}'$IUlRE.'6O:N`#6n~5:q9b&X(> K M*q%jiLgI< X'X)X+Bѝ;w&H$H+lxдҦr/~{E={)X'te[,Ѥw_ ݖ's: PPHlj`f.*a?!&b̠%a!a]v"~yqՉ M ߲g y \.d>e-[ST b< 4_~o3M˒w,W26xYfu /~ 7:`?o;55l6wM6vaW4pѣGc|p;]cf֪U˭f7ENω3?,jFev #:_W #jC[ܪF)9ܹXBtحo寓%v!{ژu=e%(Q[waso()  ɫ`B|{(@:e҆?xo&)o4>X[} 8PPn99=_(PXerwu>?e(Ph*uEό|?߹S@徠BTS O"f4y mSf-rLZ e׮6c2m 񌔤ƍ{lEǙXjU9@)T~bnj wCyZ%:) _|qJ'"((; ߮f 5I`Wg (Po۾Ν;?cgifq/ ̸g8īmuIdM6-f- S Y*IU[*qPǏQ͚oMzqB/>ZIWaCV2=V=NwP$b.l\L7PC`^g,bB ]ik1UDܼymtLeXit[EtQݱc?,nhgGR&f)jX6c HD ba&12^BԮm1xW fV]$X*4y4h&Kfow\a#0 a)Lc7QGò"ه ̄&<3Ny„\&,+Æ%|}f  ob"KXf=è;.z=;hh1cLm-4_d5u~߭[.10[E[l~9`t9ezuI@<33ۀxP;™LXt9x`去ي>ς]VfСf)-L73Ǝ53Ǎ35r#ז噇xsߑ6>~ϑ@[X#&8a-ڰjT]jTXfc?y^=W9׻K3V?b[6m2G2S}k Բekcͼy [Y͖=,E/kX@f (o:TEzNS7ڵ3SѳS'wL5w77&n͞;ui֝ΆN_գk 6F莃q&0jU( KYqB@P E]QKDr0­`6j%hƇ]ŝtfPq(${c 42A)CA`ోB }'|%>%@b9xW^醒q&m۶2"dP%!=|ah9(wSame *(dlJ2PHWl KXr-Phfʲ% (R@at5Go&%: En~Q cLfcd]vu[\qE@)_PXgm~_:G߬ ^OV̜-w~2  Zj"a7 }myG;,~_* LTgNf]`Wd B!d"eϫz±τ3;u#f0?)kqv,(:7`1ϊΜ9s6yE@I PX Ow ~ۅh?5oه .ph N ߸?gu!l9JhNY~^*lY,~Q n q,(JD@{07#ccMm,lo я~Tw~=܋Q^,D7H990PhcRpQ 79p@E@0Babk<'i5,bPN|,, sԩŋEG-{;v,ٲJa, (U(BU<<4`hsqqpu>%l L@P2(t5`MdPb-O0E@23D|畸/O%;#]a]1(%^=l QQa~꽀"("(IaS$)YDY}" vPE@PE@|@agG%E@2JٮJ2Շ"("("(YT9P*'PBA@Pu ("(&"otM۰YAlZ tAA@P%#5"S(E@P*NP)Du %(iJߜL@PAE@P2(̰6Uè dBgN((aæj"TZ$SH@ kd;P6,x(>| ()BZW@PE@I#P}fE@Pq*%(3@ E@PA!aE@y((6j'e2+afTy "㨇"("(J7y"("(Jf0E@P('N0˖-3ȑ#._% ʇ}G?~hLg÷.QEqLl|`ذL6^8lr_ (RـRNE@@I׵T[o (RՁ*"("T>͇t@yp&8>sءT%lA'aexC!{2aE@PE@PE@I;PHNP+(i U@PR PE@P2 (a "(JvY~:)ÆM}S%vJxѣGE@)OP(Q (2((JhPU (d v"^E@PE@P*3P<*(+dj=aSdF=†M}SAذw;tYuEPE@PJ* (R@IQE@P6P8W@PE@Pq,Ji @If@gr76lN&T%ɄPRX (Q $H@PJ3VE@PJ-$dE@b@I "(d (@ ;=)7=_)tʆ}t 5gFJppX($V@PE@PE@PE@:@I [Pv$ӱ P+("("()JpC26]oÆM}@I׊ʱcNJ6 8"("("(@" ("T 2D@P%y̟?_@Iհqؕ"Ld7P8E@PtMPpG(a (R;@E@PAA@PE@PE@@ [$8̆[%?Ʉ&$l +(hϞ=&???R;ve˖'NK/EuVdɒa}AAYti6lpn޼̝;7Rכ3g?/ו-۶K{?8e϶۔e͚5-L q݄>mL޽?*٣8A@?p,3^)〒& h6}ƏPʴ^W>W@2(S&OyS4$H$H$ ($ (" (" (*$ (" ("UN,\p hiy@ٷwߋ*٧ (Rf/9b i)U9t萀"e&PȜ}zQaim `IlmlL'{~[='3L2 <+9g3y]"wܟIIIŋM6ӧO~0ȝ={1}Xj1|xw"mfXhx]N;flr9bdnrR+==ݵ~z׹s:\pV,_3{kɮÆ;xqc .t[j \Ǎ 2w7 4 K\bܹ45ItMr$:HIN֠D=śo)'y才7i ц_U|730p.^<=k?~E?q#L}ĩS>1|G?C,]K.u։#,7Dv ݻѣG1 @Z N\9rիWʼn'ۘqY栘:uw ]/DΝE֭ŪUĔ)SDNNfb[l) "~Gy:v(̙3cM0AرC (z%֮]+*T ^~eѢE f*W,{9$ɮtҢM6bbr+*QQXt>|(Uػw;OʼnCwݻ/>++KvP".b\(-.w1]X?57A\e˖uo?رcE )+"V~=m4i)ĥ;hժڵB|ȑ#f"D%v)G}gҼLHc\sެ2zp~eb"(]8ރ:uކ3x7KKR6p@ L_Alu9^~C `!ߥK>Y؄q(2q&(o*WAT,(uˏp!uJHHpמ={+._ȑ#0f0/:* 9B:p(Y;9 p*$!z)1k,9sq ZA\C2+5;>/ɹE׮]RO&M*U?c[nm۶I _c~Q \Da=Nۿ+$+Tp^W+B=/qꮒUUB E\z+Yo| Qci1H.A}ɲBa%g$+PJԳgO)3gV Bcǎr\D2 +@UM=օw}'~*ƍ mpɓ%a5ꫯǂ<6|V25Vmm*vֆ=??^+!a+@<=ܳJׁw4q#<7tqQ ou]2+>>޽?+VQĥw`֗bOd0Jl۶07W4 uy\E'W :2ět{˗ .Bvms@\چ˨EVTɃtbYΘ1ãߗA25-[g)Prv8aH[Ta{Ef~|K~\ވK/f_ڐ]5 A28MzX\lk< pq?iRҴ1^yB-#68MJ庈qTMÆ %6Tn*]WA49=LG~/ qt,h D:YW( _?Aybd\ ر-H C`y$>e+jTroqzqhp =i^,=,_̰ P#M\T/QhZ k5.r!:z7 Mg);J9=A1U 'qm߾e]MIIq5Z+ :eDžAJy*Z*N8I I"^a\YVڷgم e=Ha2Ս;H8Ӧ%`J\{=gh$wߟ/^(M5JqlUq1)9~$>% HO6o^*h- 7xCqK3=R ^eB$h^q ؽ%)0W~d ͌nY܍J*)(>R(ʚ<{JTP]xZCZF}'ӿ5jԐ} e싷`+H"lhsuVVJָ`7".F׬ݨQ#7q"G_`"cF;j)kt4pt}@(]ի׾#ͺ/]rl|JNF| UT@|Lo[~&bΜtyJBvwX11UDŊ,bUx[ @CP'HgS{wUX +JjB\q]L)oxZԯ_qv"-*%AN'.ˉ-|4QF[ctCNnkIBj4I\ F\j5XݚGE5~]ZR1qvjLjl&ƌ'9H!Ub\XXneʔşVKDkזO s`Ȁb^; onB=nC\p4-(s~FѪUIVUqq$!C\Cǎq :Bڶ$5a|JѼy+3EÆ#]T!B5 $$޽ۃ{=wp~_ߕ8㮃严JqO7(.:X.,7-kG1z>:r%HVѲk"ӻwhРOREKEc\EB0z:lEZ{7'޽hܸEZM%qi"")B E\X0p t/%cecHhͰYڵYbkZ$ܹEf|G1-m; xR9֘8vJtփrbڴT1}L&f|Ka؉: ?좎9qFc`P\ĕ'q(!.C Be*$Pq /qLXD\E_EwY+WN AjiyΝ;KR5k&ju&MchhDս{wʕ+J5>?)]EQ"7HOOw r{ Hwt"3vinq߷_Zݺv+W+N\ Pq+w!*yNZEF-͌Ti| .HNP+_3 T".]ب,`^dHQB^trJCq ~CC\#pYSq C\PWNPմiSMwPZd=TGS۰bcc=:-[փ>3bC=̋rũݸNX\WD6Uuf-ENgO;REkYuרyc?↼oǶm{84i!`w$fOA-@LKR*/ٳFT:*R!. 8uTdW EœO>%?:q5o܃p#.mXDFYo'.$SV^lܰh .A_$X\׹s_5Ɏh11K/Օ5R׮@񮄄ׄ\i3\׺C\?gXIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/shufrep.png0000664000175000017500000001166412256224735021322 0ustar useruserPNG  IHDR\UsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<1IDATxsTݪX<-k!, I @X$F vYdEPw ^;~̽t:5;wz}s}r?|駟~Rq7oG)uv_~zL"ʩn_|rVZ<ᆱfΘ<M jk;5xWj׮]>$-5U^[S9MMj%ɺUHaaZxڳ{zjlOIIF_jk=u&={޽zk>}T/{РAɓ|zF232tgyF%%&jI /ד?j￯Ëuه*33S;|ŋwɓY>~{:J4i|0oٲE \J?7ĬDqcxVVڲysXN@21}ڴ8СC:k2xpX0gUBп AK=zjS;wTݴqʖ˚&_|>mϘ1Ch~Sqˑ#GTRR9bw>S5k,l2u1BoX~CN bMOOW}Q؉ܿoj7/ Xd5@& "k|cuE?p?`v# k܀Ԁ-,g۶m>pd $ݳ{Æ p|yB+Mb1{*+*T޽UO yg4q׷op\cV˵'N}pL4ܿPa֭*???xQ\ZZ\[[Zej8%%%jʔ)!F{t~}a 6_p1Ff||(,n=z0a;+qYFmv!wŇgefjMvTSSSիW2W_,tѰq?V`b%p{֧I,2~V:~.ďD8[<xh{p!ª۷bQwb$hb;՗;IlnnC)X­>؛O:\n9Rnz.]zj8`ߣe?~.]q6}\~}Pý12>x%+_|YvUUԗc { )auhhJUTWW+++E42Mۘ"[QQZlVk׮sa…5c0`јhNL-nmi f+QA`|`vL#{p1A>E6b[S/K/Va 1O&ODS Mx,{{vޭCbّ jWj'ʭٸFBm g}tlv*zцsZf^E a k.\bz)Cњ k%5j2m޴I]8WoB QQzVd~Ѹjl .(T [cqر=f{"-4~V$)uFVXG79/!f/];I\Aߚ ~" &?7B Kl1w]ߺuԯO~v 5UϠBHB1'~j D؝'9sh snƒPSh% :C Uo9g#;##LMiiiDRRKh…iLGhJl7J̒:HJbpja-\c'{-WX \Jo$HRm={Vgh-M&je[$+dIbbu{e,d$9$N'}+d :}RDNZEvK۫*+UС_&wRt`a(3isX'vH) c&k8PUm: Mi{hwDR" ^XSYb&uRnJOMՓ>ۃD(W6i< gęLӜ6_+sdsO[LhXdJVV _{Y5V ,\_#yu%ZmS7~Q3{}]}TE*dkKI4s_]*wr392h*e=e1~ /*ԣ8"U"d3ďҥOhySO\[Ţ],_lO$ӯ8R(nM;g& 8QFn4wmaB14Lp O? ӞYXzHu{-dגkڽ дuVn}AW5ثe8 1Q8Qn7eeekRm.]h\@ SEs\.}ҹB=AG]yJTD?M'{n๢::) 3<&+5]v@խ}7Igk߳6#[xD:3~? Qp>|&QWĪ,egW`̚p?fY|6 3!Wal} &}H|ℙ͛7S%ZWaȵQbhѶpG),QgxB-0Ŧnnr}~A`52i  5FNEJL90;YtBTCk̃xp6J+G Ri{X|}8ihlLX*>bQ!MKSRi{LV$!'ɋ~S2pqd{lyE!<*01SF&C76 f?5ݴ 8E + Ebm9QN$; S{#p ۵29w/N cM5n8ƍ:l= SDhO9wBV\ zVH.Yys#$e6e!"?vl:!%YoL-H)&z3&sjRRNJ&b#:x? HR.xr)Eg(!@br\..N ~[Xɕejh@ Wk\ %o$p);RVå `O%/%2!U".a))]8N6c v~E@$n$dLXA41U֕vKiD1>d[( 4\J\r0\ R,B7dt0#(7P*n$3[%(9 ^lt ij!0n.eC+8R`YbEƵp ~/ B_Bo-YΑC`-NLֲ,2hKv+=a¾o 82A"> 'C6RIx{|455ѥM۪XU&,n.%S_cq"6\JK+!A.;UfwD$^ #o2pk.EP!"a\緹X%!pR/R.1LI2PmCq@d}h^R%#3oԞX@R(U65^esp)axu/ڀE.2`vNF_xJ 1M\&qu$.Q ;t=9=;o$SO&*wad/?54y-yD17 Gm(N7s ,{C'oO pln&_@YeS6\-0"TKR2U'u16{vDZB2 tc]q_9f 0 X} x IX'ic0/_?{dJ`K%j^11SloHZ$i"I/$})8.OK'ϋ%wtT>pkB&4UL'f<=BRKG0j\'n!E)I{`S )c&91Fi1JR@ '!܄'= mg X܉QI61}`D`t¸GF rVFGk<[X_9m͊.j}`5)qTRQ riy(2~*~h0iz!/5Vj?1V0ܱL_7P:P GIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/default/balance.png0000664000175000017500000000214112256224735021221 0ustar useruserPNG  IHDR5n8sBITO pHYs ׆tEXtSoftwarewww.inkscape.org<\PLTEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}}}~~~)tRNS ]`}|atBIDATxWOAF4CPۄ@u]_u>F~GJ)|WTL $,0? "uPK , ++WXb):S*YKRX -Z mtOd1=X.ӪCJ3%<,-$cX -YAJYV3Ka)ں}9XymGYL˃Vvd`]X(RJqX [LJYy3Ka)hI+?SX9mhUeNPrɷQ-̔ LRX @Y0+ri'K%Y:`)h&LJIf)X KR:JYVS&lZ]ʎQ)k,Ka)uO+@EˋL! 7ǗC #include #include #include #include "pixmapwidget.h" PixmapWidget::PixmapWidget(QWidget *parent) : QWidget(parent) {} PixmapWidget::~PixmapWidget() {} void PixmapWidget::setPixmap(const QPixmap pixmap) { m_pixmap = pixmap; resize(m_pixmap.size()); update(); } void PixmapWidget::paintEvent (QPaintEvent *e) { Q_UNUSED(e); QPainter paint(this); style()->drawItemPixmap(&paint, rect(), Qt::AlignCenter, m_pixmap); } qmmp-0.7.4/src/plugins/Ui/skinned/keyboardmanager.h0000664000175000017500000000510212256224735021006 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _KEYBOARDMANAGER_H #define _KEYBOARDMANAGER_H class PlayList; class QKeyEvent; /*! * Class \b KeyboardManager represents key handler object that processes * all key events passed to the \b PlayList * @author Vladimir Kuznetsov */ class KeyboardManager { public: /*! * Constructor. Takes \b PlayList object as an argument. */ KeyboardManager (PlayList*); /*! * Handles key press events from \b PlayList object. Returns \b true * if the key was handled, otherwise \b false. */ bool handleKeyPress (QKeyEvent*); /*! * Handles key release events from \b PlayList object. Returns \b true * if the key was handled, otherwise \b false. */ bool handleKeyRelease (QKeyEvent*); protected: void keyUp (QKeyEvent* ke); void keyDown (QKeyEvent* ke); void keyPgUp (QKeyEvent* ke); void keyPgDown (QKeyEvent* ke); void keyEnter (QKeyEvent* ke); void keyHome(QKeyEvent* ke); void keyEnd(QKeyEvent* ke); private: PlayList* m_playlist; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/shortcutdialog.h0000664000175000017500000000360412256224735020713 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SHORTCUTDIALOG_H #define SHORTCUTDIALOG_H #include #include "ui_shortcutdialog.h" class QKeyEvent; /** @author Ilya Kotov */ class ShortcutDialog : public QDialog { Q_OBJECT public: ShortcutDialog(const QString &key, QWidget *parent = 0); ~ShortcutDialog(); const QString key(); protected: virtual void keyPressEvent (QKeyEvent *event); private: Ui::ShortcutDialog m_ui; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/mainwindow.h0000664000175000017500000000644012256224735020035 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include "display.h" #include "titlebar.h" class PlayList; class PlayListManager; class EqWidget; class MainVisual; class Skin; class SoundCore; class VisualMenu; class UiHelper; class MediaPlayer; class QMenu; class QKeyEvent; /** @author Ilya Kotov */ class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = 0); ~MainWindow(); PlayList *playlist(){return m_playlist;} QMenu* menu(); void setVolume(int volume, int balance); MainDisplay* mainDisplay()const; public slots: void previous(); void play(); void pause(); void playPause(); void stop(); void next(); void replay(); void jumpToTrack(); void toggleVisibility(); void addDir(); void addFile(); void addUrl(); void loadPlaylist(); void savePlaylist(); void about(); void updateSettings(); protected: virtual void closeEvent (QCloseEvent *); virtual void changeEvent (QEvent *event); virtual void keyPressEvent (QKeyEvent* ); private slots: void showState(Qmmp::State state); void showMetaData(); void showSettings(); void forward(); void backward(); private: void readSettings(); void writeSettings(); void createActions(); SoundCore *m_core; QMenu *m_mainMenu; MainDisplay *m_display; PlayList *m_playlist; PlayListManager *m_pl_manager; QPointer m_model; int m_preamp; EqWidget *m_equalizer; MainVisual *m_vis; bool m_update; Skin *m_skin; bool m_hideOnClose, m_startHidden; VisualMenu *m_visMenu; UiHelper *m_uiHelper; MediaPlayer *m_player; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/keyboardmanager.cpp0000664000175000017500000002503412256224735021347 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "playlist.h" #include "listwidget.h" #include "keyboardmanager.h" #include "mainwindow.h" KeyboardManager::KeyboardManager (PlayList* pl) { m_playlist = pl; } bool KeyboardManager::handleKeyPress (QKeyEvent* ke) { bool handled = true; switch (ke->key()) { case Qt::Key_Up: keyUp (ke); break; case Qt::Key_Down: keyDown (ke); break; case Qt::Key_PageUp: keyPgUp (ke); break; case Qt::Key_PageDown: keyPgDown (ke); break; case Qt::Key_Enter: case Qt::Key_Return: keyEnter (ke); break; case Qt::Key_Home: keyHome(ke); break; case Qt::Key_End: keyEnd(ke); break; default: handled = false; } return handled; } bool KeyboardManager::handleKeyRelease (QKeyEvent*) { return false; } void KeyboardManager::keyUp (QKeyEvent * ke) { QList rows = m_playlist->listWidget()->model()->selectedIndexes(); ListWidget* list_widget = m_playlist->listWidget(); if (rows.count() > 0) { if(rows.first() == 0 && rows.count() == 1) return; if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) { m_playlist->listWidget()->model()->clearSelection(); list_widget->setAnchorRow(-1); } bool select_top = false; int first_visible = list_widget->firstVisibleRow(); int last_visible = list_widget->visibleRows() + first_visible - 1; foreach (int i, rows) { if (i > last_visible || i < first_visible) { select_top = true; break; } } if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) { if (ke->modifiers() == Qt::AltModifier) { if(rows.first() == 0) return; m_playlist->listWidget()->model()->moveItems (rows.first(),rows.first() - 1); list_widget->setAnchorRow (list_widget->anchorRow() - 1); } else { if (rows.last() > list_widget->anchorRow() && ke->modifiers() & Qt::ShiftModifier) { m_playlist->listWidget()->model()->setSelected (rows.last(),false); } else if (rows.first() > 0) { m_playlist->listWidget()->model()->setSelected (rows.first() - 1,true); } else { m_playlist->listWidget()->model()->setSelected (rows.first(),true); if(list_widget->anchorRow() == -1) list_widget->setAnchorRow(rows.first()); } if (! (ke->modifiers() & Qt::ShiftModifier) && rows.first() > 0) list_widget->setAnchorRow (rows.first() - 1); } } else { m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); list_widget->setAnchorRow(list_widget->firstVisibleRow()); } rows = m_playlist->listWidget()->model()->selectedIndexes(); if (rows.first() < list_widget->firstVisibleRow() && list_widget->firstVisibleRow() > 0) { int r = rows.last() > list_widget->anchorRow() ? rows.last(): rows.first(); if(ke->modifiers() & Qt::ShiftModifier && (r >= list_widget->firstVisibleRow())) ; else list_widget->scroll (list_widget->firstVisibleRow() - 1); } } else { //if(list_widget->getAnchorRow() == -1) list_widget->setAnchorRow(list_widget->firstVisibleRow()); m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); } } void KeyboardManager::keyDown (QKeyEvent * ke) { QList rows = m_playlist->listWidget()->model()->selectedIndexes(); ListWidget* list_widget = m_playlist->listWidget(); //qWarning("count: %d",rows.count()); if (rows.count() > 0) { if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) { m_playlist->listWidget()->model()->clearSelection(); list_widget->setAnchorRow(-1); } bool select_top = false; int first_visible = list_widget->firstVisibleRow(); int last_visible = list_widget->visibleRows() + first_visible - 1; foreach (int i, rows) { if (i > last_visible || i < first_visible) { select_top = true; break; } } if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) { if (ke->modifiers() == Qt::AltModifier) { if(rows.last() == m_playlist->listWidget()->model()->count() - 1) return; m_playlist->listWidget()->model()->moveItems (rows.last(),rows.last() + 1); list_widget->setAnchorRow (list_widget->anchorRow() + 1); } else { //qWarning("list_widget %d",list_widget->getAnchorRow()); //qWarning("model count: %d rows.last(): %d",m_playlist->listWidget()->model()->count(),rows.last()); if (rows.first() < list_widget->anchorRow() && ke->modifiers() & Qt::ShiftModifier) m_playlist->listWidget()->model()->setSelected (rows.first(),false); else if (rows.last() < m_playlist->listWidget()->model()->count() - 1) { m_playlist->listWidget()->model()->setSelected (rows.last() + 1,true); } else { m_playlist->listWidget()->model()->setSelected (rows.last(),true); if(list_widget->anchorRow() == -1) list_widget->setAnchorRow(rows.last()); } if (! (ke->modifiers() & Qt::ShiftModifier) && rows.last() < m_playlist->listWidget()->model()->count() - 1) list_widget->setAnchorRow (rows.last() + 1); } } else { m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); list_widget->setAnchorRow(list_widget->firstVisibleRow()); } rows = m_playlist->listWidget()->model()->selectedIndexes(); if (!rows.isEmpty() && rows.last() >= list_widget->visibleRows() + list_widget->firstVisibleRow()) { int r = rows.first() < list_widget->anchorRow() ? rows.first(): rows.last(); if(ke->modifiers() & Qt::ShiftModifier && (r < list_widget->firstVisibleRow() + list_widget->visibleRows())) ; else list_widget->scroll (list_widget->firstVisibleRow() + 1); } } else { m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); //if(list_widget->getAnchorRow() == -1) list_widget->setAnchorRow(list_widget->firstVisibleRow()); } } void KeyboardManager::keyPgUp (QKeyEvent *) { ListWidget* list_widget = m_playlist->listWidget(); int page_size = list_widget->visibleRows(); int offset= (list_widget->firstVisibleRow()-page_size >= 0) ?list_widget->firstVisibleRow()-page_size:0; list_widget->scroll (offset); } void KeyboardManager::keyPgDown (QKeyEvent *) { ListWidget* list_widget = m_playlist->listWidget(); int page_size = list_widget->visibleRows(); int offset = (list_widget->firstVisibleRow() +page_size < m_playlist->listWidget()->model()->count()) ? list_widget->firstVisibleRow() +page_size:m_playlist->listWidget()->model()->count() - 1; list_widget->scroll (offset); } void KeyboardManager::keyEnter (QKeyEvent *) { QList rows = m_playlist->listWidget()->model()->selectedIndexes(); MainWindow* mw = qobject_cast (m_playlist->parentWidget()); if (mw && rows.count() > 0) { m_playlist->listWidget()->model()->setCurrent (rows.first()); mw->replay(); } } void KeyboardManager::keyHome(QKeyEvent *ke) { ListWidget* list_widget = m_playlist->listWidget(); m_playlist->listWidget()->scroll (0); if(ke->modifiers() & Qt::ShiftModifier) for(int i = 0; i <= list_widget->anchorRow(); ++i) m_playlist->listWidget()->model()->setSelected (i,true); } void KeyboardManager::keyEnd(QKeyEvent *ke) { ListWidget* list_widget = m_playlist->listWidget(); int page_size = list_widget->visibleRows(); int scroll_to = m_playlist->listWidget()->model()->count() - page_size; if(scroll_to >= 0) list_widget->scroll(scroll_to); if(ke->modifiers() & Qt::ShiftModifier) for(int i = list_widget->anchorRow(); i < m_playlist->listWidget()->model()->count(); ++i) m_playlist->listWidget()->model()->setSelected (i,true); } qmmp-0.7.4/src/plugins/Ui/skinned/display.h0000664000175000017500000000705712256224735017333 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DISPLAY_H #define DISPLAY_H #include #include #include "pixmapwidget.h" class TimeIndicator; class PositionBar; class Skin; class ToggleButton; class TitleBar; class NumberDisplay; class SymbolDisplay; class MonoStereo; class PlayStatus; class VolumeBar; class BalanceBar; class MainWindow; class SoundCore; class Button; class TextScroller; class MainVisual; class TitleBar; /** @author Ilya Kotov */ class MainDisplay : public PixmapWidget { Q_OBJECT public: MainDisplay(QWidget *parent = 0); ~MainDisplay(); void setEQ(QWidget*); void setPL(QWidget*); bool isEqualizerVisible()const; bool isPlaylistVisible()const; bool isRepeatable()const; bool isShuffle()const; void setIsRepeatable(bool); void setIsShuffle(bool); void setMinimalMode(bool b = true); void setActive(bool b); public slots: void setDuration(qint64); signals: void repeatableToggled(bool); void shuffleToggled(bool); protected: void wheelEvent(QWheelEvent *); void mousePressEvent(QMouseEvent*); private slots: void updateSkin(); void updateVolume(); void showPosition(); void updatePosition(); void setSampleRate(quint32 rate); void setTime(qint64); void setState(Qmmp::State state); void setVolume(int left, int right); private: void updatePositions(); void updateMask(); QWidget* m_equlizer; QWidget* m_playlist; bool m_shaded; Skin *m_skin; PositionBar *m_posbar; Button *m_previous; Button *m_play; Button *m_pause; Button *m_stop; Button *m_next; Button *m_eject; TextScroller *m_text; ToggleButton *m_eqButton; ToggleButton *m_plButton; ToggleButton *m_shuffleButton; ToggleButton *m_repeatButton; SymbolDisplay* m_kbps; SymbolDisplay* m_freq; MonoStereo* m_monoster; PlayStatus* m_playstatus; VolumeBar* m_volumeBar; BalanceBar* m_balanceBar; MainWindow* m_mw; MainVisual* m_vis; TimeIndicator* m_timeIndicator; TitleBar *m_titlebar; SoundCore *m_core; QWidget *m_aboutWidget; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playlist.h0000664000175000017500000001103112256224735017512 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLIST_H #define PLAYLIST_H #include #include class QMenu; class Skin; class ListWidget; class PlayListItem; class Button; class PlayListModel; class PlayListTitleBar; class PlayListSlider; class MainWindow; class SymbolDisplay; class OutputState; class PixmapWidget; class PlaylistControl; class KeyboardManager; class PlayListManager; class PlayListBrowser; class PlayListSelector; /** @author Ilya Kotov */ class PlayList : public QWidget { Q_OBJECT public: PlayList (PlayListManager *manager, QWidget *parent = 0); virtual ~PlayList(); void readSettings(); PlayListItem *currentItem(); ListWidget* listWidget() const { return m_listWidget; } void setMinimalMode(bool b = true); signals: void play(); void next(); void prev(); void pause(); void stop(); void eject(); void loadPlaylist(); void savePlaylist(); void closed(); public slots: void setTime(qint64 time); void updateList(); private slots: void showAddMenu(); void showSubMenu(); void showSelectMenu(); void showSortMenu(); void showPlaylistMenu(); void updateSkin(); void deletePlaylist(); void showPlayLists(); void generateCopySelectedMenu(); void copySelectedMenuActionTriggered(QAction *action); private: void updatePositions(); QString formatTime (int sec); void drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix); void writeSettings(); void createMenus(); void createActions(); //events virtual void paintEvent (QPaintEvent *); virtual void resizeEvent (QResizeEvent *); virtual void mouseMoveEvent (QMouseEvent *); virtual void mousePressEvent (QMouseEvent *); virtual void mouseReleaseEvent (QMouseEvent *); virtual void changeEvent (QEvent*); virtual void closeEvent (QCloseEvent*); virtual void keyPressEvent (QKeyEvent*); #ifdef Q_WS_X11 virtual bool event (QEvent *event); #endif QMenu *m_addMenu; QMenu *m_subMenu; QMenu *m_selectMenu; QMenu *m_sortMenu; QMenu *m_playlistMenu; QMenu *m_copySelectedMenu; QWidget *m_resizeWidget; Button *m_buttonAdd; Button *m_buttonSub; Button *m_selectButton; Button *m_sortButton; Button* m_playlistButton; PlaylistControl* m_pl_control; SymbolDisplay* m_length_totalLength; SymbolDisplay* m_current_time; Skin *m_skin; ListWidget *m_listWidget; PlayListTitleBar *m_titleBar; PlayListSlider *m_plslider; QPoint m_pos; bool m_resize; bool m_update; int m_ratio; int m_height; bool m_shaded; PlayListManager *m_pl_manager; KeyboardManager* m_keyboardManager; QPointer m_pl_browser; PlayListSelector *m_pl_selector; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playlistbrowser.cpp0000664000175000017500000001224312256224735021457 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "playlistbrowser.h" PlayListBrowser::PlayListBrowser(PlayListManager *manager, QWidget *parent) : QDialog(parent) { setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_QuitOnClose, false); setWindowModality(Qt::NonModal); ui.setupUi(this); m_pl_manager = manager; connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateList())); connect(ui.newButton, SIGNAL(clicked()), m_pl_manager, SLOT(createPlayList())); updateList(); //actions QAction *renameAct = new QAction(tr("Rename"), this); QAction *removeAct = new QAction(tr("Delete"), this); connect(renameAct,SIGNAL(triggered()), SLOT(rename())); connect(removeAct,SIGNAL(triggered()), SLOT(on_deleteButton_clicked())); ui.listWidget->setContextMenuPolicy(Qt::ActionsContextMenu); ui.listWidget->addAction(renameAct); ui.listWidget->addAction(removeAct); ui.downButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown)); ui.upButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowUp)); ui.newButton->setIcon(QIcon::fromTheme("document-new")); ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); } PlayListBrowser::~PlayListBrowser() {} void PlayListBrowser::updateList() { ui.listWidget->clear(); foreach(PlayListModel *model, m_pl_manager->playLists()) ui.listWidget->addItem(model->name()); ui.listWidget->setCurrentRow (m_pl_manager->selectedPlayListIndex()); //mark current playlist int current = m_pl_manager->currentPlayListIndex(); QListWidgetItem *item = ui.listWidget->item(current); if(item) { QFont font = item->font(); font.setBold(true); item->setFont(font); } } void PlayListBrowser::on_listWidget_itemDoubleClicked(QListWidgetItem *item) { m_pl_manager->activatePlayList(ui.listWidget->row(item)); } void PlayListBrowser::on_listWidget_itemChanged(QListWidgetItem *item) { m_pl_manager->playListAt(ui.listWidget->row(item))->setName(item->text()); } void PlayListBrowser::on_listWidget_itemPressed (QListWidgetItem *item) { m_pl_manager->selectPlayList(ui.listWidget->row(item)); } void PlayListBrowser::rename() { QListWidgetItem *item = ui.listWidget->currentItem(); if(item) { item->setFlags(Qt::ItemIsEditable | item->flags()); ui.listWidget->editItem(item); } } void PlayListBrowser::on_deleteButton_clicked() { QList models; foreach(QListWidgetItem *item, ui.listWidget->selectedItems()) models.append(m_pl_manager->playListAt(ui.listWidget->row (item))); foreach(PlayListModel *model, models) m_pl_manager->removePlayList(model); } void PlayListBrowser::on_downButton_clicked() { int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); if(pos < m_pl_manager->count() - 1) m_pl_manager->move(pos, pos + 1); } void PlayListBrowser::on_upButton_clicked() { int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); if(pos > 0) m_pl_manager->move(pos, pos - 1); } void PlayListBrowser::keyPressEvent(QKeyEvent *e) { if(e->key() == Qt::Key_Return) { QListWidgetItem *item = ui.listWidget->currentItem(); if(item) { disconnect(m_pl_manager, SIGNAL(playListsChanged()), this, SLOT(updateList())); m_pl_manager->activatePlayList(ui.listWidget->row(item)); m_pl_manager->selectPlayList(ui.listWidget->row(item)); connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateList())); updateList(); } e->accept(); } else QDialog::keyPressEvent(e); } qmmp-0.7.4/src/plugins/Ui/skinned/eqslider.h0000664000175000017500000000442312256224735017470 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQSLIDER_H #define EQSLIDER_H #include "pixmapwidget.h" class QMouseEvent; class QWheelEvent; class Skin; /** @author Ilya Kotov */ class EqSlider : public PixmapWidget { Q_OBJECT public: EqSlider(QWidget *parent = 0); ~EqSlider(); double value(); public slots: void setValue(double); void setMax(double); signals: void sliderMoved (double); private slots: void updateSkin(); private: Skin *m_skin; bool m_moving; int press_pos; double m_max, m_min, m_pos, m_value, m_old; QPixmap m_pixmap; double convert(int); // value = convert(position); void draw(bool pressed = true); protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void wheelEvent(QWheelEvent *); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/fft.c0000664000175000017500000002154712256224735016440 0ustar useruser/* fft.c: Iterative implementation of a FFT * Copyright (C) 1999 Richard Boulton * Convolution stuff by Ralph Loader * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * TODO * Remove compiling in of FFT_BUFFER_SIZE? (Might slow things down, but would * be nice to be able to change size at runtime.) * Finish making / checking thread-safety. * More optimisations. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "fft.h" //#include #include #include #ifndef PI #ifdef M_PI #define PI M_PI #else #define PI 3.14159265358979323846 /* pi */ #endif #endif /* ########### */ /* # Structs # */ /* ########### */ struct _struct_fft_state { /* Temporary data stores to perform FFT in. */ float real[FFT_BUFFER_SIZE]; float imag[FFT_BUFFER_SIZE]; }; /* ############################# */ /* # Local function prototypes # */ /* ############################# */ static void fft_prepare(const sound_sample * input, float *re, float *im); static void fft_calculate(float *re, float *im); static void fft_output(const float *re, const float *im, float *output); static int reverseBits(unsigned int initial); /* #################### */ /* # Global variables # */ /* #################### */ /* Table to speed up bit reverse copy */ static unsigned int bitReverse[FFT_BUFFER_SIZE]; /* The next two tables could be made to use less space in memory, since they * overlap hugely, but hey. */ static float sintable[FFT_BUFFER_SIZE / 2]; static float costable[FFT_BUFFER_SIZE / 2]; /* ############################## */ /* # Externally called routines # */ /* ############################## */ /* --------- */ /* FFT stuff */ /* --------- */ /* * Initialisation routine - sets up tables and space to work in. * Returns a pointer to internal state, to be used when performing calls. * On error, returns NULL. * The pointer should be freed when it is finished with, by fft_close(). */ fft_state * fft_init(void) { fft_state *state; unsigned int i; state = (fft_state *) malloc(sizeof(fft_state)); if (!state) return NULL; for (i = 0; i < FFT_BUFFER_SIZE; i++) { bitReverse[i] = reverseBits(i); } for (i = 0; i < FFT_BUFFER_SIZE / 2; i++) { float j = 2 * PI * i / FFT_BUFFER_SIZE; costable[i] = cos(j); sintable[i] = sin(j); } return state; } /* * Do all the steps of the FFT, taking as input sound data (as described in * sound.h) and returning the intensities of each frequency as floats in the * range 0 to ((FFT_BUFFER_SIZE / 2) * 32768) ^ 2 * * FIXME - the above range assumes no frequencies present have an amplitude * larger than that of the sample variation. But this is false: we could have * a wave such that its maximums are always between samples, and it's just * inside the representable range at the places samples get taken. * Question: what _is_ the maximum value possible. Twice that value? Root * two times that value? Hmmm. Think it depends on the frequency, too. * * The input array is assumed to have FFT_BUFFER_SIZE elements, * and the output array is assumed to have (FFT_BUFFER_SIZE / 2 + 1) elements. * state is a (non-NULL) pointer returned by fft_init. */ void fft_perform(const sound_sample * input, float *output, fft_state * state) { /* Convert data from sound format to be ready for FFT */ fft_prepare(input, state->real, state->imag); /* Do the actual FFT */ fft_calculate(state->real, state->imag); /* Convert the FFT output into intensities */ fft_output(state->real, state->imag, output); } /* * Free the state. */ void fft_close(fft_state * state) { if (state) free(state); } /* ########################### */ /* # Locally called routines # */ /* ########################### */ /* * Prepare data to perform an FFT on */ static void fft_prepare(const sound_sample * input, float *re, float *im) { unsigned int i; float *realptr = re; float *imagptr = im; /* Get input, in reverse bit order */ for (i = 0; i < FFT_BUFFER_SIZE; i++) { *realptr++ = input[bitReverse[i]]; *imagptr++ = 0; } } /* * Take result of an FFT and calculate the intensities of each frequency * Note: only produces half as many data points as the input had. * This is roughly a consequence of the Nyquist sampling theorm thingy. * (FIXME - make this comment better, and helpful.) * * The two divisions by 4 are also a consequence of this: the contributions * returned for each frequency are split into two parts, one at i in the * table, and the other at FFT_BUFFER_SIZE - i, except for i = 0 and * FFT_BUFFER_SIZE which would otherwise get float (and then 4* when squared) * the contributions. */ static void fft_output(const float *re, const float *im, float *output) { float *outputptr = output; const float *realptr = re; const float *imagptr = im; float *endptr = output + FFT_BUFFER_SIZE / 2; #ifdef DEBUG unsigned int i, j; #endif while (outputptr <= endptr) { *outputptr = (*realptr * *realptr) + (*imagptr * *imagptr); outputptr++; realptr++; imagptr++; } /* Do divisions to keep the constant and highest frequency terms in scale * with the other terms. */ *output /= 4; *endptr /= 4; #ifdef DEBUG printf("Recalculated input:\n"); for (i = 0; i < FFT_BUFFER_SIZE; i++) { float val_real = 0; float val_imag = 0; for (j = 0; j < FFT_BUFFER_SIZE; j++) { float fact_real = cos(-2 * j * i * PI / FFT_BUFFER_SIZE); float fact_imag = sin(-2 * j * i * PI / FFT_BUFFER_SIZE); val_real += fact_real * re[j] - fact_imag * im[j]; val_imag += fact_real * im[j] + fact_imag * re[j]; } printf("%5d = %8f + i * %8f\n", i, val_real / FFT_BUFFER_SIZE, val_imag / FFT_BUFFER_SIZE); } printf("\n"); #endif } /* * Actually perform the FFT */ static void fft_calculate(float *re, float *im) { unsigned int i, j, k; unsigned int exchanges; float fact_real, fact_imag; float tmp_real, tmp_imag; unsigned int factfact; /* Set up some variables to reduce calculation in the loops */ exchanges = 1; factfact = FFT_BUFFER_SIZE / 2; /* Loop through the divide and conquer steps */ for (i = FFT_BUFFER_SIZE_LOG; i != 0; i--) { /* In this step, we have 2 ^ (i - 1) exchange groups, each with * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges */ /* Loop through the exchanges in a group */ for (j = 0; j != exchanges; j++) { /* Work out factor for this exchange * factor ^ (exchanges) = -1 * So, real = cos(j * PI / exchanges), * imag = sin(j * PI / exchanges) */ fact_real = costable[j * factfact]; fact_imag = sintable[j * factfact]; /* Loop through all the exchange groups */ for (k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { int k1 = k + exchanges; /* newval[k] := val[k] + factor * val[k1] * newval[k1] := val[k] - factor * val[k1] **/ #ifdef DEBUG printf("%d %d %d\n", i, j, k); printf("Exchange %d with %d\n", k, k1); printf("Factor %9f + i * %8f\n", fact_real, fact_imag); #endif /* FIXME - potential scope for more optimization here? */ tmp_real = fact_real * re[k1] - fact_imag * im[k1]; tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; re[k1] = re[k] - tmp_real; im[k1] = im[k] - tmp_imag; re[k] += tmp_real; im[k] += tmp_imag; #ifdef DEBUG for (k1 = 0; k1 < FFT_BUFFER_SIZE; k1++) { printf("%5d = %8f + i * %8f\n", k1, real[k1], imag[k1]); } #endif } } exchanges <<= 1; factfact >>= 1; } } static int reverseBits(unsigned int initial) { unsigned int reversed = 0, loop; for (loop = 0; loop < FFT_BUFFER_SIZE_LOG; loop++) { reversed <<= 1; reversed += (initial & 1); initial >>= 1; } return reversed; } qmmp-0.7.4/src/plugins/Ui/skinned/fft.h0000664000175000017500000000260712256224735016441 0ustar useruser/* fft.h: Header for iterative implementation of a FFT * Copyright (C) 1999 Richard Boulton * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _FFT_H_ #define _FFT_H_ #define FFT_BUFFER_SIZE_LOG 9 #define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) /* sound sample - should be an signed 16 bit value */ typedef short int sound_sample; #ifdef __cplusplus extern "C" { #endif /* FFT library */ typedef struct _struct_fft_state fft_state; fft_state *fft_init(void); void fft_perform(const sound_sample * input, float *output, fft_state * state); void fft_close(fft_state * state); #ifdef __cplusplus } #endif #endif /* _FFT_H_ */ qmmp-0.7.4/src/plugins/Ui/skinned/forms/0000775000175000017500000000000012256224735016632 5ustar useruserqmmp-0.7.4/src/plugins/Ui/skinned/forms/popupsettings.ui0000664000175000017500000001437712256224735022131 0ustar useruser PopupSettings 0 0 277 335 Popup Information Settings 6 6 6 Template 0 0 Qt::Horizontal 138 20 Reset Insert Show cover 0 Cover size: 32 128 1 16 Qt::Horizontal Transparency: 90 Qt::Horizontal 18 0 0 Delay: 20 7000 500 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok ms buttonBox accepted() PopupSettings accept() 281 286 62 299 buttonBox rejected() PopupSettings reject() 281 286 95 299 transparencySlider valueChanged(int) trasparencyLabel setNum(int) 258 251 282 251 coverSizeSlider valueChanged(int) coverSizeLabel setNum(int) 258 223 282 223 qmmp-0.7.4/src/plugins/Ui/skinned/forms/preseteditor.ui0000664000175000017500000000562112256224735021706 0ustar useruser PresetEditor 0 0 357 290 Preset Editor false 6 6 6 0 Preset 6 9 Auto-preset 6 9 QAbstractItemView::NoEditTriggers Load Delete QDialogButtonBox::Close buttonBox clicked(QAbstractButton*) PresetEditor accept() 269 235 298 192 qmmp-0.7.4/src/plugins/Ui/skinned/forms/shortcutdialog.ui0000664000175000017500000000613212256224735022226 0ustar useruser ShortcutDialog 0 0 310 99 Change Shortcut 6 6 6 Press the key combination you want to assign Qt::NoFocus true Qt::NoFocus Qt::NoContextMenu Clear Qt::Horizontal 106 20 Qt::NoFocus QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() ShortcutDialog accept() 212 70 192 269 buttonBox rejected() ShortcutDialog reject() 212 70 246 214 clearButton clicked() keyLineEdit clear() 195 22 113 25 qmmp-0.7.4/src/plugins/Ui/skinned/forms/skinnedsettings.ui0000664000175000017500000004405412256224735022414 0ustar useruser SkinnedSettings 0 0 447 391 Form 0 Skins true QListView::Static QListView::TopToBottom QListView::ListMode 0 0 0 Add... 0 0 Refresh Qt::Horizontal 40 20 View View Hide on close Start hidden Use skin cursors 0 0 Fonts 0 0 80 16777215 Player: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 QFrame::StyledPanel QFrame::Sunken ??? ... 0 0 80 16777215 Playlist: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 QFrame::StyledPanel QFrame::Sunken ??? ... Use bitmap font if available Transparency Main window 90 Qt::Horizontal 25 0 0 Equalizer 90 Qt::Horizontal 0 Playlist 90 Qt::Horizontal 0 Qt::Vertical 20 40 Miscellaneous Song Display Show protocol Show song numbers false Align song numbers Show anchor Show playlists Show popup information false Edit template Qt::Horizontal 40 20 Playlist separator: false 0 0 Qt::Horizontal 40 20 false Show 'New Playlist' button Qt::Vertical 20 144 mwTransparencySlider valueChanged(int) mwTransparencyLabel setNum(int) 385 284 393 283 eqTransparencySlider valueChanged(int) eqTransparencyLabel setNum(int) 385 310 416 310 plTransparencySlider valueChanged(int) plTransparencyLabel setNum(int) 373 334 395 334 popupCheckBox toggled(bool) popupTemplateButton setEnabled(bool) 172 238 117 270 numbersCheckBox toggled(bool) alignCheckBox setEnabled(bool) 148 103 151 118 playlistsCheckBox toggled(bool) plSeplineEdit setEnabled(bool) 201 161 266 215 playlistsCheckBox toggled(bool) showNewPLCheckBox setEnabled(bool) 95 162 95 181 qmmp-0.7.4/src/plugins/Ui/skinned/forms/playlistbrowser.ui0000664000175000017500000000601012256224735022433 0ustar useruser PlayListBrowser 0 0 402 298 Playlist Browser 6 9 6 6 6 QAbstractItemView::ExtendedSelection QAbstractItemView::SelectRows New Delete Qt::Horizontal QDialogButtonBox::Close ... true ... Qt::ToolButtonIconOnly true buttonBox accepted() PlayListBrowser accept() 248 254 157 274 buttonBox rejected() PlayListBrowser reject() 316 260 286 274 qmmp-0.7.4/src/plugins/Ui/skinned/forms/hotkeyeditor.ui0000664000175000017500000000271712256224735021712 0ustar useruser HotkeyEditor 0 0 406 365 Shortcuts true true Action Shortcut Change shortcut... Qt::Horizontal 262 20 qmmp-0.7.4/src/plugins/Ui/skinned/timeindicator.h0000664000175000017500000000463212256224735020515 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TIMEINDICATOR_H #define TIMEINDICATOR_H #include "pixmapwidget.h" class QMouseEvent; class QTimer; class Skin; /** Class TimeIndicator * @author Vladimir Kuznetsov * * Represents time indicator in the main display. Can show elapsed * and rest time of song (mouse press on indicator changes mode) */ class TimeIndicator : public PixmapWidget { Q_OBJECT public: TimeIndicator(QWidget *parent = 0); ~TimeIndicator(); void setTime ( int t ); void setSongDuration(int); void setNeedToShowTime(bool); protected: virtual void mousePressEvent(QMouseEvent*); virtual void mouseMoveEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); void writeSettings(); void readSettings(); private slots: void updateSkin(); void reset(); private: QPixmap m_pixmap; Skin *m_skin; int m_time; int m_songDuration; bool m_elapsed; bool m_needToShowTime; QTimer *m_timer; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqpreset.h0000664000175000017500000000346712256224735017517 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQPRESET_H #define EQPRESET_H #include /** @author Ilya Kotov */ class EQPreset : public QListWidgetItem { public: EQPreset(); ~EQPreset(); void setGain(int n, double value); void setPreamp(double); double gain(int n); double preamp(); private: double m_bands[10]; double m_preamp; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/titlebarcontrol.h0000664000175000017500000000406712256224735021073 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TITLEBARCONTROL_H #define TITLEBARCONTROL_H #include class QMouseEvent; /** @author Ilya Kotov */ class TitleBarControl : public QWidget { Q_OBJECT public: TitleBarControl(QWidget *parent = 0); ~TitleBarControl(); signals: void previousClicked(); void nextClicked(); void pauseClicked(); void playClicked(); void stopClicked(); void ejectClicked(); protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); private slots: void updateSkin(); private: int m_ratio; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/skinreader.cpp0000664000175000017500000001617612256224735020352 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "skinreader.h" SkinReader::SkinReader(QObject *parent) : QObject(parent) { m_process = new QProcess(this); //create cache dir QDir dir(QDir::homePath() +"/.qmmp/"); dir.mkdir("cache"); dir.cd("cache"); dir.mkdir("thumbs"); dir.mkdir("skin"); } SkinReader::~SkinReader() {} void SkinReader::generateThumbs() { m_previewMap.clear(); QDir dir(QDir::homePath() +"/.qmmp/skins"); dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = dir.entryInfoList(); #if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN) dir.setPath(qApp->applicationDirPath()+"/skins"); #else dir.setPath(qApp->applicationDirPath()+"/../share/qmmp/skins"); #endif dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); f << dir.entryInfoList(); QDir cache_dir(QDir::homePath() +"/.qmmp/cache/thumbs"); cache_dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList d = cache_dir.entryInfoList(); //clear removed skins from cache foreach(QFileInfo thumbFile, d) { bool del = true; foreach(QFileInfo fileInfo, f) { if (fileInfo.baseName () == thumbFile.baseName ()) { del = false; break; } } if (del) { qDebug("SkinReader: deleting %s from cache", qPrintable(thumbFile.fileName ())); cache_dir.remove(thumbFile.fileName ()); } } //add new skins to cache foreach(QFileInfo fileInfo, f) { bool create = true; foreach(QFileInfo thumbInfo, d) { if (fileInfo.baseName () == thumbInfo.baseName ()) { create = false; break; } } if (create) { qDebug("SkinReader: adding %s to cache", qPrintable(fileInfo.fileName ())); QString name = fileInfo.fileName ().toLower(); if (name.endsWith(".tgz") || name.endsWith(".tar.gz") || name.endsWith(".tar.bz2")) untar(fileInfo.filePath (), cache_dir.absolutePath (), true); if (name.endsWith(".zip") || name.endsWith(".wsz")) unzip(fileInfo.filePath (), cache_dir.absolutePath (), true); } } //add thumbs to map cache_dir.refresh(); d = cache_dir.entryInfoList(); foreach(QFileInfo fileInfo, f) { foreach(QFileInfo thumbInfo, d) { if (fileInfo.baseName () == thumbInfo.baseName ()) { m_previewMap.insert(fileInfo.absoluteFilePath (), thumbInfo.absoluteFilePath ()); break; } } } } void SkinReader::unpackSkin(const QString &path) { //remove old skin QDir dir(QDir::homePath() +"/.qmmp/cache/skin"); dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = dir.entryInfoList(); foreach(QFileInfo file, f) dir.remove(file.fileName()); //unpack if (path.endsWith(".tgz") || path.endsWith(".tar.gz") || path.endsWith(".tar.bz2")) untar(path, QDir::homePath() +"/.qmmp/cache/skin", false); if (path.endsWith(".zip") || path.endsWith(".wsz")) unzip(path, QDir::homePath() +"/.qmmp/cache/skin", false); } const QStringList SkinReader::skins() { return m_previewMap.keys(); } const QPixmap SkinReader::getPreview(const QString &skinPath) { return QPixmap(m_previewMap.value(skinPath)); } void SkinReader::untar(const QString &from, const QString &to, bool preview) { QByteArray array; QStringList args; //list archive args << "tf" <start("tar", args); m_process->waitForFinished(); array = m_process->readAllStandardOutput (); QString str = QString(array); QStringList outputList = str.split("\n", QString::SkipEmptyParts); foreach(QString str, outputList) { str = str.trimmed(); args.clear(); if (!preview || (str.contains("/main.", Qt::CaseInsensitive) || str.startsWith("main.", Qt::CaseInsensitive))) { args << "xvfk" << from << "-O" << str; m_process->start("tar", args); m_process->waitForStarted(); m_process->waitForFinished(); array = m_process->readAllStandardOutput (); QString name; if (preview) name = from.section('/',-1) + (".") + str.section('.', -1); else name = str.contains('/') ? str.section('/',-1).toLower() : str.toLower(); QFile file(to+"/"+name); file.open(QIODevice::WriteOnly); file.write(array); file.close(); } } } void SkinReader::unzip(const QString &from, const QString &to, bool preview) { QStringList args; if (preview) { args << "-C" << "-j" << "-o" << "-qq" << "-d" << to << from << "main.*" << "*/main.*"; QProcess::execute("unzip", args); QDir dir(to); dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList fileList = dir.entryInfoList(); foreach(QFileInfo thumbInfo, fileList) { if (thumbInfo.fileName().startsWith("main.", Qt::CaseInsensitive)) { dir.rename(thumbInfo.fileName(), from.section('/', -1) + "." + thumbInfo.suffix ()); } } } else { args << "-j" << "-o" << "-qq" << "-d" << to << from; QProcess::execute("unzip", args); } } qmmp-0.7.4/src/plugins/Ui/skinned/visualmenu.h0000664000175000017500000000370612256224735020053 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VISUALMENU_H #define VISUALMENU_H #include #include class VisualFactory; /** @author Ilya Kotov */ class VisualMenu : public QMenu { Q_OBJECT public: VisualMenu(QWidget *parent = 0); ~VisualMenu(); public slots: void updateActions(); }; class VisualAction : public QAction { Q_OBJECT public: VisualAction(VisualFactory *factory, QWidget *parent = 0); private slots: void select(bool); private: VisualFactory *m_factory; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/display.cpp0000664000175000017500000003141312256224735017657 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "skin.h" #include "mainvisual.h" #include "button.h" #include "titlebar.h" #include "positionbar.h" #include "number.h" #include "togglebutton.h" #include "symboldisplay.h" #include "textscroller.h" #include "monostereo.h" #include "playstatus.h" #include "volumebar.h" #include "balancebar.h" #include "mainwindow.h" #include "timeindicator.h" #include "actionmanager.h" #include "display.h" MainDisplay::MainDisplay (QWidget *parent) : PixmapWidget (parent) { m_shaded = false; m_skin = Skin::instance(); setPixmap (m_skin->getMain()); setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); m_mw = qobject_cast(parent); m_titlebar = new TitleBar(this); m_titlebar->move(0,0); m_titlebar->setActive(true); m_previous = new Button (this, Skin::BT_PREVIOUS_N, Skin::BT_PREVIOUS_P, Skin::CUR_NORMAL); m_previous->setToolTip(tr("Previous")); connect (m_previous, SIGNAL (clicked()), parent, SLOT (previous())); m_play = new Button (this, Skin::BT_PLAY_N, Skin::BT_PLAY_P, Skin::CUR_NORMAL); m_play->setToolTip(tr("Play")); connect (m_play, SIGNAL (clicked()),parent,SLOT (play())); m_pause = new Button (this, Skin::BT_PAUSE_N,Skin::BT_PAUSE_P, Skin::CUR_NORMAL); m_pause->setToolTip(tr("Pause")); connect (m_pause,SIGNAL (clicked()),parent,SLOT (pause())); m_stop = new Button (this, Skin::BT_STOP_N,Skin::BT_STOP_P, Skin::CUR_NORMAL); m_stop->setToolTip(tr("Stop")); connect (m_stop,SIGNAL (clicked()),parent,SLOT (stop())); m_next = new Button (this, Skin::BT_NEXT_N,Skin::BT_NEXT_P, Skin::CUR_NORMAL); m_next->setToolTip(tr("Next")); connect (m_next,SIGNAL (clicked()),parent,SLOT (next())); m_eject = new Button (this, Skin::BT_EJECT_N,Skin::BT_EJECT_P, Skin::CUR_NORMAL); m_eject->setToolTip(tr("Add file")); connect (m_eject,SIGNAL (clicked()),parent,SLOT (addFile())); connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); m_vis = new MainVisual (this); m_eqButton = new ToggleButton (this,Skin::BT_EQ_ON_N,Skin::BT_EQ_ON_P, Skin::BT_EQ_OFF_N,Skin::BT_EQ_OFF_P); m_eqButton->setToolTip(tr("Equalizer")); m_plButton = new ToggleButton (this,Skin::BT_PL_ON_N,Skin::BT_PL_ON_P, Skin::BT_PL_OFF_N,Skin::BT_PL_OFF_P); m_plButton->setToolTip(tr("Playlist")); m_repeatButton = new ToggleButton (this,Skin::REPEAT_ON_N,Skin::REPEAT_ON_P, Skin::REPEAT_OFF_N,Skin::REPEAT_OFF_P); connect(m_repeatButton,SIGNAL(clicked(bool)),this,SIGNAL(repeatableToggled(bool))); m_repeatButton->setToolTip(tr("Repeat playlist")); m_shuffleButton = new ToggleButton (this,Skin::SHUFFLE_ON_N,Skin::SHUFFLE_ON_P, Skin::SHUFFLE_OFF_N,Skin::SHUFFLE_OFF_P); m_shuffleButton->setToolTip(tr("Shuffle")); connect(m_shuffleButton,SIGNAL(clicked(bool)),this,SIGNAL(shuffleToggled(bool))); m_kbps = new SymbolDisplay(this,3); m_freq = new SymbolDisplay(this,2); m_text = new TextScroller (this); m_monoster = new MonoStereo (this); m_playstatus = new PlayStatus(this); m_volumeBar = new VolumeBar(this); m_volumeBar->setToolTip(tr("Volume")); connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); connect(m_volumeBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); connect(m_volumeBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); m_balanceBar = new BalanceBar(this); m_balanceBar->setToolTip(tr("Balance")); connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); connect(m_balanceBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); connect(m_balanceBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); m_posbar = new PositionBar(this); connect(m_posbar, SIGNAL(sliderPressed()),SLOT(showPosition())); connect(m_posbar, SIGNAL(sliderMoved(qint64)),SLOT(showPosition())); connect(m_posbar, SIGNAL(sliderReleased()),SLOT(updatePosition())); m_timeIndicator = new TimeIndicator(this); m_aboutWidget = new QWidget(this); m_core = SoundCore::instance(); connect(m_core, SIGNAL(elapsedChanged(qint64)), SLOT(setTime(qint64))); connect(m_core, SIGNAL(bitrateChanged(int)), m_kbps, SLOT(display(int))); connect(m_core, SIGNAL(frequencyChanged(quint32)), SLOT(setSampleRate(quint32))); connect(m_core, SIGNAL(channelsChanged(int)), m_monoster, SLOT(setChannels(int))); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(setState(Qmmp::State))); connect(m_core, SIGNAL(volumeChanged(int,int)), SLOT(setVolume(int, int))); connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64))); PlayListManager *pl_manager = MediaPlayer::instance()->playListManager(); connect(pl_manager, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setChecked(bool))); connect(pl_manager, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setChecked(bool))); updatePositions(); updateMask(); } MainDisplay::~MainDisplay() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Skinned/pl_visible",m_plButton->isChecked()); settings.setValue ("Skinned/eq_visible",m_eqButton->isChecked()); } void MainDisplay::updatePositions() { int r = m_skin->ratio(); m_previous->move (r*16, r*88); m_play->move (r*39, r*88); m_pause->move (r*62, r*88); m_vis->move(r*24, r*43); m_stop->move (r*85, r*88); m_next->move (r*108, r*88); m_eject->move (r*136, r*89); m_posbar->move (r*16, r*72); m_eqButton->move (r*219, r*58); m_plButton->move (r*241, r*58); m_repeatButton->move (r*210, r*89); m_shuffleButton->move (r*164, r*89); m_kbps->move (r*111, r*43); m_freq->move (r*156, r*43); m_text->resize (r*154, r*15); m_text->move (r*109, r*23); m_monoster->move (r*212, r*41); m_playstatus->move(r*24, r*28); m_volumeBar->move(r*107, r*57); m_balanceBar->move(r*177, r*57); m_timeIndicator->move(r*34, r*26); m_aboutWidget->setGeometry(r*247,r*83,r*20,r*25); } void MainDisplay::setTime (qint64 t) { m_posbar->setValue (t); m_timeIndicator->setTime(t/1000); } void MainDisplay::setDuration(qint64 t) { m_posbar->setMaximum (t); m_timeIndicator->setSongDuration(t/1000); } void MainDisplay::setState(Qmmp::State state) { switch ((int) state) { case Qmmp::Playing: m_playstatus->setStatus(PlayStatus::PLAY); m_timeIndicator->setNeedToShowTime(true); setDuration(m_core->totalTime()); break; case Qmmp::Paused: m_playstatus->setStatus(PlayStatus::PAUSE); break; case Qmmp::Stopped: m_playstatus->setStatus(PlayStatus::STOP); m_monoster->setChannels (0); m_timeIndicator->setNeedToShowTime(false); m_posbar->setValue (0); m_posbar->setMaximum (0); m_titlebar->setTime(-1); } } void MainDisplay::setVolume(int left, int right) { int maxVol = qMax(left, right); m_volumeBar->setValue(maxVol); if (maxVol && !m_volumeBar->isPressed()) m_balanceBar->setValue((right - left) * 100/maxVol); } void MainDisplay::updateSkin() { setPixmap (m_skin->getMain()); m_mw->resize(size()); setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); setMinimalMode(m_shaded); updatePositions(); } void MainDisplay::updateMask() { m_mw->clearMask(); m_mw->setMask(QRegion(0,0,m_mw->width(),m_mw->height())); QRegion region = m_skin->getRegion(m_shaded? Skin::WINDOW_SHADE : Skin::NORMAL); if (!region.isEmpty()) m_mw->setMask(region); } void MainDisplay::setMinimalMode(bool b) { m_shaded = b; int r = m_skin->ratio(); if(m_shaded) m_mw->resize(r*275,r*14); else m_mw->resize(r*275,r*116); updateMask(); } void MainDisplay::setActive(bool b) { m_titlebar->setActive(b); } void MainDisplay::setSampleRate(quint32 rate) { m_freq->display((int) rate/1000); } //TODO optimize this connections void MainDisplay::setEQ (QWidget* w) { m_equlizer = w; m_eqButton->setChecked (m_equlizer->isVisible()); ACTION(ActionManager::SHOW_EQUALIZER)->setChecked(m_equlizer->isVisible()); connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), m_equlizer, SLOT (setVisible (bool))); connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), m_eqButton, SLOT (setChecked (bool))); connect (m_eqButton, SIGNAL(clicked(bool)), ACTION(ActionManager::SHOW_EQUALIZER), SLOT(setChecked (bool))); connect (m_eqButton, SIGNAL(clicked(bool)), m_equlizer, SLOT (setVisible (bool))); connect (m_equlizer, SIGNAL(closed ()), m_eqButton, SLOT (click())); } void MainDisplay::setPL (QWidget* w) { m_playlist = w; m_plButton->setChecked (m_playlist->isVisible()); ACTION(ActionManager::SHOW_PLAYLIST)->setChecked(m_playlist->isVisible()); connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), m_playlist, SLOT (setVisible (bool))); connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), m_plButton, SLOT (setChecked (bool))); connect (m_plButton, SIGNAL(clicked(bool)), ACTION(ActionManager::SHOW_PLAYLIST), SLOT(setChecked (bool))); connect (m_plButton, SIGNAL (clicked (bool)), m_playlist, SLOT (setVisible (bool))); connect (m_playlist, SIGNAL (closed ()), m_plButton, SLOT (click())); } bool MainDisplay::isPlaylistVisible() const { return m_plButton->isChecked(); } bool MainDisplay::isEqualizerVisible() const { return m_eqButton->isChecked(); } void MainDisplay::updateVolume() { if(sender() == m_volumeBar) m_text->setText(tr("Volume: %1%").arg(m_volumeBar->value())); if(sender() == m_balanceBar) { if(m_balanceBar->value() > 0) m_text->setText(tr("Balance: %1% right").arg(m_balanceBar->value())); else if(m_balanceBar->value() < 0) m_text->setText(tr("Balance: %1% left").arg(-m_balanceBar->value())); else m_text->setText(tr("Balance: center")); } m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); } void MainDisplay::showPosition() { int sec = m_posbar->value() / 1000; if(sec >= 3600) sec /= 60; QString time = QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); m_text->setText(tr("Seek to: %1").arg(time)); } void MainDisplay::updatePosition() { m_text->clear(); m_core->seek(m_posbar->value()); } void MainDisplay::wheelEvent (QWheelEvent *e) { m_mw->setVolume(m_volumeBar->value()+e->delta()/10, m_balanceBar->value()); } bool MainDisplay::isRepeatable() const { return m_repeatButton->isChecked(); } bool MainDisplay::isShuffle() const { return m_shuffleButton->isChecked(); } void MainDisplay::setIsRepeatable(bool yes) { m_repeatButton->setChecked(yes); } void MainDisplay::setIsShuffle(bool yes) { m_shuffleButton->setChecked(yes); } void MainDisplay::mousePressEvent(QMouseEvent *e) { if (e->button() == Qt::RightButton) m_mw->menu()->exec(e->globalPos()); else if(e->button() == Qt::LeftButton && m_aboutWidget->underMouse()) m_mw->about(); PixmapWidget::mousePressEvent(e); } qmmp-0.7.4/src/plugins/Ui/skinned/togglebutton.h0000664000175000017500000000420712256224735020375 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TOGGLEBUTTON_H #define TOGGLEBUTTON_H #include "pixmapwidget.h" /** @author Ilya Kotov */ class Skin; class ToggleButton : public PixmapWidget { Q_OBJECT public: ToggleButton( QWidget *parent, uint on_n, uint on_p, uint off_n, uint off_p ); ~ToggleButton(); bool isChecked(); public slots: void setChecked(bool); void click(); signals: void clicked(bool); private slots: void updateSkin(); private: Skin *skin; bool m_cursorin, m_old_on; uint m_on_n, m_on_p, m_off_n, m_off_p; bool m_on; protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/CMakeLists.txt0000664000175000017500000000712512256224735020251 0ustar useruserproject(skinned) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmpui & libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # X11 include_directories(${X11_INCLUDE_DIRS}) link_directories(${X11_LIBRARY_DIRS}) ADD_DEFINITIONS(${X11_CFLAGS}) SET(skinned_SRCS fft.c balancebar.cpp button.cpp skinnedsettings.cpp display.cpp dock.cpp eqgraph.cpp eqpreset.cpp eqslider.cpp eqtitlebar.cpp eqwidget.cpp keyboardmanager.cpp listwidget.cpp mainvisual.cpp mainwindow.cpp monostereo.cpp number.cpp pixmapwidget.cpp playlistcontrol.cpp playlist.cpp playlistslider.cpp playlisttitlebar.cpp playstatus.cpp positionbar.cpp preseteditor.cpp shadedbar.cpp shadedvisual.cpp skin.cpp skinreader.cpp symboldisplay.cpp textscroller.cpp timeindicator.cpp titlebarcontrol.cpp titlebar.cpp togglebutton.cpp visualmenu.cpp volumebar.cpp cursorimage.cpp playlistbrowser.cpp playlistselector.cpp popupwidget.cpp popupsettings.cpp windowsystem.cpp actionmanager.cpp shortcutitem.cpp shortcutdialog.cpp skinnedfactory.cpp hotkeyeditor.cpp ) SET(skinned_HDRS eqpreset.h fft.h inlines.h keyboardmanager.h cursorimage.h windowsystem.h shortcutitem.h ) SET(skinned_MOC_HDRS balancebar.h button.h skinnedsettings.h display.h dock.h eqgraph.h eqslider.h eqtitlebar.h eqwidget.h listwidget.h mainvisual.h mainwindow.h monostereo.h number.h pixmapwidget.h playlistcontrol.h playlist.h playlistslider.h playlisttitlebar.h playstatus.h positionbar.h preseteditor.h shadedbar.h shadedvisual.h skin.h skinreader.h symboldisplay.h textscroller.h timeindicator.h titlebarcontrol.h titlebar.h togglebutton.h visualmenu.h volumebar.h playlistbrowser.h playlistselector.h popupwidget.h popupsettings.h actionmanager.h shortcutdialog.h skinnedfactory.h hotkeyeditor.h ) SET(skinned_RCCS default/default.qrc resources/resources.qrc translations/translations.qrc) QT4_ADD_RESOURCES(skinned_RCC_SRCS ${skinned_RCCS}) QT4_AUTOMOC(${skinned_MOC_SRC}) QT4_WRAP_CPP(skinned_MOC_SRCS ${skinned_MOC_HDRS}) # user interface SET(skinned_UIS forms/skinnedsettings.ui forms/preseteditor.ui forms/playlistbrowser.ui forms/popupsettings.ui forms/shortcutdialog.ui forms/hotkeyeditor.ui ) QT4_WRAP_UI(skinned_UIS_H ${skinned_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(X11_FOUND) ADD_LIBRARY(skinned MODULE ${skinned_SRCS} ${skinned_MOC_SRCS} ${skinned_UIS_H} ${skinned_RCC_SRCS} ${skinned_HDRS}) target_link_libraries(skinned ${QT_LIBRARIES} libqmmp qmmpui ${X11_LDFLAGS}) add_dependencies(skinned qmmpui libqmmp) target_link_libraries(skinned ${QT_LIBRARIES} -lqmmpui -lqmmp ${X11_LDFLAGS}) install(TARGETS skinned DESTINATION ${LIB_DIR}/qmmp/Ui) ENDIF(X11_FOUND) qmmp-0.7.4/src/plugins/Ui/skinned/eqtitlebar.h0000664000175000017500000000463112256224735020015 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQTITLEBAR_H #define EQTITLEBAR_H #include "pixmapwidget.h" class QMouseEvent; class Skin; class MainWindow; class Button; class ShadedBar; /** @author Ilya Kotov */ class EqTitleBar : public PixmapWidget { Q_OBJECT public: EqTitleBar(QWidget *parent = 0); ~EqTitleBar(); void setActive(bool); public slots: void setVolume(int left, int right); private slots: void shade(); void updateVolume(); void updateSkin(); private: void updatePositions(); Skin* m_skin; bool m_active; int m_left; int m_right; QPoint m_pos; QWidget* m_eq; MainWindow* m_mw; Button* m_close; Button* m_shade; Button* m_shade2; bool m_shaded, m_align; ShadedBar* m_volumeBar; ShadedBar* m_balanceBar; protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void mouseDoubleClickEvent (QMouseEvent *); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/monostereo.h0000664000175000017500000000352412256224735020053 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MONOSTEREO_H #define MONOSTEREO_H #include "pixmapwidget.h" class Skin; /** @author Ilya Kotov */ class MonoStereo : public PixmapWidget { Q_OBJECT public: MonoStereo(QWidget *parent = 0); ~MonoStereo(); public slots: void setChannels(int); private slots: void updateSkin(); private: Skin *m_skin; QPixmap m_pixmap; int m_channels; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/skinnedsettings.h0000664000175000017500000000450012256224735021070 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SKINNEDSETTINGS_H #define SKINNEDSETTINGS_H #include #include #include "ui_skinnedsettings.h" class SkinReader; class Skin; class SkinnedSettings : public QWidget { Q_OBJECT public: explicit SkinnedSettings(QWidget *parent = 0); virtual ~SkinnedSettings(); void writeSettings(); private slots: void on_listWidget_itemClicked(QListWidgetItem *); void on_plFontButton_clicked(); void on_mainFontButton_clicked(); void on_skinInstallButton_clicked(); void loadSkins(); void on_popupTemplateButton_clicked(); private: void showEvent(QShowEvent *); void loadFonts(); void findSkins(const QString &path); void readSettings(); Ui::SkinnedSettings ui; QList m_skinList; QString m_currentSkinName; Skin *m_skin; QPixmap pixmap; SkinReader *m_reader; }; #endif // SKINNEDSETTINGS_H qmmp-0.7.4/src/plugins/Ui/skinned/actionmanager.h0000664000175000017500000000650412256224735020472 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ACTIONMANAGER_H #define ACTIONMANAGER_H #include #include #include class QAction; class QSettings; #define SET_ACTION(type, receiver, member) ActionManager::instance()->use(type, receiver, member) #define ACTION(type) ActionManager::instance()->action(type) /** @author Ilya Kotov */ class ActionManager : public QObject { Q_OBJECT public: explicit ActionManager(QObject *parent = 0); ~ActionManager(); enum Type { PLAY = 0, PAUSE, STOP, PREVIOUS, NEXT, PLAY_PAUSE, JUMP, REPEAT_ALL, REPEAT_TRACK, SHUFFLE, NO_PL_ADVANCE, STOP_AFTER_SELECTED, CLEAR_QUEUE, SHOW_PLAYLIST, SHOW_EQUALIZER, WM_ALLWAYS_ON_TOP, WM_STICKY, WM_DOUBLE_SIZE, PL_ADD_FILE, PL_ADD_DIRECTORY, PL_ADD_URL, PL_REMOVE_SELECTED, PL_REMOVE_ALL, PL_REMOVE_UNSELECTED, PL_REMOVE_INVALID, PL_REMOVE_DUPLICATES, PL_ENQUEUE, PL_INVERT_SELECTION, PL_CLEAR_SELECTION, PL_SELECT_ALL, PL_SHOW_INFO, PL_NEW, PL_CLOSE, PL_LOAD, PL_SAVE, PL_SELECT_NEXT, PL_SELECT_PREVIOUS, PL_SHOW_MANAGER, SETTINGS, ABOUT, ABOUT_QT, QUIT }; QAction *action(int type); QAction *use(int type, const QObject *receiver, const char *member); QList actions(); void saveActions(); static ActionManager* instance(); private: QAction *createAction(QString name, QString confKey, QString key, QString iconName = QString()); QAction *createAction2(QString name, QString confKey, QString key); QSettings *m_settings; QHash m_actions; static ActionManager *m_instance; }; #endif // ACTIONMANAGER_H qmmp-0.7.4/src/plugins/Ui/skinned/hotkeyeditor.h0000664000175000017500000000351012256224735020366 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef HOTKEYEDITOR_H #define HOTKEYEDITOR_H #include namespace Ui { class HotkeyEditor; } class HotkeyEditor : public QWidget { Q_OBJECT public: explicit HotkeyEditor(QWidget *parent = 0); virtual ~HotkeyEditor(); private slots: void on_changeShortcutButton_clicked(); private: void loadShortcuts(); Ui::HotkeyEditor *m_ui; }; #endif // HOTKEYEDITOR_H qmmp-0.7.4/src/plugins/Ui/skinned/listwidget.cpp0000664000175000017500000004267312256224735020403 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "listwidget.h" #include "skin.h" #include "popupwidget.h" #include "playlist.h" #define INVALID_ROW -1 ListWidget::ListWidget(QWidget *parent) : QWidget(parent) { m_update = false; m_skin = Skin::instance(); m_popupWidget = 0; m_metrics = 0; m_extra_metrics = 0; loadColors(); m_menu = new QMenu(this); m_scroll_direction = NONE; m_prev_y = 0; m_anchor_row = INVALID_ROW; m_player = MediaPlayer::instance(); connect (m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateList())); m_first = 0; m_rows = 0; m_scroll = false; m_select_on_release = false; readSettings(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setAcceptDrops(true); setMouseTracking(true); m_timer = new QTimer(this); m_timer->setInterval(50); connect(m_timer, SIGNAL(timeout()), SLOT(autoscroll())); } ListWidget::~ListWidget() { if(m_metrics) delete m_metrics; if(m_extra_metrics) delete m_extra_metrics; } void ListWidget::readSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); m_font.fromString(settings.value("pl_font", QApplication::font().toString()).toString()); m_extra_font = m_font; m_extra_font.setPointSize(m_font.pointSize() - 1); m_show_protocol = settings.value ("pl_show_protocol", false).toBool(); m_show_number = settings.value ("pl_show_numbers", true).toBool(); m_align_numbres = settings.value ("pl_align_numbers", false).toBool(); m_show_anchor = settings.value("pl_show_anchor", false).toBool(); bool show_popup = settings.value("pl_show_popup", false).toBool(); if (m_update) { delete m_metrics; delete m_extra_metrics; m_metrics = new QFontMetrics(m_font); m_extra_metrics = new QFontMetrics(m_extra_font); m_rows = height() / (m_metrics->lineSpacing() + 2); updateList(); if(m_popupWidget) { m_popupWidget->deleteLater(); m_popupWidget = 0; } } else { m_update = true; m_metrics = new QFontMetrics(m_font); m_extra_metrics = new QFontMetrics(m_extra_font); } if(show_popup) m_popupWidget = new PlayListPopup::PopupWidget(this); } void ListWidget::loadColors() { m_normal.setNamedColor(m_skin->getPLValue("normal")); m_current.setNamedColor(m_skin->getPLValue("current")); m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); } void ListWidget::paintEvent(QPaintEvent *) { QPainter painter(this); painter.setFont(m_font); painter.setBrush(QBrush(m_normal_bg)); painter.drawRect(-1,-1,width()+1,height()+1); #if QT_VERSION >= 0x040700 painter.setLayoutDirection(Qt::LayoutDirectionAuto); #endif bool rtl = (layoutDirection() == Qt::RightToLeft); int sx = 0, sy = 0; for (int i = 0; i < m_titles.size(); ++i ) { if (m_show_anchor && i == m_anchor_row - m_first) { painter.setBrush(m_model->isSelected(i + m_first) ? m_selected_bg : m_normal_bg); painter.setPen(m_normal); painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), width() - 10, m_metrics->lineSpacing() + 1); } else { if (m_model->isSelected(i + m_first)) { painter.setBrush(QBrush(m_selected_bg)); painter.setPen(m_selected_bg); painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), width() - 10, m_metrics->lineSpacing() + 1); } } if (m_model->currentIndex() == i + m_first) painter.setPen(m_current); else painter.setPen(m_normal); //243,58 sy = (i + 1) * (2 + m_metrics->lineSpacing()) - 2 - m_metrics->descent(); if(m_number_width) { QString number = QString("%1").arg(m_first+i+1); sx = 10 + m_number_width - m_metrics->width(number); if(rtl) sx = width() - sx - m_metrics->width(number); painter.drawText(sx, sy, number); sx = 10 + m_number_width + m_metrics->width("9"); if(rtl) sx = width() - sx - m_metrics->width(m_titles.at(i)); painter.drawText(sx, sy, m_titles.at(i)); } else { sx = rtl ? width() - 10 - m_metrics->width(m_titles.at(i)) : 10; painter.drawText(sx, sy, m_titles.at(i)); } QString extra_string = getExtraString(m_first + i); if(!extra_string.isEmpty()) { painter.setFont(m_extra_font); if(m_times.at(i).isEmpty()) { sx = rtl ? 7 : width() - 7 - m_extra_metrics->width(extra_string); painter.drawText(sx, sy, extra_string); } else { sx = width() - 10 - m_extra_metrics->width(extra_string) - m_metrics->width(m_times.at(i)); if(rtl) sx = width() - sx - m_extra_metrics->width(extra_string); painter.drawText(sx, sy, extra_string); } painter.setFont(m_font); } sx = rtl ? 7 : width() - 7 - m_metrics->width(m_times.at(i)); painter.drawText(sx, sy, m_times.at(i)); } //draw line if(m_number_width) { painter.setPen(m_normal); sx = rtl ? width() - 10 - m_number_width - m_metrics->width("9")/2 - 1 : 10 + m_number_width + m_metrics->width("9")/2 - 1; painter.drawLine(sx, 2, sx, sy); } } void ListWidget::mouseDoubleClickEvent (QMouseEvent *e) { int y = e->y(); int row = rowAt(y); if (INVALID_ROW != row) { m_model->setCurrent(row); emit selectionChanged(); update(); } } void ListWidget::mousePressEvent(QMouseEvent *e) { if(m_popupWidget) m_popupWidget->hide(); m_scroll = true; int y = e->y(); int row = rowAt(y); if (INVALID_ROW != row && m_model->count() > row) { m_pressed_row = row; if(e->button() == Qt::RightButton && !m_model->isSelected(row)) { m_model->clearSelection(); m_model->setSelected(row, true); m_anchor_row = m_pressed_row; QWidget::mousePressEvent(e); return; } if (m_model->isSelected(row) && (e->modifiers() == Qt::NoModifier)) { m_select_on_release = true; QWidget::mousePressEvent(e); return; } if ((Qt::ShiftModifier & e->modifiers())) { bool select = true; if (m_pressed_row > m_anchor_row) { for (int j = m_anchor_row;j <= m_pressed_row;j++) { m_model->setSelected(j, select); } } else { for (int j = m_anchor_row;j >= m_pressed_row;j--) { m_model->setSelected(j, select); } } m_anchor_row = m_pressed_row; } else //ShiftModifier released { if ((Qt::ControlModifier & e->modifiers())) { m_model->setSelected(row, !m_model->isSelected(row)); } else //ControlModifier released { m_model->clearSelection(); m_model->setSelected(row, true); } m_anchor_row = m_pressed_row; } update(); } QWidget::mousePressEvent(e); } void ListWidget::resizeEvent(QResizeEvent *e) { m_rows = e->size().height() / (m_metrics->lineSpacing() + 2); m_scroll = true; updateList(); QWidget::resizeEvent(e); } void ListWidget::wheelEvent (QWheelEvent *e) { if (m_model->count() <= m_rows) return; if ((m_first == 0 && e->delta() > 0) || ((m_first == m_model->count() - m_rows) && e->delta() < 0)) return; m_first -= e->delta()/40; //40*3 TODO: add step to config if (m_first < 0) m_first = 0; if (m_first > m_model->count() - m_rows) m_first = m_model->count() - m_rows; m_scroll = false; updateList(); } bool ListWidget::event (QEvent *e) { if(m_popupWidget) { if(e->type() == QEvent::ToolTip) { QHelpEvent *helpEvent = (QHelpEvent *) e; int row = rowAt(helpEvent->y()); if(row < 0) { m_popupWidget->deactivate(); return QWidget::event(e); } e->accept(); m_popupWidget->prepare(m_model->item(row), helpEvent->globalPos()); return true; } else if(e->type() == QEvent::Leave) m_popupWidget->deactivate(); } return QWidget::event(e); } void ListWidget::updateList() { if (m_model->count() < (m_rows+m_first+1) && m_rows< m_model->count()) { m_first = m_model->count() - m_rows; } if (m_model->count() < m_rows + 1) { m_first = 0; emit positionChanged(0,0); } else emit positionChanged(m_first, m_model->count() - m_rows); if (m_model->count() <= m_first) { m_first = 0; emit positionChanged(0, qMax(0, m_model->count() - m_rows)); } m_titles = m_model->getTitles(m_first, m_rows); m_times = m_model->getTimes(m_first, m_rows); m_scroll = false; //add numbers for (int i = 0; i < m_titles.size() && m_show_number && !m_align_numbres; ++i) { QString title = m_titles.at(i); m_titles.replace(i, title.prepend(QString("%1").arg(m_first+i+1)+". ")); } //song numbers width if(m_show_number && m_align_numbres && m_model->count()) { m_number_width = m_metrics->width("9") * QString::number(m_model->count()).size(); } else m_number_width = 0; //elide title QString extra_string; for (int i=0; iwidth(extra_string); if(m_number_width) extra_string_space += m_number_width + m_metrics->width("9"); m_titles.replace(i, m_metrics->elidedText (m_titles.at(i), Qt::ElideRight, width() - m_metrics->width(m_times.at(i)) - 22 - extra_string_space)); } update(); } void ListWidget::autoscroll() { SimpleSelection sel = m_model->getSelection(m_pressed_row); if ((sel.m_top == 0 && m_scroll_direction == TOP && sel.count() > 1) || (sel.m_bottom == m_model->count() - 1 && m_scroll_direction == DOWN && sel.count() > 1)) return; if(m_scroll_direction == DOWN) { int row = m_first + m_rows; (m_first + m_rows < m_model->count()) ? m_first ++ : m_first; m_model->moveItems(m_pressed_row,row); m_pressed_row = row; } else if(m_scroll_direction == TOP && m_first > 0) { m_first --; m_model->moveItems(m_pressed_row, m_first); m_pressed_row = m_first; } } void ListWidget::setModel(PlayListModel *selected, PlayListModel *previous) { if(previous) disconnect(previous, 0, this, 0); //disconnect previous model qApp->processEvents(); m_model = selected; m_first = 0; m_scroll = false; recenterCurrent(); updateList(); connect (m_model, SIGNAL(currentChanged()), SLOT(recenterCurrent())); connect (m_model, SIGNAL(listChanged()), SLOT(updateList())); } void ListWidget::scroll(int sc) { if (m_model->count() <= m_rows) return; m_first = sc; //*(m_model->count() - m_rows)/99; m_scroll = true; updateList(); } void ListWidget::updateSkin() { loadColors(); update(); } void ListWidget::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasFormat("text/uri-list")) event->acceptProposedAction(); } void ListWidget::dropEvent(QDropEvent *event) { if (event->mimeData()->hasUrls()) { QList list_urls = event->mimeData()->urls(); event->acceptProposedAction(); QApplication::restoreOverrideCursor(); foreach(QUrl u, list_urls) { if(u.scheme() == "file") m_model->add(QFileInfo(u.toLocalFile()).absoluteFilePath()); else m_model->add(u.toString()); } } } const QString ListWidget::getExtraString(int i) { QString extra_string; if (m_show_protocol && m_model->item(i)->url().contains("://")) extra_string = "[" + m_model->item(i)->url().split("://").at(0) + "]"; if (m_model->isQueued(m_model->item(i))) { int index = m_model->queuedIndex(m_model->item(i)); extra_string += "|"+QString::number(index + 1)+"|"; } if(m_model->currentIndex() == i && m_player->isRepeatable()) extra_string += "|R|"; else if(m_model->isStopAfter(m_model->item(i))) extra_string += "|S|"; extra_string = extra_string.trimmed(); //remove white space if(!extra_string.isEmpty()) extra_string.prepend(" "); return extra_string; } void ListWidget::mouseMoveEvent(QMouseEvent *e) { if(e->buttons() == Qt::LeftButton) { m_scroll = true; if (m_prev_y > e->y()) m_scroll_direction = TOP; else if (m_prev_y < e->y()) m_scroll_direction = DOWN; else m_scroll_direction = NONE; if(e->y() < 0 || e->y() > height()) { if(!m_timer->isActive()) m_timer->start(); return; } m_timer->stop(); int row = rowAt(e->y()); if (INVALID_ROW != row) { SimpleSelection sel = m_model->getSelection(m_pressed_row); if(sel.count() > 1 && m_scroll_direction == TOP) { if(sel.m_top == 0 || sel.m_top == m_first) return; } else if(sel.count() > 1 && m_scroll_direction == DOWN) { if(sel.m_bottom == m_model->count() - 1 || sel.m_bottom == m_first + m_rows) return; } m_model->moveItems(m_pressed_row,row); m_prev_y = e->y(); m_scroll = false; m_pressed_row = row; m_anchor_row = row; } } else if(m_popupWidget) { int row = rowAt(e->y()); if(row < 0 || m_popupWidget->url() != m_model->item(row)->url()) m_popupWidget->deactivate(); } } void ListWidget::mouseReleaseEvent(QMouseEvent *e) { if (m_select_on_release) { m_model->clearSelection(); m_model->setSelected(m_pressed_row,true); m_anchor_row = m_pressed_row; m_select_on_release = false; } m_pressed_row = INVALID_ROW; m_scroll_direction = NONE; m_timer->stop(); m_scroll = false; QWidget::mouseReleaseEvent(e); } int ListWidget::rowAt(int y) const { for (int i = 0; i < qMin(m_rows, m_model->count() - m_first); ++i) { if ((y >= i * (m_metrics->lineSpacing() + 2)) && (y <= (i+1) * (m_metrics->lineSpacing() + 2))) return m_first + i; } return INVALID_ROW; } void ListWidget::contextMenuEvent(QContextMenuEvent * event) { if (menu()) menu()->exec(event->globalPos()); } void ListWidget::recenterCurrent() { if (!m_scroll && m_rows) { if (m_first + m_rows < m_model->currentIndex() + 1) m_first = qMin(m_model->count() - m_rows, m_model->currentIndex() - m_rows/2); else if (m_first > m_model->currentIndex()) m_first = qMax (m_model->currentIndex() - m_rows/2, 0); } } qmmp-0.7.4/src/plugins/Ui/skinned/shadedbar.h0000664000175000017500000000471012256224735017574 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SHADEDBAR_H #define SHADEDBAR_H #include class QMouseEvent; class QPaintEvent; class Skin; /** @author Ilya Kotov */ class ShadedBar : public QWidget { Q_OBJECT public: ShadedBar(QWidget *parent = 0, uint slider1 = 0, uint slider2 = 0, uint slider3 = 0); ~ShadedBar(); int value() { return m_value; } int isPressed() { return m_moving; } void setRange(int min, int max); public slots: void setValue(int); signals: void sliderMoved (int); private slots: void updateSkin(); private: Skin *m_skin; bool m_moving; int press_pos; int m_max, m_min, m_pos, m_value, m_old, m_x; QPixmap m_pixmap; int convert(int); // value = convert(position); void draw(); uint m_slider1, m_slider2, m_slider3; int m_ratio; protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void paintEvent(QPaintEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playlisttitlebar.h0000664000175000017500000000517712256224735021257 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTTITLEBAR_H #define PLAYLISTTITLEBAR_H #include "playlist.h" #include "pixmapwidget.h" #include "mainwindow.h" /** @author Ilya Kotov */ class Skin; class MainWindow; class Button; class PlayListModel; class PlayListTitleBar : public PixmapWidget { Q_OBJECT public: PlayListTitleBar(QWidget *parent = 0); ~PlayListTitleBar(); void setActive(bool); void readSettings(); public slots: void showCurrent(); void setModel(PlayListModel *selected, PlayListModel *previous = 0); private slots: void updateSkin(); void shade(); private: void updatePositions(); void updatePixmap(); Skin *m_skin; QPoint pos; bool m_active; PlayList* m_pl; MainWindow* m_mw; Button* m_close; Button* m_shade; Button* m_shade2; bool m_shaded; bool m_align, m_resize; int m_ratio; int m_height; PlayListModel* m_model; QString m_text; QString m_truncatedText; QFont m_font; protected: void resizeEvent(QResizeEvent*); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void mouseDoubleClickEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/skinnedfactory.cpp0000664000175000017500000000542712256224735021243 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "mainwindow.h" #include "skinnedfactory.h" const UiProperties SkinnedFactory::properties() const { UiProperties props; props.hasAbout = true; props.name = tr("Skinned User Interface"); props.shortName = "skinned"; return props; } QObject *SkinnedFactory::SkinnedFactory::create() { QmmpSettings::instance()->readEqSettings(EqSettings::EQ_BANDS_10); return new MainWindow(); } void SkinnedFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Qmmp Skinned User Interface"), tr("Qmmp Skinned User Interface")+"\n"+ tr("Simple user interface with Winamp-2.x/XMMS skins support") + "\n" + tr("Written by:\n" "Vladimir Kuznetsov \n" "Ilya Kotov ") + "\n" + tr("Artwork:\n" "Andrey Adreev ")); } QTranslator *SkinnedFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/skinned_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(skinned, SkinnedFactory) qmmp-0.7.4/src/plugins/Ui/skinned/playstatus.h0000664000175000017500000000355512256224735020076 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYSTATUS_H #define PLAYSTATUS_H #include "pixmapwidget.h" /** @author Ilya Kotov */ class Skin; class PlayStatus : public PixmapWidget { Q_OBJECT public: PlayStatus(QWidget *parent = 0); ~PlayStatus(); enum Type { PLAY, STOP, PAUSE, }; void setStatus(Type); private slots: void updateSkin(); private: Skin *m_skin; Type m_status; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playlistselector.cpp0000664000175000017500000003134212256224735021615 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "skin.h" #include "playlistselector.h" PlayListSelector::PlayListSelector(PlayListManager *manager, QWidget *parent) : QWidget(parent) { m_scrollable = false; m_moving = false; m_offset = 0; m_offset_max = 0; m_metrics = 0; m_pressed_button = BUTTON_UNKNOWN; m_skin = Skin::instance(); m_pl_manager = manager; connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateTabs())); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); loadColors(); readSettings(); m_menu = new QMenu(this); m_menu->addAction(tr("&Load"), parent, SIGNAL (loadPlaylist())); m_menu->addAction(tr("&Save As..."), parent, SIGNAL (savePlaylist())); m_menu->addSeparator(); m_menu->addAction(tr("Rename"),this, SLOT (renamePlaylist())); m_menu->addAction(tr("&Delete"),parent, SLOT (deletePlaylist())); } PlayListSelector::~PlayListSelector() { if (m_metrics) delete m_metrics; m_metrics = 0; } void PlayListSelector::readSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_font.fromString(settings.value("Skinned/pl_font", QApplication::font().toString()).toString()); if (m_metrics) { delete m_metrics; m_metrics = 0; } m_metrics = new QFontMetrics(m_font); m_pl_separator = settings.value("Skinned/pl_separator", "|").toString(); m_show_new_pl_button = settings.value("Skinned/pl_show_create_button", false).toBool(); m_pl_button = "[+]"; m_pl_separator.append(" "); m_pl_separator.prepend(" "); resize(width(), m_metrics->height () +1); drawButtons(); updateTabs(); } void PlayListSelector::updateTabs() { m_rects.clear(); m_extra_rects.clear(); QRect rect; foreach(QString text, m_pl_manager->playListNames()) { if(m_rects.isEmpty()) rect.setX(9); else rect.setX(m_rects.last().x() + m_rects.last().width() + m_metrics->width(m_pl_separator)); rect.setY(0); rect.setWidth(m_metrics->width(text)); rect.setHeight(m_metrics->ascent ()); m_rects.append(rect); } if(m_show_new_pl_button) { rect.setX(m_rects.last().x() + m_rects.last().width() + m_metrics->width(" ")); rect.setY(0); rect.setWidth(m_metrics->width(m_pl_button)); rect.setHeight(m_metrics->ascent ()); m_extra_rects.append(rect); } updateScrollers(); update(); } void PlayListSelector::updateSkin() { loadColors(); drawButtons(); updateTabs(); } void PlayListSelector::renamePlaylist() { bool ok = false; QString name = QInputDialog::getText (this, tr("Rename Playlist"), tr("Playlist name:"), QLineEdit::Normal, m_pl_manager->selectedPlayList()->name(), &ok); if(ok) m_pl_manager->selectedPlayList()->setName(name); } void PlayListSelector::paintEvent(QPaintEvent *) { QPainter painter(this); painter.setFont(m_font); painter.setBrush(QBrush(m_normal_bg)); painter.drawRect(-1,-1,width()+1,height()+1); QStringList names = m_pl_manager->playListNames(); int current = m_pl_manager->indexOf(m_pl_manager->currentPlayList()); int selected = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); if(m_moving) { painter.setBrush(QBrush(m_normal_bg)); painter.setPen(m_current); painter.drawRect(m_rects.at(selected).x() - 2 - m_offset, 0, m_rects.at(selected).width() + 3, height()-1); } else { painter.setBrush(QBrush(m_selected_bg)); painter.setPen(m_selected_bg); painter.drawRect(m_rects.at(selected).x() - 2 - m_offset, 0, m_rects.at(selected).width() + 3, height()-1); } for (int i = 0; i < m_rects.size(); ++i) { if(i == current) painter.setPen(m_current); else painter.setPen(m_normal); if(!m_moving || i != selected) painter.drawText(m_rects[i].x() - m_offset, m_metrics->ascent(), names.at(i)); if(i < m_rects.size() - 1) { painter.setPen(m_normal); painter.drawText(m_rects[i].x() + m_rects[i].width() - m_offset, m_metrics->ascent(), m_pl_separator); } } for(int i = 0; i < m_extra_rects.size(); ++i) { painter.setPen(m_pressed_button == BUTTON_NEW_PL ? m_current : m_normal); painter.drawText(m_extra_rects[i].x() - m_offset, m_metrics->ascent(), m_pl_button); } if(m_moving) { painter.setBrush(QBrush(m_selected_bg)); painter.setPen(m_selected_bg); painter.drawRect(m_mouse_pos.x() - m_press_offset - 2, 0, m_rects.at(selected).width() + 3, height()); painter.setPen(selected == current ? m_current : m_normal); painter.drawText(m_mouse_pos.x() - m_press_offset, m_metrics->ascent(), names.at(selected)); } if(m_scrollable) { painter.drawPixmap(width()-40, 0, m_pixmap); painter.setBrush(QBrush(m_normal_bg)); painter.setPen(m_normal_bg); painter.drawRect(0,0,6,height()); } } void PlayListSelector::mousePressEvent (QMouseEvent *e) { m_pressed_button = findButton(e->pos()); if(m_pressed_button != BUTTON_UNKNOWN) { drawButtons(); update(); return; } bool selected = false; int index = findPlayList(e->pos()); if(index != -1) { selected = true; m_pl_manager->selectPlayList(index); } update(); QPoint pp = e->pos(); pp.rx() += m_offset; if(e->button() == Qt::RightButton) m_menu->exec(e->globalPos()); else if(e->button() == Qt::MidButton && selected) m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); else { m_moving = true; m_mouse_pos = e->pos(); m_press_offset = pp.x() - m_rects.at(m_pl_manager->selectedPlayListIndex()).x(); QWidget::mousePressEvent(e); } } void PlayListSelector::mouseReleaseEvent (QMouseEvent *e) { m_moving = false; int released_button = findButton(e->pos()); if(released_button == m_pressed_button) { switch(released_button) { case BUTTON_NEW_PL: m_pl_manager->createPlayList(); break; case BUTTON_LEFT: m_offset -= m_offset - firstVisible().x() + 9 + 2; m_offset = qMax(0, m_offset); break; case BUTTON_RIGHT: m_offset += lastVisible().right() - m_offset - width() + 42; m_offset = qMin(m_offset, m_offset_max); break; default: ; } } m_pressed_button = BUTTON_UNKNOWN; drawButtons(); update(); QWidget::mouseReleaseEvent(e); } void PlayListSelector::mouseDoubleClickEvent (QMouseEvent *e) { if(e->button() == Qt::LeftButton && !(m_scrollable && (e->x() > width() - 40))) renamePlaylist(); else QWidget::mouseDoubleClickEvent(e); } void PlayListSelector::mouseMoveEvent(QMouseEvent *e) { if(!m_moving) { QWidget::mouseMoveEvent(e); return; } m_mouse_pos = e->pos(); QPoint mp = e->pos(); mp.rx() += m_offset; int dest = -1; for(int i = 0; i < m_rects.count(); ++i) { int x_delta = mp.x() - m_rects.at(i).x(); if(x_delta < 0 || x_delta > m_rects.at(i).width()) continue; if((x_delta > m_rects.at(i).width()/2 && m_pl_manager->selectedPlayListIndex() < i) || (x_delta < m_rects.at(i).width()/2 && m_pl_manager->selectedPlayListIndex() > i)) { dest = i; break; } } if(dest == -1 || dest == m_pl_manager->selectedPlayListIndex()) { update(); QWidget::mouseMoveEvent(e); return; } m_pl_manager->move(m_pl_manager->selectedPlayListIndex(), dest); update(); } void PlayListSelector::resizeEvent (QResizeEvent *) { updateScrollers(); } void PlayListSelector::loadColors() { m_normal.setNamedColor(m_skin->getPLValue("normal")); m_current.setNamedColor(m_skin->getPLValue("current")); m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); } void PlayListSelector::drawButtons() { m_pixmap = QPixmap(40, height()); m_pixmap.fill(m_normal_bg); QPainter painter(&m_pixmap); painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen(m_pressed_button == BUTTON_LEFT ? m_current : m_normal); painter.setBrush(QBrush(m_pressed_button == BUTTON_LEFT ? m_current : m_normal)); QPoint points[3] = { QPoint(m_pixmap.width() - 25, height()/2 - 5), QPoint(m_pixmap.width() - 35, height()/2-1), QPoint(m_pixmap.width() - 25, height()/2 + 3), }; painter.drawPolygon(points, 3); painter.setPen(m_pressed_button == BUTTON_RIGHT ? m_current : m_normal); painter.setBrush(QBrush(m_pressed_button == BUTTON_RIGHT ? m_current : m_normal)); QPoint points2[3] = { QPoint(m_pixmap.width() - 20, height()/2 - 5), QPoint(m_pixmap.width() - 10, height()/2-1), QPoint(m_pixmap.width() - 20, height()/2 + 3), }; painter.drawPolygon(points2, 3); } void PlayListSelector::updateScrollers() { int last_x = m_extra_rects.isEmpty() ? m_rects.last().right() : m_extra_rects.last().right(); m_scrollable = last_x > width(); if(m_scrollable) { m_offset_max = last_x - width() + 42; m_offset = qMin(m_offset, m_offset_max); } else { m_offset = 0; m_offset_max = 0; } } QRect PlayListSelector::firstVisible() { for(int i = 0; i < m_rects.size(); ++i) { if(m_rects.at(i).right() + m_metrics->width(m_pl_separator) >= 9 + m_offset) return m_rects.at(i); } return m_rects.at(0); } QRect PlayListSelector::lastVisible() { for(int i = m_extra_rects.size() - 1; i >= 0; --i) { if(m_extra_rects.at(i).x() - m_offset - m_metrics->width(" ") - 2 <= width() - 40) return m_extra_rects.at(i); } for(int i = m_rects.size() - 1; i >= 0; --i) { if(m_rects.at(i).x() - m_offset - m_metrics->width(m_pl_separator) - 2 <= width() - 40) return m_rects.at(i); } return m_extra_rects.isEmpty() ? m_rects.last() : m_extra_rects.last(); } int PlayListSelector::findPlayList(QPoint pos) { pos.rx() += m_offset; for(int i = 0; i < m_rects.count(); ++i) { if(m_rects.at(i).contains(pos)) return i; } return -1; } int PlayListSelector::findButton(QPoint pos) { if(m_scrollable) { if(pos.x() > width() - 20) return BUTTON_RIGHT; else if ((width() - 40 < pos.x()) && (pos.x() <= width() - 20)) return BUTTON_LEFT; } pos.rx() += m_offset; for(int i = 0; i < m_extra_rects.count(); ++i) { if(m_extra_rects.at(i).contains(pos)) return BUTTON_NEW_PL; } return BUTTON_UNKNOWN; } qmmp-0.7.4/src/plugins/Ui/skinned/shadedbar.cpp0000664000175000017500000000756412256224735020141 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "skin.h" #include "shadedbar.h" ShadedBar::ShadedBar(QWidget *parent, uint slider1, uint slider2, uint slider3) : QWidget(parent) { m_slider1 = slider1; m_slider2 = slider2; m_slider3 = slider3; m_skin = Skin::instance(); m_ratio = m_skin->ratio(); if(slider1 == Skin::EQ_VOLUME1) resize(m_ratio*97,m_ratio*7); else resize(m_ratio*42,m_ratio*7); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); m_moving = false; m_min = 0; m_max = 100; m_old = m_value = 0; draw(); } ShadedBar::~ShadedBar() { } void ShadedBar::mousePressEvent(QMouseEvent *e) { m_moving = true; press_pos = e->x(); if(m_posx() && e->x()x()-m_pos; } else { m_value = convert(qMax(qMin(width()-3,e->x()-1),0)); press_pos = 1; if (m_value!=m_old) { emit sliderMoved(m_value); } } draw(); } void ShadedBar::mouseMoveEvent (QMouseEvent *e) { if(m_moving) { int po = e->x(); po = po - press_pos; if(0<=po && po<=width()-3) { m_value = convert(po); draw(); emit sliderMoved(m_value); } } } void ShadedBar::mouseReleaseEvent(QMouseEvent*) { m_moving = false; draw(); m_old = m_value; } void ShadedBar::setValue(int v) { if (m_moving || m_max == 0) return; m_value = v; draw(); } void ShadedBar::setRange(int min, int max) { m_max = max; m_min = min; draw(); } void ShadedBar::updateSkin() { m_ratio = m_skin->ratio(); if(m_slider1 == Skin::EQ_VOLUME1) resize(m_ratio*97,m_ratio*7); else resize(m_ratio*42,m_ratio*7); draw(); } void ShadedBar::draw() { if (m_value <= m_min + (m_max - m_min)/3) m_pixmap = m_skin->getEqPart(m_slider1); else if(m_min + (m_max - m_min)/3 < m_value && m_value <= m_min + 2*(m_max - m_min)/3) m_pixmap = m_skin->getEqPart(m_slider2); else m_pixmap = m_skin->getEqPart(m_slider3); m_pos = int(ceil(double(m_value-m_min)*(width()-3*m_ratio)/(m_max-m_min))); update(); } int ShadedBar::convert(int p) { return int(ceil(double(m_max-m_min)*(p)/(width()-3)+m_min)); } void ShadedBar::paintEvent(QPaintEvent*) { QPainter paint(this); paint.drawPixmap(m_pos,0,m_pixmap); } qmmp-0.7.4/src/plugins/Ui/skinned/number.cpp0000664000175000017500000000350012256224735017476 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "number.h" #include "skin.h" Number::Number(QWidget *parent) : PixmapWidget(parent) { m_skin = Skin::instance(); //TODO default value?? connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); } Number::~Number() { } void Number::setValue(int n) { setPixmap(m_skin->getNumber(n)); m_value = n; } void Number::updateSkin(void) { setValue(m_value); } qmmp-0.7.4/src/plugins/Ui/skinned/dock.h0000664000175000017500000000442612256224735016603 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DOCK_H #define DOCK_H #include #include #include class QAction; /** @author Ilya Kotov */ class Dock : public QObject { Q_OBJECT public: Dock(QObject *parent = 0); ~Dock(); static Dock *instance(); void setMainWidget(QWidget*); void addWidget(QWidget *); void move(QWidget*, QPoint); void calculateDistances(); void updateDock(); void addActions(QList actions); void align(QWidget*, int dy); private: QPoint snapDesktop(QPoint, QWidget*); QPoint snap(QPoint, QWidget*, QWidget*); bool isDocked(QWidget*, QWidget*); bool isUnder(QWidget*, QWidget*, int); static Dock *m_instance; QWidget *m_mainWidget; QList m_widgetList; QList m_dockedList; QList m_delta_list; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/skin.cpp0000664000175000017500000006463612256224735017173 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Based on Promoe, an XMMS2 Client * * Copyright (C) 2005-2006 by XMMS2 Team * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include "actionmanager.h" #include "skin.h" #include "cursorimage.h" Skin *Skin::m_instance = 0; Skin *Skin::instance() { if (!m_instance) m_instance = new Skin(); return m_instance; } QPixmap Skin::getPixmap (const QString& name, QDir dir) { dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = dir.entryInfoList(); for (int j = 0; j < f.size(); ++j) { QFileInfo fileInfo = f.at (j); QString fn = fileInfo.fileName().toLower(); if (fn.section (".",0,0) == name) { return QPixmap (fileInfo.filePath()); } } return QPixmap(); } Skin::Skin (QObject *parent) : QObject (parent) { m_instance = this; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QString path = settings.value("Skinned/skin_path").toString(); if (path.isEmpty() || !QDir(path).exists ()) path = ":/default"; m_double_size = settings.value("Skinned/double_size", false).toBool(); ACTION(ActionManager::WM_DOUBLE_SIZE)->setChecked(m_double_size); setSkin (QDir::cleanPath(path)); /* skin directory */ QDir skinDir(QDir::homePath()+"/.qmmp"); skinDir.mkdir ("skins"); } Skin::~Skin() {} void Skin::setSkin (const QString& path) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_use_cursors = settings.value("Skinned/skin_cursors", false).toBool(); m_double_size = ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked(); settings.setValue("Skinned/skin_path",path); qDebug ("Skin: using %s",qPrintable(path)); m_skin_dir = QDir (path); //clear old values m_pledit_txt.clear(); buttons.clear(); titlebar.clear(); m_numbers.clear(); m_pl_parts.clear(); m_eq_parts.clear(); m_eq_bar.clear(); m_eq_spline.clear(); m_vis_colors.clear(); cursors.clear(); //load skin parts loadPLEdit(); loadMain(); loadButtons(); loadShufRep(); loadTitleBar(); loadPosBar(); loadNumbers(); loadPlayList(); loadEq_ex(); loadEqMain(); loadVisColor(); loadLetters(); loadMonoSter(); loadVolume(); loadBalance(); loadRegion(); loadCursors(); if(m_double_size) { uint key; foreach(key, buttons.keys()) buttons[key] = scalePixmap(buttons[key]); foreach(key, titlebar.keys()) titlebar[key] = scalePixmap(titlebar[key]); foreach(key, m_pl_parts.keys()) m_pl_parts[key] = scalePixmap(m_pl_parts[key]); foreach(key, m_eq_parts.keys()) m_eq_parts[key] = scalePixmap(m_eq_parts[key]); foreach(key, m_ms_parts.keys()) m_ms_parts[key] = scalePixmap(m_ms_parts[key]); foreach(key, m_parts.keys()) m_parts[key] = scalePixmap(m_parts[key]); foreach(QChar c, m_letters.keys()) m_letters[c] = scalePixmap(m_letters[c]); m_main = scalePixmap(m_main); posbar = scalePixmap(posbar); int i; for(i = 0; i < m_numbers.size(); ++i) m_numbers[i] = scalePixmap(m_numbers[i]); for(i = 0; i < m_eq_bar.size(); ++i) m_eq_bar[i] = scalePixmap(m_eq_bar[i]); for(i = 0; i < m_eq_spline.size(); ++i) m_eq_spline[i] = scalePixmap(m_eq_spline[i]); for(i = 0; i < m_volume.size(); ++i) m_volume[i] = scalePixmap(m_volume[i]); for(i = 0; i < m_balance.size(); ++i) m_balance[i] = scalePixmap(m_balance[i]); } emit skinChanged(); } void Skin::reloadSkin() { setSkin (m_skin_dir.absolutePath ()); } void Skin::loadMain() { QPixmap *pixmap = getPixmap ("main"); if (!pixmap) pixmap = getDummyPixmap("main"); m_main = pixmap->copy (0,0,275,116); delete pixmap; } void Skin::loadCursors() { if(!m_use_cursors) { for(int i = CUR_NORMAL; i <= CUR_WSWINBUT; ++i) cursors[i] = QCursor(Qt::ArrowCursor); cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); return; } cursors[CUR_NORMAL] = createCursor(getPath("normal")); cursors[CUR_CLOSE] = createCursor(getPath("close")); cursors[CUR_MAINMENU] = createCursor(getPath("mainmenu")); cursors[CUR_MIN] = createCursor(getPath("min")); cursors[CUR_POSBAR] = createCursor(getPath("posbar.cur")); cursors[CUR_SONGNAME] = createCursor(getPath("songname")); cursors[CUR_TITLEBAR] = createCursor(getPath("titlebar.cur")); cursors[CUR_VOLBAL] = createCursor(getPath("volbal")); cursors[CUR_WINBUT] = createCursor(getPath("winbut")); cursors[CUR_WSNORMAL] = createCursor(getPath("wsnormal")); cursors[CUR_WSPOSBAR] = createCursor(getPath("wsposbar")); cursors[CUR_EQCLOSE] = createCursor(getPath("eqclose")); cursors[CUR_EQNORMAL] = createCursor(getPath("eqnormal")); cursors[CUR_EQSLID] = createCursor(getPath("eqslid")); cursors[CUR_EQTITLE] = createCursor(getPath("eqtitle")); cursors[CUR_PCLOSE] = createCursor(getPath("pclose")); cursors[CUR_PNORMAL] = createCursor(getPath("pnormal")); cursors[CUR_PSIZE] = createCursor(getPath("psize")); if(cursors[CUR_PSIZE].shape() == Qt::ArrowCursor) cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); cursors[CUR_PTBAR] = createCursor(getPath("ptbar")); cursors[CUR_PVSCROLL] = createCursor(getPath("pvscroll")); cursors[CUR_PWINBUT] = createCursor(getPath("pwinbut")); cursors[CUR_PWSNORM] = createCursor(getPath("pwsnorm")); cursors[CUR_PWSSIZE] = createCursor(getPath("pwssize")); cursors[CUR_VOLBAR] = createCursor(getPath("volbar")); cursors[CUR_WSCLOSE] = createCursor(getPath("wsclose")); cursors[CUR_WSMIN] = createCursor(getPath("wsmin")); cursors[CUR_WSWINBUT] = createCursor(getPath("wswinbut")); } void Skin::loadButtons() { QPixmap *pixmap = getPixmap ("cbuttons"); if (!pixmap) pixmap = getDummyPixmap("cbuttons"); buttons[BT_PREVIOUS_N] = pixmap->copy (0, 0,23,18); buttons[BT_PREVIOUS_P] = pixmap->copy (0,18,23,18); buttons[BT_PLAY_N] = pixmap->copy (23, 0,23,18); buttons[BT_PLAY_P] = pixmap->copy (23,18,23,18); buttons[BT_PAUSE_N] = pixmap->copy (46, 0,23,18); buttons[BT_PAUSE_P] = pixmap->copy (46,18,23,18); buttons[BT_STOP_N] = pixmap->copy (69, 0,23,18); buttons[BT_STOP_P] = pixmap->copy (69,18,23,18); buttons[BT_NEXT_N] = pixmap->copy (92, 0,22,18); buttons[BT_NEXT_P] = pixmap->copy (92,18,22,18); buttons[BT_EJECT_N] = pixmap->copy (114, 0,22,16); buttons[BT_EJECT_P] = pixmap->copy (114,16,22,16); delete pixmap; } void Skin::loadTitleBar() { QPixmap *pixmap = getPixmap ("titlebar"); if (!pixmap) pixmap = getDummyPixmap("titlebar"); buttons[BT_MENU_N] = pixmap->copy (0,0,9,9); buttons[BT_MENU_P] = pixmap->copy (0,9,9,9); buttons[BT_MINIMIZE_N] = pixmap->copy (9,0,9,9); buttons[BT_MINIMIZE_P] = pixmap->copy (9,9,9,9); buttons[BT_CLOSE_N] = pixmap->copy (18,0,9,9); buttons[BT_CLOSE_P] = pixmap->copy (18,9,9,9); buttons[BT_SHADE1_N] = pixmap->copy (0,18,9,9); buttons[BT_SHADE1_P] = pixmap->copy (9,18,9,9); buttons[BT_SHADE2_N] = pixmap->copy (0,27,9,9); buttons[BT_SHADE2_P] = pixmap->copy (9,27,9,9); titlebar[TITLEBAR_A] = pixmap->copy (27, 0,275,14); titlebar[TITLEBAR_I] = pixmap->copy (27,15,275,14); titlebar[TITLEBAR_SHADED_A] = pixmap->copy (27,29,275,14); titlebar[TITLEBAR_SHADED_I] = pixmap->copy (27,42,275,14); delete pixmap; } void Skin::loadPosBar() { QPixmap *pixmap = getPixmap ("posbar"); if (!pixmap) pixmap = getDummyPixmap("posbar"); if (pixmap->width() > 249) { buttons[BT_POSBAR_N] = pixmap->copy (248,0,29, pixmap->height()); buttons[BT_POSBAR_P] = pixmap->copy (278,0,29, pixmap->height()); } else { QPixmap dummy(29, pixmap->height()); dummy.fill(Qt::transparent); buttons[BT_POSBAR_N] = dummy; buttons[BT_POSBAR_P] = dummy; } posbar = pixmap->copy (0,0,248,pixmap->height()); delete pixmap; } void Skin::loadNumbers() { QPixmap *pixmap = getPixmap ("nums_ex"); if (!pixmap) pixmap = getPixmap ("numbers"); if (!pixmap) pixmap = getDummyPixmap("numbers"); for (uint i = 0; i < 10; i++) m_numbers << pixmap->copy (i*9, 0, 9, pixmap->height()); if (pixmap->width() > 107) m_numbers << pixmap->copy(99, 0, 9, pixmap->height()); else { // We didn't find "-" symbol. So we have to extract it from "2". // Winamp uses this method too. QPixmap pix; if(pixmap->width() > 98) pix = pixmap->copy(90,0,9,pixmap->height()); else { pix = QPixmap(9, pixmap->height()); pix.fill(Qt::transparent); } QPixmap minus = pixmap->copy(18,pixmap->height()/2,9,1); QPainter paint(&pix); paint.drawPixmap(0,pixmap->height()/2, minus); m_numbers << pix; } delete pixmap; } void Skin::loadPlayList() { QPixmap *pixmap = getPixmap ("pledit"); if (!pixmap) pixmap = getDummyPixmap("pledit"); m_pl_parts[PL_CORNER_UL_A] = pixmap->copy (0,0,25,20); m_pl_parts[PL_CORNER_UL_I] = pixmap->copy (0,21,25,20); m_pl_parts[PL_CORNER_UR_A] = pixmap->copy (153,0,25,20); m_pl_parts[PL_CORNER_UR_I] = pixmap->copy (153,21,25,20); m_pl_parts[PL_TITLEBAR_A] = pixmap->copy (26,0,100,20); m_pl_parts[PL_TITLEBAR_I] = pixmap->copy (26,21,100,20); m_pl_parts[PL_TFILL1_A] = pixmap->copy (127,0,25,20); m_pl_parts[PL_TFILL1_I] = pixmap->copy (127,21,25,20); //m_pl_parts[PL_TFILL2_A] = pixmap->copy();//FIXME: ����� //m_pl_parts[PL_TFILL2_I] = pixmap->copy(); m_pl_parts[PL_LFILL] = pixmap->copy (0,42,12,29); m_pl_parts[PL_RFILL] = pixmap->copy (31,42,20,29); //??? m_pl_parts[PL_LSBAR] = pixmap->copy (0,72,125,38); m_pl_parts[PL_RSBAR] = pixmap->copy (126,72,150,38); m_pl_parts[PL_SFILL1] = pixmap->copy (179,0,25,38); m_pl_parts[PL_SFILL2] = pixmap->copy (250,21,75,38); m_pl_parts[PL_TITLEBAR_SHADED1_A] = pixmap->copy (99,42,50,14); m_pl_parts[PL_TITLEBAR_SHADED1_I] = pixmap->copy (99,57,50,14); m_pl_parts[PL_TITLEBAR_SHADED2] = pixmap->copy (72,42,25,14); m_pl_parts[PL_TFILL_SHADED] = pixmap->copy (72,57,25,14); m_pl_parts[PL_CONTROL] = pixmap->copy(129,94,60,8); buttons[PL_BT_ADD] = pixmap->copy (11,80,25,18); buttons[PL_BT_SUB] = pixmap->copy (40,80,25,18); buttons[PL_BT_SEL] = pixmap->copy (70,80,25,18); buttons[PL_BT_SORT] = pixmap->copy (99,80,25,18); buttons[PL_BT_LST] = pixmap->copy(229, 80, 25, 18); buttons[PL_BT_SCROLL_N] = pixmap->copy (52,53,8,18); buttons[PL_BT_SCROLL_P] = pixmap->copy (61,53,8,18); buttons[PL_BT_CLOSE_N] = pixmap->copy (167,3,9,9); buttons[PL_BT_CLOSE_P] = pixmap->copy (52,42,9,9); buttons[PL_BT_SHADE1_N] = pixmap->copy (158,3,9,9); buttons[PL_BT_SHADE1_P] = pixmap->copy (62,42,9,9); buttons[PL_BT_SHADE2_N] = pixmap->copy (129,45,9,9); buttons[PL_BT_SHADE2_P] = pixmap->copy (150,42,9,9); delete pixmap; } QPixmap *Skin::getPixmap (const QString& name) { m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = m_skin_dir.entryInfoList(); for (int j = 0; j < f.size(); ++j) { QFileInfo fileInfo = f.at (j); QString fn = fileInfo.fileName().toLower(); if (fn.section (".",0,0) == name) { return new QPixmap (fileInfo.filePath()); } } return 0; } QString Skin::getPath (const QString& name) { m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = m_skin_dir.entryInfoList(); bool nameHasExt = name.contains('.'); for (int j = 0; j < f.size(); ++j) { QFileInfo fileInfo = f.at (j); QString fn = fileInfo.fileName().toLower(); if (!nameHasExt && fn.section (".",0,0) == name) { return fileInfo.filePath(); } else if (nameHasExt && fn == name) { return fileInfo.filePath(); } } return QString(); } void Skin::loadPLEdit() { QString path = findFile("pledit.txt", m_skin_dir); if (path.isEmpty()) path = findFile("pledit.txt", ":/default"); if (path.isEmpty()) qFatal("Skin: invalid default skin"); QFile file(path); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) qFatal("Skin: unable to open %s", qPrintable(path)); while (!file.atEnd ()) { QByteArray line = file.readLine (); QList l = line.split ('='); if (l.count () == 2) { m_pledit_txt[l[0].toLower () ] = l[1].trimmed(); } else if (line.length() == 0) { break; } } if (!m_pledit_txt.keys().contains("mbbg")) m_pledit_txt["mbbg"] = m_pledit_txt["normalbg"]; if (!m_pledit_txt.keys().contains("mbfg")) m_pledit_txt["mbfg"] = m_pledit_txt["normal"]; } void Skin::loadEqMain() { QPixmap *pixmap = getPixmap ("eqmain"); if (!pixmap) pixmap = getDummyPixmap("eqmain"); m_eq_parts[ EQ_MAIN ] = pixmap->copy (0,0,275,116); m_eq_parts[ EQ_TITLEBAR_A ] = pixmap->copy (0,134,275,14); m_eq_parts[ EQ_TITLEBAR_I ] = pixmap->copy (0,149,275,14); if (pixmap->height() > 295) m_eq_parts[ EQ_GRAPH ] = pixmap->copy (0,294,113,19); else m_eq_parts[ EQ_GRAPH ] = QPixmap(); for (int i = 0; i < 14; ++i) { m_eq_bar << pixmap->copy (13 + i*15,164,14,63); } for (int i = 0; i < 14; ++i) { m_eq_bar << pixmap->copy (13 + i*15,229,14,63); } buttons[ EQ_BT_BAR_N ] = pixmap->copy (0,164,11,11); buttons[ EQ_BT_BAR_P ] = pixmap->copy (0,164+12,11,11); buttons[ EQ_BT_ON_N ] = pixmap->copy (69,119,28,12); buttons[ EQ_BT_ON_P ] = pixmap->copy (128,119,28,12); buttons[ EQ_BT_OFF_N ] = pixmap->copy (10, 119,28,12); buttons[ EQ_BT_OFF_P ] = pixmap->copy (187,119,28,12); buttons[ EQ_BT_PRESETS_N ] = pixmap->copy (224,164,44,12); buttons[ EQ_BT_PRESETS_P ] = pixmap->copy (224,176,44,12); buttons[ EQ_BT_AUTO_1_N ] = pixmap->copy (94,119,33,12); buttons[ EQ_BT_AUTO_1_P ] = pixmap->copy (153,119,33,12); buttons[ EQ_BT_AUTO_0_N ] = pixmap->copy (35, 119,33,12); buttons[ EQ_BT_AUTO_0_P ] = pixmap->copy (212,119,33,12); buttons[ EQ_BT_CLOSE_N ] = pixmap->copy (0,116,9,9); buttons[ EQ_BT_CLOSE_P ] = pixmap->copy (0,125,9,9); buttons[ EQ_BT_SHADE1_N ] = pixmap->copy (254,137,9,9); for (int i = 0; i < 19; ++i) { m_eq_spline << pixmap->copy (115, 294+i, 1, 1); } delete pixmap; } void Skin::loadEq_ex() { QPixmap *pixmap = getPixmap ("eq_ex"); if (!pixmap) pixmap = getDummyPixmap("eq_ex"); buttons[ EQ_BT_SHADE1_P ] = pixmap->copy (1,38,9,9); buttons[ EQ_BT_SHADE2_N ] = pixmap->copy (254,3,9,9); buttons[ EQ_BT_SHADE2_P ] = pixmap->copy (1,47,9,9); m_eq_parts[ EQ_TITLEBAR_SHADED_A ] = pixmap->copy(0,0,275,14); m_eq_parts[ EQ_TITLEBAR_SHADED_I ] = pixmap->copy(0,15,275,14); m_eq_parts[ EQ_VOLUME1 ] = pixmap->copy(1,30,3,8); m_eq_parts[ EQ_VOLUME2 ] = pixmap->copy(4,30,3,8); m_eq_parts[ EQ_VOLUME3 ] = pixmap->copy(7,30,3,8); m_eq_parts[ EQ_BALANCE1 ] = pixmap->copy(11,30,3,8); m_eq_parts[ EQ_BALANCE2 ] = pixmap->copy(14,30,3,8); m_eq_parts[ EQ_BALANCE3 ] = pixmap->copy(17,30,3,8); delete pixmap; } void Skin::loadVisColor() { QString path = findFile("viscolor.txt", m_skin_dir); if (path.isEmpty()) path = findFile("viscolor.txt", ":/default"); if (path.isEmpty()) qFatal("Skin: invalid default skin"); QFile file(path); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) qFatal("Skin: unable to open %s", qPrintable(path)); int j = 0; while (!file.atEnd () && j<24) { j++; QByteArray line = file.readLine (); QString tmp = QString::fromAscii (line); tmp = tmp.trimmed (); int i = tmp.indexOf ("//"); if (i>0) tmp.truncate (tmp.indexOf ("//")); QStringList list = tmp.split (","); if (list.count () >= 3) { //colors int r = list.at (0).toInt(); int g = list.at (1).toInt(); int b = list.at (2).toInt(); m_vis_colors << QColor (r,g,b); } else if (line.length() == 0) { break; } } if (m_vis_colors.size() < 24) { qWarning ("Skin: cannot parse viscolor.txt"); while (m_vis_colors.size() < 24) m_vis_colors << QColor (0,0,0); } } void Skin::loadShufRep() { QPixmap *pixmap = getPixmap ("shufrep"); if (!pixmap) pixmap = getDummyPixmap("shufrep"); buttons[ BT_EQ_ON_N ] = pixmap->copy (0,73,23,12); buttons[ BT_EQ_ON_P ] = pixmap->copy (46,73,23,12); buttons[ BT_EQ_OFF_N ] = pixmap->copy (0,61,23,12); buttons[ BT_EQ_OFF_P ] = pixmap->copy (46,61,23,12); buttons[ BT_PL_ON_N ] = pixmap->copy (23,73,23,12); buttons[ BT_PL_ON_P ] = pixmap->copy (69,73,23,12); buttons[ BT_PL_OFF_N ] = pixmap->copy (23,61,23,12); buttons[ BT_PL_OFF_P ] = pixmap->copy (69,61,23,12); //buttons[ BT_PL_CLOSE_N ] = pixmap->copy (); //buttons[ BT_PL_CLOSE_P ] = pixmap->copy (); buttons[REPEAT_ON_N] = pixmap->copy (0,30, 28, 15); buttons[REPEAT_ON_P] = pixmap->copy (0,45, 28, 15); buttons[REPEAT_OFF_N] = pixmap->copy (0, 0,28,15); buttons[REPEAT_OFF_P] = pixmap->copy (0,15,28,15); buttons[SHUFFLE_ON_N] = pixmap->copy (28,30,46,15); buttons[SHUFFLE_ON_P] = pixmap->copy (28,45,46,15); buttons[SHUFFLE_OFF_N] = pixmap->copy (28, 0,46,15); buttons[SHUFFLE_OFF_P] = pixmap->copy (28,15,46,15); delete pixmap; } void Skin::loadLetters(void) { QPixmap *img = getPixmap("text"); if (!img) img = getDummyPixmap("text"); QList > (letters); for (int i = 0; i < 3; i++) { QList (l); for (int j = 0; j < 31; j++) { l.append (img->copy (j*5, i*6, 5, 6)); } letters.append (l); } delete img; /* alphabet */ for (uint i = 97; i < 123; i++) { m_letters.insert(i, letters[0][i-97]); } /* digits */ for (uint i = 0; i <= 9; i++) { m_letters.insert (i+48, letters[1][i]); } /* special characters */ m_letters.insert('"', letters[0][27]); m_letters.insert('@', letters[0][28]); m_letters.insert(':', letters[1][12]); m_letters.insert('(', letters[1][13]); m_letters.insert(')', letters[1][14]); m_letters.insert('-', letters[1][15]); m_letters.insert('\'', letters[1][16]); m_letters.insert('`', letters[1][16]); m_letters.insert('!', letters[1][17]); m_letters.insert('_', letters[1][18]); m_letters.insert('+', letters[1][19]); m_letters.insert('\\', letters[1][20]); m_letters.insert('/', letters[1][21]); m_letters.insert('[', letters[1][22]); m_letters.insert(']', letters[1][23]); m_letters.insert('^', letters[1][24]); m_letters.insert('&', letters[1][25]); m_letters.insert('%', letters[1][26]); m_letters.insert('.', letters[1][27]); m_letters.insert(',', letters[1][27]); m_letters.insert('=', letters[1][28]); m_letters.insert('$', letters[1][29]); m_letters.insert('#', letters[1][30]); m_letters.insert(229, letters[2][0]); m_letters.insert(246, letters[2][1]); m_letters.insert(228, letters[2][2]); m_letters.insert('?', letters[2][3]); m_letters.insert('*', letters[2][4]); m_letters.insert(' ', letters[2][5]); /* text background */ //m_items->insert (TEXTBG, letters[2][6]); } void Skin::loadMonoSter() { QPixmap *pixmap = getPixmap("monoster"); if (!pixmap) pixmap = getDummyPixmap("monoster"); m_ms_parts.clear(); m_ms_parts[ MONO_A ] = pixmap->copy (29,0,27,12); m_ms_parts[ MONO_I ] = pixmap->copy (29,12,27,12); m_ms_parts[ STEREO_A ] = pixmap->copy (0,0,27,12); m_ms_parts[ STEREO_I ] = pixmap->copy (0,12,27,12); delete pixmap; m_parts.clear(); QPainter paint; pixmap = getPixmap("playpaus"); if (!pixmap) pixmap = getDummyPixmap("playpaus"); QPixmap part(11, 9); paint.begin(&part); paint.drawPixmap (0, 0, 3, 9, *pixmap, 36, 0, 3, 9); paint.drawPixmap (3, 0, 8, 9, *pixmap, 1, 0, 8, 9); paint.end(); m_parts [PLAY] = part.copy(); part = QPixmap(11, 9); paint.begin(&part); paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); paint.drawPixmap (2, 0, 9, 9, *pixmap, 9, 0, 9, 9); paint.end(); m_parts [PAUSE] = part.copy(); part = QPixmap(11, 9); paint.begin(&part); paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); paint.drawPixmap (2, 0, 9, 9, *pixmap, 18, 0, 9, 9); paint.end(); m_parts [STOP] = part.copy(); delete pixmap; } void Skin::loadVolume() { QPixmap *pixmap = getPixmap("volume"); if (!pixmap) pixmap = getDummyPixmap("volume"); m_volume.clear(); for (int i = 0; i < 28; ++i) m_volume.append(pixmap->copy (0,i*15, pixmap->width(),13)); if (pixmap->height() > 425) { buttons [BT_VOL_N] = pixmap->copy (15,422,14, pixmap->height() - 422); buttons [BT_VOL_P] = pixmap->copy (0, 422,14, pixmap->height() - 422); } else { buttons [BT_VOL_N] = QPixmap(); buttons [BT_VOL_P] = QPixmap(); } delete pixmap; } void Skin::loadBalance() { QPixmap *pixmap = getPixmap ("balance"); if (!pixmap) pixmap = getPixmap ("volume"); if (!pixmap) pixmap = getDummyPixmap("balance"); m_balance.clear(); for (int i = 0; i < 28; ++i) m_balance.append(pixmap->copy (9,i*15,38,13)); if (pixmap->height() > 427) { buttons [BT_BAL_N] = pixmap->copy (15, 422,14,pixmap->height()-422); buttons [BT_BAL_P] = pixmap->copy (0,422,14,pixmap->height()-422); } else { buttons [BT_BAL_N] = QPixmap(); buttons [BT_BAL_P] = QPixmap(); } delete pixmap; } void Skin::loadRegion() { m_regions.clear(); QString path = findFile("region.txt", m_skin_dir); if (path.isNull ()) { qDebug ("Skin: cannot find region.txt. Transparency disabled"); return; } m_regions[NORMAL] = createRegion(path, "Normal"); m_regions[EQUALIZER] = createRegion(path, "Equalizer"); m_regions[WINDOW_SHADE] = createRegion(path, "WindowShade"); m_regions[EQUALIZER_WS] = createRegion(path, "EqualizerWS"); } QRegion Skin::createRegion(const QString &path, const QString &key) { QRegion region; QSettings settings(path, QSettings::IniFormat); QStringList numPoints = settings.value(key+"/NumPoints").toStringList(); QStringList value = settings.value(key+"/PointList").toStringList(); QStringList numbers; foreach(QString str, value) numbers << str.split(" ", QString::SkipEmptyParts); QList regions; QList::iterator n; n = numbers.begin(); int r = m_double_size ? 2 : 1; for (int i = 0; i < numPoints.size(); ++i) { QList lp; for (int j = 0; j < numPoints.at(i).toInt()*2; j++) { lp << n->toInt(); n ++; } QVector points; for (int l = 0; l < lp.size(); l+=2) { points << QPoint(lp.at(l)*r, lp.at(l+1)*r); } region = region.united(QRegion(QPolygon(points))); } return region; } QPixmap * Skin::getDummyPixmap(const QString& name) { QDir dir (":/default"); dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); QFileInfoList f = dir.entryInfoList(); for (int j = 0; j < f.size(); ++j) { QFileInfo fileInfo = f.at (j); QString fn = fileInfo.fileName().toLower(); if (fn.section (".",0,0) == name) { return new QPixmap (fileInfo.filePath()); } } qFatal("Skin: default skin is corrupted"); return 0; } QPixmap Skin::scalePixmap(const QPixmap &pix, int ratio) { return pix.scaled(pix.width() * ratio, pix.height() * ratio, Qt::KeepAspectRatio); } const QString Skin::findFile(const QString &name, QDir dir) { dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); QString path; QFileInfoList list = dir.entryInfoList(); for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at (i); if (fileInfo.fileName().toLower() == name) { path = fileInfo.filePath (); break; } } return path; } const QString Skin::findFile(const QString &name, const QString &dir) { return findFile(name, QDir(dir)); } qmmp-0.7.4/src/plugins/Ui/skinned/button.cpp0000664000175000017500000000555612256224735017536 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Based on Promoe, an XMMS2 Client * * Copyright (C) 2005-2006 by XMMS2 Team * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "button.h" #include "skin.h" #include Button::Button (QWidget *parent, uint normal, uint pressed, uint cursor) : PixmapWidget (parent) { name_normal = normal; name_pressed = pressed; name_cursor = cursor; m_pressed = false; skin = Skin::instance(); setON (false); setCursor (skin->getCursor (name_cursor)); connect (skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); } Button::~Button() {} void Button::updateSkin() { setPixmap (skin->getButton (name_normal)); setCursor (skin->getCursor (name_cursor)); } void Button::setON (bool on) { if (on) setPixmap (skin->getButton (name_pressed)); else setPixmap (skin->getButton (name_normal)); } void Button::mousePressEvent (QMouseEvent *e) { if(e->button() != Qt::LeftButton) return; setON (true); m_pressed = true; QWidget::mousePressEvent(e); } void Button::mouseReleaseEvent (QMouseEvent *e) { if (!m_pressed) return; m_pressed = false; if(rect().contains(e->pos())) { setON (false); emit clicked(); } } void Button::mouseMoveEvent (QMouseEvent *e) { setON (m_pressed && rect().contains(e->pos())); } qmmp-0.7.4/src/plugins/Ui/skinned/preseteditor.h0000664000175000017500000000376112256224735020375 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PRESETEDITOR_H #define PRESETEDITOR_H #include #include "ui_preseteditor.h" /** @author Ilya Kotov */ class EQPreset; class PresetEditor : public QDialog { Q_OBJECT public: PresetEditor(QWidget *parent = 0); ~PresetEditor(); void addPresets(const QList&); void addAutoPresets(const QList&); signals: void presetLoaded(EQPreset*); void presetDeleted(EQPreset*); private slots: void loadPreset(); void deletePreset(); private: Ui::PresetEditor ui; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/windowsystem.h0000664000175000017500000000375212256224735020440 0ustar useruser/*************************************************************************** * Based on Licq * * Copyright (C) 2006-2009 Licq developers * * Copyright (C) 2011-2013 Ilya Kotov * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef WINDOWSYSTEM_H #define WINDOWSYSTEM_H #include class WindowSystem { public: #ifdef Q_WS_X11 static void ghostWindow(WId id); static QString netWindowManagerName(); static void changeWinSticky(WId win, bool stick); static void setWinHint(WId win, const char *res_name, const char *res_class); static void revertGravity(WId win); private: static unsigned char* getWindowProperty(WId win, const char* prop); #endif }; #endif // WINDOWSYSTEM_H qmmp-0.7.4/src/plugins/Ui/skinned/positionbar.h0000664000175000017500000000454612256224735020217 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef POSITIONBAR_H #define POSITIONBAR_H #include "pixmapwidget.h" class QMouseEvent; class Skin; /** @author Ilya Kotov */ class PositionBar : public PixmapWidget { Q_OBJECT public: PositionBar(QWidget *parent = 0); virtual ~PositionBar(); public slots: void setValue(qint64); qint64 value()const{return m_value;} void setMaximum(qint64); qint64 maximum() const {return m_max;} signals: void sliderMoved (qint64); void sliderPressed(); void sliderReleased(); private slots: void updateSkin(); private: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); Skin *m_skin; bool m_moving; qint64 press_pos; qint64 m_max, m_min, m_pos, m_value, m_old; QPixmap m_pixmap; qint64 convert(qint64); // value = convert(position); void draw(bool pressed = true); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqpreset.cpp0000664000175000017500000000365012256224735020044 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "eqpreset.h" EQPreset::EQPreset() : QListWidgetItem() { m_preamp = 0; for(int i = 0; i < 10; ++i) m_bands[i] = 0; } EQPreset::~EQPreset() {} void EQPreset::setGain(int n, double value) { if(n > 9 || n < 0) return; m_bands[n] = value; } void EQPreset::setPreamp(double preamp) { m_preamp = preamp; } double EQPreset::gain(int n) { if(n > 9 || n < 0) return 0; return m_bands[n]; } double EQPreset::preamp() { return m_preamp; } qmmp-0.7.4/src/plugins/Ui/skinned/playlistbrowser.h0000664000175000017500000000435512256224735021131 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTBROWSER_H #define PLAYLISTBROWSER_H #include #include "ui_playlistbrowser.h" class PlayListManager; /** @author Ilya Kotov */ class PlayListBrowser : public QDialog { Q_OBJECT public: PlayListBrowser(PlayListManager *manager, QWidget *parent = 0); ~PlayListBrowser(); private slots: void updateList(); void on_listWidget_itemDoubleClicked(QListWidgetItem *item); void on_listWidget_itemChanged(QListWidgetItem *item); void on_listWidget_itemPressed (QListWidgetItem *item); void rename(); void on_deleteButton_clicked(); void on_downButton_clicked(); void on_upButton_clicked(); private: void keyPressEvent(QKeyEvent *e); Ui::PlayListBrowser ui; PlayListManager *m_pl_manager; }; #endif // PLAYLISTBROWSER_H qmmp-0.7.4/src/plugins/Ui/skinned/volumebar.cpp0000664000175000017500000000733512256224735020214 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "skin.h" #include "button.h" #include "mainwindow.h" #include "volumebar.h" VolumeBar::VolumeBar(QWidget *parent) : PixmapWidget(parent) { m_skin = Skin::instance(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setPixmap(m_skin->getVolumeBar(0)); mw = qobject_cast(window()); m_moving = false; m_min = 0; m_max = 100; m_old = m_value = 0; draw(false); } VolumeBar::~VolumeBar() {} void VolumeBar::mousePressEvent(QMouseEvent *e) { m_moving = true; press_pos = e->x(); if(m_posx() && e->x()ratio()) { press_pos = e->x()-m_pos; emit sliderPressed(); } else { m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); press_pos = 6*m_skin->ratio(); emit sliderPressed(); if (m_value != m_old) emit sliderMoved(m_value); } draw(); } void VolumeBar::mouseMoveEvent (QMouseEvent *e) { if(m_moving) { int po = e->x(); po = po - press_pos; if(0<=po && po<=width()-18*m_skin->ratio()) { m_value = convert(po); draw(); emit sliderMoved(m_value); } } } void VolumeBar::mouseReleaseEvent(QMouseEvent*) { m_moving = false; draw(false); m_old = m_value; emit sliderReleased(); } void VolumeBar::setValue(int v) { if (m_moving || m_max == 0) return; m_value = v; draw(false); } void VolumeBar::setMax(int max) { m_max = max; draw(false); } void VolumeBar::updateSkin() { resize(m_skin->getVolumeBar(0).size()); draw(false); setCursor(m_skin->getCursor(Skin::CUR_VOLBAL)); } void VolumeBar::draw(bool pressed) { int p=int(ceil(double(m_value-m_min)*(width()-18*m_skin->ratio())/(m_max-m_min))); m_pixmap = m_skin->getVolumeBar(27*(m_value-m_min)/(m_max-m_min)); QPainter paint(&m_pixmap); if(pressed) paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_P)); else paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_N)); setPixmap(m_pixmap); m_pos = p; } int VolumeBar::convert(int p) { return int(ceil(double(m_max-m_min)*(p)/(width()-18*m_skin->ratio())+m_min)); } qmmp-0.7.4/src/plugins/Ui/skinned/popupwidget.h0000664000175000017500000000435212256224735020230 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef POPUPWIDGET_H #define POPUPWIDGET_H #include #define DEFAULT_TEMPLATE "%if(%t,%t,%f)\n%if(%p,
%p,)\n%if(%a,
%a,)" class QTimer; class QLabel; class PlayListItem; namespace PlayListPopup { /** @author Ilya Kotov */ class PopupWidget : public QWidget { Q_OBJECT public: PopupWidget(QWidget *parent = 0); ~PopupWidget(); void prepare(PlayListItem *item, QPoint pos); void deactivate(); const QString url() const; protected: virtual void mousePressEvent (QMouseEvent *); virtual void mouseMoveEvent (QMouseEvent *); private slots: void loadCover(); private: QTimer *m_timer; QLabel *m_label1; QLabel *m_pixlabel; QString m_template; uint m_pos; int m_coverSize; QString m_url; }; } #endif qmmp-0.7.4/src/plugins/Ui/skinned/mainvisual.h0000664000175000017500000000733312256224735020033 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MAINVISUAL_H #define MAINVISUAL_H #include #include #include class QTimer; class QMenu; class QActionGroup; class VisualBase { public: virtual ~VisualBase(){} virtual void clear() = 0; virtual bool process(short *l) = 0; virtual void draw(QPainter *) = 0; virtual const QString name() = 0; }; class Skin; class MainVisual : public Visual { Q_OBJECT public: MainVisual( QWidget *parent = 0); virtual ~MainVisual(); static MainVisual *instance(); void setVisual(VisualBase *newvis); void add(unsigned char *data, qint64 size, int chan); void clear(); void paintEvent(QPaintEvent *); protected: virtual void hideEvent (QHideEvent *); virtual void showEvent (QShowEvent *); virtual void mousePressEvent (QMouseEvent *); public slots: void timeout(); private slots: void readSettings(); void writeSettings(); private: void drawBackGround(); void createMenu(); static MainVisual *m_instance; VisualBase *m_vis; QPixmap m_pixmap; QPixmap m_bg; QTimer *m_timer; Skin *m_skin; //menu and actions QMenu *m_menu; //action groups QActionGroup *m_visModeGroup; QActionGroup *m_fpsGroup; QActionGroup *m_peaksFalloffGroup; QActionGroup *m_analyzerFalloffGroup; QActionGroup *m_analyzerModeGroup; QActionGroup *m_analyzerTypeGroup; QAction *m_peaksAction; QAction *m_transparentAction; int m_ratio; short *m_buffer; int m_buffer_at; bool m_update; }; namespace mainvisual { class Analyzer : public VisualBase { public: Analyzer(); virtual ~Analyzer(); void clear(); bool process(short *l); void draw(QPainter *p); const QString name() { return "Analyzer"; } private: QSize m_size; double m_intern_vis_data[75]; double m_peaks[75]; double m_peaks_falloff; double m_analyzer_falloff; bool m_show_peaks; bool m_lines; int m_mode; Skin *m_skin; }; class Scope : public VisualBase { public: Scope(); virtual ~Scope(); void clear(); bool process(short *l); void draw(QPainter *p); const QString name() { return "Scope"; } private: int m_intern_vis_data[76]; Skin *m_skin; int m_ratio; }; } #endif qmmp-0.7.4/src/plugins/Ui/skinned/monostereo.cpp0000664000175000017500000000514012256224735020402 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "skin.h" #include "monostereo.h" MonoStereo::MonoStereo (QWidget *parent) : PixmapWidget (parent) { m_skin = Skin::instance(); m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); setChannels (0); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); } MonoStereo::~MonoStereo() {} void MonoStereo::setChannels (int c) { m_channels = c; QPainter paint (&m_pixmap); switch ((int) c) { case 0: { paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); break; } case 1: { paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_A)); paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); break; } } if (c > 1) { paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_A)); } setPixmap (m_pixmap); } void MonoStereo::updateSkin() { m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); setChannels (m_channels); } qmmp-0.7.4/src/plugins/Ui/skinned/shadedvisual.cpp0000664000175000017500000001225712256224735020673 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "skin.h" #include "mainvisual.h" #include "inlines.h" #include "shadedvisual.h" #define VISUAL_NODE_SIZE 512 //samples #define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) ShadedVisual::ShadedVisual(QWidget *parent) : Visual(parent) { m_skin = Skin::instance(); m_ratio = m_skin->ratio(); resize(m_ratio*38,m_ratio*5); m_pixmap = QPixmap (m_ratio*38,m_ratio*5); m_timer = new QTimer(this); connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); m_left_buffer = new short[VISUAL_BUFFER_SIZE]; m_right_buffer = new short[VISUAL_BUFFER_SIZE]; m_buffer_at = 0; m_timer->setInterval(50); m_timer->start(); clear(); } ShadedVisual::~ShadedVisual() { delete [] m_left_buffer; delete [] m_right_buffer; } void ShadedVisual::add(unsigned char *data, qint64 size, int chan) { if (!m_timer->isActive ()) return; if(VISUAL_BUFFER_SIZE == m_buffer_at) { m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); return; } int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); if (chan >= 2) { stereo16_from_multichannel(m_left_buffer + m_buffer_at, m_right_buffer + m_buffer_at,(short *) data, frames, chan); } else { memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); memcpy(m_right_buffer + m_buffer_at, (short *) data, frames << 1); } m_buffer_at += frames; } void ShadedVisual::clear() { m_buffer_at = 0; m_l = 0; m_r = 0; m_pixmap.fill(m_skin->getVisColor(0)); update(); } void ShadedVisual::timeout() { m_pixmap.fill(m_skin->getVisColor(0)); mutex()->lock (); if(m_buffer_at < VISUAL_NODE_SIZE) { mutex()->unlock (); return; } process (m_left_buffer, m_right_buffer); m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); QPainter p(&m_pixmap); draw (&p); mutex()->unlock (); update(); } void ShadedVisual::process (short *left, short *right) { int step = (VISUAL_NODE_SIZE << 8)/74; int pos = 0; int l = 0; int r = 0; int j_l = 0, j_r = 0; for (int i = 0; i < 75; ++i) { pos += step; if (left) { j_l = abs((left[pos >> 8] >> 12)); if (j_l > 15) j_l = 15; l = qMax(l, j_l); } if (right) { j_r = abs((right[pos >> 8] >> 12)); if (j_r > 15) j_r = 15; r = qMax(r, j_r); } } m_l -= 0.5; m_l = m_l > l ? m_l : l; m_r -= 0.5; m_r = m_r > r ? m_r : r; } void ShadedVisual::draw (QPainter *p) { for (int i = 0; i < m_l; ++i) { p->fillRect (i*3*m_ratio, 0, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); } for (int i = 0; i < m_r; ++i) { p->fillRect (i*3*m_ratio, 3*m_ratio, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); } } void ShadedVisual::paintEvent (QPaintEvent *) { QPainter painter (this); painter.drawPixmap (0,0,m_pixmap); } void ShadedVisual::hideEvent (QHideEvent *) { m_timer->stop(); } void ShadedVisual::showEvent (QShowEvent *) { m_timer->start(); } void ShadedVisual::updateSkin() { m_ratio = m_skin->ratio(); resize(m_ratio*38,m_ratio*5); m_pixmap = QPixmap (m_ratio*38,m_ratio*5); clear(); } qmmp-0.7.4/src/plugins/Ui/skinned/translations/0000775000175000017500000000000012256224735020225 5ustar useruserqmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts0000664000175000017500000013316112256224735024726 0ustar useruser ActionManager &Play 播放(&P) X X &Pause 暫停(&P) C C &Stop 停止(&S) V V &Previous 上一曲(&P) Z Z &Next 下一曲(&N) B B &Play/Pause 播放/暫停(&P) Space 空格 J J &Jump to Track &Repeat Playlist 重復播放清單(&R) R R &Repeat Track 重復音軌(&R) Ctrl+R Ctrl+R &Shuffle 亂序(&S) S S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File 添加檔案(&A) F F &Add Directory 添加檔案夾(&A) D D &Add Url 添加 URL (&A) U U &Remove Selected 移除所選(&R) Del Del &Remove All 移除全部(&R) &Remove Unselected 移除未選(&R) Remove unavailable files Remove duplicates &Queue Toggle Q Q Invert Selection 反選 &Select None 無選取(&S) &Select All 選取全部(&S) Ctrl+A Ctrl+A &View Track Details 檢視音軌詳細資訊(&V) Alt+I Alt+I &New List 新建清單(&N) Ctrl+T &Delete List Ctrl+W &Load List 載入清單(&L) O O &Save List 儲存清單(&S) Shift+S Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings 設定(&S) Ctrl+P Ctrl+P &About 關於(&A) &About Qt 關於 Qt (&A) &Exit 結束(&E) Ctrl+Q Ctrl+Q EqWidget preset 預設 &Load/Delete 載入/移除(&L) &Save Preset 儲存預設(&S) &Save Auto-load Preset 儲存自動載入預設(&S) &Clear 清除(&C) Saving Preset 儲存預設 Preset name: 預設名稱: preset # 預設 # &Import 導入(&I) Equalizer 均衡器 Import Preset 導入預設 HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist 播放清單 Misc MainDisplay Previous 上一曲 Play 播放 Pause 暫停 Stop 停止 Next 下一曲 Add file 添加檔案 Equalizer 均衡器 Playlist 播放清單 Repeat playlist 重復播放清單 Shuffle 亂序 Volume 音量 Balance 平衡 Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode 可視化型態 Analyzer 解析器 Scope 示波器 Off 關閉 Analyzer Mode 解析型態 Normal 標準 Fire 火花 Vertical Lines 垂直線 Lines 線形 Bars 條形 Peaks 峰值 Refresh Rate 刷新率 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff 解析器下降速度 Slowest 最慢 Slow Medium Fast Fastest 最快 Peaks Falloff 峰值下降速度 Background 背景 Transparent 透明 MainWindow Appearance 外觀 Shortcuts View Playlist 播放清單 Tools 工具 PlayList &Copy Selection To Sort List 清單排序 By Title 按標題 By Album By Disc Number By Artist By Filename 按檔名 By Path + Filename 按路徑+檔名 By Date 按日期 By File Creation Date Sort Selection 選取排序 Randomize List 隨機產生清單 Reverse List 逆串列表 &New PlayList By Track Number 按音軌 Playlist 播放清單 Actions 動作 PlayListBrowser Playlist Browser New Delete 移除 ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Show cover Transparency: Delay: ms Cover size: Template Reset Insert Artist 藝術家 Album 專輯 Title 標題 Track number Two-digit track number Genre 流派 Comment 備註 Composer Duration Disc number File name File path Year 年代 Condition PresetEditor Preset Editor 預設編輯程式 Load 載入 Delete 移除 Preset 預設 Auto-preset 自動預設 ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins 皮膚 Add... 添加... Refresh 刷新 View Hide on close 關閉時隱藏 Start hidden 啟動時隱藏 Use skin cursors Fonts 字型 Player: 播放器: ??? ??? ... ... Playlist: 播放清單: Use bitmap font if available Transparency 透明度 Main window 主窗口 0 0 Equalizer 均衡器 Playlist 播放清單 Miscellaneous Song Display 察看歌曲 Show protocol 顯示協議 Show song numbers 顯示曲目編號 Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files 選取皮膚檔案 Skin files 皮膚檔案 Unarchived skin 未封包皮膚 Archived skin 封包皮膚 TextScroller Autoscroll Songname 自動捲動曲目名 Transparent Background Buffering: %1% VisualMenu Visualization 可視化 qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_gl_ES.ts0000664000175000017500000013123712256224735024666 0ustar useruser ActionManager &Play &Reproducir X X &Pause &Pausa C C &Stop &Deter V V &Previous &Anterior Z Z &Next &Seguinte B B &Play/Pause &Reproducir/Pausar Space Espacio &Jump to Track &Saltar a pista J J &Repeat Playlist &Repetir lista de reprodución R R &Repeat Track &Repetir pista Ctrl+R Ctrl+R &Shuffle &Aleatorio S S &No Playlist Advance &Non avanzar na lista de reprodución Ctrl+N Ctrl+N &Stop After Selected &Deter despois da seleccionada Ctrl+S Ctrl+S &Clear Queue &Limpar cola Alt+Q Alt+Q Show Playlist Amosar lista de reprodución Alt+E Alt+E Show Equalizer Amosar ecualizador Alt+G Alt+G Always on Top Sempre por enriba Put on All Workspaces Poñer en tódolos escritorios Double Size Tamaño dobre Meta+D Meta+D &Add File &Engadir ficheiro F F &Add Directory &Engadir directorio D D &Add Url &Engadir Url U U &Remove Selected &Eliminar seleccionada Del Supr &Remove All &Eliminar todas &Remove Unselected &Eliminar deseleccionadas Remove unavailable files Eliminar os ficheiros non dispoñibles Remove duplicates Eliminar duplicados &Queue Toggle &Cambio de cola Q Q Invert Selection Inverter selección &Select None &Non seleccionar nada &Select All &Seleccionar todo Ctrl+A Ctrl+A &View Track Details &Ver detalles da pista Alt+I Alt+I &New List &Lista nova Ctrl+T Ctrl+T &Delete List &Borrar lista Ctrl+W Ctrl+W &Load List &Cargar lista O O &Save List &Gardar lista Shift+S Shift+S &Select Next Playlist &Seleccionar a próxima lista de reprodución Ctrl+PgDown Ctrl+PgDown &Select Previous Playlist &Seleccionar a lista de reprodución anterior Ctrl+PgUp Ctrl+repág &Show Playlists &Mostrar listas de reprodución P P &Settings &Preferencias Ctrl+P Ctrl+P &About &Acerca de &About Qt &Acerca de Qt &Exit &Saír Ctrl+Q Ctrl+Q EqWidget Equalizer Ecualizador preset perfil &Load/Delete &Cargar/Eliminar &Save Preset &Gardar perfil &Save Auto-load Preset &Gardar perfil autocargado &Import &Importar &Clear &Limpar Saving Preset Gardando perfil Preset name: Nome de perfil: preset # perfil # Import Preset Importar perfil HotkeyEditor Action Acción Shortcut Acceso rápido Change shortcut... Cambiar acceso rápido... Playback Reprodución View Vista Playlist Lista de reprodución Misc Miscelánea MainDisplay Previous Anterior Play Reproducir Pause Pausar Stop Deter Next Próxima Add file Engadir ficheiro Equalizer Ecualizador Playlist Lista de reprodución Repeat playlist Repetir lista de reprodución Shuffle Aleatorio Volume Volume Balance Balance Volume: %1% Volume: %1% Balance: %1% right Balance: %1% dereita Balance: %1% left Balance: %1% esquerda Balance: center Balance: centrado Seek to: %1 Ir ata: %1 MainVisual Visualization Mode Modo de visualización Analyzer Analizador Scope Pendente Off Apagado Analyzer Mode Modo de analizador Normal Normal Fire Lume Vertical Lines Liñas verticais Lines Liñas Bars Barras Peaks Picos Refresh Rate Taxa de refresco 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Analizador Falloff Slowest O máis lento Slow Lento Medium Medio Fast Rápido Fastest O máis rápido Peaks Falloff Caída de picos Background Fondo Transparent Transparente MainWindow Appearance Apariencia Shortcuts Accesos rápidos View Vista Playlist Lista de reprodución Tools Ferramentas PlayList Playlist Lista de reprodución &Copy Selection To &Copiar selección a Sort List Ordear lista By Title Por título By Album Por álbume By Disc Number Por número de disco By Artist Por artista By Filename Por nome de ficheiro By Path + Filename Por ruta + nome de ficheiro By Date Por data By Track Number Por número de pista By File Creation Date Por data de creación do ficheiro Sort Selection Ordear selección Randomize List Lista aleatoria Reverse List Reverter lista Actions Accións &New PlayList &Nova lista de reprodución PlayListBrowser Playlist Browser Navegador de listas de reprodución New Novo Delete Borrar ... ... Rename Renomear PlayListSelector &Load &Cargar &Save As... &Gardar como... Rename Renomear &Delete &Eliminar Rename Playlist Renomear lista de reprodución Playlist name: Nome da lista de reprodución: PopupSettings Popup Information Settings Preferencias de información emerxente Template Plantilla Reset Restablecer Insert Insertar Show cover Amosar cuberta Cover size: Tamaño de cuberta: Transparency: Transparencia: Delay: Duración: ms ms Artist Artista Album Álbume Title Título Track number Número de pista Two-digit track number Número de pista de dous díxitos Genre Xénero Comment Comentarios Composer Compositor Duration Duración Disc number Número de disco File name Nome do ficheiro File path Ruto do ficheiro Year Ano Condition Codición PresetEditor Preset Editor Editor de perfís Preset Perfil Auto-preset Perfil automático Load Cargar Delete Borrar ShortcutDialog Change Shortcut Cambiar acceso rápido Press the key combination you want to assign Pulse a combinación de teclas que quere asignar Clear Limpar SkinnedFactory Skinned User Interface Peles de interface de usuario About Qmmp Skinned User Interface Sobre as peles de interface de usuario de Qmmp Qmmp Skinned User Interface Peles de usuario de Qmmp Simple user interface with Winamp-2.x/XMMS skins support Interface de usuario con soporte para peles de Winamp-2.x/XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Peles Add... Engadir... Refresh Refrescar View Vista Hide on close Ocultar no peche Start hidden Comezar agochado Use skin cursors Usar temas de cursor Fonts Fontes Player: Reprodutor: ??? ??? ... ... Playlist: Lista de reprodución: Use bitmap font if available Usar fonte de mapa de bits se está dispoñible Transparency Transparencia Main window Xanela principal 0 0 Equalizer Ecualizador Playlist Lista de reprodución Miscellaneous Miscelánea Song Display Pantalla de canción Show protocol Mostrar protocolo Show song numbers Mostrar números de canción Align song numbers Aliñar números de canción Show anchor Mostrar áncora Show playlists Mostrar listas de reprodución Show popup information Mostrar información emerxente Edit template Editar plantilla Playlist separator: Separador de lista de reprodución: Show 'New Playlist' button Amosar botón 'Nova lista de reprodución' Select Skin Files Seleccionar ficheiros de pel Skin files Ficheiros de pel Unarchived skin Pel non arquivada Archived skin Pel arquivada TextScroller Autoscroll Songname Autopercorrer nome de canción Transparent Background Transparencia do fondo Buffering: %1% Buffering: %1% VisualMenu Visualization Visualización qmmp-0.7.4/src/plugins/Ui/skinned/translations/translations.qrc0000664000175000017500000000152112256224735023454 0ustar useruser skinned_plugin_ru.qm skinned_plugin_uk_UA.qm skinned_plugin_zh_CN.qm skinned_plugin_zh_TW.qm skinned_plugin_tr.qm skinned_plugin_cs.qm skinned_plugin_pt_BR.qm skinned_plugin_de.qm skinned_plugin_pl_PL.qm skinned_plugin_fr.qm skinned_plugin_it.qm skinned_plugin_kk.qm skinned_plugin_lt.qm skinned_plugin_hu.qm skinned_plugin_nl.qm skinned_plugin_ja.qm skinned_plugin_sk.qm skinned_plugin_es.qm skinned_plugin_he.qm skinned_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts0000664000175000017500000013537712256224735024712 0ustar useruser ActionManager &Play &Відтворити X &Pause &Пауза C &Stop &Стоп V &Previous &Назад Z &Next &Вперед B &Play/Pause &Грати/Пауза Space J &Jump to Track &Перейти до треку &Repeat Playlist &Повторити список R &Repeat Track &Повторити трек Ctrl+R &Shuffle &Перемішати S &No Playlist Advance &Не пересуватися по списку Ctrl+N &Stop After Selected &Зупинити після вибраного Ctrl+S &Clear Queue &Очистити чергу Alt+Q Show Playlist Показати список Alt+E Show Equalizer Показати еквалайзер Alt+G Always on Top Завжди зверху Put on All Workspaces Розмістити на усіх робочих столах Double Size Подвійний розмір Meta+D &Add File &Додати файл F &Add Directory &Додати теку D &Add Url &Додати адресу U &Remove Selected &Видалити вибране Del &Remove All &Видалити все &Remove Unselected &Видалити не вибране Remove unavailable files Видалити недоступні файли Remove duplicates Видалити дублікати &Queue Toggle &В чергу Q Invert Selection Інвертувати вибране &Select None &Зняти виділення &Select All &Вибрати все Ctrl+A &View Track Details &Інформація Alt+I &New List &Новий список Ctrl+T &Delete List &Видалити список Ctrl+W &Load List &Завантажити список O &Save List &Зберегти список Shift+S &Select Next Playlist Вибрати &наступний список Ctrl+PgDown &Select Previous Playlist Вибрати &попередній список Ctrl+PgUp &Show Playlists Показати &всі списки P &Settings &Налаштування Ctrl+P &About &Про програму &About Qt &Про Qt &Exit &Вихід Ctrl+Q EqWidget preset предвстановлення &Load/Delete &Завантажити/Видалити &Save Preset &Зберегти предвстановлення &Save Auto-load Preset &Зберегти авто-предвстановлення &Clear &Очистити Saving Preset Збережені предвстановлення Preset name: Ім'я предвстановлення: preset # предвстановлення # &Import &Імпортувати Equalizer Еквалайзер Import Preset Імпорт предвстановлення HotkeyEditor Action Дія Shortcut Комбінація Change shortcut... Змінити комбінацію клавіш... Playback Відтворення View Вигляд Playlist Список Misc Інші MainDisplay Previous Назад Play Відтворити Pause Пауза Stop Стоп Next Вперед Add file Додати файл Equalizer Еквалайзер Playlist Список Repeat playlist Повторити список Shuffle Перемішати Volume Гучність Balance Баланс Volume: %1% Гучність: %1% Balance: %1% right Баланс: %1% вправо Balance: %1% left Баланс: %1% вліво Balance: center Баланс: центр Seek to: %1 Пошук: %1 MainVisual Visualization Mode Режим візуалізації Analyzer Аналізатор Scope Осцилограф Off Вимкнено Analyzer Mode Режим аналізатора Normal Звичайний Fire Вогонь Vertical Lines Вертикальні лінії Lines Лінії Bars Смужки Peaks Піки Refresh Rate Частота оновлення 50 fps 50 ф/с 25 fps 25 ф/с 10 fps 10 ф/с 5 fps 5 ф/с Analyzer Falloff Падіння аналізатора Slowest Найповільніше Slow Повільне Medium Середнє Fast Швидке Fastest Найшвидше Peaks Falloff Падіння піків Background Тло Transparent Прозорість MainWindow Appearance Зовнішній вигляд Shortcuts Комбінації клавіш View Вигляд Playlist Список Tools Утиліти PlayList &Copy Selection To &Копіювати вибране в Sort List Сортувати By Title За назвою By Album За альбомом By Disc Number За номером диску By Artist За артистом By Filename За ім'ям файлу By Path + Filename За шляхом та файлом By Date За датою By File Creation Date За датою створення файлу Sort Selection Сортувати вибране Randomize List Перемішати Reverse List Перевернути &New PlayList &Новий список By Track Number Playlist Список Actions Дії PlayListBrowser Playlist Browser Переглядач списків New Новий Delete Видалити ... ... Rename Переіменувати PlayListSelector &Load &Завантажити &Save As... &Зберегти як... Rename Переіменувати &Delete &Видалити Rename Playlist Переіменувати список Playlist name: Ім'я списка: PopupSettings Popup Information Settings Налаштування спливаючої інформації Show cover Показати обкладинку Transparency: Прозорість: Delay: Затримка: ms мс Cover size: Розмір обкладинки: Template Шаблон Reset Скинути Insert Вставити Artist Виконавець Album Альбом Title Назва Track number Номер треку Two-digit track number 2- розрядний номер трека Genre Жанр Comment Коментар Composer Композитор Duration Тривалість Disc number Номер диску File name Ім'я файлу File path Шлях файлу Year Рік Condition Умова PresetEditor Preset Editor Редактор предвстановлення Load Завантажити Delete Видалити Preset Предвстановлення Auto-preset Авто-предвстановлення ShortcutDialog Change Shortcut Змінити комбінацію клавіш Press the key combination you want to assign Натисніть клавіші, комбінації яких ви бажаєте використовувати Clear Очистити SkinnedFactory Skinned User Interface Інтерфейс з підтримкою обкладинок About Qmmp Skinned User Interface Про інтерфейс з підтримкою обкладинок Qmmp Skinned User Interface Інтерфейс з підтримкою обкладинок для Qmmp Simple user interface with Winamp-2.x/XMMS skins support Простий інтерфейс користувача з підтримкою обкладинок Winamp-2.x/XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Розробники: Володимир Кузнецов <vovanec@gmail.com> Ілля Котов <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Графіка: Андрій Андрєєв <andreev00@gmail.com> SkinnedSettings Skins Шкурки Add... Додати... Refresh Поновити View Вигляд Hide on close Ховати при закритті Start hidden Запускати схованим Use skin cursors Використовувати курсори скіна Fonts Шрифти Player: Програвач: ??? ??? ... ... Playlist: Список: Use bitmap font if available Використовувати растрові шрифти, якщо доступні Transparency Прозорість Main window Головне вікно 0 Equalizer Еквалайзер Playlist Список Miscellaneous Різне Song Display Список пісень Show protocol Показати протокол Show song numbers Відображати номери пісень Show playlists Показати списки Show popup information Показувати спливаюче вікно з інформацією Edit template Редагувати шаблон Playlist separator: Розділювач списків: Show 'New Playlist' button Показати кнопку "Новий список" Show anchor Показувати "якір" Align song numbers Вирівнювати номери фрагментів Select Skin Files Вибрати файли скінів Skin files Файли скінів Unarchived skin Розпакована тема Archived skin Упакована тема TextScroller Autoscroll Songname Автопрокрутка назви пісні Transparent Background Прозоре тло Buffering: %1% Буферизація: %1% VisualMenu Visualization Візуалізація qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts0000664000175000017500000013052312256224735024700 0ustar useruser ActionManager &Play &Odtwarzaj X X &Pause &Wstrzymaj C C &Stop &Zatrzymaj V V &Previous &Poprzedni Z Z &Next &Następny B B &Play/Pause &Odtwarzaj/Wstrzymaj Space Spacja J J &Jump to Track &Skocz do utworu &Repeat Playlist Powtó&rz listę odtwarzania R &Repeat Track &Powtórz utwór Ctrl+R &Shuffle &Losowo S &No Playlist Advance Ctrl+N &Stop After Selected Zatrzymaj po aktualnie odtwarzanym utworze Ctrl+S &Clear Queue Wy&czyść kolejkę Alt+Q Show Playlist Pokaż listę odtwarzania Alt+E Show Equalizer Pokaż korektor Alt+G Always on Top Zawsze na wierzchu Put on All Workspaces Na wszystkie pulpity Double Size Podwójny rozmiar Meta+D &Add File &Dodaj plik F F &Add Directory Dodaj &katalog D D &Add Url Dod&aj Url U U &Remove Selected &Usuń zaznaczone Del Del &Remove All Usuń &wszystkie &Remove Unselected Usuń &niezaznaczone Remove unavailable files Usuń niedostępne pliki Remove duplicates Usuń duplikaty &Queue Toggle Dodaj do/Usuń z kolejki Q Q Invert Selection Odwróć zaznaczenie &Select None &Odznacz wszystkie &Select All &Zaznacz wszystkie Ctrl+A Ctrl+A &View Track Details &Pokaż informacje o pliku Alt+I Alt+I &New List &Nowa lista Ctrl+T &Delete List Usuń listę o&dtwarzania Ctrl+W &Load List &Ładuj listę O O &Save List &Zapisz listę Shift+S Shift+S &Select Next Playlist Wybierz na&stępną listę Ctrl+PgDown &Select Previous Playlist Wybierz poprzednią li&stę Ctrl+PgUp &Show Playlists Pokaż li&sty odtwarzania P &Settings &Ustawienia Ctrl+P Ctrl+P &About &O programie &About Qt &O Qt &Exit &Wyjście Ctrl+Q Ctrl+Q EqWidget preset profil &Load/Delete Wczytaj/&Usuń &Save Preset Zapi&sz Profil &Save Auto-load Preset Zapi&sz Auto-ładowanie Profilu &Clear &Wyczyść Saving Preset Zapisywanie Profilu Preset name: Nazwa Profilu: preset # profil # &Import &Importuj Equalizer Korektor Import Preset Importuj Profil HotkeyEditor Action Akcje Shortcut Skrót Change shortcut... Zmień skrót... Playback Odtwarzanie View Wygląd Playlist Lista odtwarzania Misc Inne MainDisplay Previous Poprzedni Play Odtwarzaj Pause Pauza Stop Zatrzymaj Next Następny Add file Dodaj plik Equalizer Equalizer Playlist Lista odtwarzania Repeat playlist Powtórz listę odtwarzania Shuffle Losowo Volume Głośność Balance Balans Volume: %1% Głośność: %1% Balance: %1% right Balans: %1% prawy Balance: %1% left Balans: %1% lewy Balance: center Balans: środek Seek to: %1 Przewijanie: %1 MainVisual Visualization Mode Tryb wizualizacji Analyzer Analizator Scope Off Wyłączone Analyzer Mode Tryb Analizatora Normal Normalny Fire Ogień Vertical Lines Pionowe Linie Lines Linie Bars Słupki Peaks Piki Refresh Rate Odświeżanie 50 fps 25 fps 10 fps 5 fps Analyzer Falloff Prędkość Analizatora Slowest Najwolniej Slow Wolno Medium Średnio Fast Szybko Fastest Najszybciej Peaks Falloff Opadanie Pików Background Tło Transparent Przezroczystość MainWindow Appearance Wygląd Shortcuts Skróty klawiszowe View Wygląd Playlist Lista odtwarzania Tools Narzędzia PlayList &Copy Selection To Kopiuj zazna&czenie do Sort List Sortuj listę By Title Według nazwy By Album Według nazwy albumu By Disc Number Według numeru płyty By Artist Według artysty By Filename Według nazwy pliku By Path + Filename Według Ścieżki + Nazwy pliku By Date Wg Daty By File Creation Date Wg Daty Utworzenia Pliku Sort Selection Sortuj zaznaczone Randomize List Tasuj listę Reverse List Odwróć listę &New PlayList &Nowa lista odtwarzania By Track Number Wg numeru utworu Playlist Lista odtwarzania Actions Akcje PlayListBrowser Playlist Browser Menedżer list odtwarzania New Nowa Delete Usuń ... ... Rename Zmień nazwę PlayListSelector &Load Załaduj &Save As... Zapi&sz jako... Rename Zmień nazwę &Delete Usuń Rename Playlist Zmień nazwę listy Playlist name: Nazwa listy odtwarzania: PopupSettings Popup Information Settings Ustawienia informacji Popup Show cover Pokaż okładkę Transparency: Przezroczystość: Delay: Opóźnienie: ms Cover size: Rozmiar okładki: Template Szablon Reset Przywróć Insert Wstaw Artist Artysta Album Album Title Tytuł Track number Numer utworu Two-digit track number Dwuznakowy numer utworu Genre Gatunek Comment Komentarz Composer Kompozytor Duration Długość Disc number Numer albumu File name Nazwa pliku File path Lokalizacja Year Rok Condition Warunek PresetEditor Preset Editor Edytor Profili Load Ładuj Delete Usuń Preset Profil Auto-preset Auto-profil ShortcutDialog Change Shortcut Modyfikuj skrót Press the key combination you want to assign Wciśnij kombinację klawiszy, które chcesz przypisać Clear Wyczyść SkinnedFactory Skinned User Interface Interfejs obsługi skór dla Qmmp About Qmmp Skinned User Interface O interfejsie obsługi skór Qmmp Skinned User Interface Qmmp - Interfejs obsługi skór Simple user interface with Winamp-2.x/XMMS skins support Prosty interfejs obsługi skór z Winamp-2.x/XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Stworzone przez: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Grafika: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Skóry Add... Dodaj... Refresh Odśwież View Wygląd Hide on close Zminimalizuj przy zamykaniu Start hidden Uruchom zminimalizowany Use skin cursors Użyj kursorów z motywu Fonts Czcionki Player: Odtwarzacz: ??? ??? ... ... Playlist: Lista odtwarzania: Use bitmap font if available Użyj czcionki bitmapowej jeśli jest dostępna Transparency Przezroczystość Main window Okno główne 0 0 Equalizer Korektor Playlist Lista odtwarzania Miscellaneous Zaawansowane Song Display Wyświetlanie utworu Show protocol Pokaż protokół Show song numbers Wyświetl numery utworów na liście odtwarzania Show playlists Pokaż listy odtwarzania Show popup information Pokaż informację popup Edit template Edytuj szablon Playlist separator: Separator listy: Show 'New Playlist' button Pokaż przycisk 'Nowa lista odtwarazania' Show anchor Pokaż kotwicę Align song numbers Wyrównaj w pionie numery utworów Select Skin Files Wybierz skórę Skin files Pliki skór Unarchived skin Niekompresowana skórka Archived skin Skompresowana skórka TextScroller Autoscroll Songname Automatyczne przewijanie tytułu utworu Transparent Background Przeźroczyste tło Buffering: %1% Buforowanie: : %1% VisualMenu Visualization Wizualizacja qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts0000664000175000017500000013415112256224735024701 0ustar useruser ActionManager &Play Tocar X &Pause Pausar C &Stop Parar V &Previous Anterior Z &Next Próximo B &Play/Pause Space J &Jump to Track &Repeat Playlist R &Repeat Track Ctrl+R &Shuffle S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File &Adicionar arquivo F &Add Directory &Adicionar Diretorio D &Add Url U &Remove Selected &Remover selecionadas Del &Remove All &Remover tudo &Remove Unselected &Remover não selecionadas Remove unavailable files Remove duplicates &Queue Toggle Q Invert Selection Inverter Seleção &Select None &Nenhum selecionado &Select All &Selecionar tudo Ctrl+A &View Track Details &Ver detalhes da Faixa Alt+I &New List &Nova lista Ctrl+T &Delete List Ctrl+W &Load List &Carregar lista O &Save List &Salvar lista Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings Configurações Ctrl+P &About &Sobre &About Qt &Exit Sair Ctrl+Q EqWidget preset preset &Load/Delete &Carregar/Deletar &Save Preset %Salvar preset &Save Auto-load Preset &Salvar Auto-Carregar preset &Clear &Limpar Saving Preset Salvando Preset Preset name: Nome Preset: preset # Preset # &Import &Importar Equalizer Import Preset Importar Preset HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist Lista de músicas Misc MainDisplay Previous Play Pause Stop Next Add file Equalizer Playlist Lista de músicas Repeat playlist Shuffle Volume Balance Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Analyzer Scope Off Analyzer Mode Normal Fire Vertical Lines Lines Bars Peaks Refresh Rate 50 fps 25 fps 10 fps 5 fps Analyzer Falloff Slowest Slow Medium Fast Fastest Peaks Falloff Background Transparent MainWindow Appearance Aparência Shortcuts View Playlist Lista de músicas Tools PlayList &Copy Selection To Sort List Classificar lista By Title Por Título By Album By Disc Number By Artist By Filename Por Nome By Path + Filename Por Dirertório + Nome By Date Por Data By File Creation Date Sort Selection Classificar por Seleção Randomize List Lista Eleatória Reverse List Lista Revertida &New PlayList By Track Number Playlist Lista de músicas Actions PlayListBrowser Playlist Browser New Delete Remover ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Show cover Transparency: Delay: ms Cover size: Template Reset Insert Artist Artista Album Álbum Title Título Track number Two-digit track number Genre Gênero Comment Comentário Composer Duration Disc number File name File path Year Ano Condition PresetEditor Preset Editor Editor de Preset Load Carregar Delete Remover Preset Preset Auto-preset Auto-preset ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Temas Add... Refresh Recarregar View Hide on close Start hidden Use skin cursors Fonts Fontes Player: Player ??? ??? ... ... Playlist: Lista de músicas: Use bitmap font if available Transparency Main window 0 Equalizer Playlist Lista de músicas Miscellaneous Song Display Mostrar música Show protocol Show song numbers Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files Skin files Unarchived skin Archived skin TextScroller Autoscroll Songname Transparent Background Buffering: %1% VisualMenu Visualization qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts0000664000175000017500000013170312256224735024263 0ustar useruser ActionManager &Play &Wiedergabe X X &Pause &Pause C C &Stop &Stopp V V &Previous &Vorheriger Titel Z Z &Next &Nächster Titel B B &Play/Pause Wieder&gabe/Pause Space Leertaste J J &Jump to Track Zu Titel spr&ingen &Repeat Playlist W&iedergabeliste wiederholen R R &Repeat Track Tite&l wiederholen Ctrl+R Strg+R &Shuffle &Zufallswiedergabe S S &No Playlist Advance Kei&n voranschreiten in der Wiedergabeliste Ctrl+N Strg+N &Stop After Selected Wiedergabe nach dem au&sgewähltem Titel beenden Ctrl+S Strg+S &Clear Queue Wartes&chlange löschen Alt+Q Alt+Q Show Playlist Wiedergabeliste anzeigen Alt+E Alt+E Show Equalizer Equalizer anzeigen Alt+G Alt+G Always on Top Immer im Vordergrund Put on All Workspaces Auf allen Arbeitsflächen anzeigen Double Size Doppelte Größe Meta+D Meta+D &Add File &Datei hinzufügen F F &Add Directory &Verzeichnis hinzufügen D D &Add Url &URL hinzufügen U U &Remove Selected &Ausgewählte entfernen Del Entf &Remove All Alle &entfernen &Remove Unselected &Nicht ausgewählte entfernen Remove unavailable files Nichtverfügbare Dateien entfernen Remove duplicates Duplikate entfernen &Queue Toggle Zur &Warteschlange hinzufügen/Aus der Warteschlange entfernen Q Q Invert Selection Auswahl umkehren &Select None &Auswahl aufheben &Select All Alle aus&wählen Ctrl+A Strg+A &View Track Details &Titeldetails anzeigen Alt+I Alt+I &New List &Neue Wiedergabeliste Ctrl+T Strg+T &Delete List Wie&dergabeliste löschen Ctrl+W Strg+W &Load List Wiedergabeliste &laden O O &Save List Wiedergabeliste &speichern Shift+S Umschalt+S &Select Next Playlist Näch&ste Wiedergabeliste auswählen Ctrl+PgDown Strg+Bild ab &Select Previous Playlist Vorherige Wiedergabeli&ste auswählen Ctrl+PgUp Strg+Bild auf &Show Playlists Wiedergabeli&sten anzeigen P P &Settings Ein&stellungen Ctrl+P Strg+P &About Ü&ber &About Qt Übe&r Qt &Exit Be&enden Ctrl+Q Strg+Q EqWidget Equalizer Equalizer preset Voreinstellung &Load/Delete &Laden/Löschen &Save Preset &Voreinstellung speichern &Save Auto-load Preset &Automatische Voreinstellungen speichern &Import &Importieren &Clear &Zurücksetzen Saving Preset Voreinstellung speichern Preset name: Name der Voreinstellung: preset # Voreinstellung # Import Preset Voreinstellung importieren HotkeyEditor Action Aktion Shortcut Kurzbefehl Change shortcut... Kurzbefehl ändern … Playback Wiedergabe View Ansicht Playlist Wiedergabeliste Misc Verschiedenes MainDisplay Previous Vorheriger Titel Play Wiedergabe Pause Pause Stop Stopp Next Nächster Titel Add file Datei hinzufügen Equalizer Equalizer Playlist Wiedergabeliste Repeat playlist Wiedergabeliste wiederholen Shuffle Zufallswiedergabe Volume Lautstärke Balance Balance Volume: %1% Lautstärke: %1 % Balance: %1% right Balance: %1 % rechts Balance: %1% left Balance: %1 % links Balance: center Balance: Mitte Seek to: %1 Springen zu: %1 MainVisual Visualization Mode Visualisierungsmodus Analyzer Analyzer Scope Oszilloskop Off Aus Analyzer Mode Analyzer-Modus Normal Normal Fire Feuer Vertical Lines Vertikale Linien Lines Linien Bars Balken Peaks Spitzen Refresh Rate Wiederholfrequenz 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Analyzer-Abfall Slowest Sehr langsam Slow Langsam Medium Mittel Fast Schnell Fastest Sehr schnell Peaks Falloff Abfallen der Spitzen Background Hintergrund Transparent Transparent MainWindow Appearance Erscheinungsbild Shortcuts Kurzbefehle View Ansicht Playlist Wiedergabeliste Tools Werkzeuge PlayList Sort List Wiedergabeliste sortieren By Title Nach Titel By Album Nach Album By Disc Number Nach CD-Nummer By Artist Nach Interpret By Filename Nach Dateinamen By Path + Filename Nach Pfad + Dateinamen By Date Nach Datum By File Creation Date Sort Selection Auswahl sortieren Randomize List Wiedergabeliste mischen Reverse List Wiedergabeliste umkehren &New PlayList &Neue Wiedergabeliste &Copy Selection To Auswahl kopieren na&ch Playlist Wiedergabeliste By Track Number Nach Titelnummer Actions Aktionen PlayListBrowser Playlist Browser Wiedergabelisten durchsuchen New Neu Delete Löschen ... Rename Umbenennen PlayListSelector &Load &Laden &Save As... &Speichern unter … Rename Umbenennen &Delete L&öschen Rename Playlist Wiedergabeliste umbenennen Playlist name: Name der Wiedergabeliste: PopupSettings Popup Information Settings Einstellungen Aufklapp-Informationen Show cover Cover anzeigen Transparency: Transparenz: Delay: Verzögerung: ms ms Cover size: Cover-Größe: Template Vorlage Reset Zurücksetzen Insert Einfügen Artist Interpret Album Album Title Titel Track number Stücknummer Two-digit track number Zweistellige Stücknummer Genre Genre Comment Kommentar Composer Komponist Duration Abspieldauer Disc number CD-Nummer File name Dateiname File path Dateipfad Year Jahr Condition Zustand PresetEditor Preset Editor Bearbeiten der Voreinstellungen Load Laden Delete Löschen Preset Voreinstellung Auto-preset Automatische Voreinstellung ShortcutDialog Change Shortcut Kurzbefehl ändern Press the key combination you want to assign Drücken Sie die Tastenkombination, die Sie zuweisen möchten Clear Löschen SkinnedFactory Skinned User Interface Designte Benutzeroberfläche About Qmmp Skinned User Interface Über Qmmp „Designte Benutzeroberfläche“ Qmmp Skinned User Interface Qmmp „Designte Benutzeroberfläche“ Simple user interface with Winamp-2.x/XMMS skins support Einfache Benutzeroberfläche mit Unterstützung für Designs von Winamp 2.x und XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Autoren: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Design: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Designs Add... Hinzufügen... Refresh Aktualisieren View Ansicht Hide on close Beim Schließen in den Systemabschnitt der Kontrollleiste minimieren Start hidden Minimiert starten Use skin cursors Design-Mauszeiger verwenden Fonts Schriftarten Player: Player: ??? ??? ... Playlist: Wiedergabeliste: Use bitmap font if available Bitmap-Schriftart verwenden, falls verfügbar Transparency Transparenz Main window Hauptfenster 0 0 Equalizer Equalizer Playlist Wiedergabeliste Miscellaneous Verschiedenes Song Display Titelanzeige Show protocol Protokoll anzeigen Show song numbers Titelnummern anzeigen Show playlists Wiedergabelisten anzeigen Show popup information Informationen in einem Aufklapp-Fenster anzeigen Edit template Vorlage bearbeiten Playlist separator: Wiedergabelisten-Trenner: Show 'New Playlist' button „Neue Wiedergabeliste“-Knopf zeigen Show anchor Align song numbers Stücknummern ausrichten Select Skin Files Design-Dateien auswählen Skin files Design-Dateien Unarchived skin Nicht archiviertes Design Archived skin Archiviertes Design TextScroller Autoscroll Songname Automatischer Bildlauf des Titelnamens Transparent Background Transparenter Hintergrund Buffering: %1% Pufferung: %1 % VisualMenu Visualization Visualisierung qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts0000664000175000017500000013143312256224735024300 0ustar useruser ActionManager &Play Pře&hrát X X &Pause Pau&za C C &Stop &Stop V V &Previous &Předchozí Z Z &Next &Další B B &Play/Pause Př&ehrát/Pauza Space Mezerník J J &Jump to Track &Skočit na stopu &Repeat Playlist &Opakovat seznam skladeb R O &Repeat Track &Opakovat stopu Ctrl+R Ctrl+R &Shuffle Za&míchat S M &No Playlist Advance &Nepokračovat v seznamu skladeb Ctrl+N Ctrl+N &Stop After Selected Za&stavit po výběru Ctrl+S Ctrl+S &Clear Queue &Vyčistit frontu Alt+Q Alt+Q Show Playlist Zobrazit seznam skladeb Alt+E Alt+E Show Equalizer Zobrazit ekvalizér Alt+G Alt+G Always on Top Vždy na vrchu Put on All Workspaces Na všech pracovních plochách Double Size Dvojnásobná velikost Meta+D Meta+D &Add File Přidat &soubor F F &Add Directory Přidat &adresář D D &Add Url Přidat &URL U U &Remove Selected &Odstranit vybrané Del Del &Remove All Odstranit &vše &Remove Unselected Odstranit &nevybrané Remove unavailable files Odstranit nedostupné soubory Remove duplicates Odstranit duplicity &Queue Toggle Do/z &fronty Q Q Invert Selection Invertovat výběr &Select None &Zrušit výběr &Select All &Vybrat vše Ctrl+A Ctrl+A &View Track Details Zobrazit &informace o skladbě Alt+I Alt+I &New List &Nový seznam Ctrl+T Ctrl+T &Delete List O&dstranit seznam Ctrl+W Ctrl+W &Load List Načíst &seznam O O &Save List &Uložit seznam Shift+S Shift+S &Select Next Playlist Vybrat další &seznam skladeb Ctrl+PgDown Ctrl+PageDown &Select Previous Playlist Vybrat předchozí &seznam skladeb Ctrl+PgUp Ctrl+PageUp &Show Playlists Zobrazit &seznamy skladeb P P &Settings &Nastavení Ctrl+P Ctrl+P &About O &aplikaci &About Qt O knihovně &Qt &Exit U&končit Ctrl+Q Ctrl+Q EqWidget Equalizer Ekvalizér preset předvolba &Load/Delete &Načíst/Odstranit &Save Preset &Uložit předvolbu &Save Auto-load Preset Uložit &automatickou předvolbu &Import &Importovat &Clear &Vynulovat Saving Preset Uložení předvolby Preset name: Název předvolby: preset # předvolba # Import Preset Importovat předvolbu HotkeyEditor Action Činnost Shortcut Zkratka Change shortcut... Změnit zkratku... Playback Přehrávání View Zobrazení Playlist Seznam skladeb Misc Různé MainDisplay Previous Předchozí Play Přehrát Pause Pozastavit Stop Zastavit Next Další Add file Přidat soubor Equalizer Ekvalizér Playlist Seznam skladeb Repeat playlist Opakovat seznam skladeb Shuffle Zamíchat Volume Hlasitost Balance Vyvážení Volume: %1% Hlasitost: %1% Balance: %1% right Vyvážení: %1% vpravo Balance: %1% left Vyvážení %1% vlevo Balance: center Vyvážení: střed Seek to: %1 Přesunout na: %1 MainVisual Visualization Mode Režim vizualizace Analyzer Frekvenční analýza Scope Osciloskop Off Vypnuto Analyzer Mode Režim analýzy Normal Normální Fire Oheň Vertical Lines Sloupce Lines Úzké Bars Široké Peaks Špičky Refresh Rate Obnovovací frekvence 50 fps 50 Hz 25 fps 25 Hz 10 fps 10 Hz 5 fps 5 Hz Analyzer Falloff Pokles analyzátoru Slowest Nejpomalejší Slow Pomalý Medium Střední Fast Rychlý Fastest Nejrychlejší Peaks Falloff Pokles špiček Background Pozadí Transparent Průhledné MainWindow Appearance Vzhled Shortcuts Zkratky View Zobrazení Playlist Seznam skladeb Tools Nástroje PlayList Sort List Seřadit seznam By Title Podle názvu skladby By Album Podle alba By Disc Number Podle čísla disku By Artist Podle umělce By Filename Podle názvu souboru By Path + Filename Podle cesty a názvu souboru By Date Podle data By File Creation Date Podle data vytvoření souboru Sort Selection Seřadit výběr Randomize List Zamíchat seznam Reverse List Obrátit pořadí seznamu &New PlayList &Nový seznam skladeb &Copy Selection To &Kopírovat výběr do Playlist Seznam skladeb By Track Number Podle čísla skladby Actions Činnosti PlayListBrowser Playlist Browser Prohlížeč seznamů skladeb New Nový Delete Odstranit ... ... Rename Přejmenovat PlayListSelector &Load &Načíst &Save As... Uložit j&ako... Rename Přejmenovat &Delete O&dstranit Rename Playlist Přejmenovat seznam skladeb Playlist name: Název seznamu skladeb: PopupSettings Popup Information Settings Nastavení informací ve vyskakovacím okně Show cover Zobrazit obal Transparency: Průhlednost: Delay: Prodleva: ms ms Cover size: Velikost obalu: Template Šablona Reset Původní Insert Vložit Artist Umělec Album Album Title Název Track number Číslo stopy Two-digit track number Dvoumístné číslo stopy Genre Žánr Comment Poznámka Composer Skladatel Duration Délka Disc number Číslo disku File name Název souboru File path Cesta k souboru Year Rok Condition Stav PresetEditor Preset Editor Editor předvoleb Load Načíst Delete Odstranit Preset Předvolba Auto-preset Automatická předvolba ShortcutDialog Change Shortcut Změnit klávesovou zkratku Press the key combination you want to assign Stlačte kombinaci kláves, kterou chcete přiřadit Clear Vymazat SkinnedFactory Skinned User Interface Uživatelské rozhraní s tématy vzhledu About Qmmp Skinned User Interface O uživatelském rozhraní Qmmp s tématy vzhledu Qmmp Skinned User Interface Uživatelské rohraní Qmmp s tématy vzhledu Simple user interface with Winamp-2.x/XMMS skins support Jednoduché úživatelské rozhraní, které podporuje témata vzhledu pro Winamp-2.x a XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Autoři: Vladimír Kuzněcov <vovanec@gmail.com> Ilja Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Grafika: Andrej Andrejev <andreev00@gmail.com> SkinnedSettings Skins Témata Add... Přidat... Refresh Obnovit View Zobrazení Hide on close Skrýt při zavření Start hidden Spustit skryté Use skin cursors Použít kurzory z tématu Fonts Písma Player: Přehrávač: ??? ??? ... ... Playlist: Seznam skladeb: Use bitmap font if available Použít bitmapové písmo, je-li dostupné Transparency Průhlednost Main window Hlavní okno 0 0 Equalizer Ekvalizér Playlist Seznam skladeb Miscellaneous Různé Song Display Zobrazení skladby Show protocol Zobrazit protokol Show song numbers Zobrazit čísla skladeb Show playlists Zobrazit seznamy skladeb Show popup information Zobrazit informace ve vyskakovacím okně Edit template Upravit šablonu Playlist separator: Oddělovač seznamu skladeb: Show 'New Playlist' button Zobrazit tlačítko ‚Nový seznam skladeb‘ Show anchor Zobrazit kotvu Align song numbers Zarovnat čísla skladeb Select Skin Files Vybrat soubory s tématem Skin files Soubory s tématem Unarchived skin Rozbalené téma Archived skin Sbalené téma TextScroller Autoscroll Songname Automaticky rolovat název skladby Transparent Background Průhledné pozadí Buffering: %1% překlad nemusí být doslovný, ale srozumitelný ... :-) Načítám: %1% VisualMenu Visualization Vizualizace qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts0000664000175000017500000013214312256224735024301 0ustar useruser ActionManager &Play &Reproducir X X &Pause &Pausar C C &Stop &Detener V V &Previous &Anterior Z Z &Next &Siguiente B B &Play/Pause &Reproducir/Pausar Space Espacio J J &Jump to Track &Repeat Playlist &Repetir la lista R R &Repeat Track &Repetir pista Ctrl+R Ctrl+R &Shuffle &Revolver S S &No Playlist Advance &No avanzar en la lista Ctrl+N Ctrl+N &Stop After Selected &Parar tras los seleccionados Ctrl+S Ctrl+S &Clear Queue &Limpiar la Cola Alt+Q Alt+Q Show Playlist Mostrar la lista Alt+E Alt+E Show Equalizer Mostrar el ecualizador Alt+G Alt+G Always on Top Siempre encima Put on All Workspaces Ver en todos los escritorios Double Size Tamaño doble Meta+D &Add File &Añadir archivo F F &Add Directory &Añadir directorio D D &Add Url &Añadir URL U U &Remove Selected &Eliminar los seleccionados Del Supr &Remove All &Eliminar todo &Remove Unselected &Eliminar los no seleccionados Remove unavailable files Eliminar los archivos no disponibles Remove duplicates Eliminar los duplicados &Queue Toggle &Cambiar de cola Q Q Invert Selection Invertir la selección &Select None &No seleccionar nada &Select All &Seleccionar todo Ctrl+A Ctrl+A &View Track Details &Ver detalles de la pista Alt+I Alt+I &New List &Lista nueva Ctrl+T Ctrl+T &Delete List &Borrar la lista Ctrl+W Ctrl+W &Load List &Cargar una lista O O &Save List &Guardar la lista Shift+S Shift+S &Select Next Playlist &Seleccionar la lista siguiente Ctrl+PgDown Ctrl+AvPág &Select Previous Playlist &Seleccionar la lista anterior Ctrl+PgUp Ctrl+RePág &Show Playlists &Mostrar las listas P P &Settings &Configuración Ctrl+P Ctrl+P &About &Acerca de &About Qt &Acerca de Qt &Exit &Salir Ctrl+Q Ctrl+Q EqWidget preset preprogramado &Load/Delete &Cargar/Eliminar &Save Preset &Guardar preprogramado &Save Auto-load Preset &Guardar preprogramado autocargable &Clear &Limpiar Saving Preset Guardando preprogramado Preset name: Nombre del preprogramado: preset # Preprogramado nº &Import &Importar Equalizer Ecualizador Import Preset Importar preprogramado HotkeyEditor Action Acción Shortcut Atajo Change shortcut... Cambiar atajo... Playback Reproducción View Ver Playlist Lista de reproducción Misc Varios MainDisplay Previous Anterior Play Reproducir Pause Pausar Stop Detener Next Siguiente Add file Añadir archivo Equalizer Ecualizador Playlist Lista de reproducción Repeat playlist Repetir la lista de reproducción Shuffle Revolver Volume Volumen Balance Balance Volume: %1% Volumen: %1% Balance: %1% right Balance: %1% derecha Balance: %1% left Balance: %1% izquierda Balance: center Balance: centro Seek to: %1 Ir hasta: %1 MainVisual Visualization Mode Modo de visualización Analyzer Analizador Scope Osciloscopio Off Apagado Analyzer Mode Modo del analizador Normal Normal Fire Fuego Vertical Lines Líneas verticales Lines Líneas Bars Barras Peaks Picos Refresh Rate Velocidad de actualización 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Caída del analizador Slowest Muy lenta Slow Lenta Medium Media Fast Rápida Fastest Muy rápida Peaks Falloff Caída de picos Background Fondo Transparent Transparente MainWindow Appearance Aspecto Shortcuts Atajos View Ver Playlist Lista de reproducción Tools Herramientas PlayList &Copy Selection To &Copiar la selección a Sort List Ordenar la lista By Title Por título By Album Por album By Disc Number By Artist Por intérprete By Filename Por nombre de archivo By Path + Filename Por ruta + nombre By Date Por fecha By File Creation Date Sort Selection Ordenar la selección Randomize List Lista aleatoria Reverse List Invertir la lista &New PlayList &Lista nueva By Track Number Por número de pista Playlist Lista de reproducción Actions Acciones PlayListBrowser Playlist Browser Navegador de listas de reproducción New Nueva Delete Borrar ... ... Rename Renombrar PlayListSelector &Load &Cargar &Save As... &Guardar como... Rename Renombrar &Delete &Borrar Rename Playlist Renombrar lista Playlist name: Nombre de la lista: PopupSettings Popup Information Settings Configuración de información emergente Show cover Mostrar carátula Transparency: Transparencia: Delay: Retardo: ms ms Cover size: Tamaño de la carátula: Template Plantilla Reset Reiniciar Insert Insertar Artist Intérprete Album Album Title Título Track number Número de pista Two-digit track number Número de pista con dos cifras Genre Género Comment Comentario Composer Compositor Duration Duración Disc number Número de disco File name Nombre del archivo File path Ruta del archivo Year Año Condition Condición PresetEditor Preset Editor Editor de preprogamados Load Cargar Delete Borrar Preset Preprogramado Auto-preset Automático ShortcutDialog Change Shortcut Cambiar atajo Press the key combination you want to assign Pulse la combinación de teclas que quiere asignar Clear Borrar SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Pieles Add... Añadir... Refresh Actualizar View Ver Hide on close Esconder al cerrar Start hidden Iniciar oculto Use skin cursors Usar pieles en cursor Fonts Fuentes Player: Reproductor: ??? ??? ... ... Playlist: Lista de reproducción: Use bitmap font if available Usar fuente bitmap si está disponible Transparency Transparencia Main window Ventana principal 0 0 Equalizer Ecualizador Playlist Lista de reproducción Miscellaneous Varios Song Display Mostrar la canción Show protocol Motrar protocolo Show song numbers Mostrar los números de canción Show playlists Mostrar la lista de reproducción Show popup information Mostrar información emergente Edit template Editar la plantilla Playlist separator: Show 'New Playlist' button Show anchor Mostrar ancla Align song numbers Alinear los números de canción Select Skin Files Seleccionar archivos de pieles Skin files Archivos de pieles Unarchived skin Piel no archivada Archived skin Piel archivada TextScroller Autoscroll Songname Autodesplazar el nombre de la canción Transparent Background Buffering: %1% Cargando: %1% VisualMenu Visualization Visualización qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_fr.ts0000664000175000017500000013363312256224735024306 0ustar useruser ActionManager &Play &Jouer X X &Pause &Pause C C &Stop &Arrêter V V &Previous &Précédent Z Z &Next &Suivant B B &Play/Pause &Jouer / Pause Space Espace &Jump to Track J J &Repeat Playlist R &Repeat Track Ctrl+R &Shuffle S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File &Ajouter un fichier F F &Add Directory &Ajouter un dossier D D &Add Url &Ajouter un flux internet U U &Remove Selected &Supprimer la sélection Del Suppr &Remove All &Tout supprimer &Remove Unselected &Ne garder que la sélection Remove unavailable files Remove duplicates &Queue Toggle Q Q Invert Selection Inverser la sélection &Select None &Ne rien sélectionner &Select All &Tout sélectionner Ctrl+A Ctrl+A &View Track Details &Afficher les détails du morceau Alt+I Alt+I &New List &Nouvelle liste Ctrl+T &Delete List Ctrl+W &Load List &Charger une liste O O &Save List &Enregistrer une liste Shift+S Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings &Configuration Ctrl+P Ctrl+P &About &À propos &About Qt &À propos de Qt &Exit &Quitter Ctrl+Q Ctrl+Q EqWidget preset réglage &Load/Delete &Charger / Supprimer &Save Preset &Enregistrer un réglage &Save Auto-load Preset &Enregistrer un réglage automatiquement-chargé &Clear &Effacer Saving Preset Réglage en cours d'enregistrement Preset name: Nom du réglage : preset # réglage # &Import &Importer Equalizer Import Preset Importer un réglage HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist Liste de lecture Misc MainDisplay Previous Play Pause Stop Next Add file Equalizer Playlist Liste de lecture Repeat playlist Shuffle Volume Balance Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Visualisation Analyzer Analyseur Scope Oscilloscope Off Arrêt Analyzer Mode Mode analyseur Normal Normal Fire Feu Vertical Lines Lignes verticales Lines Lignes Bars Barres Peaks Pics Refresh Rate Rafraîchir le taux 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Retombée de l'analyseur Slowest Très lente Slow Lente Medium Moyenne Fast Rapide Fastest Très rapide Peaks Falloff Retombée des pics Background Arrière-plan Transparent Transparent MainWindow Appearance Apparence Shortcuts View Playlist Liste de lecture Tools PlayList Playlist Liste de lecture &Copy Selection To Sort List Trier la liste By Title Par titre By Album By Disc Number By Artist By Filename Par nom de fichier By Path + Filename Par emplacement + nom de fichier By Date Par date By File Creation Date Sort Selection Trier la sélection Randomize List Mélanger la liste Reverse List Inverser la liste Actions &New PlayList By Track Number Par numéro de piste PlayListBrowser Playlist Browser New Delete Supprimer ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Template Reset Insert Show cover Cover size: Transparency: Delay: ms Artist Artiste Album Album Title Titre Track number Two-digit track number Genre Genre Comment Commentaire Composer Duration Disc number File name File path Year Année Condition PresetEditor Preset Editor Éditeur de réglages Load Charger Delete Supprimer Preset Réglage Auto-preset Réglage auto ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Thèmes Add... Refresh Rafraîchir View Hide on close Masquer à la fermeture Start hidden Démarrer masqué Use skin cursors Fonts Polices Player: Lecteur : ??? ??? ... ... Playlist: Liste de lecture : Use bitmap font if available Transparency Main window 0 Equalizer Playlist Liste de lecture Miscellaneous Song Display Affichage du morceau Show protocol Show song numbers Align song numbers Show anchor Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Select Skin Files Skin files Unarchived skin Thème non-archivé Archived skin Thème archivé TextScroller Autoscroll Songname Détection automatique du nom de fichier Transparent Background Buffering: %1% VisualMenu Visualization Visualisation qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_he.ts0000664000175000017500000013255312256224735024273 0ustar useruser ActionManager &Play &נגן X &Pause ה&שהה C &Stop ה&פסק V &Previous ה&קודם Z &Next ה&בא B &Play/Pause נ&גן/השהה Space רווח &Jump to Track &קפוץ אל רצועה J &Repeat Playlist &חזור על רשימת השמעה R &Repeat Track &חזור על רצועה Ctrl+R &Shuffle &ערבב S &No Playlist Advance אין &בלי החשת רשימת השמעה Ctrl+N &Stop After Selected לאחר ה&פסק עובר נבחרת Ctrl+S &Clear Queue &טהר תור Alt+Q Show Playlist הצג רשימת השמעה Alt+E Show Equalizer הצג אקולייזר Alt+G Always on Top תמיד עליון Put on All Workspaces השם בכל מרחבי העבודה Double Size מימד כפול Meta+D &Add File &הוסף קובץ F &Add Directory &הוסף מדור D &Add Url &הוסף Url U &Remove Selected &הסר נבחרות Del &Remove All ה&סר הכל &Remove Unselected &הסר לא נבחרות Remove unavailable files הסר קבצים שאינם זמינים Remove duplicates הסר כפילויות &Queue Toggle &תור Q Invert Selection הפוך בחירה &Select None &בחר כלום &Select All &בחר הכל Ctrl+A &View Track Details &הצג פרטי רצועה Alt+I &New List רשימה &חדשה Ctrl+T &Delete List &מחק רשימה Ctrl+W &Load List &טען רשימה O &Save List &שמור רשימה Shift+S &Select Next Playlist &בחר רשימת השמעה באה Ctrl+PgDown &Select Previous Playlist &בחר רשימת השמעה קודמת Ctrl+PgUp &Show Playlists &הצג רשימות השמעה P &Settings &הגדרות Ctrl+P &About &אודות &About Qt אודות &Qt &Exit י&ציאה Ctrl+Q EqWidget Equalizer אקולייזר preset קביעות &Load/Delete &טען/מחק &Save Preset &שמור קביעות &Save Auto-load Preset &שמור קביעות שנטענות אוטומטית &Import יי&בוא &Clear &טהר Saving Preset שמירת קביעות Preset name: שם קביעה: preset # קביעה מספר Import Preset ייבוא קביעות HotkeyEditor Action פעולה Shortcut קיצור דרך Change shortcut... שנה קיצור דרך... Playback פס קול View תצוגה Playlist רשימת השמעה Misc שונות MainDisplay Previous הקודם Play נגן Pause השהה Stop הפסק Next הבא Add file הוסף קובץ Equalizer אקולייזר Playlist רשימת השמעה Repeat playlist חזור על רשימת השמעה Shuffle ערבב Volume עוצמת קול Balance איזון Volume: %1% עצמת קול: %1% Balance: %1% right איזון: %1% ימינה Balance: %1% left איזון: %1% שמאלה Balance: center איזון: מרכז Seek to: %1 מעבר אל: %1 MainVisual Visualization Mode מצב חיזוי Analyzer מאבחן Scope היקף טווח Off כבוי Analyzer Mode צורת אבחון Normal רגילה Fire אש Vertical Lines קווים אנכיים Lines קווים Bars מוטות Peaks שיאים Refresh Rate שיעור רענון 50 fps 25 fps 10 fps 5 fps Analyzer Falloff נפילת מאבחן Slowest הכי איטית Slow איטית Medium בינונית Fast מהירה Fastest הכי מהירה Peaks Falloff נפילת שיאים Background רקע אחורי Transparent שקיפות MainWindow Appearance הופעה Shortcuts קיצורי דרך View תצוגה Playlist רשימת השמעה Tools כלים PlayList Playlist רשימת השמעה &Copy Selection To &העתק בחירה אל Sort List מיין רשימה By Title לפי כותרת By Album לפי אלבום By Disc Number לפי מספר תקליטור By Artist לפי אמן By Filename לפי שם קובץ By Path + Filename לפי נתיב + שם קובץ By Date לפי תאריך By Track Number לפי מספר רצועה By File Creation Date לפי תאריך יצירת קובץ Sort Selection מיין נבחרות Randomize List רשימה אקראית Reverse List רשימה מהופכת Actions פעולות &New PlayList רשימת השמעה &חדשה PlayListBrowser Playlist Browser עיון ברשימת השמעה New חדש Delete מחק ... Rename שנה שם PlayListSelector &Load &טען &Save As... &שמור בשם... Rename שנה שם &Delete &מחק Rename Playlist שנה שם רשימת השמעה Playlist name: שם רשימת השמעה: PopupSettings Popup Information Settings הגדרות מידע מוקפץ Template תבנית Reset אפס Insert שבץ Show cover הצג כיסוי Cover size: מידת כיסוי: Transparency: שקיפות: Delay: שיהוי: ms מ״ש Artist אמן Album אלבום Title כותרת Track number מספר רצועה Two-digit track number מספר רצועה דו ספרתי Genre ז'אנר Comment הערה Composer מלחין Duration משך Disc number מספר תקליטור File name שם קובץ File path נתיב קובץ Year שנה Condition תנאי PresetEditor Preset Editor עורך קביעות Preset קביעות Auto-preset קביעות אוטומטיות Load טען Delete מחק ShortcutDialog Change Shortcut שנה קיצור דרך Press the key combination you want to assign הזן את צירוף המקשים שברצונך להקצות Clear טהר SkinnedFactory Skinned User Interface forged ממשק משתמש מחושל About Qmmp Skinned User Interface אודות ממשק משתמש מחושל Qmmp Qmmp Skinned User Interface ממשק משתמש מחושל Qmmp Simple user interface with Winamp-2.x/XMMS skins support ממשק משתמש פשוט עם תמיכה לסקינים של Winamp-2.x/XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי:‭ Vladimir Kuznetsov ‫<vovanec@gmail.com> Ilya Kotov ‫<forkotov02@hotmail.ru>‬ Artwork: Andrey Adreev <andreev00@gmail.com> אומנות:‭ Andrey Adreev <andreev00@gmail.com>‬ SkinnedSettings Skins סקינים Add... הוסף... Refresh רענן View תצוגה Hide on close הסתר בעת סגירה Start hidden התחל מוסתר Use skin cursors השתמש בסמני סקין Fonts גופנים Player: נגן: ??? ... Playlist: רשימת השמעה: Use bitmap font if available נצל גופן השתמש בגופן של מפת סיביות אם זמין Transparency שקיפות Main window חלון ראשי 0 Equalizer אקולייזר Playlist רשימת השמעה Miscellaneous שונות Song Display תצוגת שיר Show protocol הצג פרוטוקול Show song numbers הצג מספר שיר Align song numbers ישר מספר שיר Show anchor הצג עוגן Show playlists הצג רשימות השמעה Show popup information הצג מידע מוקפץ Edit template ערוך תבנית Playlist separator: מפריד רשימת השמעה: Show 'New Playlist' button הצג לחצן 'רשימת השמעה חדשה' Select Skin Files בחר קבצי סקין Skin files קבצי סקין Unarchived skin סקין שלא בתוך ארכיון Archived skin סקין שבתוך ארכיון TextScroller Autoscroll Songname גלול שם שיר אוטומטית Transparent Background רקע אחורי שקוף Buffering: %1% אוגר כעת: %1% VisualMenu Visualization חיזוי qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts0000664000175000017500000013430712256224735024312 0ustar useruser ActionManager &Play &Lejátszás X X &Pause &Szünet C C &Stop &Megállítás V V &Previous &Előző Z Z &Next &Következő B B &Play/Pause &Lejátszás/Szünet Space Szóköz J J &Jump to Track &Repeat Playlist Lista &ismétlése R &Repeat Track Számok i&smétlése Ctrl+R Crtl+R &Shuffle &Véletlenszerű S S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File &Fájl hozzáadása F F &Add Directory &Könyvtár hazááadása D D &Add Url &Url hozzáadása U U &Remove Selected &Megjelöltek eltávolítása Del Del &Remove All &Összes eltávolítása &Remove Unselected &Jelöletlenek eltávolítása Remove unavailable files Elérhetetlen fájlok eltávolítása Remove duplicates Duplikációk eltávolítása &Queue Toggle Q Q Invert Selection Fordított kijelölés &Select None &Kijelölés megszűntetése &Select All &Összes kijelölése Ctrl+A Ctrl+A &View Track Details Szám adatainak &megnézése Alt+I Alt+I &New List &Új lista Ctrl+T Ctrl+T &Delete List &Lista törlése Ctrl+W Ctrl+W &Load List &Lista betöltése O O &Save List Lista &mentése Shift+S Shift+S &Select Next Playlist &Következő lista választása Ctrl+PgDown Ctrl+PgDown &Select Previous Playlist &Előző lista választása Ctrl+PgUp Ctrl+PgUp &Show Playlists &Lejátszási lista mutatása P P &Settings &Beállítások Ctrl+P Ctrl+P &About &Névjegy &About Qt N&évjegy: Qt &Exit &Kilépés Ctrl+Q Ctrl+Q EqWidget Equalizer Hangszínszabályzó preset beállítás &Load/Delete &Betölt/Töröl &Save Preset Beálítás &mentése &Save Auto-load Preset &Automatikusan betöltödő beállítás mentése &Import &Importálás &Clear &Törlés Saving Preset Beállítások mentése Preset name: Beállítás neve: preset # beállítás # Import Preset Beállítás importálása HotkeyEditor Action Shortcut Change shortcut... Playback Lejátszás View Megnéz Playlist Lejátszási lista Misc MainDisplay Previous Előző Play Lejátszás Pause Szünet Stop Megállít Next Következő Add file Fájl hozzáadása Equalizer Hangszínszabályzó Playlist Lejátszási lista Repeat playlist Lista ismétlése Shuffle Véletlenszerű Volume Hangerő Balance Egyensúly Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Vizualizációs mód Analyzer Analyzer Scope Scope Off Ki Analyzer Mode Analyzer mód Normal Hagyományos Fire Tűz Vertical Lines Függőleges vonalak Lines Vonalak Bars Csíkok Peaks Csúcsok Refresh Rate Ráta frissítése 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Analízer esése Slowest Lassabb Slow Lassú Medium Közepes Fast Gyors Fastest Gyorsabb Peaks Falloff Csúcsok esése Background Háttér Transparent Átlátszóság MainWindow Playlist Lejátszási lista Appearance Megjelenés Shortcuts View Megnéz Tools Eszközök PlayList Playlist Lejátszási lista Sort List Lista rendezése By Title Cím szerint By Album Album szerint By Disc Number By Artist Előadó szerint By Filename Fájlnév szerint By Path + Filename Elérési út és fájlnév szerint By Date Dátum szerint By Track Number Zene sorszáma szerint By File Creation Date Sort Selection Jelöltek rendezése Randomize List Lista összekeverése Reverse List Fordított lista Actions Tevékenységek &New PlayList &Copy Selection To PlayListBrowser Playlist Browser Lejátszási lista böngésző New Új Delete Törlés ... ... Rename Átnevez PlayListSelector &Load &Betölt &Save As... &Mentés másként... Rename Átnevez &Delete &Törlés Rename Playlist Lista átnevezése Playlist name: Lista neve: PopupSettings Popup Information Settings Popup Információs Beállítások Show cover Borító mutatása Transparency: Átlátszóság: Delay: Késleltetés: ms ms Cover size: Borító mérete: Template Sablon Reset Visszaállít Insert Beszúr Artist Előadó Album Album Title Cím Track number Zeneszám Two-digit track number Két jegyű zeneszám Genre Műfaj Comment Megjegyzés Composer Szerző Duration Időtartam Disc number Lemezszám File name Fájl neve File path Fájl útvonala Year Év Condition Feltétel PresetEditor Preset Editor Beállítás szerkesztő Load Betölt Delete Töröl Preset Beállítás Auto-preset Automatikus beállítás ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Skinek Add... Hozzáad... Refresh Frissít View Megnéz Hide on close Elrejtés bezáráskor Start hidden Rejtve induljon Use skin cursors Skin egértéma használata Fonts Betűtípus Player: Lejátszó: ??? ??? ... ... Playlist: Lejátszási lista: Use bitmap font if available Bittérképes betűtípus használata, ha elérhető Transparency Átlátszóság Main window Fő ablak 0 0 Equalizer Hangszínszabályzó Playlist Lejátszási lista Miscellaneous Vegyes Song Display Szám kijelző Show protocol Protokol mutatása Show song numbers Zene sorszámának mutatása Show playlists Lejátszási lista mutatása Show popup information Felugró információk mutatása Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files Skin fájl kiválasztása Skin files Skin fájlok Unarchived skin Tömörítettlen skin Archived skin Tömörített skin TextScroller Autoscroll Songname Számok címének görgetése Transparent Background Buffering: %1% VisualMenu Visualization Vizualizáció qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts0000664000175000017500000013340012256224735024261 0ustar useruser ActionManager &Play 再生(&Y) X X &Pause 一時停止(&P) C C &Stop 終止(&S) V V &Previous 前の曲(&R) Z Z &Next 次の曲(&N) B B &Play/Pause 再生/一時停止(&A) Space Space J J &Jump to Track 指定のトラックへ移動(&J) &Repeat Playlist プレイリストを繰り返す(&L) R R &Repeat Track トラックを繰り返す(&T) Ctrl+R Ctrl+R &Shuffle シャッフル(&F) S S &No Playlist Advance 次の曲に進まず終止(&N) Ctrl+N Ctrl+N &Stop After Selected 選んだ曲を再生後に終止(&S) Ctrl+S Ctrl+S &Clear Queue キューを消去(&C) Alt+Q Alt+Q Show Playlist プレイリストを表示 Alt+E Alt+E Show Equalizer イコライザーを表示 Alt+G Alt+G Always on Top 常に前面へ Put on All Workspaces 常に表示中のワークスペースに置く Double Size 倍サイズ Meta+D &Add File ファイルを追加(&F) F F &Add Directory ディレクトリを追加(&D) D D &Add Url URL を追加(&U) U U &Remove Selected 選択したものを除去(&V) Del Delele &Remove All すべて除去(&M) &Remove Unselected 選択外のものを除去(&N) Remove unavailable files 無効なファイルを除去 Remove duplicates 重複分を除去 &Queue Toggle 選んだプレイリストを キューに追加/キューから撤去 Q Q Invert Selection 選択範囲を反転 &Select None 選択を解除(&N) &Select All すべて選択(&E) Ctrl+A Ctrl+A &View Track Details トラックの詳細を表示(&D) Alt+I Alt+I &New List 新規リスト(&W) Ctrl+T Ctrl+T &Delete List リストを削除(&D) Ctrl+W Ctrl+W &Load List リストを読込(&L) O O &Save List リストを保存(&S) Shift+S Shift+S &Select Next Playlist 次のプレイリストを選択(&N) Ctrl+PgDown Ctrl+PgDown &Select Previous Playlist 前のプレイリストを選択(&P) Ctrl+PgUp Ctrl+PgUp &Show Playlists プレイリストを表示(&H) P P &Settings 設定(&S) Ctrl+P Ctrl+P &About QMMP について(&A) &About Qt Qt について(&Q) &Exit 終了(&X) Ctrl+Q Ctrl+Q EqWidget Equalizer イコライザー preset プリセット &Load/Delete 読み込み/削除(&L) &Save Preset プリセットを保存(&S) &Save Auto-load Preset 自動読み込みされたプリセットを保存(&S) &Import 移入(&I) &Clear 消去(&C) Saving Preset プリセットを保存しています Preset name: プリセット名: preset # プリセット番号 Import Preset プリセットを移入 HotkeyEditor Action 動作 Shortcut ショートカット Change shortcut... ショートカットを変更... Playback 再生 View 観容 Playlist プレイリスト Misc その他いろいろ MainDisplay Previous 前の曲 Play 再生 Pause 一時停止 Stop 終止 Next 次の曲 Add file ファイルを追加 Equalizer イコライザー Playlist プレイリスト Repeat playlist プレイリストを繰り返し Shuffle シャッフル Volume 音量 Balance バランス Volume: %1% 音量: %1% Balance: %1% right バランス: %1% 右へ Balance: %1% left バランス: %1% 左へ Balance: center バランス: 中央に Seek to: %1 %1 に移動 MainVisual Visualization Mode 視覚効果モード Analyzer スペクトルアナライザー Scope オシロスコープ Off 使わない Analyzer Mode アナライザーモード Normal 通常 Fire Vertical Lines Winamp の表示どおりに Lines Bars Peaks ピーク表示 Refresh Rate 再描画の頻度 50 fps 50 フレーム毎秒 25 fps 25 フレーム毎秒 10 fps 10 フレーム毎秒 5 fps 5 フレーム毎秒 Analyzer Falloff アナライザー減衰速度 Slowest さらに遅く Slow 遅く Medium 適度 Fast 速く Fastest さらに速く Peaks Falloff ピーク減衰速度 Background 背景 Transparent 透過させる MainWindow Playlist プレイリスト Appearance 外観 Shortcuts ショートカット View 観容 Tools ツール PlayList Playlist プレイリスト &Copy Selection To 選んだ曲目で新しいプレイリストを作る(&C) Sort List リストを並び換え By Title タイトル順に By Album アルバム名順に By Disc Number ディスク番号順に By Artist アーティスト名順に By Filename ファイル名順に By Path + Filename パスとファイル名の順に By Date 日付順に By Track Number トラック番号順に By File Creation Date ファイルの作成日順に Sort Selection 選択範囲内で並び換え Randomize List リストを順不同に Reverse List リストを逆順に Actions 動作 &New PlayList 新しいプレイリスト(&N) PlayListBrowser Playlist Browser プレイリストブラウザー New 新規 Delete 削除 ... ... Rename 名前を変更 PlayListSelector &Load 読込(&L) &Save As... 名前を付けて保存(&A)... Rename 名前を変更 &Delete 削除(&D) Rename Playlist プレイリスト名を変更 Playlist name: プレイリスト名: PopupSettings Popup Information Settings 吹き出し情報の設定 Template ひな形 Reset リセット Insert 挿入 Show cover 表紙画像を表示 Cover size: 表紙画像の大きさ: Transparency: 透明度: Delay: 残映時間: ms ミリ秒 Artist アーティスト Album アルバム Title タイトル Track number トラック番号 Two-digit track number トラック番号 数字2桁 Genre ジャンル Comment コメント Composer 作曲者 Duration 再生時間 Disc number ディスク番号 File name ファイル名 File path ファイルパス Year Condition 定番 PresetEditor Preset Editor プリセットエディター Preset プリセット Auto-preset 自動プリセット Load 読込 Delete 削除 ShortcutDialog Change Shortcut ショートカットを変更 Press the key combination you want to assign 割り当てたい組み合わせキーを押します Clear 消去 SkinnedFactory Skinned User Interface スキンつきユーザーインターフェイス About Qmmp Skinned User Interface QMMP スキンつきユーザーインターフェイスについて Qmmp Skinned User Interface QMMP スキンつきユーザーインターフェイス Simple user interface with Winamp-2.x/XMMS skins support WinAmp-2.x や XMMS1 用のスキンを介した簡素なユーザーインターフェイス Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> 制作者: Владимир Кузнецов (Vladimir Kuznetsov) <vovanec@gmail.com> Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> 美術: Андрей Андреев (Andrey Adreev) <andreev00@gmail.com> SkinnedSettings Skins スキン Add... 追加... Refresh 回復 View 観容 Hide on close 「閉じる」で隠す Start hidden 開始時に隠す Use skin cursors スキンカーソルを使用 Fonts 書体 Player: プレイヤー: ??? ??? ... ... Playlist: プレイリスト: Use bitmap font if available あればビットマップフォントを使用 Transparency 透過効果 Main window メインウィンドウ 0 0 Equalizer イコライザー Playlist プレイリスト Miscellaneous その他いろいろ Song Display 演目表示 Show protocol プロトコルを表示 Show song numbers 曲番号つきで表示 Show playlists プレイリストを表示 Show popup information 情報吹き出しを表示 Edit template ひな型を編集 Playlist separator: プレイリストの区切り: Show 'New Playlist' button '新しいプレイリスト'ボタンを表示 Show anchor アンカーを表示 Align song numbers 曲番号のみを表示 Select Skin Files スキンファイルを選択 Skin files スキンファイル Unarchived skin 非書庫化スキン Archived skin 書庫化スキン TextScroller Autoscroll Songname 曲名を自動スクロール Transparent Background 背景を透過 Buffering: %1% バッファーへ先読み: %1% VisualMenu Visualization 視覚効果 qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts0000664000175000017500000013376712256224735024323 0ustar useruser ActionManager &Play &Esegui X X &Pause &Pausa C C &Stop &Arresta V V &Previous &Precedente Z Z &Next &Successivo B B &Play/Pause &Esegui / Pausa Space Spazio J J &Jump to Track &Repeat Playlist &Ripeti lista brani R R &Repeat Track &Ripeti brano Ctrl+R Ctrl+R &Shuffle &Ordine casuale S S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File &Aggiungi brani F F &Add Directory &Aggiungi cartelle D D &Add Url &Aggiungi URL U U &Remove Selected &Elimina la selezione Del Canc &Remove All &Elimina tutto &Remove Unselected &Elimina i non selezionati Remove unavailable files Rimuovi files non disponibili Remove duplicates Rimuovi duplicati &Queue Toggle Q Q Invert Selection Inverti la selezione &Select None &Non scegliere alcun brano &Select All &Seleziona tutto Ctrl+A Ctrl+A &View Track Details &Dettagli della traccia Alt+I Alt+I &New List &Nuova lista Ctrl+T Ctrl+T &Delete List &Cancella lista Ctrl+W Ctrl+W &Load List &Carica lista O O &Save List &Salva lista Shift+S Shift+S &Select Next Playlist &Seleziona la successiva lista esecuzione brani Ctrl+PgDown Ctrl+PgDown &Select Previous Playlist &Seleziona la rpecedente lista esecuzione brani Ctrl+PgUp Ctrl+PgUp &Show Playlists Mostra lista esecuzione brani P P &Settings &Configurazione Ctrl+P Ctrl+P &About &Informazioni &About Qt &Informazioni su Qt &Exit &Esci Ctrl+Q Ctrl+Q EqWidget preset Impostazione &Load/Delete &Carica/Elimina &Save Preset &Salva preimpostazione &Save Auto-load Preset &Salvare preimpostazioni caricate automaticamente &Clear &Cancella Saving Preset Salvataggio preimpostazioni Preset name: Nome delle preimpostazioni: preset # Preimpostazione # &Import &Importa Equalizer Equalizzatore Import Preset Importa preimpostazione HotkeyEditor Action Shortcut Change shortcut... Playback Riproduzione View Playlist Lista brani Misc MainDisplay Previous Brano precedente Play Esegui Pause Sospendi Stop Ferma Next Brano successivo Add file Aggiungi brani Equalizer Equalizzatore Playlist Lista brani Repeat playlist Ripeti la lista brani Shuffle Ordine casuale Volume Volume Balance Bilanciamento Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Modo visualizzazione Analyzer Analizzatore Scope Oscilloscopio Off Chiudi Analyzer Mode Modo analizzatore Normal Normale Fire Fuoco Vertical Lines Linee verticali Lines Linee Bars Barre Peaks Picchi Refresh Rate Velocità di aggiornamento 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Ricaduta analizzatore Slowest Molto lenta Slow Lenta Medium Media Fast Rapida Fastest Molto veloce Peaks Falloff Ricadua picchi Background Sfondo Transparent Transparente MainWindow Appearance Aspetto Shortcuts View Playlist Lista brani Tools Strumenti PlayList &Copy Selection To Sort List Riordina la lista By Title Per titolo By Album Per album By Disc Number By Artist PEr interprete By Filename Per titolo del brano By Path + Filename per percorso più titolo del brano By Date Per data By File Creation Date Sort Selection Riordina la selezione Randomize List Mescola i brnai della lista Reverse List Inverti la lista &New PlayList By Track Number Per numero di traccia Playlist Lista brani Actions Azioni PlayListBrowser Playlist Browser Esplora lista esecuzione New Nuova Delete Elimina ... ... Rename Rinomina PlayListSelector &Load &Carica &Save As... &Salva come Rename Rinomina &Delete &Elimina Rename Playlist Rinomina lista brani Playlist name: Nome della lista brani: PopupSettings Popup Information Settings Popup delle impostazioni Show cover Mostra copertina Transparency: Trasparenza: Delay: Ritardo: ms ms Cover size: Dimensione copertina: Template Modello Reset Azzera Insert Inserisci Artist Interprete Album Album Title Titolo Track number Traccia n° Two-digit track number Traccia n° a due cifre Genre Genere Comment Commento Composer Compositore Duration Durata Disc number Disco n° File name Nome file File path Percorso file Year Anno Condition Condizione PresetEditor Preset Editor Editor delle impostazioni Load Carica Delete Elimina Preset Impostazioni Auto-preset Impostazioni automatiche ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Temi Add... Aggiungi... Refresh Aggiorna View Hide on close Nascondi alla chiusura Start hidden Avvia nascosto Use skin cursors Usa cursore skin Fonts Caratteri Player: Player: ??? ??? ... ... Playlist: Lista brani : Use bitmap font if available Usa carattere bitmap se disponibile Transparency Transparenza Main window Finestra principale 0 0 Equalizer Equalizzatore Playlist Lista brani Miscellaneous Varie Song Display Mostra il brano Show protocol Motra protocollo Show song numbers Mostra numero brani Show playlists Mostra lista esecuzione brani Show popup information Mostra informazioni popup Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files Seleziona aspetto Skin files Aspetto Unarchived skin Tema non archiviato Archived skin Tema archiviato TextScroller Autoscroll Songname Scorrimento automatico del titolo del brano Transparent Background Buffering: %1% VisualMenu Visualization Visualizzazione qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_kk.ts0000664000175000017500000013543312256224735024304 0ustar useruser ActionManager &Play &Ойнату X &Pause &Аялдату C &Stop &Тоқтату V &Previous Ал&дыңғысы Z &Next &Келесісі B &Play/Pause О&йнат/аялдат Space &Jump to Track J &Repeat Playlist Тізі&мді қайталау R &Repeat Track Т&ректі қайталау Ctrl+R &Shuffle Ке&з-келген ретпен S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File Фа&йлды қосу F &Add Directory Бу&маны қосу D &Add Url URL-д&ы қосу U &Remove Selected Таңда&лғанды өшіру Del &Remove All &Барлығын өшіру &Remove Unselected Таң&далмағанды өшіру Remove unavailable files Remove duplicates &Queue Toggle Q Invert Selection Таңдауды кері айналдыру &Select None Т&аңдауды алу &Select All &Барлығын таңдау Ctrl+A &View Track Details &Ақпараты Alt+I &New List &Жаңа тізім Ctrl+T &Delete List Ctrl+W &Load List Ті&зімді жүктеу O &Save List Тізімді &сақтау Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings &Баптаулары Ctrl+P &About &Осы туралы &About Qt Qt т&уралы &Exit &Шығу Ctrl+Q EqWidget preset орнату &Load/Delete &Жүктеу/Өшіру &Save Preset &Орнатуды сақтау &Save Auto-load Preset &Авто-орнатуды сақтау &Clear &Тазарту Saving Preset Орнатуды сақтау Preset name: Орнату атауы: preset # орнату # &Import &Импорттау Equalizer Эквалайзер Import Preset Орнатуды импорттау HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist Тізім Misc MainDisplay Previous Алдыңғысы Play Ойнату Pause Аялдату Stop Тоқтату Next Келесіге өту Add file Файлды қосу Equalizer Эквалайзер Playlist Тізім Repeat playlist Тізімді қайталау Shuffle Кез-келген ретпен Volume Даусы Balance Баланс Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Визуализация түрі Analyzer Анализатор Scope Осциллограф Off Сөндірілген Analyzer Mode Анализатор режимі Normal Кәдімгі Fire От Vertical Lines Тік сызықтар Lines Сызықтар Bars Жолақшалар Peaks Пиктер Refresh Rate Жаңарту жиілігі 50 fps 25 fps 10 fps 5 fps Analyzer Falloff Анализатор түсуі Slowest Ең баяу Slow Баяу Medium Орташа Fast Жылдам Fastest Ең жылдам Peaks Falloff Пиктер түсуі Background Фон Transparent Мөлдір MainWindow Appearance Сыртқы түрі Shortcuts View Playlist Тізім Tools Қызмет PlayList Playlist Тізім &Copy Selection To Sort List Сұрыптау By Title Аты бойынша By Album By Disc Number By Artist By Filename Файл аты бойынша By Path + Filename Жолы мен файл аты бойынша By Date Уақыты бойынша By File Creation Date Sort Selection Таңдалғанды сұрыптау Randomize List Тізімді араластыру Reverse List Тізімді кері айналдыру &New PlayList By Track Number Трек нөмірі бойынша Actions Әрекеттер PlayListBrowser Playlist Browser New Delete Өшіру ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Template Reset Insert Show cover Cover size: Transparency: Delay: ms Artist Орындаушы Album Альбом Title Аты Track number Two-digit track number Genre Жанры Comment Қосымша Composer Duration Disc number File name File path Year Жылы Condition PresetEditor Preset Editor Орнатулар түзеткіші Load Жүктеу Delete Өшіру Preset Орнату Auto-preset Авто-орнату ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Скиндар Add... Қосу... Refresh Жаңарту View Hide on close Жабылғанда жасыру Start hidden Жасырын түрінде қосылу Use skin cursors Fonts Қаріптер Player: Плеер: ??? ??? ... ... Playlist: Тізім: Use bitmap font if available Transparency Мөлдірлілігі Main window Басты терезе 0 Equalizer Эквалайзер Playlist Тізім Miscellaneous Song Display Өлендер тізімі Show protocol Хаттаманы көрсету Show song numbers Align song numbers Show anchor Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Select Skin Files Скин файлдарын таңдау Skin files Скин файлдары Unarchived skin Тарқатылған скин Archived skin Сығылған скин TextScroller Autoscroll Songname Өлен атауын автоайналдыру Transparent Background Buffering: %1% VisualMenu Visualization Визуализация qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts0000664000175000017500000013223612256224735024314 0ustar useruser ActionManager &Play &Groti X &Pause &Pristabdyti C &Stop &Sustabdyti V &Previous &Ankstesnis Z &Next &Sekantis B &Play/Pause &Groti/Pristabdyti Space Tarpas J &Jump to Track &Šokti prie takelio &Repeat Playlist &Kartoti grojaraštį R &Repeat Track &Kartoti takelį Ctrl+R &Shuffle &Sumaišyti S &No Playlist Advance ????? &Nesislinkti grojaraščiu Ctrl+N &Stop After Selected &Stabdyti po pasirinkto Ctrl+S &Clear Queue &Išvalyti eilę Alt+Q Show Playlist Rodyti grojaraštį Alt+E Show Equalizer Rodyti glotintuvą Alt+G Always on Top Visada viršuje Put on All Workspaces Įkelti į visus darbastalius Double Size Dvigubas dydis Meta+D &Add File &Pridėti bylą F &Add Directory &Pridėti aplanką D &Add Url &Pridėti interneto adresą U &Remove Selected &Pašalinti pasirinktus Del &Remove All &Pašalinti visus &Remove Unselected &Pašalinti NEpasirinktus Remove unavailable files Pašalinti neesamas bylas Remove duplicates Pašalinti besidubliuojančius pavadinimus &Queue Toggle &Įtraukti į eilę Q Invert Selection Apverstinis pasirinkimas &Select None &Nepasirinkti nei vieno &Select All &Pasirinkti visus Ctrl+A &View Track Details &Takelio informacija Alt+I &New List &Naujas sąrašas Ctrl+T &Delete List &Pašalinti sąrašą Ctrl+W &Load List &Įkelti sąrašą O &Save List &Išsaugoti sąrašą Shift+S &Select Next Playlist &Pasirinkti sekantį grojaraštį Ctrl+PgDown &Select Previous Playlist &Pasirinkti ankstesnį grojaraštį Ctrl+PgUp &Show Playlists &Rodyti grojaraščius P &Settings &Nustatymai Ctrl+P &About &Apie &About Qt &Apie Qt &Exit &Išeiti Ctrl+Q EqWidget preset Nustatymas &Load/Delete &Įkelti/Pašalinti &Save Preset &Išsaugoti nustatymus &Save Auto-load Preset &Išsaugoti auto-nustatymą &Clear &išvalyti Saving Preset Išsaugojamas nustatymas Preset name: Nustatymo pavadinimas: preset # Nustatymas # &Import &Importuoti Equalizer Glotintuvas Import Preset Importuoti nustatymus HotkeyEditor Action Veiksmas Shortcut Trumpinys Change shortcut... Keisti trumpinį... Playback Grojimas View Rodyti Playlist Grojaraštis Misc Įvairūs MainDisplay Previous Ankstesnis Play Groti Pause Pristabdyti Stop Sustoti Next Sekantis Add file Pridėti bylą Equalizer Glotintuvas Playlist Grojaraštis Repeat playlist Gartoti grojaraštį Shuffle Atsitiktine tvarka Volume Garsumas Balance Balansas Volume: %1% Garsas: %1% Balance: %1% right Balansas: %1% dešinė Balance: %1% left Balansas: %1% kairė Balance: center Balansas: centras Seek to: %1 Peršokti į: %1 MainVisual Visualization Mode Vizualizacijos metodas Analyzer Analizatorius Scope Scope Off Išjungta Analyzer Mode Analizatoriaus metodas Normal Įprastinis Fire Ugnis Vertical Lines Vertikalios linijos Lines Linijos Bars Bangos Peaks Pikai Refresh Rate Atnaujinimo dažnumas 50 fps 50 kps 25 fps 25 kps 10 fps 10 kps 5 fps 5 kps Analyzer Falloff Analyzer Falloff Slowest Lėčiausias Slow Lėtas Medium Vidutinis Fast Greitas Fastest Greičiausias Peaks Falloff Peaks Falloff Background Fonas Transparent Permatomumas MainWindow Appearance Išvaizda Shortcuts Trumpiniai View Rodyti Playlist Grojaraštis Tools Įrankiai PlayList &Copy Selection To &Kopijuoti pasirinkimą į Sort List Rūšiuoti By Title Pagal dainos pavadinimą By Album Pagal albumą By Disc Number Pagal disko numerį By Artist Pagal atlikėją By Filename Pagal bylos pavadinimą By Path + Filename Pagal kelią iki bylos By Date Pagal datą By File Creation Date Sort Selection Rūšiuoti pasirinktus Randomize List Sumaišyti sąrašą Reverse List Apversti &New PlayList &Naujas grojaraštis By Track Number Pagal takelio numerį Playlist Grojaraštis Actions Veiksmai PlayListBrowser Playlist Browser Grojaraščių naršyklė New Naujas Delete Ištrinti ... ... Rename Pervadinti PlayListSelector &Load &Įkelti &Save As... &Įrašyti kaip... Rename Pervadinti &Delete &Ištrinti Rename Playlist Pervadinti grojaraštį Playlist name: Grojaraščio pavadinimas: PopupSettings Popup Information Settings Iššokančios informacijos nustatymai Show cover Rodyti viršelį Transparency: Permatomumas: Delay: Atidėjimas: ms ms Cover size: Viršelio dydis: Template Šablonas Reset Ištrinti Insert Įtraukti Artist Atlikėjas Album Albumas Title Pavadinimas Track number Takelio numeris Two-digit track number Dviejų skaičių takelio numeris Genre Žanras Comment Komentaras Composer Autorius Duration Ilgis Disc number Disko numeris File name Bylos pavadinimas File path Bylos kelias Year Metai Condition Būklė PresetEditor Preset Editor Nustatymų redaktorius Load Įkelti Delete Ištrinti Preset Nustatymas Auto-preset Auto-nustatymas ShortcutDialog Change Shortcut Keisti trumpinį Press the key combination you want to assign Paspauskite klavišų kombinaciją, kurią norite priskirti Clear Išvalyti SkinnedFactory Skinned User Interface Apvilkta vartotojo sąsaja About Qmmp Skinned User Interface Apie apvilktą Qmmp vartotojo sčsają Qmmp Skinned User Interface Qmmp apvilkta vartotojo sąsaja Simple user interface with Winamp-2.x/XMMS skins support Paprasta vartotojo sąsaja su Winamp-2.x/XMMS apvalkalų palaikymu Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Grafika: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Temos Add... Pridėti... Refresh Atnaujinti View Rodyti Hide on close Paslėpti išjungus Start hidden Įjungti paslėptą Use skin cursors Naudoti temos kursorių Fonts Šriftai Player: Grotuvas: ??? ??? ... ... Playlist: Gojaraštis: Use bitmap font if available Naudoti bitmap šriftą, jei įmanoma Transparency Permatomumas Main window Pagrindinis langas 0 Equalizer Glotintuvas Playlist Grojaraštis Miscellaneous Kiti Song Display Dainų sąrašas Show protocol Rodyti bylos galūnę Show song numbers Rodyti takelių numerius Show playlists Rodyti grojaraščius Show popup information Rodyti iššokančią informaciją Edit template Taisyti šabloną Playlist separator: Grojaraščio atskyrėjas: Show 'New Playlist' button Rodyti naujo grojaraščio mygtuką Show anchor ?????????????? Rodyti inkarą Align song numbers Lygiuoti dainų numerius Select Skin Files Pasirinkti temų bylas Skin files Temų bylos Unarchived skin Išskleista tema Archived skin Suspausta tema TextScroller Autoscroll Songname Automatinis takelio slinkimas Transparent Background Permatomas fonas Buffering: %1% Buferis: %1% VisualMenu Visualization Vizualizacija qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts0000664000175000017500000013002512256224735024300 0ustar useruser ActionManager &Play &Afspelen X &Pause &Pauze C &Stop V &Previous &Vorige Z &Next &Volgende B &Play/Pause &Afspelen/Pauze Space Spatie J &Jump to Track &Ga naar Nummer &Repeat Playlist &Herhaal Afspeellijst R &Repeat Track &Herhaal Nummer Ctrl+R &Shuffle &Willekeurig S &No Playlist Advance &Niet verderschuiven in afspeellijst Ctrl+N &Stop After Selected &Stop na geselecteerde Ctrl+S &Clear Queue &Leeg Rij Alt+Q Show Playlist Toon Afspeellijst Alt+E Show Equalizer Toon Equalizer Alt+G Always on Top Altijd bovenaan Put on All Workspaces Plaats op alle werkbladen Double Size Dubbele grootte Meta+D &Add File &Voeg Bestand Toe F &Add Directory &Voeg Map toe D &Add Url &Voeg URL toe U &Remove Selected &Verwijder Geselecteerde Del &Remove All &Verwijder Alles &Remove Unselected &Verwijder Gedeselecteerde Remove unavailable files Verwijder afwezige bestanden Remove duplicates Verwijder duplicaten &Queue Toggle &Rij schakelaar Q Invert Selection Draai Selectie Om &Select None &Selecteer Niets &Select All &Selecteer Alles Ctrl+A &View Track Details &Bekijk Nummerdetails Alt+I &New List &Nieuwe Lijst Ctrl+T &Delete List &Verwijder Lijst Ctrl+W &Load List &Laad Lijst O &Save List &Bewaar Lijst Shift+S &Select Next Playlist &Selecteer Volgende Afspeellijst Ctrl+PgDown &Select Previous Playlist &Selecteer Vorige Afspeellijst Ctrl+PgUp &Show Playlists &Toon Afspeellijst P &Settings &Instellingen Ctrl+P &About &Over &About Qt &Over Qt &Exit &Sluit Ctrl+Q EqWidget Equalizer preset Profiel &Load/Delete &Laad/Verwijder &Save Preset &Bewaar Profiel &Save Auto-load Preset &Bewaar Auto-laad Profiel &Import &Importeer &Clear &Leeghalen Saving Preset Bewaren van Profiel Preset name: Profielnaam: preset # Profiel # Import Preset Importeer Profiel HotkeyEditor Action Actie Shortcut Sneltoets Change shortcut... Verander sneltoets... Playback Afspelen View Toon Playlist Afspeellijst Misc Overige MainDisplay Previous Vorige Play Afspelen Pause Pauze Stop Next Volgende Add file Bestand toevoegen Equalizer Playlist Afspeellijst Repeat playlist Herhaal afspeellijst Shuffle Willekeurig Volume Balance Balans Volume: %1% Balance: %1% right Balans: %1% rechts Balance: %1% left Balans: %1 links Balance: center Balans: midden Seek to: %1 Spoel naar: %1 MainVisual Visualization Mode Visualisatiestand Analyzer Analysator Scope Bereik Off Uit Analyzer Mode Analysatorstand Normal Normaal Fire Vuur Vertical Lines Verticale Lijnen Lines Lijnen Bars Strepen Peaks Toppen Refresh Rate Vernieuw Frequentie 50 fps 25 fps 10 fps 5 fps Analyzer Falloff Analysator Uitval Slowest Traagst Slow Traag Medium Normaal Fast Snel Fastest Snelst Peaks Falloff Toppen Uitval Background Achtergrond Transparent Transparant MainWindow Appearance Vertoning Shortcuts Sneltoetsen View Weergave Playlist Afspeellijst Tools Gereedschappen PlayList Sort List Sorteer Lijst By Title Op Titel By Album Op Album By Disc Number Op CD nummer By Artist Op Artiest By Filename Op Bestandsnaam By Path + Filename Op Pad + Bestandsnaam By Date Op Datum By File Creation Date Sort Selection Sorteer Selectie Randomize List Schud Lijst Reverse List Draai Lijst Om &New PlayList &Nieuwe Afspeellijst &Copy Selection To &Kopiëer Selectie Naar Playlist Afspeellijst By Track Number Op Lied Nummer Actions Acties PlayListBrowser Playlist Browser Afspeellijst Navigator New Nieuw Delete Verwijder ... Rename Hernoem PlayListSelector &Load &Laad &Save As... &Bewaar Als... Rename Hernoem &Delete &Verwijder Rename Playlist Hernoem Afspeellijst Playlist name: Naam van de Afspeellijst: PopupSettings Popup Information Settings Toon Informatie Instellingen Show cover Toon Hoes Transparency: Transparantie: Delay: Vertraging: ms Cover size: Albumhoesgrootte: Template Layout Reset Terugzetten Insert Invoegen Artist Artiest Album Album Title Naam Track number Liednummer Two-digit track number Liednummer (twee cijfer formaat) Genre Comment Commentaar Composer Componist Duration Duur Disc number CD nummer File name Bestandsnaam File path Pad Year Jaar Condition Staat PresetEditor Preset Editor Profiel Bewerker Load Laad Delete Verwijder Preset Instelling Auto-preset Auto-profiel ShortcutDialog Change Shortcut Verander Sneltoets Press the key combination you want to assign Druk de gewenste sneltoetscombinatie Clear Leeghalen SkinnedFactory Skinned User Interface Thematische Gebruikersinterface About Qmmp Skinned User Interface Over de Qmmp Thematische Gebruikersinterface Qmmp Skinned User Interface Qmmp Thematische Gebruikersinterface Simple user interface with Winamp-2.x/XMMS skins support Simpele gebruikersinterface met Winamp-2.x/XMMS thema ondersteuning Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Geschreven door: Vladimir-Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Artiestenwerk: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Thema's Add... Toevoegen... Refresh Herlaad View Weergave Hide on close Verberg bij sluit Start hidden Start verborgen Use skin cursors Gebruik thema cursor Fonts Lettertypen Player: Speler: ??? ... Playlist: Afspeellijst: Use bitmap font if available Gebruik bitmap lettertype indien aanwezig Transparency Transparantie Main window Hoofdscherm 0 Equalizer Playlist Afspeellijst Miscellaneous Overige Song Display Nummer Weergave Show protocol Laad protocol Show song numbers Toon liednummers Show playlists Toon afspeellijst Show popup information Toon popup informatie Edit template Bewerk layout Playlist separator: Scheidingsteken afspeellijst: Show 'New Playlist' button Toon 'Nieuwe Afspeellijst' knop Show anchor Toon verankering Align song numbers Liednummers uitlijnen Select Skin Files Selecteer themabestanden Skin files Thema bestanden Unarchived skin Niet gearchiveerd thema Archived skin Gearchiveerd thema TextScroller Autoscroll Songname Automatisch naar Liednummer Scrollen Transparent Background Transparante Achtergrond Buffering: %1% Bufferen: %1% VisualMenu Visualization Visualisatie qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts0000664000175000017500000013724212256224735024325 0ustar useruser ActionManager &Play &Воспроизвести X &Pause &Приостановить C &Stop &Стоп V &Previous &Предыдущий фрагмент Z &Next &Следующий фрагмент B &Play/Pause &Воспр/приост Space J &Jump to Track &Перейти к треку &Repeat Playlist &Повторять список R &Repeat Track &Повторять трек Ctrl+R &Shuffle &В случайном порядке S &No Playlist Advance &Не продвигаться по списку Ctrl+N &Stop After Selected &Остановить после выделенного Ctrl+S &Clear Queue &Очистить очередь Alt+Q Show Playlist Показывать список Alt+E Show Equalizer Показывать эквалайзер Alt+G Always on Top Поверх всех окон Put on All Workspaces Разместить на всех рабочих столах Double Size Двойной размер Meta+D &Add File &Добавить файл F &Add Directory &Добавить директорию D &Add Url &Добавить URL U &Remove Selected &Удалить выделенное Del &Remove All &Удалить всё &Remove Unselected &Удалить невыделенное Remove unavailable files Удалить недоступные файлы Remove duplicates Удалить дубликаты &Queue Toggle &В очередь Q Invert Selection Инвертировать выделение &Select None &Снять выделение &Select All &Выделить всё Ctrl+A &View Track Details &Информация Alt+I &New List &Новый список Ctrl+T &Delete List &Удалить список Ctrl+W &Load List &Загрузить список O &Save List &Сохранить список Shift+S &Select Next Playlist &Выбрать следующий список Ctrl+PgDown &Select Previous Playlist &Выбрать предыдущий список Ctrl+PgUp &Show Playlists &Показать списки P &Settings &Настройки Ctrl+P &About &О программе &About Qt &О библиотеке Qt &Exit &Выход Ctrl+Q EqWidget preset предустановка &Load/Delete &Загрузить/Удалить &Save Preset &Сохранить предустановку &Save Auto-load Preset &Сохранить авто-предустановку &Clear &Очистить Saving Preset Сохранение предустановки Preset name: Имя предустановки: preset # предустановка # &Import &Импортировать Equalizer Эквалайзер Import Preset Импорт предустановки HotkeyEditor Action Действие Shortcut Сочетание клавиш Change shortcut... Изменить сочетание клавиш... Playback Воспроизведение View Вид Playlist Список Misc Другие MainDisplay Previous Предыдущий фрагмент Play Воспроизвести Pause Приостановить Stop Стоп Next Следующий фрагмент Add file Добавить файл Equalizer Эквалайзер Playlist Список Repeat playlist Повторять список Shuffle В случайном порядке Volume Громкость Balance Баланс Volume: %1% Громкость: %1% Balance: %1% right Баланс: %1% вправо Balance: %1% left Баланс: %1% влево Balance: center Баланс: по центру Seek to: %1 Поиск: %1 MainVisual Visualization Mode Режим визуализации Analyzer Анализатор Scope Осциллограф Off Выключено Analyzer Mode Режим анализатора Normal Обычный Fire Огонь Vertical Lines Вертикальные линии Lines Линии Bars Полоски Peaks Пики Refresh Rate Частота обновления 50 fps 50 кадр/с 25 fps 25 кадр/с 10 fps 10 кадр/с 5 fps 5 кадр/с Analyzer Falloff Падение анализатора Slowest Самое медленное Slow Медленное Medium Среднее Fast Быстрое Fastest Самое быстрое Peaks Falloff Падение пиков Background Фон Transparent Прозрачность MainWindow Appearance Внешний вид Shortcuts Сочетания клавиш View Вид Playlist Список Tools Сервис PlayList &Copy Selection To &Копировать выделенное в Sort List Сортировать By Title По названию By Album По альбому By Disc Number По номеру диска By Artist По исполнителю By Filename По имени файла By Path + Filename По пути и файлу By Date По дате By File Creation Date По дате создания файла Sort Selection Сортировать выделенное Randomize List Перемешать Reverse List Перевернуть &New PlayList &Новый список By Track Number По номеру трека Playlist Список Actions Действия PlayListBrowser Playlist Browser Обзор списков воспроизведения New Создать Delete Удалить ... ... Rename Переименовать PlayListSelector &Load &Загрузить &Save As... &Сохранить как... Rename Переименовать &Delete &Удалить Rename Playlist Переименовать список Playlist name: Имя списка: PopupSettings Popup Information Settings Настройки всплывающей информации Show cover Показывать обложку Transparency: Прозрачность: Delay: Задержка: ms мс Cover size: Размер обложки: Template Шаблон Reset Сброс Insert Вставить Artist Исполнитель Album Альбом Title Название Track number Номер трека Two-digit track number 2-x разрядный номер трека Genre Жанр Comment Комментарий Composer Композитор Duration Длительность Disc number Номер диска File name Имя файла File path Путь к файлу Year Год Condition Условие PresetEditor Preset Editor Редактор предустановок Load Загрузить Delete Удалить Preset Предустановка Auto-preset Авто-предустановка ShortcutDialog Change Shortcut Изменить сочетание клавиш Press the key combination you want to assign Нажмите клавиши, сочетание которых вы хотите использовать Clear Очистить SkinnedFactory Skinned User Interface Интерфейс с поддержкой обложек About Qmmp Skinned User Interface Об интерфейсе с поддержкой обложек Qmmp Skinned User Interface Интерфейс с поддержкой обложек для Qmmp Simple user interface with Winamp-2.x/XMMS skins support Простой пользовательский интерфейс с поддержкой обложек Winamp-2.x/XMMS Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Разработчики: Владимир Кузнецов <vovanec@gmail.com> Илья Котов <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> Графика: Андрей Андреев <andreev00@gmail.com> SkinnedSettings Skins Обложки Add... Добавить... Refresh Обновить View Вид Hide on close Скрывать при закрытии Start hidden Запускать скрытым Use skin cursors Использовать встроенные курсоры Fonts Шрифты Player: Плеер: ??? ??? ... ... Playlist: Список: Use bitmap font if available Использовать растровые шрифты, если возможно Transparency Прозрачность Main window Главное окно 0 0 Equalizer Эквалайзер Playlist Список Miscellaneous Разное Song Display Список песен Show protocol Показывать протокол Show song numbers Показывать номера песен Show playlists Показывать списки воспроизведения Show popup information Показывать всплывающее окно с информацией Edit template Редактировать шаблон Playlist separator: Разделитель списков: Show 'New Playlist' button Показывать кнопку "Новый список" Show anchor Показывать "якорь" Align song numbers Выравнивать номера фрагментов Select Skin Files Выберите файлы обложек Skin files Файлы обложек Unarchived skin Распакованная тема Archived skin Упакованная тема TextScroller Autoscroll Songname Автопрокрутка названия песни Transparent Background Прозрачный фон Buffering: %1% Буферизация: %1% VisualMenu Visualization Визуализация qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts0000664000175000017500000013202712256224735024310 0ustar useruser ActionManager &Play &Hrať X X &Pause &Pozastaviť C C &Stop Za&staviť V V &Previous &Predchádzajúca Z Z &Next &Nasledujúca B B &Play/Pause &Hrať/Pozastaviť Space Medzerník J J &Jump to Track &Repeat Playlist &Opakovať playlist R R &Repeat Track &Opakovať skladbu Ctrl+R Ctrl+R &Shuffle &Zamiešať S S &No Playlist Advance &Nepokročilý playlist Ctrl+N Ctrl+N &Stop After Selected &Zastaviť po vybranej Ctrl+S Ctrl+S &Clear Queue &Vyčistiť rad Alt+Q Alt+Q Show Playlist Ukázať playlist Alt+E Alt+E Show Equalizer Ukázať ekvalizér Alt+G Alt+G Always on Top Vždy na vrchu Put on All Workspaces Dať na všetky plochy Double Size Dvojitá veľkosť Meta+D Meta+D &Add File &Pridať súbor F F &Add Directory &Pridať priečinok D D &Add Url &Pridať URL U U &Remove Selected Odst&rániť vybraté Del Del &Remove All Odst&rániť všetko &Remove Unselected Odst&rániť nevybraté Remove unavailable files Odstrániť nedostupné súbory Remove duplicates Odstrániť duplikáty &Queue Toggle &Zaradiť prepínanie Q Q Invert Selection Invertovať výber &Select None Zrušiť &výber &Select All &Vybrať všetko Ctrl+A Ctrl+A &View Track Details &Zobraziť detaily o skladbe Alt+I Alt+I &New List &Nový zoznam Ctrl+T Ctrl+T &Delete List &Vymazať zoznam Ctrl+W Ctrl+W &Load List &Načítať zoznam O O &Save List &Uložiť zoznam Shift+S Shift+S &Select Next Playlist &Vybrať nasledujúci playlist Ctrl+PgDown Ctrl+Page Down &Select Previous Playlist &Vybrať predchádzajúci playlist Ctrl+PgUp Ctrl+Page Up &Show Playlists &kázať playlisty P P &Settings Na&stavenia Ctrl+P Ctrl+P &About O progr&ame &About Qt &O Qt &Exit &Ukončiť Ctrl+Q Ctrl+Q EqWidget Equalizer Ekvalizér preset předvolba &Load/Delete &Načíst/Odstranit &Save Preset &Uložit předvolbu &Save Auto-load Preset Uložit &automatickou předvolbu &Import &Importovat &Clear &Vynulovat Saving Preset Uložení předvolby Preset name: Název předvolby: preset # předvolba # Import Preset Importovat předvolbu HotkeyEditor Action Činnosť Shortcut Skratka Change shortcut... Zmeniť skratku... Playback Prehrávanie View Zobraziť Playlist Playlist Misc Rôzn. MainDisplay Previous Predchádzajúca Play Hrať Pause Pozastaviť Stop Zastaviť Next Nasledujúca Add file Pridať súbor Equalizer Ekvalizér Playlist Playlist Repeat playlist Opakovať playlist Shuffle Zamiešať Volume Hlasitosť Balance Vyváženie Volume: %1% Hlasitosť: %1% Balance: %1% right Vyváženie: %1% vpravo Balance: %1% left Vyváženie: %1% vľavo Balance: center Vyváženie: stred Seek to: %1 Pretočiť na: %1 MainVisual Visualization Mode Režim vizualizácií Analyzer Analyzér Scope Osciloskop Off Vypnuté Analyzer Mode Režim analyzéra Normal Normálny Fire Oheň Vertical Lines Stĺpce Lines Čiary Bars Prúžky Peaks Špičky Refresh Rate Obnovovacia frekvencia 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Pokles analyzéra Slowest Najpomaljšie Slow Pomaly Medium Stredne Fast Rýchlo Fastest Najrýchlejšie Peaks Falloff Pokles špičiek Background Pozadie Transparent Priehľadné MainWindow Appearance Vzhľad Shortcuts Skratky View Zobraziť Playlist Playlist Tools Nástroje PlayList Sort List Triediť zoznam By Title Podľa názvu By Album Podľa albumu By Disc Number By Artist Podľa interpréta By Filename Podľa názvu súboru By Path + Filename Podľa cesty a názvu súboru By Date Podľa dátumu By File Creation Date Sort Selection Potriediť výber Randomize List Zamiešať zoznam Reverse List Otočiť zoznam &New PlayList &Nový playlist &Copy Selection To &Skopírovať výber do Playlist Playlist By Track Number Podľa čísla skladby Actions Činnosti PlayListBrowser Playlist Browser Prehliadač playlistu New Nový Delete Vymazať ... ... Rename Premenovať PlayListSelector &Load &Načítať &Save As... &Uložiť ako... Rename Premenovať &Delete &Vymazať Rename Playlist Premenovať playlist Playlist name: Název playlistu: PopupSettings Popup Information Settings Nastavenie informácií v upozornení Show cover Zobraziť obal Transparency: Priehľadnosť: Delay: Oneskorenie: ms ms Cover size: Veľkosť obalu: Template Šablóna Reset Zresetovať Insert Vložiť Artist Interprét Album Album Title Názov Track number Číslo skladby Two-digit track number Dvojmiestne číslo skladby Genre Žáner Comment Poznámka Composer Skladateľ Duration Dĺžka Disc number Číslo disku File name Názov súboru File path Cesta k súboru Year Rok Condition Stav PresetEditor Preset Editor Editor predvolieb Load Načítať Delete Vymazať Preset Predvoľba Auto-preset Automatická predvoľba ShortcutDialog Change Shortcut Zmeniť skratku Press the key combination you want to assign Stlačte klávesovú kombináciu ktorú chcete priradiť Clear Vyčistiť SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Skiny Add... Pridať... Refresh Obnoviť View Zobraziť Hide on close Skryť pri zatvorení Start hidden Spustiť skryté Use skin cursors Použiť kurzory zo skinu Fonts Písma Player: Prehrávač: ??? ??? ... ... Playlist: Playlist: Use bitmap font if available Použiť bitmapové písmo, ak je dostupné Transparency Priehľadnosť Main window Hlavné okno 0 0 Equalizer Ekvalizér Playlist Playlist Miscellaneous Rôzne Song Display Zobrazenie skladby Show protocol Zobraziť protokol Show song numbers Zobrazovať čísla piesní Show playlists Zobrazovať playlisty Show popup information Zobrazovať upozornenia s informáciami Edit template Upraviť šablónu Playlist separator: Show 'New Playlist' button Show anchor Zobrazovať ukotvenie Align song numbers Zarovnať čísla piesní Select Skin Files Vybrať súbory skinov Skin files Súbory skinov Unarchived skin Nearchivovaný skin Archived skin Archivovaný skin TextScroller Autoscroll Songname Automaticky skrolovať názov piesne Transparent Background Buffering: %1% Bufferuje sa:%1% VisualMenu Visualization Vizualizácie qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts0000664000175000017500000013367212256224735024327 0ustar useruser ActionManager &Play &Çal X X &Pause &Duraklat C C &Stop &Durdur V V &Previous &Önceki Z Z &Next &Sonraki B B &Play/Pause &Oynat/Duraklat Space Boşluk J J &Jump to Track &Repeat Playlist &Çalma Listesini Yinele R R &Repeat Track &Parçayı Yinele Ctrl+R Ctrl+R &Shuffle &Rastgele S S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File &Dosya Ekle F F &Add Directory &Dizin Ekle D D &Add Url &Url Ekle U U &Remove Selected &Seçileni Kaldır Del Del &Remove All &Hepsini Kaldır &Remove Unselected &Seçilmemişleri Kaldır Remove unavailable files Remove duplicates &Queue Toggle Q Q Invert Selection Seçimi Tersine Çevir &Select None &Hiçbirini Seçme &Select All &Tümünü Seç Ctrl+A Ctrl+A &View Track Details &Parça Detaylarını Göster Alt+I Alt+I &New List &Yeni Liste Ctrl+T &Delete List Ctrl+W &Load List &Liste Yükle O O &Save List &Listeyi Kaydet Shift+S Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings &Ayarlar Ctrl+P Ctrl+P &About &Hakkında &About Qt &Qt Hakkında &Exit &Çıkış Ctrl+Q Ctrl+Q EqWidget preset tanımlanmış ayar &Load/Delete &Yükle/Sil &Save Preset Tanımlanmış &Ayarları Kaydet &Save Auto-load Preset &Otomatik Tanımlanmış Ayarları Kaydet &Clear &Temizle Saving Preset Tanımlanmış Ayarla Kaydediliyor Preset name: Tanımlanmış ayar adı: preset # tanımlanmış ayar # &Import &İçe Aktar Equalizer Ekolayzır Import Preset Tanımlanmış Ayarları Al HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist Çalma Listesi Misc MainDisplay Previous Önceki Play Oynat Pause Duraklat Stop Durdur Next Sonraki Add file Dosya ekle Equalizer Ekolayzır Playlist Çalma Listesi Repeat playlist Çalma Listesini Yinele Shuffle Rastgele Volume Ses Balance Denge Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode Görselleştirme Modu Analyzer Çözümleyici Scope Kapsam Off Kapat Analyzer Mode Çözümleyici Modu Normal Normal Fire Ateş Vertical Lines Dikey Satırlar Lines Satırlar Bars Çubuklar Peaks Tepeler Refresh Rate Tazeleme Oranı 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff Çözümleyici Düşüşü Slowest En yavaş Slow Yavaş Medium Orta Fast Hızlı Fastest En hızlı Peaks Falloff Tepe Düşüşü Background Arkaplan Transparent Transparan MainWindow Appearance Görünüm Shortcuts View Playlist Çalma Listesi Tools Araçlar PlayList &Copy Selection To Sort List Listeyi Sınıflandır By Title Başlığa Göre By Album By Disc Number By Artist By Filename Dosya Adına Göre By Path + Filename Dosya Yolu + Dosya Adına Göre By Date Tarihe Göre By File Creation Date Sort Selection Seçilenleri Sınıflandır Randomize List Rastgele Listele Reverse List Listeyi Ters Çevir &New PlayList By Track Number Parça Numarasına Göre Playlist Çalma Listesi Actions Eylemler PlayListBrowser Playlist Browser New Delete Sil ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Show cover Transparency: Delay: ms Cover size: Template Reset Insert Artist Sanatçı Album Albüm Title Başlık Track number Two-digit track number Genre Tarz Comment Yorum Composer Duration Disc number File name File path Year Yıl Condition PresetEditor Preset Editor Tanımlanmış Ayar Düzenleyici Load Yükle Delete Sil Preset Tanımlanmış Ayar Auto-preset Ayarları Otomatik Tanımla ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins Kabuklar Add... Ekle... Refresh Yenile View Hide on close Kapatınca saklan Start hidden Gizli başlat Use skin cursors Fonts Fontlar Player: Oynatıcı: ??? ??? ... ... Playlist: Çalma Listesi: Use bitmap font if available Transparency Transparanlık Main window Ana pencere 0 0 Equalizer Ekolayzır Playlist Çalma Listesi Miscellaneous Song Display Şarkı Göstergesi Show protocol Protokolü göster Show song numbers Şarkı numaralarını göster Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files Kabuk Dosyası Seç Skin files Kabuk dosyaları Unarchived skin Arşivlenmemiş kabuk Archived skin Arşivlenmiş kabuk TextScroller Autoscroll Songname Şarkı Adını Otomatik Kaydır Transparent Background Buffering: %1% VisualMenu Visualization Görüntüleme qmmp-0.7.4/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts0000664000175000017500000013316412256224735024677 0ustar useruser ActionManager &Play 播放(&P) X X &Pause 暂停(&P) C C &Stop 停止(&S) V V &Previous 上一曲(&P) Z Z &Next 下一曲(&N) B B &Play/Pause 播放/暂停(&P) Space 空格 J J &Jump to Track &Repeat Playlist 重复播放列表(&R) R R &Repeat Track 重复音轨(&R) Ctrl+R Ctrl+R &Shuffle 乱序(&S) S S &No Playlist Advance Ctrl+N &Stop After Selected Ctrl+S &Clear Queue Alt+Q Show Playlist Alt+E Show Equalizer Alt+G Always on Top Put on All Workspaces Double Size Meta+D &Add File 添加文件(&A) F F &Add Directory 添加文件夹(&A) D D &Add Url 添加 URL (&A) U U &Remove Selected 删除所选(&R) Del Del &Remove All 删除全部(&R) &Remove Unselected 删除未选(&R) Remove unavailable files Remove duplicates &Queue Toggle Q Q Invert Selection 反选 &Select None 无选择(&S) &Select All 选择全部(&S) Ctrl+A Ctrl+A &View Track Details 查看音轨详细信息(&V) Alt+I Alt+I &New List 新建列表(&N) Ctrl+T &Delete List Ctrl+W &Load List 载入列表(&L) O O &Save List 保存列表(&S) Shift+S Shift+S &Select Next Playlist Ctrl+PgDown &Select Previous Playlist Ctrl+PgUp &Show Playlists P &Settings 设置(&S) Ctrl+P Ctrl+P &About 关于(&A) &About Qt 关于 Qt (&A) &Exit 退出(&E) Ctrl+Q Ctrl+Q EqWidget preset 预设 &Load/Delete 载入/删除(&L) &Save Preset 保存预设(&S) &Save Auto-load Preset 保存自动载入预设(&S) &Clear 清除(&C) Saving Preset 保存预设 Preset name: 预设名称: preset # 预设 # &Import 导入(&I) Equalizer 均衡器 Import Preset 导入预设 HotkeyEditor Action Shortcut Change shortcut... Playback View Playlist 播放列表 Misc MainDisplay Previous 上一曲 Play 播放 Pause 暂停 Stop 停止 Next 下一曲 Add file 添加文件 Equalizer 均衡器 Playlist 播放列表 Repeat playlist 重复播放列表 Shuffle 乱序 Volume 音量 Balance 平衡 Volume: %1% Balance: %1% right Balance: %1% left Balance: center Seek to: %1 MainVisual Visualization Mode 可视化模式 Analyzer 分析器 Scope 示波器 Off 关闭 Analyzer Mode 分析模式 Normal 标准 Fire 火花 Vertical Lines 垂直线 Lines 线形 Bars 条形 Peaks 峰值 Refresh Rate 刷新率 50 fps 50 fps 25 fps 25 fps 10 fps 10 fps 5 fps 5 fps Analyzer Falloff 分析器下降速度 Slowest 最慢 Slow Medium Fast Fastest 最快 Peaks Falloff 峰值下降速度 Background 背景 Transparent 透明 MainWindow Appearance 外观 Shortcuts View Playlist 播放列表 Tools 工具 PlayList &Copy Selection To Sort List 列表排序 By Title 按标题 By Album By Disc Number By Artist By Filename 按文件名 By Path + Filename 按路径+文件名 By Date 按日期 By File Creation Date Sort Selection 选择排序 Randomize List 随机产生列表 Reverse List 逆序列表 &New PlayList By Track Number 按音轨 Playlist 播放列表 Actions 动作 PlayListBrowser Playlist Browser New Delete 删除 ... ... Rename PlayListSelector &Load &Save As... Rename &Delete Rename Playlist Playlist name: PopupSettings Popup Information Settings Show cover Transparency: Delay: ms Cover size: Template Reset Insert Artist 艺术家 Album 专辑 Title 标题 Track number Two-digit track number Genre 流派 Comment 备注 Composer Duration Disc number File name File path Year 年代 Condition PresetEditor Preset Editor 预设编辑器 Load 载入 Delete 删除 Preset 预设 Auto-preset 自动预设 ShortcutDialog Change Shortcut Press the key combination you want to assign Clear SkinnedFactory Skinned User Interface About Qmmp Skinned User Interface Qmmp Skinned User Interface Simple user interface with Winamp-2.x/XMMS skins support Written by: Vladimir Kuznetsov <vovanec@gmail.com> Ilya Kotov <forkotov02@hotmail.ru> Artwork: Andrey Adreev <andreev00@gmail.com> SkinnedSettings Skins 皮肤 Add... 添加... Refresh 刷新 View Hide on close 关闭时隐藏 Start hidden 启动时隐藏 Use skin cursors Fonts 字体 Player: 播放器: ??? ??? ... ... Playlist: 播放列表: Use bitmap font if available Transparency 透明度 Main window 主窗口 0 0 Equalizer 均衡器 Playlist 播放列表 Miscellaneous Song Display 显示歌曲 Show protocol 显示协议 Show song numbers 显示曲目编号 Show playlists Show popup information Edit template Playlist separator: Show 'New Playlist' button Show anchor Align song numbers Select Skin Files 选择皮肤文件 Skin files 皮肤文件 Unarchived skin 未压缩皮肤 Archived skin 压缩皮肤 TextScroller Autoscroll Songname 自动滚动曲目名 Transparent Background Buffering: %1% VisualMenu Visualization 可视化 qmmp-0.7.4/src/plugins/Ui/skinned/positionbar.cpp0000664000175000017500000000761212256224735020547 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "skin.h" #include "button.h" #include "positionbar.h" PositionBar::PositionBar(QWidget *parent) : PixmapWidget(parent) { m_skin = Skin::instance(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setPixmap(m_skin->getPosBar()); m_moving = false; m_min = 0; m_max = 0; m_old = m_value = 0; draw(false); setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); } PositionBar::~PositionBar() {} void PositionBar::mousePressEvent(QMouseEvent *e) { if(m_max <= 0) return; m_moving = true; press_pos = e->x(); if (m_posx() && e->x()ratio()) { press_pos = e->x()-m_pos; emit sliderPressed(); } else { m_value = convert(qMax(qMin(width()-30*m_skin->ratio(),e->x()-15*m_skin->ratio()),0)); press_pos = 15*m_skin->ratio(); emit sliderPressed(); if (m_value!=m_old) { emit sliderMoved(m_value); } } draw(); } void PositionBar::mouseMoveEvent (QMouseEvent *e) { if (m_moving) { qint64 po = e->x(); po = po - press_pos; if (0<=po && po<=width()-30*m_skin->ratio()) { m_value = convert(po); draw(); emit sliderMoved(m_value); } } } void PositionBar::mouseReleaseEvent(QMouseEvent*) { draw(false); if (m_value != m_old && m_max > 0) m_old = m_value; m_moving = false; if(m_max > 0) emit sliderReleased(); } void PositionBar::setValue(qint64 v) { if (m_moving || m_max == 0) return; m_value = v; draw(false); } void PositionBar::setMaximum(qint64 max) { m_max = max; draw(false); } void PositionBar::updateSkin() { resize(m_skin->getPosBar().size()); draw(false); setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); } void PositionBar::draw(bool pressed) { qint64 p=qint64(ceil(double(m_value-m_min)*(width()-30*m_skin->ratio())/(m_max-m_min))); m_pixmap = m_skin->getPosBar(); if (m_max > 0) { QPainter paint(&m_pixmap); if (pressed) paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_P)); else paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_N)); } setPixmap(m_pixmap); m_pos = p; } qint64 PositionBar::convert(qint64 p) { return qint64(ceil(double(m_max-m_min)*(p)/(width()-30*m_skin->ratio())+m_min)); } qmmp-0.7.4/src/plugins/Ui/skinned/playlistcontrol.cpp0000664000175000017500000000514212256224735021454 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "playlistcontrol.h" #include "skin.h" PlaylistControl::PlaylistControl(QWidget* parent) : PixmapWidget(parent) { m_skin = Skin::instance(); setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); m_ratio = m_skin->ratio(); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); } void PlaylistControl::mouseReleaseEvent(QMouseEvent *me) { QPoint pt = me->pos(); if(QRect(4*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit previousClicked(); else if(QRect(12*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit playClicked(); else if(QRect(21*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit pauseClicked(); else if(QRect(31*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit stopClicked(); else if(QRect(40*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit nextClicked(); else if(QRect(49*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit ejectClicked(); } void PlaylistControl::updateSkin() { setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); m_ratio = m_skin->ratio(); } qmmp-0.7.4/src/plugins/Ui/skinned/actionmanager.cpp0000664000175000017500000001755612256224735021036 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "actionmanager.h" ActionManager *ActionManager::m_instance = 0; ActionManager::ActionManager(QObject *parent) : QObject(parent) { m_instance = this; m_settings = new QSettings(Qmmp::configFile(), QSettings::IniFormat); m_settings->beginGroup("SkinnedShortcuts"); //playback m_actions[PLAY] = createAction(tr("&Play"), "play", tr("X"), "media-playback-start"); m_actions[PAUSE] = createAction(tr("&Pause"), "pause", tr("C"), "media-playback-pause"); m_actions[STOP] = createAction(tr("&Stop"), "stop", tr("V"), "media-playback-stop"); m_actions[PREVIOUS] = createAction(tr("&Previous"), "previous", tr("Z"), "media-skip-backward"); m_actions[NEXT] = createAction(tr("&Next"), "next", tr("B"), "media-skip-forward"); m_actions[PLAY_PAUSE] = createAction(tr("&Play/Pause"), "play_pause", tr("Space")); m_actions[JUMP] = createAction(tr("&Jump to Track"), "jump", tr("J"), "go-up"); m_actions[REPEAT_ALL] = createAction2(tr("&Repeat Playlist"), "repeate_playlist", tr("R")); m_actions[REPEAT_TRACK] = createAction2(tr("&Repeat Track"), "repeate_track", tr("Ctrl+R")); m_actions[SHUFFLE] = createAction2(tr("&Shuffle"), "shuffle", tr("S")); m_actions[NO_PL_ADVANCE] = createAction2(tr("&No Playlist Advance"), "no_playlist_advance", tr("Ctrl+N")); m_actions[STOP_AFTER_SELECTED] = createAction(tr("&Stop After Selected"), "stop_after_selected", tr("Ctrl+S")); m_actions[CLEAR_QUEUE] = createAction(tr("&Clear Queue"), "clear_queue", tr("Alt+Q")); //view m_actions[SHOW_PLAYLIST] = createAction2(tr("Show Playlist"), "show_playlist", tr("Alt+E")); m_actions[SHOW_EQUALIZER] = createAction2(tr("Show Equalizer"), "show_equalizer", tr("Alt+G")); m_actions[WM_ALLWAYS_ON_TOP] = createAction2(tr("Always on Top"), "always_on_top", ""); m_actions[WM_STICKY] = createAction2(tr("Put on All Workspaces"), "sticky", ""); m_actions[WM_DOUBLE_SIZE] = createAction2(tr("Double Size"), "double_size", tr("Meta+D")); //playlist m_actions[PL_ADD_FILE] = createAction(tr("&Add File"), "add_file", tr("F"), "audio-x-generic"); m_actions[PL_ADD_DIRECTORY] = createAction(tr("&Add Directory"), "add_dir", tr("D"), "folder"); m_actions[PL_ADD_URL] = createAction(tr("&Add Url"), "add_url", tr("U"), "network-server"); m_actions[PL_REMOVE_SELECTED] = createAction(tr("&Remove Selected"), "remove_selected", tr("Del"), "edit-delete"); m_actions[PL_REMOVE_ALL] = createAction(tr("&Remove All"), "remove_all", "", "edit-clear"); m_actions[PL_REMOVE_UNSELECTED] = createAction(tr("&Remove Unselected"), "remove_unselected", "", "edit-delete"); m_actions[PL_REMOVE_INVALID] = createAction(tr("Remove unavailable files"), "remove_invalid", "", "dialog-error"); m_actions[PL_REMOVE_DUPLICATES] = createAction(tr("Remove duplicates"), "remove_duplicates", ""); m_actions[PL_ENQUEUE] = createAction(tr("&Queue Toggle"), "enqueue", tr("Q")); m_actions[PL_INVERT_SELECTION] = createAction(tr("Invert Selection"), "invert_selection", ""); m_actions[PL_CLEAR_SELECTION] = createAction(tr("&Select None"), "clear_selection", ""); m_actions[PL_SELECT_ALL] = createAction(tr("&Select All"), "select_all", tr("Ctrl+A"), "edit-select-all"); m_actions[PL_SHOW_INFO] = createAction(tr("&View Track Details"), "show_info", tr("Alt+I"), "dialog-information"); m_actions[PL_NEW] = createAction(tr("&New List"), "new_pl", tr("Ctrl+T"), "document-new"); m_actions[PL_CLOSE] = createAction(tr("&Delete List"), "close_pl", tr("Ctrl+W"), "window-close"); m_actions[PL_LOAD] = createAction(tr("&Load List"), "load_pl", tr("O"), "document-open"); m_actions[PL_SAVE] = createAction(tr("&Save List"), "save_pl", tr("Shift+S"), "document-save-as"); m_actions[PL_SELECT_NEXT] = createAction(tr("&Select Next Playlist"), "next_pl", tr("Ctrl+PgDown"), "go-next"); m_actions[PL_SELECT_PREVIOUS] = createAction(tr("&Select Previous Playlist"), "prev_pl", tr("Ctrl+PgUp"), "go-previous"); m_actions[PL_SHOW_MANAGER] = createAction(tr("&Show Playlists"), "show_playlists", tr("P"), "view-list-details"); //other m_actions[SETTINGS] = createAction(tr("&Settings"), "show_settings", tr("Ctrl+P"), "configure"); m_actions[ABOUT] = createAction(tr("&About"), "about", ""); m_actions[ABOUT_QT] = createAction(tr("&About Qt"), "about_qt", ""); m_actions[QUIT] = createAction(tr("&Exit"), "exit", tr("Ctrl+Q"), "application-exit"); m_settings->endGroup(); delete m_settings; m_settings = 0; m_actions[ABOUT]->setIcon(qApp->windowIcon()); } ActionManager::~ActionManager() { m_instance = 0; } QAction *ActionManager::action(int type) { return m_actions[type]; } QAction *ActionManager::use(int type, const QObject *receiver, const char *member) { QAction *act = m_actions[type]; connect(act,SIGNAL(triggered(bool)), receiver, member); return act; } QList ActionManager::actions() { return m_actions.values(); } ActionManager* ActionManager::instance() { return m_instance; } QAction *ActionManager::createAction(QString name, QString confKey, QString key, QString iconName) { QAction *action = new QAction(name, this); action->setShortcut(m_settings->value(confKey, key).toString()); action->setObjectName(confKey); if(iconName.isEmpty()) return action; if(QFile::exists(iconName)) action->setIcon(QIcon(iconName)); else action->setIcon(QIcon::fromTheme(iconName)); return action; } QAction *ActionManager::createAction2(QString name, QString confKey, QString key) { QAction *action = createAction(name, confKey, key); action->setCheckable(true); return action; } void ActionManager::saveActions() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); foreach(QAction *action, m_actions.values()) { settings.setValue(QString("SkinnedShortcuts/")+action->objectName(), action->shortcut()); } } qmmp-0.7.4/src/plugins/Ui/skinned/visualmenu.cpp0000664000175000017500000000455312256224735020407 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "visualmenu.h" VisualMenu::VisualMenu(QWidget *parent) : QMenu(tr("Visualization"), parent) { VisualFactory *factory = 0; foreach(factory, *Visual::factories()) { VisualAction *act = new VisualAction(factory, this); addAction(act); } } VisualMenu::~VisualMenu() { } void VisualMenu::updateActions() { for(int i = 0; i < Visual::factories()->size(); ++i) { actions()[i]->setChecked(Visual::isEnabled(Visual::factories()->at(i))); } } VisualAction::VisualAction(VisualFactory *factory, QWidget *parent) : QAction(factory->properties().name, parent) { setCheckable (true); setChecked (Visual::isEnabled(factory)); m_factory = factory; connect(this, SIGNAL(triggered(bool)), SLOT(select(bool))); } void VisualAction::select(bool select) { Visual::setEnabled(m_factory, select); } qmmp-0.7.4/src/plugins/Ui/skinned/skin.h0000664000175000017500000002230412256224735016622 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Based on Promoe, an XMMS2 Client * * Copyright (C) 2005-2006 by XMMS2 Team * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SKIN_H #define SKIN_H #include #include #include #include #include #include class Skin : public QObject { Q_OBJECT public: Skin(QObject *parent = 0); ~Skin(); static Skin *instance(); static QPixmap getPixmap(const QString&, QDir); int ratio() { return m_double_size ? 2 : 1; } const QPixmap getMain() const { return m_main; } const QPixmap getButton(uint bt) const { return buttons[bt]; } const QCursor getCursor(uint cu) const { return cursors[cu]; } const QPixmap getTitleBar(uint tb) const { return titlebar[tb]; } const QPixmap getPosBar() const { return posbar; } const QPixmap getNumber(uint n) const { return m_numbers[n]; } /*! * Returns count of numbers in number list. * We need this to check if we have "-" in pixmaps. * if no we should draw it manually. */ uint getNumCount(void) const { return m_numbers.count(); } const QPixmap getPlPart(uint p) const { return m_pl_parts[p]; } const QPixmap getEqPart(uint p) const { return m_eq_parts[p]; } const QPixmap getEqSlider(uint n) const { return m_eq_bar[n]; } const QPixmap getEqSpline(uint n) const { return m_eq_spline[n]; } const QPixmap getMSPart(uint n) const { return m_ms_parts[n]; } const QPixmap getLetter(const QChar& ch) const { return m_letters[ch]; } const QPixmap getItem(uint n) const { return m_parts[n]; } const QPixmap getVolumeBar(int n) const { return m_volume[n]; } const QPixmap getBalanceBar(int n) const { return m_balance[n]; } const QByteArray getPLValue (QByteArray c) const { return m_pledit_txt[c]; } const QColor getVisColor(int n) const { return m_vis_colors[n]; } const QRegion getRegion(uint r) const { return m_regions[r]; } enum Buttons { BT_PREVIOUS_N = 0, BT_PREVIOUS_P, BT_PLAY_N, BT_PLAY_P, BT_PAUSE_N, BT_PAUSE_P, BT_STOP_N, BT_STOP_P, BT_NEXT_N, BT_NEXT_P, BT_EJECT_N, BT_EJECT_P, /*titlebar.* */ BT_MENU_N, BT_MENU_P, BT_MINIMIZE_N, BT_MINIMIZE_P, BT_CLOSE_N, BT_CLOSE_P, BT_SHADE1_N, BT_SHADE1_P, BT_SHADE2_N, BT_SHADE2_P, BT_CLOSE_SHADED_N, BT_CLOSE_SHADED_P, /* posbar.* */ BT_POSBAR_N, BT_POSBAR_P, /* pledit.* */ PL_BT_ADD, PL_BT_SUB, PL_BT_SEL, PL_BT_SORT, PL_BT_LST, PL_BT_SCROLL_N, PL_BT_SCROLL_P, PL_BT_CLOSE_N, PL_BT_CLOSE_P, PL_BT_SHADE1_N, PL_BT_SHADE1_P, PL_BT_SHADE2_N, PL_BT_SHADE2_P, /* eqmain.* */ EQ_BT_BAR_N, EQ_BT_BAR_P, EQ_BT_ON_N, EQ_BT_ON_P, EQ_BT_OFF_N, EQ_BT_OFF_P, EQ_BT_PRESETS_N, EQ_BT_PRESETS_P, EQ_BT_AUTO_1_N, EQ_BT_AUTO_1_P, EQ_BT_AUTO_0_N, EQ_BT_AUTO_0_P, EQ_BT_CLOSE_N, EQ_BT_CLOSE_P, EQ_BT_SHADE1_N, /* eq_ex.* */ EQ_BT_SHADE1_P, EQ_BT_SHADE2_N, EQ_BT_SHADE2_P, /* shufrep.* */ BT_EQ_ON_N, BT_EQ_ON_P, BT_EQ_OFF_N, BT_EQ_OFF_P, BT_PL_ON_N, BT_PL_ON_P, BT_PL_OFF_N, BT_PL_OFF_P, BT_PL_CLOSE_N, BT_PL_CLOSE_P, REPEAT_ON_N, REPEAT_ON_P, REPEAT_OFF_N, REPEAT_OFF_P, SHUFFLE_ON_N, SHUFFLE_ON_P, SHUFFLE_OFF_N, SHUFFLE_OFF_P, /* volume.* */ BT_VOL_N, BT_VOL_P, /* balance.* */ BT_BAL_N, BT_BAL_P, }; enum TitleBar { TITLEBAR_A = 0, TITLEBAR_I, TITLEBAR_SHADED_A, TITLEBAR_SHADED_I }; enum PlayList { PL_CORNER_UL_A = 0, PL_CORNER_UL_I, PL_CORNER_UR_A, PL_CORNER_UR_I, PL_TITLEBAR_A, PL_TITLEBAR_I, PL_TFILL1_A, PL_TFILL1_I, PL_TFILL2_A, PL_TFILL2_I, PL_LFILL, PL_RFILL, PL_LSBAR, PL_RSBAR, PL_SFILL1, PL_SFILL2, PL_CONTROL, PL_TITLEBAR_SHADED1_A, PL_TITLEBAR_SHADED1_I, PL_TITLEBAR_SHADED2, PL_TFILL_SHADED }; enum Equalizer { EQ_MAIN = 0, EQ_TITLEBAR_A, EQ_TITLEBAR_I, EQ_GRAPH, EQ_TITLEBAR_SHADED_A, EQ_TITLEBAR_SHADED_I, EQ_VOLUME1, EQ_VOLUME2, EQ_VOLUME3, EQ_BALANCE1, EQ_BALANCE2, EQ_BALANCE3 }; enum MonoSter { MONO_A = 0, MONO_I, STEREO_A, STEREO_I }; enum OtherParts { PLAY = 0, PAUSE, STOP }; enum Regions { NORMAL = 0, EQUALIZER, WINDOW_SHADE, EQUALIZER_WS }; enum Cursors { CUR_NORMAL = 0, CUR_CLOSE, CUR_MAINMENU, CUR_MIN, CUR_POSBAR, CUR_SONGNAME, CUR_TITLEBAR, CUR_VOLBAL, CUR_WINBUT, CUR_WSNORMAL, CUR_WSPOSBAR, CUR_EQCLOSE, CUR_EQNORMAL, CUR_EQSLID, CUR_EQTITLE, CUR_PCLOSE, CUR_PNORMAL, CUR_PSIZE, CUR_PTBAR, CUR_PVSCROLL, CUR_PWINBUT, CUR_PWSNORM, CUR_PWSSIZE, CUR_VOLBAR, CUR_WSCLOSE, CUR_WSMIN, CUR_WSWINBUT }; public slots: void setSkin(const QString& path); void reloadSkin(); signals: void skinChanged(); private: QPixmap *getPixmap(const QString&); QString getPath(const QString&); const QString findFile(const QString&, QDir); const QString findFile(const QString&, const QString&); /*! * As far as there is no standard in skin making we cannot be sure * that all needful images we can find in skin :( This will cause * segfaults and asserts. So to prevent this we need such method * to load pixmap from default skin. */ QPixmap *getDummyPixmap(const QString&); QPixmap scalePixmap(const QPixmap &pix, int ratio = 2); static Skin *m_instance; QDir m_skin_dir; QMap buttons; QMap cursors; QMap titlebar; QMap m_pl_parts; QMap m_eq_parts; QMap m_ms_parts; QMap m_parts; QMap m_letters; QMap m_pledit_txt; QMap m_regions; QPixmap m_main; QPixmap posbar; QList m_numbers; QList m_eq_bar; QList m_eq_spline; QList m_volume; QList m_balance; QList m_vis_colors; bool m_use_cursors; bool m_double_size; void loadMain(); void loadButtons(); void loadCursors(); void loadTitleBar(); void loadPosBar(); void loadNumbers(); void loadPlayList(); void loadPLEdit(); void loadEqMain(); void loadEq_ex(); void loadVisColor(); void loadShufRep(); void loadLetters(); void loadMonoSter(); void loadVolume(); void loadBalance(); void loadRegion(); QRegion createRegion(const QString &path, const QString &key); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/popupwidget.cpp0000664000175000017500000001051212256224735020556 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "popupwidget.h" using namespace PlayListPopup; PopupWidget::PopupWidget(QWidget *parent) : QWidget(parent) { setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::Dialog | Qt::FramelessWindowHint); //setFrameStyle(QFrame::Box | QFrame::Plain); setAttribute(Qt::WA_QuitOnClose, false); QHBoxLayout *hlayout = new QHBoxLayout(this); //layout m_pixlabel = new QLabel(this); hlayout->addWidget(m_pixlabel); m_label1 = new QLabel(this); hlayout->addWidget (m_label1); //settings QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); setWindowOpacity(settings.value("popup_opacity", 1.0).toDouble()); m_coverSize = settings.value("popup_cover_size", 48).toInt(); m_template = settings.value("popup_template",DEFAULT_TEMPLATE).toString(); int delay = settings.value("popup_delay", 2500).toInt(); bool show_cover = settings.value("popup_show_cover",true).toBool(); settings.endGroup(); //timer m_timer = new QTimer(this); m_timer->setInterval(delay); m_timer->setSingleShot (true); connect(m_timer, SIGNAL(timeout ()), SLOT(show())); if(show_cover) connect(m_timer, SIGNAL(timeout ()), SLOT(loadCover())); else m_pixlabel->hide(); setMouseTracking(true); } PopupWidget::~PopupWidget() {} void PopupWidget::mousePressEvent (QMouseEvent *) { hide(); } void PopupWidget::mouseMoveEvent (QMouseEvent *) { hide(); } void PopupWidget::prepare(PlayListItem *item, QPoint pos) { pos += QPoint(15,10); m_url = item->url(); hide(); if(!item) { m_timer->stop(); return; } QString title = m_template; MetaDataFormatter f(title); title = f.parse(item); m_label1->setText(title); qApp->processEvents(); updateGeometry (); resize(sizeHint()); qApp->processEvents(); m_timer->start(); QRect rect = QApplication::desktop()->availableGeometry(this); if(pos.x() + width() > rect.x() + rect.width()) pos.rx() -= width(); move(pos); } void PopupWidget::deactivate() { m_timer->stop(); m_url.clear(); hide(); } const QString PopupWidget::url() const { return m_url; } void PopupWidget::loadCover() { if(m_url.isEmpty()) return; QPixmap pix = MetaDataManager::instance()->getCover(m_url); if(pix.isNull()) pix = QPixmap(":/skinned/ui_no_cover.png"); m_pixlabel->setFixedSize(m_coverSize,m_coverSize); m_pixlabel->setPixmap(pix.scaled(m_coverSize,m_coverSize)); qApp->processEvents(); updateGeometry (); resize(sizeHint()); qApp->processEvents(); } qmmp-0.7.4/src/plugins/Ui/skinned/togglebutton.cpp0000664000175000017500000000676612256224735020744 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Based on Promoe, an XMMS2 Client * * Copyright (C) 2005-2006 by XMMS2 Team * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "skin.h" #include "togglebutton.h" #include ToggleButton::ToggleButton ( QWidget *parent,uint on_n,uint on_p,uint off_n,uint off_p ) : PixmapWidget ( parent ) { m_on_n = on_n; m_on_p = on_p; m_off_n = off_n; m_off_p = off_p; m_on = false; skin = Skin::instance(); setChecked ( false ); connect ( skin, SIGNAL ( skinChanged() ), this, SLOT ( updateSkin() ) ); } ToggleButton::~ToggleButton() {} bool ToggleButton::isChecked() { return m_on; } void ToggleButton::updateSkin() { //setPixmap ( skin->getButton ( name_normal ) ); setChecked ( m_on ); } void ToggleButton::click() { m_on = !m_on; setChecked (m_on); emit clicked(m_on); } void ToggleButton::setChecked ( bool on ) { m_on = on; if ( on ) setPixmap ( skin->getButton ( m_on_n ) ); else setPixmap ( skin->getButton ( m_off_n ) ); } void ToggleButton::mousePressEvent ( QMouseEvent* ) { m_cursorin = true; m_old_on = m_on; if ( m_on ) setPixmap ( skin->getButton ( m_off_p ) ); else setPixmap ( skin->getButton ( m_on_p ) ); } void ToggleButton::mouseReleaseEvent ( QMouseEvent* ) { if ( m_cursorin ) { m_on = !m_old_on; setChecked ( m_on ); emit clicked( m_on ); } else { m_on = m_old_on; setChecked ( m_on ); } } void ToggleButton::mouseMoveEvent (QMouseEvent *e) { if ( !m_cursorin && rect().contains(e->pos()) ) { m_cursorin = true; if ( m_old_on ) setPixmap ( skin->getButton ( m_off_p ) ); else setPixmap ( skin->getButton ( m_on_p ) ); } else if ( m_cursorin && !rect().contains(e->pos()) ) { m_cursorin = false; if ( m_old_on ) setPixmap ( skin->getButton ( m_on_n ) ); else setPixmap ( skin->getButton ( m_off_n ) ); } } qmmp-0.7.4/src/plugins/Ui/skinned/shortcutitem.cpp0000664000175000017500000000365112256224735020747 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "actionmanager.h" #include "shortcutitem.h" ShortcutItem::ShortcutItem(QTreeWidgetItem *parent, int type) : QTreeWidgetItem(parent, QStringList() << ActionManager::instance()->action(type)->text().remove("&") << ActionManager::instance()->action(type)->shortcut()) { m_action = ActionManager::instance()->action(type); setIcon(0, m_action->icon()); } ShortcutItem::~ShortcutItem() {} QAction *ShortcutItem::action() { return m_action; } qmmp-0.7.4/src/plugins/Ui/skinned/eqwidget.cpp0000664000175000017500000003412612256224735020027 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "skin.h" #include "eqslider.h" #include "eqtitlebar.h" #include "togglebutton.h" #include "eqgraph.h" #include "button.h" #include "eqpreset.h" #include "preseteditor.h" #include "mainwindow.h" #include "playlist.h" #include "windowsystem.h" #include "eqwidget.h" EqWidget::EqWidget (QWidget *parent) : PixmapWidget (parent) { setWindowTitle(tr("Equalizer")); m_shaded = false; m_skin = Skin::instance(); setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); m_titleBar = new EqTitleBar (this); m_titleBar->move (0,0); connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); m_preamp = new EqSlider (this); connect (m_preamp,SIGNAL (sliderMoved (double)),SLOT (writeEq())); m_on = new ToggleButton (this,Skin::EQ_BT_ON_N,Skin::EQ_BT_ON_P, Skin::EQ_BT_OFF_N,Skin::EQ_BT_OFF_P); connect (m_on, SIGNAL (clicked(bool)), SLOT(writeEq())); m_autoButton = new ToggleButton(this, Skin::EQ_BT_AUTO_1_N, Skin::EQ_BT_AUTO_1_P, Skin::EQ_BT_AUTO_0_N, Skin::EQ_BT_AUTO_0_P); m_eqg = new EQGraph(this); m_presetsMenu = new QMenu(this); m_presetButton = new Button (this, Skin::EQ_BT_PRESETS_N, Skin::EQ_BT_PRESETS_P, Skin::CUR_EQNORMAL); connect(m_presetButton, SIGNAL(clicked()), SLOT(showPresetsMenu())); connect(SoundCore::instance(), SIGNAL(eqSettingsChanged()), SLOT(readEq())); for (int i = 0; i<10; ++i) { m_sliders << new EqSlider (this); connect (m_sliders.at (i), SIGNAL (sliderMoved (double)),SLOT (writeEq())); } readSettings(); createActions(); updatePositions(); updateMask(); connect(SoundCore::instance(), SIGNAL(volumeChanged(int, int)), m_titleBar, SLOT(setVolume(int, int))); #ifdef Q_WS_X11 QString wm_name = WindowSystem::netWindowManagerName(); if(wm_name.contains("metacity", Qt::CaseInsensitive) || wm_name.contains("openbox", Qt::CaseInsensitive)) setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); else #endif setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); } EqWidget::~EqWidget() { while (!m_presets.isEmpty()) delete m_presets.takeFirst(); while (!m_autoPresets.isEmpty()) delete m_autoPresets.takeFirst(); } void EqWidget::updatePositions() { int r = m_skin->ratio(); m_preamp->move (21*r,38*r); m_on->move (14*r,18*r); m_autoButton->move(39*r,18*r); m_eqg->move(87*r,17*r); m_presetButton->move(217*r,18*r); for (int i = 0; i < 10; ++i) m_sliders.at (i)->move ((78+i*18)*r,38*r); } void EqWidget::changeEvent (QEvent * event) { if (event->type() == QEvent::ActivationChange) { m_titleBar->setActive(isActiveWindow()); } } void EqWidget::closeEvent (QCloseEvent* e) { if (e->spontaneous ()) emit closed(); writeSettings(); } void EqWidget::updateSkin() { m_titleBar->setActive (false); setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); setMimimalMode(m_shaded); updatePositions(); } void EqWidget::setMimimalMode(bool b) { m_shaded = b; int r = m_skin->ratio(); if(m_shaded) resize(r*275,r*14); else resize(r*275,r*116); updateMask(); } void EqWidget::readSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); move (settings.value ("Skinned/eq_pos", QPoint (100, 216)).toPoint()); //geometry readEq(); //equalizer presets QString preset_path = QDir::homePath() +"/.qmmp/eq.preset"; if(!QFile::exists(preset_path)) preset_path = ":/skinned/eq.preset"; QSettings eq_preset (preset_path, QSettings::IniFormat); for (int i = 1; true; ++i) { if (eq_preset.contains("Presets/Preset"+QString("%1").arg(i))) { QString name = eq_preset.value(QString("Presets/Preset%1").arg(i), tr("preset")).toString(); EQPreset *preset = new EQPreset(); preset->setText(name); eq_preset.beginGroup(name); for (int j = 0; j < 10; ++j) { preset->setGain(j,eq_preset.value(QString("Band%1").arg(j), 0).toDouble()); } preset->setPreamp(eq_preset.value("Preamp",0).toDouble()); m_presets.append(preset); eq_preset.endGroup(); } else break; } //equalizer auto-load presets QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", QSettings::IniFormat); for (int i = 1; true; ++i) { if (eq_auto.contains(QString("Presets/Preset%1").arg(i))) { QString name = eq_auto.value(QString("Presets/Preset%1").arg(i), tr("preset")).toString(); EQPreset *preset = new EQPreset(); preset->setText(name); eq_auto.beginGroup(name); for (int j = 0; j < 10; ++j) { preset->setGain(j,eq_auto.value(QString("Band%1").arg(j), 0).toDouble()); } preset->setPreamp(eq_auto.value("Preamp",0).toDouble()); m_autoPresets.append(preset); eq_auto.endGroup(); } else break; } } void EqWidget::writeSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Skinned/eq_pos", this->pos()); //geometry //equalizer presets QSettings eq_preset (QDir::homePath() +"/.qmmp/eq.preset", QSettings::IniFormat); eq_preset.clear (); for (int i = 0; i < m_presets.size(); ++i) { eq_preset.setValue(QString("Presets/Preset%1").arg(i+1), m_presets.at(i)->text()); eq_preset.beginGroup(m_presets.at(i)->text()); for (int j = 0; j < 10; ++j) { eq_preset.setValue(QString("Band%1").arg(j),m_presets.at(i)->gain(j)); } eq_preset.setValue("Preamp",m_presets.at(i)->preamp()); eq_preset.endGroup(); } //equalizer auto-load presets QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", QSettings::IniFormat); eq_auto.clear(); for (int i = 0; i < m_autoPresets.size(); ++i) { eq_auto.setValue("Presets/Preset"+QString("%1").arg(i+1), m_autoPresets.at(i)->text()); eq_auto.beginGroup(m_autoPresets.at(i)->text()); for (int j = 0; j < 10; ++j) { eq_auto.setValue(QString("Band%1").arg(j),m_autoPresets.at(i)->gain(j)); } eq_auto.setValue("Preamp",m_autoPresets.at(i)->preamp()); eq_auto.endGroup(); } } void EqWidget::readEq() { m_eqg->clear(); EqSettings eqSettings = SoundCore::instance()->eqSettings(); if(eqSettings.bands() != 10) { m_on->setChecked(false); return; } m_preamp->setValue(eqSettings.preamp()); for (int i=0; i<10; ++i) { m_sliders.at(i)->setValue(eqSettings.gain(i)); m_eqg->addValue(m_sliders.at(i)->value()); } m_on->setChecked(eqSettings.isEnabled()); } void EqWidget::writeEq() { m_eqg->clear(); EqSettings eqSettings; eqSettings.setPreamp(m_preamp->value()); for (int i=0; i<10; ++i) { eqSettings.setGain(i,m_sliders.at(i)->value()); m_eqg->addValue(m_sliders.at(i)->value()); } eqSettings.setEnabled(m_on->isChecked()); SoundCore::instance()->setEqSettings(eqSettings); } void EqWidget::createActions() { m_presetsMenu->addAction(tr("&Load/Delete"),this, SLOT(showEditor())); m_presetsMenu->addSeparator(); m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Preset"), this, SLOT(savePreset())); m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Auto-load Preset"), this, SLOT(saveAutoPreset())); m_presetsMenu->addAction(QIcon::fromTheme("document-open"), tr("&Import"), this, SLOT(importWinampEQF())); m_presetsMenu->addSeparator(); m_presetsMenu->addAction(QIcon::fromTheme("edit-clear"), tr("&Clear"), this, SLOT(reset())); } void EqWidget::showPresetsMenu() { m_presetsMenu->exec(m_presetButton->mapToGlobal(QPoint(0, 0))); } void EqWidget::reset() { for (int i = 0; i < m_sliders.size(); ++i) m_sliders.at(i)->setValue(0); m_preamp->setValue(0); writeEq(); } void EqWidget::showEditor() { PresetEditor *editor = new PresetEditor(this); editor->addPresets(m_presets); editor->addAutoPresets(m_autoPresets); connect (editor, SIGNAL(presetLoaded(EQPreset*)), SLOT(setPreset(EQPreset*))); connect (editor, SIGNAL(presetDeleted(EQPreset*)), SLOT(deletePreset(EQPreset*))); editor->show(); } void EqWidget::savePreset() { bool ok; QString text = QInputDialog::getText(this, tr("Saving Preset"), tr("Preset name:"), QLineEdit::Normal, tr("preset #")+QString("%1").arg(m_presets.size()+1), &ok); if (ok) { EQPreset* preset = new EQPreset; preset->setText(text); preset->setPreamp(m_preamp->value()); for (int i = 0; i<10; ++i) preset->setGain(i, m_sliders.at (i)->value()); foreach(EQPreset *p, m_presets) //remove preset with same name { if (p->text() == text) { m_presets.removeAll(p); delete p; } } m_presets.append(preset); } } void EqWidget::saveAutoPreset() { PlayList* playlist = qobject_cast(parent())->playlist(); if (!playlist->currentItem()) return; //delete preset if it already exists EQPreset* preset = findPreset(playlist->currentItem()->url().section("/",-1)); if (preset) deletePreset(preset); //create new preset preset = new EQPreset(); preset->setText(playlist->currentItem()->url().section("/",-1)); preset->setPreamp(m_preamp->value()); for (int i = 0; i<10; ++i) { preset->setGain(i, m_sliders.at (i)->value()); } m_autoPresets.append(preset); } void EqWidget::setPreset(EQPreset* preset) { for (int i = 0; i<10; ++i) m_sliders.at(i)->setValue(preset->gain(i)); m_preamp->setValue(preset->preamp()); writeEq(); } void EqWidget::deletePreset(EQPreset* preset) { int p = m_presets.indexOf(preset); if (p != -1) { delete m_presets.takeAt(p); return; } p = m_autoPresets.indexOf(preset); if (p != -1) { delete m_autoPresets.takeAt(p); return; } } void EqWidget::loadPreset(const QString &name) { if (m_autoButton->isChecked()) { EQPreset *preset = findPreset(name); if (preset) setPreset(preset); else reset(); } } EQPreset *EqWidget::findPreset(const QString &name) { foreach(EQPreset *preset, m_autoPresets) { if (preset->text() == name) return preset; } return 0; } void EqWidget::importWinampEQF() { char header[31]; char name[257]; char bands[11]; QString path = FileDialog::getOpenFileName(this, tr("Import Preset"), QDir::homePath(), QString("Winamp EQF (*.q1)")); QFile file(path); file.open(QIODevice::ReadOnly); file.read (header, 31); if (QString::fromAscii(header).contains("Winamp EQ library file v1.1")) { while (file.read (name, 257)) { EQPreset* preset = new EQPreset; preset->setText(QString::fromAscii(name)); file.read(bands,11); for (int i = 0; i<10; ++i) { preset->setGain(i, 20 - bands[i]*40/64); } preset->setPreamp(20 - bands[10]*40/64); m_presets.append(preset); } } file.close(); } void EqWidget::keyPressEvent (QKeyEvent *ke) { QKeyEvent event = QKeyEvent(ke->type(), ke->key(), ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); QApplication::sendEvent(qobject_cast(parent())->playlist(), &event); } #ifdef Q_WS_X11 bool EqWidget::event (QEvent *event) { if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) { WindowSystem::ghostWindow(winId()); WindowSystem::setWinHint(winId(), "equalizer", "Qmmp"); } return QWidget::event(event); } #endif void EqWidget::updateMask() { clearMask(); setMask(QRegion(0,0,width(),height())); QRegion region = m_skin->getRegion(m_shaded? Skin::EQUALIZER_WS : Skin::EQUALIZER); if (!region.isEmpty()) setMask(region); } qmmp-0.7.4/src/plugins/Ui/skinned/balancebar.h0000664000175000017500000000440612256224735017733 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef BALANCEBAR_H #define BALANCEBAR_H #include "pixmapwidget.h" class Skin; /** @author Ilya Kotov */ class BalanceBar : public PixmapWidget { Q_OBJECT public: BalanceBar(QWidget *parent = 0); ~BalanceBar(); int value() {return m_value; } public slots: void setValue(int); void setMax(int); signals: void sliderMoved (int); void sliderPressed(); void sliderReleased(); private slots: void updateSkin(); private: Skin *m_skin; bool m_moving; int press_pos; int m_max, m_min, m_pos, m_value, m_old; QPixmap m_pixmap; int convert(int); // value = convert(position); void draw(bool pressed = true); protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playstatus.cpp0000664000175000017500000000424412256224735020425 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "skin.h" #include "playstatus.h" PlayStatus::PlayStatus ( QWidget *parent ) : PixmapWidget ( parent ) { m_skin = Skin::instance(); setStatus ( STOP ); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); } PlayStatus::~PlayStatus() {} void PlayStatus::setStatus ( Type st ) { m_status = st; switch ( ( uint ) st ) { case PLAY: { setPixmap ( m_skin->getItem ( Skin::PLAY )); break; } case STOP: { setPixmap ( m_skin->getItem ( Skin::STOP )); break; } case PAUSE: { setPixmap ( m_skin->getItem ( Skin::PAUSE )); break; } } } void PlayStatus::updateSkin() { setStatus ( m_status ); } qmmp-0.7.4/src/plugins/Ui/skinned/playlist.cpp0000664000175000017500000005656412256224735020071 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dock.h" #include "skin.h" #include "listwidget.h" #include "button.h" #include "playlisttitlebar.h" #include "playlistslider.h" #include "pixmapwidget.h" #include "symboldisplay.h" #include "playlistcontrol.h" #include "keyboardmanager.h" #include "playlistbrowser.h" #include "playlistselector.h" #include "windowsystem.h" #include "actionmanager.h" #include "playlist.h" PlayList::PlayList (PlayListManager *manager, QWidget *parent) : QWidget (parent) { setAttribute(Qt::WA_AlwaysShowToolTips,true); setWindowTitle(tr("Playlist")); m_pl_manager = manager; m_update = false; m_resize = false; m_skin = Skin::instance(); m_ratio = m_skin->ratio(); m_shaded = false; m_pl_browser = 0; m_pl_selector = 0; resize (275*m_ratio, 116*m_ratio); setSizeIncrement (25*m_ratio, 29*m_ratio); setMinimumSize(275*m_ratio, 116*m_ratio); m_listWidget = new ListWidget (this); m_plslider = new PlayListSlider (this); m_buttonAdd = new Button (this,Skin::PL_BT_ADD,Skin::PL_BT_ADD, Skin::CUR_PNORMAL); m_buttonSub = new Button (this,Skin::PL_BT_SUB,Skin::PL_BT_SUB, Skin::CUR_PNORMAL); m_selectButton = new Button (this,Skin::PL_BT_SEL,Skin::PL_BT_SEL, Skin::CUR_PNORMAL); m_sortButton= new Button (this,Skin::PL_BT_SORT,Skin::PL_BT_SORT, Skin::CUR_PNORMAL); m_playlistButton = new Button (this,Skin::PL_BT_LST,Skin::PL_BT_LST, Skin::CUR_PNORMAL); m_resizeWidget = new QWidget(this); m_resizeWidget->resize(25,25); m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); m_pl_control = new PlaylistControl (this); m_length_totalLength = new SymbolDisplay (this,14); m_length_totalLength->setAlignment (Qt::AlignLeft); m_current_time = new SymbolDisplay (this,6); m_keyboardManager = new KeyboardManager (this); connect (m_listWidget, SIGNAL (selectionChanged()), parent, SLOT (replay())); connect (m_plslider, SIGNAL (sliderMoved (int)), m_listWidget, SLOT (scroll (int))); connect (m_listWidget, SIGNAL (positionChanged (int, int)), m_plslider, SLOT (setPos (int, int))); connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); connect (m_buttonAdd, SIGNAL (clicked()), SLOT (showAddMenu())); connect (m_buttonSub, SIGNAL (clicked()), SLOT (showSubMenu())); connect (m_selectButton, SIGNAL (clicked()), SLOT (showSelectMenu())); connect (m_sortButton, SIGNAL (clicked()), SLOT (showSortMenu())); connect (m_playlistButton, SIGNAL (clicked()), SLOT (showPlaylistMenu())); connect (m_pl_control, SIGNAL (nextClicked()), SIGNAL (next())); connect (m_pl_control, SIGNAL (previousClicked()), SIGNAL (prev())); connect (m_pl_control, SIGNAL (playClicked()), SIGNAL (play())); connect (m_pl_control, SIGNAL (pauseClicked()), SIGNAL (pause())); connect (m_pl_control, SIGNAL (stopClicked()), SIGNAL (stop())); connect (m_pl_control, SIGNAL (ejectClicked()), SIGNAL (eject())); connect (m_pl_manager, SIGNAL (selectedPlayListChanged(PlayListModel *, PlayListModel *)), m_listWidget, SLOT(setModel(PlayListModel*))); m_listWidget->setModel(m_pl_manager->selectedPlayList()); createMenus(); createActions(); readSettings(); m_titleBar = new PlayListTitleBar (this); m_titleBar->setMinimumSize(0,0); m_titleBar->move (0,0); connect (m_pl_manager, SIGNAL (currentPlayListChanged(PlayListModel *, PlayListModel *)), m_titleBar, SLOT(setModel(PlayListModel*))); m_titleBar->setModel(m_pl_manager->currentPlayList()); setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); updatePositions(); #ifdef Q_WS_X11 QString wm_name = WindowSystem::netWindowManagerName(); if(wm_name.contains("metacity", Qt::CaseInsensitive) || wm_name.contains("openbox", Qt::CaseInsensitive)) setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); else #endif setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); } PlayList::~PlayList() { delete m_keyboardManager; } void PlayList::updatePositions() { int sx = (width()-275*m_ratio)/25; int sy = (height()-116*m_ratio)/29; if (sx < 0 || sy < 0 || m_shaded) //skip shaded mode return; m_titleBar->resize (275*m_ratio+25*sx, 20*m_ratio); m_plslider->resize (20*m_ratio, 58*m_ratio+sy*29); if(m_pl_selector) { m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy - m_pl_selector->height()); m_pl_selector->resize(243*m_ratio+25*sx, m_pl_selector->height()); m_pl_selector->move(12*m_ratio, 20*m_ratio + 58*m_ratio+29*sy - m_pl_selector->height()); } else m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy); m_listWidget->move (12*m_ratio,20*m_ratio); m_buttonAdd->move (11*m_ratio, 86*m_ratio+29*sy); m_buttonSub->move (40*m_ratio, 86*m_ratio+29*sy); m_selectButton->move (70*m_ratio, 86*m_ratio+29*sy); m_sortButton->move (99*m_ratio, 86*m_ratio+29*sy); m_pl_control->move (128*m_ratio+sx*25, 100*m_ratio+29*sy); m_playlistButton->move (228*m_ratio+sx*25,86*m_ratio+29*sy); m_length_totalLength -> move (131*m_ratio+sx*25,88*m_ratio+29*sy); m_current_time->move (190*m_ratio+sx*25,101*m_ratio+29*sy); m_plslider->move (255*m_ratio+sx*25,20*m_ratio); m_resizeWidget->move(width() - 25, height() - 29); } void PlayList::createMenus() { m_addMenu = new QMenu (this); m_subMenu = new QMenu (this); m_selectMenu = new QMenu (this); m_sortMenu = new QMenu (this); m_playlistMenu = new QMenu (this); m_copySelectedMenu = new QMenu (tr("&Copy Selection To"), m_listWidget->menu()); m_copySelectedMenu->setIcon(QIcon::fromTheme("edit-copy")); connect(m_copySelectedMenu, SIGNAL(aboutToShow()), SLOT(generateCopySelectedMenu())); connect(m_copySelectedMenu, SIGNAL(triggered(QAction *)), SLOT(copySelectedMenuActionTriggered(QAction *))); } void PlayList::createActions() { //add menu m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_FILE, parent(), SLOT(addFile()))); m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_DIRECTORY, parent(), SLOT(addDir()))); m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_URL, parent(), SLOT(addUrl()))); //sub menu m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_SELECTED, m_pl_manager, SLOT(removeSelected()))); m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_ALL, m_pl_manager, SLOT(clear()))); m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_UNSELECTED, m_pl_manager, SLOT(removeUnselected()))); m_subMenu->addSeparator(); m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_INVALID, m_pl_manager, SLOT(removeInvalidItems()))); m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_DUPLICATES, m_pl_manager, SLOT(removeDuplicates()))); //sort menu m_sortMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_INFO, m_pl_manager, SLOT (showDetails ()))); m_sortMenu->addSeparator(); QMenu* sort_mode_menu = new QMenu (tr("Sort List"), m_sortMenu); sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); QSignalMapper* signalMapper = new QSignalMapper (this); QAction* titleAct = sort_mode_menu->addAction (tr ("By Title")); connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (titleAct, PlayListModel::TITLE); QAction* albumAct = sort_mode_menu->addAction (tr ("By Album")); connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (albumAct, PlayListModel::ALBUM); QAction* discnumberAct = sort_mode_menu->addAction (tr ("By Disc Number")); connect (discnumberAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (discnumberAct, PlayListModel::DISCNUMBER); QAction* artistAct = sort_mode_menu->addAction (tr ("By Artist")); connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (artistAct, PlayListModel::ARTIST); QAction* nameAct = sort_mode_menu->addAction (tr ("By Filename")); connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (nameAct, PlayListModel::FILENAME); QAction* pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); QAction* dateAct = sort_mode_menu->addAction (tr ("By Date")); connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (dateAct, PlayListModel::DATE); QAction* trackAct = sort_mode_menu->addAction (tr("By Track Number")); connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (trackAct, PlayListModel::TRACK); QAction* fileCreationDateAct = sort_mode_menu->addAction (tr("By File Creation Date")); connect (fileCreationDateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (fileCreationDateAct, PlayListModel::FILE_CREATION_DATE); connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sort (int))); m_sortMenu->addMenu (sort_mode_menu); sort_mode_menu = new QMenu (tr("Sort Selection"), m_sortMenu); sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); signalMapper = new QSignalMapper (this); titleAct = sort_mode_menu->addAction (tr ("By Title")); connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (titleAct, PlayListModel::TITLE); albumAct = sort_mode_menu->addAction (tr ("By Album")); connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (albumAct, PlayListModel::ALBUM); discnumberAct = sort_mode_menu->addAction (tr ("By Disc Number")); connect (discnumberAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (discnumberAct, PlayListModel::DISCNUMBER); artistAct = sort_mode_menu->addAction (tr ("By Artist")); connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (artistAct, PlayListModel::ARTIST); nameAct = sort_mode_menu->addAction (tr ("By Filename")); connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (nameAct, PlayListModel::FILENAME); pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); dateAct = sort_mode_menu->addAction (tr ("By Date")); connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (dateAct, PlayListModel::DATE); trackAct = sort_mode_menu->addAction (tr ("By Track Number")); connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (trackAct, PlayListModel::TRACK); fileCreationDateAct = sort_mode_menu->addAction (tr("By File Creation Date")); connect (fileCreationDateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); signalMapper->setMapping (fileCreationDateAct, PlayListModel::FILE_CREATION_DATE); connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sortSelection (int))); m_sortMenu->addMenu (sort_mode_menu); m_sortMenu->addSeparator(); m_sortMenu->addAction (QIcon::fromTheme("media-playlist-shuffle"), tr("Randomize List"), m_pl_manager, SLOT(randomizeList())); m_sortMenu->addAction (QIcon::fromTheme("view-sort-descending"), tr("Reverse List"), m_pl_manager, SLOT(reverseList())); //playlist context menu m_listWidget->menu()->addAction(ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); m_listWidget->menu()->addSeparator(); m_listWidget->menu()->addActions (m_subMenu->actions().mid(0,3)); //use 3 first actions m_listWidget->menu()->addMenu(UiHelper::instance()->createMenu(UiHelper::PLAYLIST_MENU, tr("Actions"), this)); m_listWidget->menu()->addSeparator(); m_listWidget->menu()->addAction(SET_ACTION(ActionManager::PL_ENQUEUE, m_pl_manager, SLOT(addToQueue()))); //select menu m_selectMenu->addAction(SET_ACTION(ActionManager::PL_INVERT_SELECTION, m_pl_manager, SLOT(invertSelection ()))); m_selectMenu->addSeparator(); m_selectMenu->addAction(SET_ACTION(ActionManager::PL_CLEAR_SELECTION, m_pl_manager, SLOT(clearSelection ()))); m_selectMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_ALL, m_pl_manager, SLOT(selectAll()))); //Playlist Menu m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_NEW, m_pl_manager, SLOT(createPlayList()))); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_CLOSE, this, SLOT(deletePlaylist()))); m_playlistMenu->addSeparator(); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_LOAD, this, SIGNAL(loadPlaylist()))); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SAVE, this, SIGNAL(savePlaylist()))); m_playlistMenu->addSeparator(); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_NEXT, m_pl_manager, SLOT(selectNextPlayList()))); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_PREVIOUS, m_pl_manager, SLOT(selectPreviousPlayList()))); m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_MANAGER, this, SLOT(showPlayLists()))); } void PlayList::closeEvent (QCloseEvent *e) { if (e->spontaneous ()) emit closed(); writeSettings(); } void PlayList::paintEvent (QPaintEvent *) { int sx = (width()-275*m_ratio) /25; int sy = (height()-116*m_ratio) /29; QPainter paint(this); drawPixmap (&paint, 0, 20*m_ratio, m_skin->getPlPart (Skin::PL_LFILL)); for (int i = 1; igetPlPart (Skin::PL_LFILL)); } drawPixmap (&paint, 0, 78*m_ratio+29*sy, m_skin->getPlPart (Skin::PL_LSBAR)); for (int i = 0; igetPlPart (Skin::PL_SFILL1)); } drawPixmap (&paint,125*m_ratio+sx*25,78*m_ratio+sy*29,m_skin->getPlPart (Skin::PL_RSBAR)); } void PlayList::drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix) { style()->drawItemPixmap(painter, QRect(x, y, pix.width(), pix.height()), Qt::AlignCenter, pix); } void PlayList::resizeEvent (QResizeEvent *) { updatePositions(); } void PlayList::mousePressEvent (QMouseEvent *e) { m_pos = e->pos (); if (m_resizeWidget->underMouse()) { m_resize = true; setCursor (m_skin->getCursor (Skin::CUR_PSIZE)); } else m_resize = false; } void PlayList::mouseMoveEvent (QMouseEvent *e) { if (m_resize) { #ifdef Q_OS_WIN32 int sx = (width()-275) /25; int sy = (height()-116) /29; if(width() < e->x() - 14) sx++; else if(width() > e->x() + 14) sx--; if(height() < e->y() - 14) sy++; else if(height() > e->y() + 14) sy--; resize (275+25*sx,116+29*sy); #else #ifdef Q_WS_X11 //avoid right corner moving during resize if(layoutDirection() == Qt::RightToLeft) WindowSystem::revertGravity(winId()); #endif resize (e->x() +25, e->y() +25); #endif } } void PlayList::mouseReleaseEvent (QMouseEvent *) { setCursor (m_skin->getCursor (Skin::CUR_PNORMAL)); /*if (m_resize) m_listWidget->updateList();*/ m_resize = false; Dock::instance()->updateDock(); } void PlayList::changeEvent (QEvent * event) { if (event->type() == QEvent::ActivationChange) { m_titleBar->setActive (isActiveWindow()); } } void PlayList::readSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); if (settings.value("Skinned/pl_show_plalists", false).toBool()) { if(!m_pl_selector) m_pl_selector = new PlayListSelector(m_pl_manager, this); m_pl_selector->show(); m_listWidget->menu()->insertMenu(m_listWidget->menu()->actions().at(2),m_copySelectedMenu); } else { if(m_pl_selector) { m_pl_selector->deleteLater(); m_listWidget->menu()->removeAction(m_copySelectedMenu->menuAction()); } m_pl_selector = 0; } if (m_update) { m_listWidget->readSettings(); m_titleBar->readSettings(); if(m_pl_selector) m_pl_selector->readSettings(); updatePositions(); } else { move (settings.value ("Skinned/pl_pos", QPoint (100, 332)).toPoint()); //position m_update = true; } } #ifdef Q_WS_X11 bool PlayList::event (QEvent *event) { if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) { WindowSystem::ghostWindow(winId()); WindowSystem::setWinHint(winId(), "playlist", "Qmmp"); } return QWidget::event(event); } #endif void PlayList::writeSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); //position settings.setValue ("Skinned/pl_pos", this->pos()); } void PlayList::showAddMenu() { m_addMenu->exec (m_buttonAdd->mapToGlobal (QPoint (0,0))); } void PlayList::showSubMenu() { m_subMenu->exec (m_buttonSub->mapToGlobal (QPoint (0,0))); } void PlayList::showSelectMenu() { m_selectMenu->exec (m_selectButton->mapToGlobal (QPoint (0,0))); } void PlayList::showSortMenu() { m_sortMenu->exec (m_sortButton->mapToGlobal (QPoint (0,0))); } QString PlayList::formatTime (int sec) { if(sec >= 3600) sec /= 60; return QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); } void PlayList::setTime(qint64 time) { if (time < 0) m_current_time->display ("--:--"); else m_current_time->display (formatTime (time/1000)); m_current_time->update(); if (SoundCore::instance()) { QString str_length = formatTime (m_pl_manager->currentPlayList()->totalLength()) + "/" + formatTime (SoundCore::instance()->totalTime()/1000); m_length_totalLength->display (str_length); m_length_totalLength->update(); } } void PlayList::updateList() { m_listWidget->updateList(); m_titleBar->showCurrent(); } PlayListItem *PlayList::currentItem() { return m_pl_manager->currentPlayList()->currentItem(); } void PlayList::showPlaylistMenu() { m_playlistMenu->exec (m_playlistButton->mapToGlobal (QPoint (0,0))); } void PlayList::keyPressEvent (QKeyEvent *ke) { m_keyboardManager->handleKeyPress (ke); } void PlayList::updateSkin() { setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); // TODO shaded m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); if(m_ratio != m_skin->ratio()) { if(m_skin->ratio() < m_ratio) { setMinimumSize (275*m_skin->ratio(), (m_shaded ? 14 : 116)*m_skin->ratio()); resize(width()*m_skin->ratio() / m_ratio, height()*m_skin->ratio() / m_ratio); } m_ratio = m_skin->ratio(); } setMinimalMode(m_shaded); } void PlayList::deletePlaylist() { m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); } void PlayList::showPlayLists() { if(!m_pl_browser) { m_pl_browser = new PlayListBrowser(m_pl_manager, this); m_pl_browser->show(); } else m_pl_browser->show(); } void PlayList::generateCopySelectedMenu() { m_copySelectedMenu->clear(); QAction* action = m_copySelectedMenu->addAction (tr ("&New PlayList")); action->setIcon(QIcon::fromTheme("document-new")); m_copySelectedMenu->addSeparator(); foreach(QString name, m_pl_manager->playListNames()) { action = m_copySelectedMenu->addAction("&"+name.replace("&", "&&")); } } void PlayList::copySelectedMenuActionTriggered(QAction *action) { PlayListModel *targetPlayList = 0; QString actionText=action->text(); if(action == m_copySelectedMenu->actions().at(0))//actionText == tr ("&New PlayList")) { targetPlayList = m_pl_manager->createPlayList(m_pl_manager->selectedPlayList()->name()); } else { actionText.remove(0,1).replace("&&", "&"); foreach(PlayListModel *model, m_pl_manager->playLists()) { //if("&" + model->name().replace("&", "&&") == actionText) if(model->name() == actionText) { targetPlayList=model; break; } } } if(!targetPlayList) { qWarning("Error: Cannot find target playlist '%s'",qPrintable(actionText)); return; } QList theCopy; foreach(PlayListItem *item, m_pl_manager->selectedPlayList()->selectedItems()) { PlayListItem *newItem = new PlayListItem(*item); theCopy << newItem; } targetPlayList->add(theCopy); } void PlayList::setMinimalMode(bool b) { if(!m_shaded) m_height = height(); m_shaded = b; if(m_shaded) { m_height = height(); setSizeIncrement (25*m_ratio, 1); setMinimumSize (275*m_ratio, 14*m_ratio); resize(width(), 14*m_ratio); } else { setMinimumSize(275*m_ratio, 116*m_ratio); resize (width(), m_height); setSizeIncrement (25*m_ratio, 29*m_ratio); } updatePositions(); update(); } qmmp-0.7.4/src/plugins/Ui/skinned/resources/0000775000175000017500000000000012256224735017516 5ustar useruserqmmp-0.7.4/src/plugins/Ui/skinned/resources/shortcuts.png0000664000175000017500000000113312256224735022260 0ustar useruserPNG  IHDR&&sRGBPLTE___bbbfffggggggeeedddddd```KKKLLLNNNOOOXXXZZZ]]]^^^___```aaahhhkkkmmmvvv|||"etRNS@fbKGDH pHYs /LtIME 7 q\!IDAT8I ЊŒ  HG¿2BL`vY> `l2\j[n*ӉZF4g R #}%eBw _egkLDH%3m0d+@p&=^$oR. X6yr^`t⪩j sŬAn*r|EҥIENDB`qmmp-0.7.4/src/plugins/Ui/skinned/resources/interface.png0000664000175000017500000000261212256224735022165 0ustar useruserPNG  IHDR&&sBITO pHYs /LtEXtSoftwarewww.inkscape.org<PLTE______bbbfffggggggeeedddddd``` ! ! """"*$"-,,...0&%4)'6668*):::;-*;::;;;>>>>@A?.,A/,BAAD20D64E1.EEEFFFG2/G31GGGI52J31J71JJJK51K52K63MMMN53N62O64O:7P85R96R97S97S:7T@=TB@TRRTSSUSSWZ[XDAXWW]IF^]]___bbbgURglliUSjiijjjkjjmllpppqpprrruecxxxyyyznlzzzvt¼Q tRNS(YH[IDAT8ˍkSAƿ6J$RHT|PlV/ 73FWH\"WbJXk3猋$ͽ]97s3s c7g^=YNn%h2|Rei" <HRy; :yn@t0uOOPN* ""ceX݌~잋/džQ㕟-;1`Z"2ID./ ]xveq (m{`NtW`ZQ]83'XtsB_@-Kv&Xc5^zأ #f+"Kqer{]a-r$ࣦSޘ!<0#"xamBBkw2IfPNzjrDp.}6Mt֐`M!(Нw@+]iҶ9Q8[\b 5g,2/+CxߝeD| 6^۝)btJ\5t$>T=TF?P9IENDB`qmmp-0.7.4/src/plugins/Ui/skinned/resources/ui_no_cover.png0000664000175000017500000001011212256224735022526 0ustar useruserPNG  IHDR>asRGBbKGD pHYs B(xtIME#-ךIDATx]kdUN}t=3Y'badd6 $ ?@"QL „5Hlcv~GݪÏ={;}{?3}[usSGeX\ ,,,,,,,,,,,,,,,,,,,,,,,,,,,NPYZ6 8%IAJc&lBa pR1eEQ MSKX!h4vXfF@׳#I03 , Cheu+0 !10 C kNr.PlЌ@Dz`0@ل뺐RBpx`Lr&㬿)0Pp]Byh'u\Q !Iu2A@Jg;1`fcھFk c <߾0$F bf_)%hGҚi@Jf0 vQŞHDH "t}u:3B'ySZC)(}c̱9uH)>;ia|Ս$"\wuHqϴRJmk63۶v[+A_;^] l;n IJF%c( âh%ژ0 XKǡQ#kj,Zk]p]CPBB-0D$ Ff A׫+&VWW _2ϣ74iy@l<3zA4MٯַZu]Ԟ[ବzt:LD^WB;#>#v7s9s&|7;(V~Տw1s>}(E1˧5 qH@Z-2ЁXYYI &L+B)Os-Vz?ȃlwWAp_Q@9W.JK*A#%!@ 1 m0Ս2i ×tx0-RUx3싈z}qC{~N 7߄{nfGZvYQf~?؝ݻ1>s挘4fk}Įy.>?Sw߁_Ju0_Q~9>omv@ c ߆h|(@DK]1LDt$Y䏴W/?|)u/gpwh|^h|G~?G^襶v;JL'P)%U~?$Z:Wރ[+P4$Hr}Fz+O )dh.t.s<.w͟=L@w}r/Y |o?85I1= @Dt:֚-cf\?_laP=W{f E!R|K_QǔR*$qNn 9|P)>OO{B7>y{!CxߞDW<_<|$#ik|jkvNNJL90@s;w{f ~<OͼO+hW/>Y_ mfkk9}{y;/_iQgWYkj??Nߝپqo,zF]k(%Un/00 E,vM7IGL͘N`,}9 \!Z'eNߗ.]~_3s>>,(W83M}$,PT6pϕRyK._'I"+`HDlllxNGk++y񾷽 I&z;bhO0~- ]Ϟ(ʻݮi?4v EQ(dey|_ucoE+hc` c݊3c.|Sfo*1Vo9콎"Me୯+!цooSmo&|'/BL^'wL-}ZV*1{BJȞ۟zO;F̌FqvY\QH,c'»|'>r3 s_a])1FJR?o7!!SZFP ?k" *grROs|쳏 [=|O#a_=߉WZ+ =ϣ$I `k)A^h2vz葹|V`cPqε/\D?\|fk7Ov )&Z)Ceٽk. $If8BdYZo2Z, Qϸurx8&Ky|H'G$'PJS interface.png ui_no_cover.png shortcuts.png eq.preset qmmp-0.7.4/src/plugins/Ui/skinned/popupsettings.cpp0000664000175000017500000000764712256224735021152 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "popupwidget.h" #include "popupsettings.h" PopupSettings::PopupSettings(QWidget *parent) : QDialog(parent) { ui.setupUi(this); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); ui.transparencySlider->setValue(100 - settings.value("popup_opacity", 1.0).toDouble()*100); ui.coverSizeSlider->setValue(settings.value ("popup_cover_size", 48).toInt()); ui.textEdit->setPlainText(settings.value ("popup_template", DEFAULT_TEMPLATE).toString()); ui.delaySpinBox->setValue(settings.value("popup_delay", 2500).toInt()); ui.coverCheckBox->setChecked(settings.value("popup_show_cover",true).toBool()); settings.endGroup(); createMenu(); } PopupSettings::~PopupSettings() {} void PopupSettings::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); settings.setValue("popup_opacity", 1.0 - (double)ui.transparencySlider->value()/100); settings.setValue("popup_cover_size", ui.coverSizeSlider->value()); settings.setValue("popup_template", ui.textEdit->toPlainText()); settings.setValue("popup_delay", ui.delaySpinBox->value()); settings.setValue("popup_show_cover", ui.coverCheckBox->isChecked()); settings.endGroup(); QDialog::accept(); } void PopupSettings::createMenu() { QMenu *menu = new QMenu(this); menu->addAction(tr("Artist"))->setData("%p"); menu->addAction(tr("Album"))->setData("%a"); menu->addAction(tr("Title"))->setData("%t"); menu->addAction(tr("Track number"))->setData("%n"); menu->addAction(tr("Two-digit track number"))->setData("%NN"); menu->addAction(tr("Genre"))->setData("%g"); menu->addAction(tr("Comment"))->setData("%c"); menu->addAction(tr("Composer"))->setData("%C"); menu->addAction(tr("Duration"))->setData("%l"); menu->addAction(tr("Disc number"))->setData("%D"); menu->addAction(tr("File name"))->setData("%f"); menu->addAction(tr("File path"))->setData("%F"); menu->addAction(tr("Year"))->setData("%y"); menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); ui.insertButton->setMenu(menu); connect(menu, SIGNAL(triggered (QAction *)), SLOT(insertExpression(QAction *))); } void PopupSettings::insertExpression(QAction *a) { ui.textEdit->insertPlainText(a->data().toString()); } void PopupSettings::on_resetButton_clicked() { ui.textEdit->setPlainText(DEFAULT_TEMPLATE); } qmmp-0.7.4/src/plugins/Ui/skinned/preseteditor.cpp0000664000175000017500000000615112256224735020724 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "eqpreset.h" #include "preseteditor.h" PresetEditor::PresetEditor(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); connect(ui.loadButton,SIGNAL(clicked()),SLOT(loadPreset())); connect(ui.deleteButton,SIGNAL(clicked()),SLOT(deletePreset())); ui.loadButton->setIcon(QIcon::fromTheme("document-open")); ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); } PresetEditor::~PresetEditor() { while (ui.presetListWidget->count () !=0) ui.presetListWidget->takeItem (0); while (ui.autoPresetListWidget->count () !=0) ui.autoPresetListWidget->takeItem (0); } void PresetEditor::addPresets(const QList &presets) { foreach(QListWidgetItem *item, presets) { ui.presetListWidget->addItem(item); } } void PresetEditor::addAutoPresets(const QList &presets) { foreach(QListWidgetItem *item, presets) { ui.autoPresetListWidget->addItem(item); } } void PresetEditor::loadPreset() { EQPreset* preset = 0; if (ui.tabWidget->currentIndex () == 0) preset = (EQPreset *) ui.presetListWidget->currentItem (); if (ui.tabWidget->currentIndex () == 1) preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); if (preset) emit presetLoaded(preset); } void PresetEditor::deletePreset() { EQPreset* preset = 0; if (ui.tabWidget->currentIndex () == 0) preset = (EQPreset *) ui.presetListWidget->currentItem (); if (ui.tabWidget->currentIndex () == 1) preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); if (preset) emit presetDeleted(preset); } qmmp-0.7.4/src/plugins/Ui/skinned/symboldisplay.h0000664000175000017500000000407612256224735020557 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SYMBOLDISPLAY_H #define SYMBOLDISPLAY_H #include #include "pixmapwidget.h" class Skin; /** @author Vladimir Kuznetsov */ class SymbolDisplay : public PixmapWidget { Q_OBJECT public: SymbolDisplay(QWidget *parent = 0, int digits = 3); virtual ~SymbolDisplay(); void setAlignment(Qt::Alignment a); Qt::Alignment alignment() const; public slots: void display(const QString&); void display(int); private slots: void draw(); private: Skin* m_skin; QPixmap m_pixmap; QString m_text; Qt::Alignment m_alignment; int m_digits; int m_max; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/shortcutitem.h0000664000175000017500000000345612256224735020417 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SHORTCUTITEM_H #define SHORTCUTITEM_H #include class QWidget; class QAction; /** @author Ilya Kotov */ class ShortcutItem : public QTreeWidgetItem { public: ShortcutItem(QTreeWidgetItem *parent, int type); ~ShortcutItem(); QAction *action(); private: QAction *m_action; }; #endif //SHORTCUTITEM_H qmmp-0.7.4/src/plugins/Ui/skinned/windowsystem.cpp0000664000175000017500000001610312256224735020765 0ustar useruser/*************************************************************************** * Based on Licq * * Copyright (C) 2006-2009 Licq developers * * Copyright (C) 2011-2013 Ilya Kotov * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "windowsystem.h" #include #ifdef Q_WS_X11 #include #include #include #include #include #endif #ifdef Q_WS_X11 void WindowSystem::ghostWindow(WId win) { Display* dsp = QX11Info::display(); Window root = DefaultRootWindow(dsp); Atom win_state = XInternAtom(dsp, "_NET_WM_STATE", False); Atom win_state_add = XInternAtom(dsp, "_NET_WM_STATE_ADD", False); Atom win_state_settings[] = { XInternAtom(dsp, "_NET_WM_STATE_SKIP_TASKBAR", False), XInternAtom(dsp, "_NET_WM_STATE_SKIP_PAGER", False) }; XChangeProperty(dsp, win, win_state, XA_ATOM, 32, PropModeReplace, reinterpret_cast(&win_state_settings), 2); XEvent xev; xev.type = ClientMessage; xev.xclient.type = ClientMessage; xev.xclient.display = dsp; xev.xclient.window = win; xev.xclient.message_type = win_state; xev.xclient.format = 32; xev.xclient.data.l[0] = win_state_add; xev.xclient.data.l[1] = win_state_settings[0]; xev.xclient.data.l[2] = win_state_settings[1]; XSendEvent(dsp, root, false, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } QString WindowSystem::netWindowManagerName() { Display* dsp = QX11Info::display(); WId root = DefaultRootWindow(dsp); unsigned char* retValue1 = NULL; unsigned char* retValue2 = NULL; retValue1 = getWindowProperty(root, "_NET_SUPPORTING_WM_CHECK"); if (retValue1 == NULL) return QString(); WId win = *(reinterpret_cast(retValue1)); retValue2 = getWindowProperty(win, "_NET_SUPPORTING_WM_CHECK"); if (retValue2 == NULL) { XFree(retValue1); return QString(); } if (win != *(reinterpret_cast(retValue2))) { XFree(retValue1); XFree(retValue2); return QString(); } XFree(retValue2); retValue2 = NULL; retValue2 = getWindowProperty(win, "_NET_WM_NAME"); XFree(retValue1); if (retValue2 == NULL) return QString(); QString name = QString((char *)retValue2); XFree(retValue2); return name; } void WindowSystem::changeWinSticky(WId win, bool stick) { qDebug("WindowSystem: setting sticky state of window 0x%lx to %s.", static_cast(win), stick ? "true" : "false"); Display* dsp = QX11Info::display(); Window root = DefaultRootWindow(dsp); unsigned long desktop = ~(0UL); if (!stick) { unsigned char* tmp = getWindowProperty(root, "_NET_CURRENT_DESKTOP"); if (tmp == NULL) qWarning("WindowSystem: error reading current desktop property."); else { desktop = *(reinterpret_cast(tmp)); XFree(tmp); } } XEvent xev; xev.type = ClientMessage; xev.xclient.type = ClientMessage; xev.xclient.display = dsp; xev.xclient.window = win; xev.xclient.message_type = XInternAtom(dsp, "_NET_WM_DESKTOP", False); xev.xclient.format = 32; xev.xclient.data.l[0] = desktop; XSendEvent(dsp, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); } void WindowSystem::setWinHint(WId win, const char *res_name, const char *res_class) { Display* dsp = QX11Info::display(); XClassHint hint; hint.res_name = strdup(res_name); hint.res_class = strdup(res_class); XSetClassHint(dsp, win, &hint); free(hint.res_name); free(hint.res_class); } unsigned char* WindowSystem::getWindowProperty(WId win, const char* prop) { Display* dsp = QX11Info::display(); // We inhibit new Atom creation since if you request for it // then such Atom most probably exists already. // Otherwise, no surprise we return NULL here. Atom reqAtom = XInternAtom(dsp, prop, True); if (reqAtom == None) return NULL; int retCheck = None; Atom retType = None; int retFormat = 0; unsigned long retItems = 0UL; unsigned long retMoreBytes = 0UL; unsigned char* retValue = NULL; // Check if the property exists and calculate its length. retCheck = XGetWindowProperty(dsp, win, reqAtom, 0L, 0L, False, AnyPropertyType, &retType, &retFormat, &retItems, &retMoreBytes, &retValue); // The value is most probably empty, since we requested to read // only 0L length, thus, it's just useless... if (retValue != NULL) { XFree(retValue); retValue = NULL; } if (retCheck != Success || retType == None || retMoreBytes == 0) return NULL; // These are not needed for now. retCheck = None; retFormat = 0; retItems = 0UL; // Convert the byte length into 32bit multiples. if (retMoreBytes % 4 != 0) retMoreBytes += 4 - retMoreBytes % 4; retMoreBytes /= 4; // Now request the actual property value with correct length and type. retCheck = XGetWindowProperty(dsp, win, reqAtom, 0L, retMoreBytes, False, retType, &retType, &retFormat, &retItems, &retMoreBytes, &retValue); if (retCheck != Success || retMoreBytes != 0) { if (retValue != NULL) XFree(retValue); return NULL; } return retValue; } //On RTL locales Qt sets flag NorthEastGravity for windows. //This function reverts these changes. void WindowSystem::revertGravity(WId win) { Display* dsp = QX11Info::display(); XSizeHints sh; memset(&sh, 0, sizeof(sh)); long unused; XGetWMNormalHints(dsp, win, &sh, &unused); sh.flags |= PWinGravity; if(sh.win_gravity == NorthEastGravity) sh.win_gravity = NorthWestGravity; else return; sh.win_gravity = NorthWestGravity; XSetWMNormalHints(dsp, win, &sh); } #endif qmmp-0.7.4/src/plugins/Ui/skinned/textscroller.cpp0000664000175000017500000002263712256224735020754 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "skin.h" #include "actionmanager.h" #include "textscroller.h" #define SCROLL_SEP " *** " #define TITLE_FORMAT "%p%if(%p&%t, - ,)%t%if(%p,,%if(%t,,%f))%if(%l, - %l,)" TextScroller::TextScroller (QWidget *parent) : QWidget (parent) { m_pressed = false; m_press_pos = 0; m_metrics = 0; m_defautText = QString("Qmmp ") + Qmmp::strVersion(); m_core = SoundCore::instance(); m_skin = Skin::instance(); m_ratio = m_skin->ratio(); m_timer = new QTimer (this); m_timer->setInterval(50); m_timer->start(); m_menu = new QMenu(this); m_scrollAction = m_menu->addAction(tr("Autoscroll Songname"), this, SLOT(updateText())); m_transparencyAction = m_menu->addAction(tr("Transparent Background"), this, SLOT(updateText())); m_scrollAction->setCheckable(true); m_transparencyAction->setCheckable(true); connect(m_scrollAction, SIGNAL(toggled(bool)), SLOT(updateText())); connect(m_timer, SIGNAL (timeout()), SLOT (addOffset())); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(processState(Qmmp::State))); connect(m_core, SIGNAL(metaDataChanged()), SLOT(processMetaData())); updateSkin(); } TextScroller::~TextScroller() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Skinned/autoscroll", m_scrollAction->isChecked()); settings.setValue("Skinned/scroller_transparency", m_transparencyAction->isChecked()); if(m_metrics) delete m_metrics; } void TextScroller::setText(const QString &text) { m_sliderText = text; updateText(); } void TextScroller::clear() { setText(QString()); } void TextScroller::addOffset() { if(!m_scroll) { m_timer->stop(); return; } m_x1--; m_x2--; if(m_x1 < - m_pixmap.width()) m_x1 = m_pixmap.width(); if(m_x2 < - m_pixmap.width()) m_x2 = m_pixmap.width(); update(); } void TextScroller::updateSkin() { m_color.setNamedColor(m_skin->getPLValue("mbfg")); setCursor(m_skin->getCursor(Skin::CUR_SONGNAME)); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_bitmap = settings.value("Skinned/bitmap_font", false).toBool(); m_ratio = m_skin->ratio(); QString fontname = settings.value("Skinned/mw_font", QApplication::font().toString()).toString(); m_font.fromString(fontname); if (m_metrics) delete m_metrics; else { m_scrollAction->setChecked(settings.value("Skinned/autoscroll", true).toBool()); m_transparencyAction->setChecked(settings.value("Skinned/scroller_transparency", true).toBool()); } m_metrics = new QFontMetrics(m_font); updateText(); } void TextScroller::setProgress(int progress) { m_bufferText = tr("Buffering: %1%").arg(progress); updateText(); } void TextScroller::hideEvent (QHideEvent *) { m_timer->stop(); } void TextScroller::showEvent (QShowEvent *) { if (m_scroll) m_timer->start(); } inline void drawBitmapText(int x, int y, const QString &text, QPainter *paint, Skin *skin) { QString lowertext = text.toLower(); int chwidth, ypix; { QPixmap samplechar = skin->getLetter('a'); chwidth = samplechar.width(); ypix = y - samplechar.height(); } for (int i = 0; i < lowertext.size(); i++) { QPixmap pixchar = skin->getLetter(lowertext[i]); paint->drawPixmap(x, ypix, pixchar); x += chwidth; } } void TextScroller::paintEvent (QPaintEvent *) { QPainter paint(this); if(m_scroll) { paint.drawPixmap(m_x1,0, m_pixmap); paint.drawPixmap(m_x2,0, m_pixmap); } else paint.drawPixmap(4,0, m_pixmap); } void TextScroller::mousePressEvent (QMouseEvent *e) { if (e->button() == Qt::RightButton) m_menu->exec(e->globalPos()); else if (e->button() == Qt::LeftButton && m_scroll) { m_timer->stop(); m_press_pos = e->x() - m_x1; m_pressed = true; } else QWidget::mousePressEvent(e); } void TextScroller::mouseReleaseEvent (QMouseEvent *e) { if(e->button() == Qt::RightButton) m_menu->exec(e->globalPos()); else if (e->button() == Qt::LeftButton && m_scroll) m_timer->start(); else QWidget::mouseReleaseEvent(e); m_pressed = false; } void TextScroller::mouseMoveEvent (QMouseEvent *e) { if (m_pressed) { int bound = m_pixmap.width(); m_x1 = (e->x() - m_press_pos) % bound; if (m_x1 > 0) m_x1 -= bound; m_x2 = m_x1 + m_pixmap.width(); update(); } else QWidget::mouseMoveEvent(e); } void TextScroller::processState(Qmmp::State state) { switch(state) { case Qmmp::Buffering: { connect(m_core, SIGNAL(bufferingProgress(int)), SLOT(setProgress(int))); break; } case Qmmp::Playing: { disconnect(m_core, SIGNAL(bufferingProgress(int)), this, 0); m_bufferText.clear(); updateText(); break; } case Qmmp::Paused: { break; } case Qmmp::Stopped: { m_bufferText.clear(); m_titleText.clear(); updateText(); break; } default: break; } } void TextScroller::processMetaData() { MetaDataFormatter formater(TITLE_FORMAT); if(m_core->state() == Qmmp::Playing) { m_titleText = formater.parse(m_core->metaData(), m_core->totalTime()/1000); updateText(); } } void TextScroller::preparePixmap(const QString &text, bool scrollable) { m_scroll = scrollable; bool bitmap = m_bitmap && (text.toLatin1() == text.toLocal8Bit()); //use bitmap font if possible if(scrollable) { int textWidth = m_bitmap ? QString(text + SCROLL_SEP).size() * 5 : m_metrics->width(text + SCROLL_SEP); int count = 150*m_ratio / textWidth + 1; int width = count * textWidth; QString fullText; for(int i = 0; i < count; ++i) { fullText.append(text + SCROLL_SEP); } m_pixmap = QPixmap(width,15*m_ratio); if(m_transparencyAction->isChecked()) m_pixmap.fill(Qt::transparent); else m_pixmap.fill(QString(Skin::instance()->getPLValue("normalbg"))); QPainter painter(&m_pixmap); painter.setPen(m_color); painter.setFont(m_font); if(bitmap) drawBitmapText (0,12, fullText, &painter, m_skin); else painter.drawText (0,12, fullText); m_x1 = 0; m_x2 = m_pixmap.width(); } else { m_pixmap = QPixmap(150*m_ratio,15*m_ratio); if(m_transparencyAction->isChecked()) m_pixmap.fill(Qt::transparent); else m_pixmap.fill(QString(Skin::instance()->getPLValue("normalbg"))); QPainter painter(&m_pixmap); painter.setPen(m_color); painter.setFont(m_font); if(bitmap) drawBitmapText (0,12, text, &painter, m_skin); else painter.drawText (0,12, text); } } void TextScroller::updateText() //draw text according priority { if(!m_sliderText.isEmpty()) { preparePixmap(m_sliderText); m_timer->stop(); } else if(!m_bufferText.isEmpty()) { preparePixmap(m_bufferText); m_timer->stop(); } else if (!m_titleText.isEmpty()) { preparePixmap(m_titleText, m_scrollAction->isChecked()); m_timer->start(); } else if(!m_defautText.isEmpty()) { preparePixmap(m_defautText); m_timer->stop(); } else { m_timer->stop(); m_pixmap = QPixmap (150*m_ratio,15*m_ratio); m_pixmap.fill(Qt::transparent); m_scroll = false; } update(); } qmmp-0.7.4/src/plugins/Ui/skinned/skinnedfactory.h0000664000175000017500000000357412256224735020711 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SKINNEDFACTORY_H #define SKINNEDFACTORY_H #include #include #include /*! * @author Ilya Kotov */ class SkinnedFactory : public QObject, public UiFactory { Q_OBJECT Q_INTERFACES(UiFactory) public: const UiProperties properties() const; QObject *create(); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqgraph.h0000664000175000017500000000375112256224735017312 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQGRAPH_H #define EQGRAPH_H #include "pixmapwidget.h" class Skin; /** @author Ilya Kotov */ class EQGraph : public PixmapWidget { Q_OBJECT public: EQGraph (QWidget *parent = 0); ~EQGraph(); void addValue (int); void clear(); private slots: void updateSkin(); private: QList m_values; Skin *m_skin; void init_spline (double * x, double * y, int n, double * y2); double eval_spline (double xa[], double ya[], double y2a[], int n, double x); void draw(); int m_ratio; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/inlines.h0000664000175000017500000000237612256224735017326 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef INLINES_H #define INLINES_H #include "fft.h" // *fast* convenience functions static inline void calc_freq(short* dest, short *src) { static fft_state *state = NULL; float tmp_out[257]; int i; if (!state) state = fft_init(); fft_perform(src, tmp_out, state); for (i = 0; i < 256; i++) dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; } static inline void stereo16_from_multichannel(register short *l, register short *r, register short *s, long cnt, int chan) { while (cnt > 0) { l[0] = s[0]; r[0] = s[1]; s += chan; l++; r++; cnt--; } } static inline void mono16_from_multichannel(register short *l, register short *s, long cnt, int chan) { while (cnt > 0) { l[0] = s[0]; s += chan; l++; cnt--; } } #endif // INLINES_H qmmp-0.7.4/src/plugins/Ui/skinned/listwidget.h0000664000175000017500000001050512256224735020035 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LISTWIDGET_H #define LISTWIDGET_H #include #include #include #include class QFont; class QFontMetrics; class QMenu; class QAction; class QTimer; class PlayList; class PlayListModel; class Skin; class PlayListItem; class MediaPlayer; namespace PlayListPopup{ class PopupWidget; } /** @author Ilya Kotov */ class ListWidget : public QWidget { Q_OBJECT public: ListWidget(QWidget *parent = 0); ~ListWidget(); void readSettings(); /*! * Returns count of currently visible rows. */ int visibleRows()const { return m_rows; } /*! * Returns number of first visible row. */ int firstVisibleRow()const { return m_first; } int anchorRow() const { return m_anchor_row; } void setAnchorRow(int r) { m_anchor_row = r; update(); } QMenu *menu() { return m_menu; } PlayListModel *model() { Q_ASSERT(m_model); return m_model; } public slots: void updateList(); void scroll(int); //0-99 void recenterCurrent(); void setModel(PlayListModel *selected, PlayListModel *previous = 0); signals: void selectionChanged(); void positionChanged(int, int); //current position, maximum value protected: void paintEvent(QPaintEvent *); void mouseDoubleClickEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); void resizeEvent(QResizeEvent *); void wheelEvent(QWheelEvent *); int rowAt(int)const; void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); void contextMenuEvent (QContextMenuEvent * event); bool event (QEvent *e); private slots: void updateSkin(); void autoscroll(); private: void loadColors(); bool m_update; bool m_scroll; int m_pressed_row; QMenu *m_menu; PlayListModel *m_model; /*! * Returns string with queue number or(and) repeate flag for the item number \b i. */ const QString getExtraString(int i); int m_rows, m_first; QList m_titles; QList m_times; PlayList *m_pl; QFont m_font, m_extra_font; QFontMetrics *m_metrics; QFontMetrics *m_extra_metrics; Skin *m_skin; QColor m_normal, m_current, m_normal_bg, m_selected_bg; int m_anchor_row; enum ScrollDirection { NONE = 0,TOP,DOWN }; /*! * Scroll direction that is preforming in current moment. */ ScrollDirection m_scroll_direction; int m_prev_y; bool m_select_on_release; bool m_show_protocol; bool m_show_number; bool m_show_anchor; bool m_align_numbres; int m_number_width; MediaPlayer *m_player; PlayListPopup::PopupWidget *m_popupWidget; QTimer *m_timer; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/timeindicator.cpp0000664000175000017500000001003512256224735021042 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "skin.h" #include "timeindicator.h" TimeIndicator::TimeIndicator (QWidget *parent) : PixmapWidget (parent) { m_skin = Skin::instance(); m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); m_elapsed = true; m_time = m_songDuration = 0; readSettings(); m_needToShowTime = false; updateSkin(); reset(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); m_timer = new QTimer(this); m_timer->setInterval(125); m_timer->setSingleShot (true); connect(m_timer, SIGNAL(timeout()),SLOT(reset())); } void TimeIndicator::setTime (int t) { m_time = t; m_pixmap.fill (Qt::transparent); int r = m_skin->ratio(); QPainter paint (&m_pixmap); if (!m_elapsed) { t = m_songDuration - t; paint.drawPixmap(r*2,0,m_skin->getNumber(10)); } if (t < 0) t = 0; if(t > 3600) t /= 60; paint.drawPixmap(r*13,0,m_skin->getNumber(t/600%10)); paint.drawPixmap(r*26,0,m_skin->getNumber(t/60%10)); paint.drawPixmap(r*43,0,m_skin->getNumber(t%60/10)); paint.drawPixmap(r*56,0,m_skin->getNumber(t%60%10)); setPixmap (m_pixmap); } void TimeIndicator::reset() { m_pixmap.fill (Qt::transparent); QPainter paint (&m_pixmap); setPixmap (m_pixmap ); } void TimeIndicator::mousePressEvent(QMouseEvent* e) { if (m_needToShowTime && e->button() & Qt::LeftButton) { m_elapsed = m_elapsed ? false : true; setTime(m_time); } PixmapWidget::mousePressEvent(e); } void TimeIndicator::setSongDuration(int d) { m_songDuration = d; } TimeIndicator::~TimeIndicator() { writeSettings(); } void TimeIndicator::updateSkin() { m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); if (m_needToShowTime) setTime(m_time); } void TimeIndicator::readSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); m_elapsed = settings.value("disp_elapsed",true).toBool(); settings.endGroup(); } void TimeIndicator::writeSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); settings.setValue("disp_elapsed",m_elapsed); settings.endGroup(); } void TimeIndicator::setNeedToShowTime(bool need) { m_needToShowTime = need; if (!need) m_timer->start(); else m_timer->stop(); } void TimeIndicator::mouseMoveEvent(QMouseEvent *) {} void TimeIndicator::mouseReleaseEvent(QMouseEvent *) {} qmmp-0.7.4/src/plugins/Ui/skinned/titlebar.h0000664000175000017500000000504512256224735017467 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TITLEBAR_H #define TITLEBAR_H #include #include #include "pixmapwidget.h" #include "playlist.h" class MainWindow; class QMouseEvent; class Skin; class Button; class SymbolDisplay; class TitleBarControl; class ShadedVisual; /** @author Ilya Kotov */ class TitleBar : public PixmapWidget { Q_OBJECT public: TitleBar(QWidget *parent = 0); ~TitleBar(); void setActive(bool); public slots: void setTime(qint64 time); private slots: void updateSkin(); void showMainMenu(); void shade(); private: Skin *m_skin; QPoint m_pos; MainWindow *m_mw; Button *m_menu; Button *m_minimize; Button *m_shade; Button *m_shade2; Button *m_close; SymbolDisplay *m_currentTime; QString formatTime (int); bool m_shaded; bool m_align; TitleBarControl *m_control; ShadedVisual *m_visual; void updatePositions(); protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); void mouseDoubleClickEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/skinreader.h0000664000175000017500000000412412256224735020005 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SKINREADER_H #define SKINREADER_H #include #include #include /** @author Ilya Kotov */ class QProcess; class SkinReader : public QObject { Q_OBJECT public: SkinReader(QObject *parent = 0); ~SkinReader(); void generateThumbs(); void unpackSkin(const QString &path); const QStringList skins(); const QPixmap getPreview(const QString &skinPath); private: QProcess *m_process; void untar(const QString &from, const QString &to, bool preview); void unzip(const QString &from, const QString &to, bool preview); QMap m_previewMap; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/hotkeyeditor.cpp0000664000175000017500000000712212256224735020724 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "actionmanager.h" #include "hotkeyeditor.h" #include "shortcutdialog.h" #include "shortcutitem.h" #include "ui_hotkeyeditor.h" HotkeyEditor::HotkeyEditor(QWidget *parent) : QWidget(parent), m_ui(new Ui::HotkeyEditor) { m_ui->setupUi(this); loadShortcuts(); m_ui->changeShortcutButton->setIcon(QIcon::fromTheme("configure")); } HotkeyEditor::~HotkeyEditor() { delete m_ui; } void HotkeyEditor::on_changeShortcutButton_clicked() { ShortcutItem *item = dynamic_cast (m_ui->shortcutTreeWidget->currentItem()); if(!item) return; ShortcutDialog editor(item->action()->shortcut().toString(), this); if(editor.exec() == QDialog::Accepted) { item->action()->setShortcut(editor.key()); item->setText(1, item->action()->shortcut().toString()); } } void HotkeyEditor::loadShortcuts() { //playback QTreeWidgetItem *item = new QTreeWidgetItem (m_ui->shortcutTreeWidget, QStringList() << tr("Playback")); for(int i = ActionManager::PLAY; i <= ActionManager::CLEAR_QUEUE; ++i) new ShortcutItem(item, i); item->setExpanded(true); m_ui->shortcutTreeWidget->addTopLevelItem(item); //view item = new QTreeWidgetItem (m_ui->shortcutTreeWidget, QStringList() << tr("View")); for(int i = ActionManager::SHOW_PLAYLIST; i <= ActionManager::WM_DOUBLE_SIZE; ++i) new ShortcutItem(item, i); item->setExpanded(true); m_ui->shortcutTreeWidget->addTopLevelItem(item); //playlist item = new QTreeWidgetItem (m_ui->shortcutTreeWidget, QStringList() << tr("Playlist")); for(int i = ActionManager::PL_ADD_FILE; i <= ActionManager::PL_SHOW_MANAGER; ++i) new ShortcutItem(item, i); item->setExpanded(true); m_ui->shortcutTreeWidget->addTopLevelItem(item); //misc item = new QTreeWidgetItem (m_ui->shortcutTreeWidget, QStringList() << tr("Misc")); for(int i = ActionManager::SETTINGS; i <= ActionManager::QUIT; ++i) new ShortcutItem(item, i); item->setExpanded(true); m_ui->shortcutTreeWidget->addTopLevelItem(item); m_ui->shortcutTreeWidget->resizeColumnToContents(0); m_ui->shortcutTreeWidget->resizeColumnToContents(1); } qmmp-0.7.4/src/plugins/Ui/skinned/button.h0000664000175000017500000000405512256224735017174 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef BUTTON_H #define BUTTON_H #include "pixmapwidget.h" class Skin; /** @author Ilya Kotov */ class Button : public PixmapWidget { Q_OBJECT public: Button(QWidget *parent, uint normal, uint pressed, uint cursor); ~Button(); signals: void clicked(); private slots: void updateSkin(); private: Skin *skin; //bool m_cursorin; bool m_pressed; void setON(bool); uint name_normal, name_pressed; uint name_cursor; protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/titlebar.cpp0000664000175000017500000001616212256224735020024 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "symboldisplay.h" #include "skin.h" #include "button.h" #include "dock.h" #include "titlebarcontrol.h" #include "shadedvisual.h" #include "display.h" #include "titlebar.h" #include "mainwindow.h" // TODO skin cursor with shade mode TitleBar::TitleBar(QWidget *parent) : PixmapWidget(parent) { m_align = false; m_skin = Skin::instance(); setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); m_mw = qobject_cast(parent->parent()); m_shaded = false; m_shade2 = 0; m_currentTime = 0; m_control = 0; m_visual = 0; //buttons m_menu = new Button(this,Skin::BT_MENU_N,Skin::BT_MENU_P, Skin::CUR_MAINMENU); connect(m_menu,SIGNAL(clicked()),this,SLOT(showMainMenu())); m_menu->move(6,3); m_minimize = new Button(this,Skin::BT_MINIMIZE_N,Skin::BT_MINIMIZE_P, Skin::CUR_MIN); connect(m_minimize, SIGNAL(clicked()), m_mw, SLOT(showMinimized())); m_shade = new Button(this,Skin::BT_SHADE1_N,Skin::BT_SHADE1_P, Skin::CUR_WINBUT); connect(m_shade, SIGNAL(clicked()), SLOT(shade())); m_close = new Button(this,Skin::BT_CLOSE_N,Skin::BT_CLOSE_P, Skin::CUR_CLOSE); connect(m_close, SIGNAL(clicked()), m_mw, SLOT(close())); setActive(false); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); if (settings.value("Skinned/disp_shaded", false).toBool()) shade(); m_align = true; setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); updatePositions(); } TitleBar::~TitleBar() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Skinned/disp_shaded", m_shaded); } void TitleBar::updatePositions() { int r = m_skin->ratio(); m_menu->move(r*6, r*3); m_minimize->move(r*244, r*3); m_shade->move(r*254, r*3); m_close->move(r*264, r*3); if(m_shade2) m_shade2->move(r*254, r*3); if(m_currentTime) m_currentTime->move(r*127, r*4); if(m_control) m_control->move(r*168, r*2); if(m_visual) m_visual->move(r*79,r*5); } void TitleBar::mousePressEvent(QMouseEvent* event) { switch ((int) event->button ()) { case Qt::LeftButton: m_pos = event->pos(); Dock::instance()->calculateDistances(); Dock::instance()->updateDock(); break; case Qt::RightButton: m_mw->menu()->exec(event->globalPos()); } } void TitleBar::mouseReleaseEvent(QMouseEvent*) { Dock::instance()->updateDock(); } void TitleBar::mouseMoveEvent(QMouseEvent* event) { if (m_pos.x() < width() - m_skin->ratio() * 37) { QPoint npos = (event->globalPos()-m_pos); Dock::instance()->move(m_mw, npos); } } void TitleBar::setActive(bool a) { if (a) { if (m_shaded) setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); else setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); } else { if (m_shaded) setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_I)); else setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_I)); } } void TitleBar::updateSkin() { setActive(false); setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); updatePositions(); } void TitleBar::showMainMenu() { m_mw->menu()->exec(m_menu->mapToGlobal(m_menu->pos())); } void TitleBar::shade() { m_shaded = !m_shaded; int r = m_skin->ratio(); if (m_shaded) { setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); m_shade->hide(); m_shade2 = new Button(this,Skin::BT_SHADE2_N, Skin::BT_SHADE2_P, Skin::CUR_WSNORMAL); connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); m_shade2->show(); m_currentTime = new SymbolDisplay(this, 6); m_currentTime->show(); m_currentTime->display("--:--"); m_control = new TitleBarControl(this); m_control->show(); connect (m_control, SIGNAL (nextClicked()), m_mw, SLOT (next())); connect (m_control, SIGNAL (previousClicked()), m_mw, SLOT (previous())); connect (m_control, SIGNAL (playClicked()), m_mw, SLOT (play())); connect (m_control, SIGNAL (pauseClicked()), m_mw, SLOT (pause())); connect (m_control, SIGNAL (stopClicked()), m_mw, SLOT (stop())); connect (m_control, SIGNAL (ejectClicked()), m_mw, SLOT (addFile())); m_visual = new ShadedVisual(this); Visual::add(m_visual); m_visual->show(); } else { setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); m_shade2->deleteLater(); m_currentTime->deleteLater(); m_control->deleteLater(); Visual::remove(m_visual); m_visual->deleteLater(); m_shade2 = 0; m_currentTime = 0; m_control = 0; m_visual = 0; m_shade->show(); } qobject_cast (parent())->setMinimalMode(m_shaded); if (m_align) Dock::instance()->align(m_mw, m_shaded? -r*102: r*102); updatePositions(); } void TitleBar::mouseDoubleClickEvent (QMouseEvent *) { TitleBar::shade(); } QString TitleBar::formatTime (int sec) { int minutes = sec / 60; int seconds = sec % 60; QString str_minutes = QString::number (minutes); QString str_seconds = QString::number (seconds); if (minutes < 10) str_minutes.prepend ("0"); if (seconds < 10) str_seconds.prepend ("0"); return str_minutes + ":" + str_seconds; } void TitleBar::setTime(qint64 time) { if (!m_currentTime) return; if (time < 0) m_currentTime->display("--:--"); else m_currentTime->display(formatTime(time/1000)); } qmmp-0.7.4/src/plugins/Ui/skinned/shadedvisual.h0000664000175000017500000000444212256224735020335 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SHADEDVISUAL_H #define SHADEDVISUAL_H #include #include #include class QTimer; class QPixmap; class Skin; //class VisualNode; /** @author Ilya Kotov */ class ShadedVisual : public Visual { Q_OBJECT public: ShadedVisual(QWidget *parent = 0); ~ShadedVisual(); void add(unsigned char *data, qint64 size, int chan); void clear(); void paintEvent (QPaintEvent *); void hideEvent (QHideEvent *); void showEvent (QShowEvent *); public slots: void timeout(); private slots: void updateSkin(); private: void process (short *l, short *r); void draw (QPainter *); Skin *m_skin; QTimer *m_timer; QPixmap m_pixmap; short *m_left_buffer; short *m_right_buffer; int m_buffer_at; double m_l, m_r; int m_ratio; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/symboldisplay.cpp0000664000175000017500000000643012256224735021106 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "skin.h" #include "symboldisplay.h" SymbolDisplay::SymbolDisplay (QWidget *parent, int digits) : PixmapWidget (parent) { m_alignment = Qt::AlignRight; m_skin = Skin::instance(); m_digits = digits; m_max = 0; connect (m_skin, SIGNAL (skinChanged()), this, SLOT (draw())); draw(); for (int i=0; igetLetter (' '); int w = bg.size().width(); int h = bg.size().height(); QPixmap tmp (m_digits*w,h); QPainter paint (&tmp); int j; for (int i = 0; i < m_digits; ++i) { if (m_alignment == Qt::AlignRight) // TODO: add align Center { j = str.size() -1 - i; if (j >= 0) paint.drawPixmap ((m_digits-1-i) *w,0,m_skin->getLetter (str.at (j))); else paint.drawPixmap ((m_digits-1-i) *w,0,m_skin->getLetter (' ')); } else { if (i < str.size()) paint.drawPixmap (i * w,0,m_skin->getLetter (str.at (i))); else paint.drawPixmap (i * w,0,m_skin->getLetter (' ')); ; } } setPixmap(tmp); } void SymbolDisplay::display(int val) { if (val < m_max) display(QString::number(val)); else display(QString("%1h").arg(val/100)); } qmmp-0.7.4/src/plugins/Ui/skinned/pixmapwidget.h0000664000175000017500000000352212256224735020361 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PIXMAPWIDGET_H #define PIXMAPWIDGET_H #include /** @author Ilya Kotov */ class QPixmap; class PixmapWidget : public QWidget { Q_OBJECT public: PixmapWidget(QWidget *parent = 0); virtual ~PixmapWidget(); virtual void setPixmap(const QPixmap); protected: void paintEvent ( QPaintEvent * event ); private: QPixmap m_pixmap; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/playlisttitlebar.cpp0000664000175000017500000002216412256224735021605 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "dock.h" #include "windowsystem.h" #include "button.h" #include "playlisttitlebar.h" #include "skin.h" // TODO {shademode, updateskin} -> do we have the shaded cursor PlayListTitleBar::PlayListTitleBar(QWidget *parent) : PixmapWidget(parent) { m_active = false; m_resize = false; m_shade2 = 0; m_model = 0; m_shaded = false; m_align = false; m_skin = Skin::instance(); m_ratio = m_skin->ratio(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); m_pl = qobject_cast(parent); m_mw = qobject_cast(m_pl->parent()); m_close = new Button(this,Skin::PL_BT_CLOSE_N, Skin::PL_BT_CLOSE_P, Skin::CUR_PCLOSE); connect (m_close, SIGNAL(clicked()), m_pl, SIGNAL(closed())); m_shade = new Button(this, Skin::PL_BT_SHADE1_N, Skin::PL_BT_SHADE1_P, Skin::CUR_PWINBUT); connect(m_shade, SIGNAL(clicked()), SLOT(shade())); resize(275*m_ratio,20*m_ratio); setMinimumWidth(275*m_ratio); readSettings(); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); m_pl->resize (settings.value ("Skinned/pl_size", QSize (m_ratio*275, m_ratio*116)).toSize()); if (settings.value ("Skinned/pl_shaded", false).toBool()) shade(); resize(m_pl->width(),height()); m_align = true; setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); updatePositions(); } PlayListTitleBar::~PlayListTitleBar() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Skinned/pl_size", QSize (m_pl->width(), m_shaded ? m_height:m_pl->height())); settings.setValue ("Skinned/pl_shaded", m_shaded); } void PlayListTitleBar::updatePositions() { m_ratio = m_skin->ratio(); int sx = (width()-275*m_ratio)/25; m_close->move(m_ratio*264+sx*25,m_ratio*3); m_shade->move(m_ratio*255+sx*25,m_ratio*3); if (m_shade2) m_shade2->move(m_ratio*255+sx*25,m_ratio*3); } void PlayListTitleBar::updatePixmap() { int sx = ((m_shaded ? m_pl->width() : width())-275*m_ratio)/25; QPixmap pixmap(275*m_ratio+sx*25,20*m_ratio); QPainter paint; paint.begin(&pixmap); if (m_shaded) { paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED2)); for (int i = 1; igetPlPart(Skin::PL_TFILL_SHADED)); } } if (m_active) { if (m_shaded) paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_A)); else { paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_A)); for (int i = 1; igetPlPart(Skin::PL_TFILL1_A)); } paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_A)); paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_A)); } } else { if (m_shaded) paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_I)); else { paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_I)); for (int i = 1; igetPlPart(Skin::PL_TFILL1_I)); } paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_I)); paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_I)); } } if (m_shaded) { QColor col; col.setNamedColor(QString(m_skin->getPLValue("mbbg"))); paint.setBrush(QBrush(col)); paint.setPen(col); paint.drawRect(8*m_ratio, m_ratio, 235*m_ratio + sx*25, 11*m_ratio); //draw text paint.setFont(m_font); paint.setPen(QString(m_skin->getPLValue("mbfg"))); paint.drawText(9*m_ratio, 11*m_ratio, m_truncatedText); } paint.end(); setPixmap(pixmap); } void PlayListTitleBar::resizeEvent(QResizeEvent *) { QFontMetrics metrics(m_font); m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); updatePositions(); updatePixmap(); } void PlayListTitleBar::mousePressEvent(QMouseEvent* event) { switch ((int) event->button ()) { case Qt::LeftButton: pos = event->pos(); if (m_shaded && (width() - 30*m_ratio) < pos.x() && pos.x() < (width() - 22*m_ratio)) { m_resize = true; setCursor (Qt::SizeHorCursor); } break; case Qt::RightButton: m_mw->menu()->exec(event->globalPos()); } } void PlayListTitleBar::mouseReleaseEvent(QMouseEvent*) { Dock::instance()->updateDock(); m_resize = false; setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); } void PlayListTitleBar::mouseMoveEvent(QMouseEvent* event) { QPoint npos = event->globalPos()-pos; if (m_shaded && m_resize) { #ifdef Q_WS_X11 //avoid right corner moving during resize if(layoutDirection() == Qt::RightToLeft) WindowSystem::revertGravity(m_pl->winId()); #endif resize((event->x() + 25*m_ratio), height()); m_pl->resize((event->x() + 25*m_ratio), m_pl->height()); } else if (pos.x() < width() - 30*m_ratio) Dock::instance()->move(m_pl, npos); } void PlayListTitleBar::setActive(bool a) { m_active = a; updatePixmap(); } void PlayListTitleBar::setModel(PlayListModel *selected, PlayListModel *previous) { if(previous) disconnect(previous, 0, this, 0); //disconnect previous model m_model = selected; connect (m_model, SIGNAL(listChanged()), SLOT(showCurrent())); showCurrent(); } void PlayListTitleBar::readSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); m_font.fromString(settings.value("Skinned/pl_font", QApplication::font().toString()).toString()); m_font.setPointSize(8); } void PlayListTitleBar::updateSkin() { setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); if(m_ratio != m_skin->ratio()) { m_ratio = m_skin->ratio(); setMinimumWidth(275*m_ratio); updatePositions(); } updatePixmap(); } void PlayListTitleBar::shade() { m_shaded = !m_shaded; if (m_shaded) { m_height = m_pl->height(); m_shade->hide(); m_shade2 = new Button(this, Skin::PL_BT_SHADE2_N, Skin::PL_BT_SHADE2_P, Skin::CUR_PWSNORM); m_shade2->move(254,3); connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); m_shade2->show(); } else { m_shade2->deleteLater(); m_shade2 = 0; m_shade->show(); } m_pl->setMinimalMode(m_shaded); showCurrent(); update(); if (m_align) Dock::instance()->align(m_pl, m_shaded? -m_height+14*m_ratio: m_height-14*m_ratio); updatePositions(); } void PlayListTitleBar::mouseDoubleClickEvent (QMouseEvent *) { PlayListTitleBar::shade(); } void PlayListTitleBar::showCurrent() { if (m_model) { PlayListItem* info = m_model->currentItem(); if (info) { m_text = QString("%1. %2").arg(m_model->currentIndex()+1) .arg(info->text()); if(info->length()) { m_text.append(QString(" (%1:%2)").arg(info->length()/60) .arg(info->length()%60, 2, 10, QChar('0'))); } } else m_text.clear(); } QFontMetrics metrics(m_font); m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); updatePixmap(); } qmmp-0.7.4/src/plugins/Ui/skinned/shortcutdialog.cpp0000664000175000017500000000474212256224735021252 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "shortcutdialog.h" ShortcutDialog::ShortcutDialog(const QString &key, QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); m_ui.keyLineEdit->setText(key); //buttons should not catch keys foreach(QAbstractButton *button, m_ui.buttonBox->buttons()) button->setFocusPolicy(Qt::NoFocus); } ShortcutDialog::~ShortcutDialog() { } void ShortcutDialog::keyPressEvent (QKeyEvent *event) { int key = event->key(); switch (key) { case Qt::Key_Shift: case Qt::Key_Control: case Qt::Key_Meta: case Qt::Key_Alt: case Qt::Key_AltGr: case Qt::Key_Super_L: case Qt::Key_Super_R: case Qt::Key_Menu: case 0: case Qt::Key_unknown: key = 0; m_ui.keyLineEdit->clear(); QWidget::keyPressEvent(event); return; } QKeySequence seq(event->modifiers() + event->key()); m_ui.keyLineEdit->setText(seq.toString()); QWidget::keyPressEvent(event); } const QString ShortcutDialog::key() { return m_ui.keyLineEdit->text(); } qmmp-0.7.4/src/plugins/Ui/skinned/mainwindow.cpp0000664000175000017500000004044612256224735020374 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "hotkeyeditor.h" #include "skinnedsettings.h" #include "mainwindow.h" #include "skin.h" #include "playlist.h" #include "dock.h" #include "eqwidget.h" #include "mainvisual.h" #include "listwidget.h" #include "visualmenu.h" #include "windowsystem.h" #include "actionmanager.h" #define KEY_OFFSET 10000 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { #ifdef Q_WS_X11 qDebug("MainWindow: detected wm: %s", qPrintable(WindowSystem::netWindowManagerName())); #endif m_vis = 0; m_update = false; setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint); setWindowTitle("Qmmp"); new ActionManager(this); m_player = MediaPlayer::instance(); m_core = SoundCore::instance(); m_pl_manager = PlayListManager::instance(); m_uiHelper = UiHelper::instance(); //user interface m_skin = new Skin(this); resize(275 * m_skin->ratio(),116 * m_skin->ratio()); Dock *dock = new Dock(this); dock->setMainWidget(this); m_display = new MainDisplay(this); setCentralWidget(m_display); m_display->setFocus (); m_playlist = new PlayList(m_pl_manager, this); dock->addWidget(m_playlist); m_equalizer = new EqWidget(this); dock->addWidget(m_equalizer); createActions(); //prepare visualization Visual::initialize(this, m_visMenu, SLOT(updateActions())); m_vis = MainVisual::instance(); Visual::add(m_vis); //connections connect (m_playlist,SIGNAL(next()),SLOT(next())); connect (m_playlist,SIGNAL(prev()),SLOT(previous())); connect (m_playlist,SIGNAL(play()),SLOT(play())); connect (m_playlist,SIGNAL(pause()), m_core ,SLOT(pause())); connect (m_playlist,SIGNAL(stop()),SLOT(stop())); connect (m_playlist,SIGNAL(eject()),SLOT(addFile())); connect (m_playlist,SIGNAL(loadPlaylist()),SLOT(loadPlaylist())); connect (m_playlist,SIGNAL(savePlaylist()),SLOT(savePlaylist())); connect(m_display,SIGNAL(shuffleToggled(bool)),m_pl_manager,SLOT(setShuffle(bool))); connect(m_display,SIGNAL(repeatableToggled(bool)),m_pl_manager,SLOT(setRepeatableList(bool))); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State))); connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64))); connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData())); connect(m_uiHelper, SIGNAL(toggleVisibilityCalled()), SLOT(toggleVisibility())); readSettings(); m_display->setEQ(m_equalizer); m_display->setPL(m_playlist); dock->updateDock(); m_pl_manager->currentPlayList()->doCurrentVisibleRequest(); if (m_startHidden && m_uiHelper->visibilityControl()) toggleVisibility(); } MainWindow::~MainWindow() { qDebug("%s", Q_FUNC_INFO); } void MainWindow::play() { m_player->play(); } void MainWindow::replay() { stop(); m_pl_manager->activatePlayList(m_pl_manager->selectedPlayList()); play(); } void MainWindow::forward() { m_core->seek(m_core->elapsed() + KEY_OFFSET); } void MainWindow::backward() { m_core->seek(qMax(qint64(0), m_core->elapsed() - KEY_OFFSET)); } void MainWindow::setVolume(int volume, int balance) { m_core->setVolume(volume-qMax(balance,0)*volume/100, volume+qMin(balance,0)*volume/100); } void MainWindow::pause(void) { m_core->pause(); } void MainWindow::stop() { m_player->stop(); } void MainWindow::next() { m_player->next(); } void MainWindow::previous() { m_player->previous(); } void MainWindow::showState(Qmmp::State state) { switch ((int) state) { case Qmmp::Playing: if (m_pl_manager->currentPlayList()->currentItem()) m_equalizer->loadPreset(m_pl_manager->currentPlayList()->currentItem()->url().section("/",-1)); break; case Qmmp::Paused: break; case Qmmp::Stopped: m_playlist->setTime(-1); if (m_playlist->currentItem()) setWindowTitle(m_playlist->currentItem()->text()); else setWindowTitle("Qmmp"); break; } } void MainWindow::showMetaData() { if (m_playlist->currentItem() && m_playlist->currentItem()->url() == m_core->metaData().value(Qmmp::URL)) { setWindowTitle(m_playlist->currentItem()->text()); } } void MainWindow::closeEvent (QCloseEvent *) { writeSettings(); m_playlist->close(); m_equalizer->close(); if (!m_hideOnClose || !m_uiHelper->visibilityControl()) m_uiHelper->exit(); } void MainWindow::addDir() { m_uiHelper->addDirectory(this); } void MainWindow::addFile() { m_uiHelper->addFile(this); } void MainWindow::changeEvent (QEvent * event) { if (event->type() == QEvent::ActivationChange) { m_display->setActive(isActiveWindow()); } } void MainWindow::readSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); if (!m_update) { move(settings.value("mw_pos", QPoint(100, 100)).toPoint()); //geometry m_startHidden = settings.value("start_hidden", false).toBool(); if(settings.value("always_on_top", false).toBool()) { ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->setChecked(true); setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); } ACTION(ActionManager::WM_STICKY)->setChecked(settings.value("show_on_all_desktops", false).toBool()); show(); qApp->processEvents(); //visibility m_playlist->setVisible(settings.value("pl_visible",true).toBool()); qApp->processEvents(); m_equalizer->setVisible(settings.value("eq_visible",true).toBool()); qApp->processEvents(); // Repeat/Shuffle m_display->setIsRepeatable(m_pl_manager->isRepeatableList()); m_display->setIsShuffle(m_pl_manager->isShuffle()); ACTION(ActionManager::REPEAT_ALL)->setChecked(m_pl_manager->isRepeatableList()); ACTION(ActionManager::SHUFFLE)->setChecked(m_pl_manager->isShuffle()); m_update = true; } else { if(ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()) { setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); m_playlist->setWindowFlags(m_playlist->windowFlags() | Qt::WindowStaysOnTopHint); m_equalizer->setWindowFlags(m_equalizer->windowFlags() | Qt::WindowStaysOnTopHint); } else { setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); m_playlist->setWindowFlags(m_playlist->windowFlags() & ~Qt::WindowStaysOnTopHint); m_equalizer->setWindowFlags(m_equalizer->windowFlags() & ~Qt::WindowStaysOnTopHint); } show(); qApp->processEvents(); m_playlist->setVisible(m_display->isPlaylistVisible()); m_equalizer->setVisible(m_display->isEqualizerVisible()); } #ifdef Q_WS_X11 WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); WindowSystem::setWinHint(winId(), "player", "Qmmp"); #endif //Call setWindowOpacity only if needed double opacity = settings.value("mw_opacity", 1.0).toDouble(); if(opacity != windowOpacity ()) setWindowOpacity(opacity); opacity = settings.value("eq_opacity", 1.0).toDouble(); if(opacity != m_equalizer->windowOpacity ()) m_equalizer->setWindowOpacity(opacity); opacity = settings.value("pl_opacity", 1.0).toDouble(); if(opacity != m_playlist->windowOpacity ()) m_playlist->setWindowOpacity(opacity); m_hideOnClose = settings.value("hide_on_close", false).toBool(); settings.endGroup(); Dock::instance()->addActions(m_uiHelper->actions(UiHelper::PLAYLIST_MENU)); Dock::instance()->addActions(m_uiHelper->actions(UiHelper::TOOLS_MENU)); } void MainWindow::writeSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); //geometry settings.setValue("mw_pos", this->pos()); //look & feel settings.setValue("double_size", ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked()); settings.setValue("always_on_top", ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()); settings.setValue("show_on_all_desktops", ACTION(ActionManager::WM_STICKY)->isChecked()); settings.endGroup(); } void MainWindow::showSettings() { ConfigDialog *confDialog = new ConfigDialog(this); SkinnedSettings *skinnedSettings = new SkinnedSettings(this); confDialog->addPage(tr("Appearance"), skinnedSettings, QIcon(":/skinned/interface.png")); confDialog->addPage(tr("Shortcuts"), new HotkeyEditor(this), QIcon(":/skinned/shortcuts.png")); confDialog->exec(); skinnedSettings->writeSettings(); confDialog->deleteLater(); updateSettings(); ActionManager::instance()->saveActions(); } void MainWindow::toggleVisibility() { if (isHidden()) { show(); raise(); activateWindow(); m_playlist->setVisible(m_display->isPlaylistVisible()); m_equalizer->setVisible(m_display->isEqualizerVisible()); #ifdef Q_WS_X11 if(WindowSystem::netWindowManagerName() == "Metacity") { m_playlist->activateWindow(); m_equalizer->activateWindow(); } #endif qApp->processEvents(); setFocus (); if (isMinimized()) { if (isMaximized()) showMaximized(); else showNormal(); } #ifdef Q_WS_X11 WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); WindowSystem::setWinHint(winId(), "player", "Qmmp"); raise(); #endif } else { if (m_playlist->isVisible()) m_playlist->hide(); if (m_equalizer->isVisible()) m_equalizer->hide(); hide(); } qApp->processEvents(); } void MainWindow::createActions() { m_mainMenu = new QMenu(this); m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY, this, SLOT(play()))); m_mainMenu->addAction(SET_ACTION(ActionManager::PAUSE, this, SLOT(pause()))); m_mainMenu->addAction(SET_ACTION(ActionManager::STOP, this, SLOT(stop()))); m_mainMenu->addAction(SET_ACTION(ActionManager::PREVIOUS, this, SLOT(previous()))); m_mainMenu->addAction(SET_ACTION(ActionManager::NEXT, this, SLOT(next()))); m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY_PAUSE, this, SLOT(playPause()))); m_mainMenu->addSeparator(); m_mainMenu->addAction(SET_ACTION(ActionManager::JUMP, this, SLOT(jumpToTrack()))); m_mainMenu->addSeparator(); QMenu *viewMenu = m_mainMenu->addMenu(tr("View")); viewMenu->addAction(ACTION(ActionManager::SHOW_PLAYLIST)); viewMenu->addAction(ACTION(ActionManager::SHOW_EQUALIZER)); viewMenu->addSeparator(); viewMenu->addAction(SET_ACTION(ActionManager::WM_ALLWAYS_ON_TOP, this, SLOT(updateSettings()))); viewMenu->addAction(SET_ACTION(ActionManager::WM_STICKY, this, SLOT(updateSettings()))); viewMenu->addAction(SET_ACTION(ActionManager::WM_DOUBLE_SIZE, this, SLOT(updateSettings()))); QMenu *plMenu = m_mainMenu->addMenu(tr("Playlist")); plMenu->addAction(SET_ACTION(ActionManager::REPEAT_ALL, m_pl_manager, SLOT(setRepeatableList(bool)))); plMenu->addAction(SET_ACTION(ActionManager::REPEAT_TRACK, m_player, SLOT(setRepeatable(bool)))); plMenu->addAction(SET_ACTION(ActionManager::SHUFFLE, m_pl_manager, SLOT(setShuffle(bool)))); plMenu->addAction(SET_ACTION(ActionManager::NO_PL_ADVANCE, m_player, SLOT(setNoPlaylistAdvance(bool)))); plMenu->addAction(SET_ACTION(ActionManager::STOP_AFTER_SELECTED, m_pl_manager, SLOT(stopAfterSelected()))); plMenu->addAction(SET_ACTION(ActionManager::CLEAR_QUEUE, m_pl_manager, SLOT(clearQueue()))); connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), ACTION(ActionManager::REPEAT_ALL), SLOT(setChecked(bool))); connect(m_player, SIGNAL (repeatableChanged(bool)), ACTION(ActionManager::REPEAT_TRACK), SLOT(setChecked(bool))); connect(m_player, SIGNAL (noPlaylistAdvanceChanged(bool)), ACTION(ActionManager::NO_PL_ADVANCE), SLOT(setChecked(bool))); connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), ACTION(ActionManager::SHUFFLE), SLOT(setChecked(bool))); m_visMenu = new VisualMenu(this); m_mainMenu->addMenu(m_visMenu); m_mainMenu->addMenu(m_uiHelper->createMenu(UiHelper::TOOLS_MENU, tr("Tools"), this)); m_mainMenu->addSeparator(); m_mainMenu->addAction(SET_ACTION(ActionManager::SETTINGS, this, SLOT(showSettings()))); m_mainMenu->addSeparator(); m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT, this, SLOT(about()))); m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT_QT, qApp, SLOT(aboutQt()))); m_mainMenu->addSeparator(); m_mainMenu->addAction(SET_ACTION(ActionManager::QUIT, this, SLOT(close()))); QAction* forward = new QAction(this); forward->setShortcut(QKeySequence(Qt::Key_Right)); connect(forward,SIGNAL(triggered(bool)),this,SLOT(forward())); QAction* backward = new QAction(this); backward->setShortcut(QKeySequence(Qt::Key_Left)); connect(backward,SIGNAL(triggered(bool)),this,SLOT(backward())); Dock::instance()->addActions(QList() << forward << backward); Dock::instance()->addActions(ActionManager::instance()->actions()); } void MainWindow::about() { m_uiHelper->about(this); } void MainWindow::updateSettings() { readSettings(); m_playlist->readSettings(); m_visMenu->updateActions(); m_skin->reloadSkin(); Dock::instance()->updateDock(); } QMenu* MainWindow::menu() { return m_mainMenu; } void MainWindow::loadPlaylist() { m_uiHelper->loadPlayList(this); } void MainWindow::savePlaylist() { m_uiHelper->savePlayList(this); } void MainWindow::playPause() { if (m_core->state() == Qmmp::Playing) m_core->pause(); else play(); } void MainWindow::jumpToTrack() { m_uiHelper->jumpToTrack(this); } void MainWindow::addUrl() { m_uiHelper->addUrl(this); } MainDisplay * MainWindow::mainDisplay() const { return m_display; } void MainWindow::keyPressEvent(QKeyEvent *ke) { QKeyEvent event = QKeyEvent(ke->type(), ke->key(), ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); QApplication::sendEvent(m_playlist,&event); } qmmp-0.7.4/src/plugins/Ui/skinned/number.h0000664000175000017500000000343712256224735017154 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef NUMBER_H #define NUMBER_H #include "pixmapwidget.h" /** @author Ilya Kotov */ class Skin; class Number : public PixmapWidget { Q_OBJECT public: Number(QWidget *parent = 0); ~Number(); void setValue(int); private slots: void updateSkin(void); private: Skin *m_skin; int m_value; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/balancebar.cpp0000664000175000017500000000757012256224735020273 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "skin.h" #include "button.h" #include "mainwindow.h" #include "balancebar.h" BalanceBar::BalanceBar(QWidget *parent) : PixmapWidget(parent) { m_skin = Skin::instance(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setPixmap(m_skin->getBalanceBar(0)); m_moving = false; m_min = -100; m_max = 100; m_old = m_value = 0; draw(false); } BalanceBar::~BalanceBar() {} void BalanceBar::mousePressEvent(QMouseEvent *e) { m_moving = true; press_pos = e->x(); if(e->button() == Qt::MidButton) { m_value = 0; emit sliderPressed(); emit sliderMoved(m_value); } else if(m_posx() && e->x()ratio()) { press_pos = e->x()-m_pos; emit sliderPressed(); } else { m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); press_pos = 6*m_skin->ratio(); emit sliderPressed(); if (m_value != m_old) { emit sliderMoved(m_value); } } draw(); } void BalanceBar::mouseMoveEvent (QMouseEvent *e) { if(m_moving) { int po = e->x(); po = po - press_pos; if(0 <= po && po <= width()-13*m_skin->ratio()) { m_value = convert(po); draw(); emit sliderMoved(m_value); } } } void BalanceBar::mouseReleaseEvent(QMouseEvent*) { m_moving = false; draw(false); m_old = m_value; emit sliderReleased(); } void BalanceBar::setValue(int v) { if (m_moving || m_max == 0) return; m_value = v; draw(false); } void BalanceBar::setMax(int max) { m_max = max; draw(false); } void BalanceBar::updateSkin() { resize(m_skin->getBalanceBar(0).size()); draw(false); } void BalanceBar::draw(bool pressed) { if(abs(m_value)<6) m_value = 0; int p=int(ceil(double(m_value-m_min)*(width()-13*m_skin->ratio())/(m_max-m_min))); m_pixmap = m_skin->getBalanceBar(abs(27*m_value/m_max)); QPainter paint(&m_pixmap); if(pressed) paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_P)); else paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_N)); setPixmap(m_pixmap); m_pos = p; } int BalanceBar::convert(int p) { return int(ceil(double(m_max-m_min)*(p)/(width()-13*m_skin->ratio())+m_min)); } qmmp-0.7.4/src/plugins/Ui/skinned/dock.cpp0000664000175000017500000002131012256224735017125 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "dock.h" Dock *Dock::m_instance = 0; Dock *Dock::instance() { if (!m_instance) m_instance = new Dock(); return m_instance; } Dock::Dock (QObject *parent) : QObject (parent) { m_instance = this; m_mainWidget = 0; } Dock::~Dock() { m_instance = 0; } void Dock::setMainWidget (QWidget *widget) { m_mainWidget = widget; m_widgetList.prepend (widget); m_dockedList.prepend (false); } QPoint Dock::snapDesktop(QPoint npos, QWidget* mv) { QRect desktopRect = QApplication::desktop()->availableGeometry(mv); int nx = abs (npos.x() - desktopRect.x()); //left-top int ny = abs (npos.y() - desktopRect.y()); if(nx < 13) npos.rx() = desktopRect.x(); if(ny < 13) npos.ry() = desktopRect.y(); nx = abs (npos.x() + mv->width() - desktopRect.width() - desktopRect.x()); //right-bottom ny = abs (npos.y() + mv->height() - desktopRect.height() - desktopRect.y()); if(nx < 13) npos.rx() = desktopRect.width() - mv->width() + desktopRect.x(); if(ny < 13) npos.ry() = desktopRect.height() - mv->height() + desktopRect.y(); return npos; } QPoint Dock::snap (QPoint npos, QWidget* mv, QWidget* st) { int nx = npos.x() - st->x(); int ny = abs (npos.y() - st->y() + mv->height()); if (abs (nx) < 13 && ny < 13) //above npos.rx() = st->x(); if (ny < 13 && nx > -mv->width() && nx < st->width()) npos.ry() = st->y() - mv->height(); nx = abs (npos.x() + mv->width() - st->x() - st->width()); if (nx < 13 && ny < 13) npos.rx() = st->x() + st->width() - mv->width(); /***********/ nx = npos.x() - st->x(); ny = abs (npos.y() - st->y() - st->height()); if (abs (nx) < 13 && ny < 13) //near npos.rx() = st->x(); if (ny < 13 && nx > -mv->width() && nx < st->width()) npos.ry() = st->y() + st->height(); nx = abs (npos.x() + mv->width() - st->x() - st->width()); if (nx < 13 && ny < 13) npos.rx() = st->x() + st->width() - mv->width(); /**************/ nx = abs (npos.x() - st->x() + mv->width()); ny = npos.y() - st->y(); if (nx < 13 && abs (ny) < 13) //left npos.ry() = st->y(); if (nx < 13 && ny > -mv->height() && ny < st->height()) npos.rx() = st->x() - mv->width(); ny = abs (npos.y() + mv->height() - st->y() - st->height()); if (nx < 13 && ny < 13) npos.ry() = st->y() + st->height() - mv->height(); /*****************/ nx = abs (npos.x() - st->x() - st->width()); ny = npos.y() - st->y(); if (nx < 13 && abs (ny) < 13) //right npos.ry() = st->y(); if (nx < 13 && ny > -mv->height() && ny < st->height()) npos.rx() = st->x() + st->width(); ny = abs (npos.y() + mv->height() - st->y() - st->height()); if (nx < 13 && ny < 13) npos.ry() = st->y() + st->height() - mv->height(); return (npos); } void Dock::addWidget (QWidget *widget) { m_widgetList.append (widget); m_dockedList.append (false); if(m_mainWidget) widget->addActions(m_mainWidget->actions()); } void Dock::move (QWidget* mv, QPoint npos) { //QRect desktopRect = QApplication::desktop()->availableGeometry(m_mainWidget); /*if(npos.y() < desktopRect.y()) npos.setY(desktopRect.y());*/ if (mv == m_mainWidget) { for (int i = 1; iisVisible()) npos = snap (npos, mv, m_widgetList.at (i)); } else { QPoint pos = npos + m_delta_list.at(i); for (int j = 1; jisVisible()) { pos = snap (pos, m_widgetList.at (i), m_widgetList.at (j)); npos = pos - m_delta_list.at(i); } } } } npos = snapDesktop(npos, mv); for (int i = 1; imove(pos); npos = pos - m_delta_list.at(i); } } mv->move (npos); } else { for (int i = 0; iisVisible()) { npos = snap (npos, mv, m_widgetList.at (i)); npos = snapDesktop(npos, mv); } } mv->move (npos); } } void Dock::calculateDistances() { m_delta_list.clear(); foreach (QWidget *w, m_widgetList) { if (w == m_mainWidget) m_delta_list.append(QPoint(0,0)); else m_delta_list.append(w->pos() - m_mainWidget->pos()); } } void Dock::updateDock() { QWidget *mv = m_widgetList.at (0); for (int j = 1; jx() - st->x(); int ny = abs (mv->y() - st->y() + mv->height()); if (ny < 2 && nx > -mv->width() && nx < st->width()) //above return true; /***********/ nx = mv->x() - st->x(); ny = abs (mv->y() - st->y() - st->height()); if (ny < 2 && nx > -mv->width() && nx < st->width()) //near return true; /**************/ nx = abs (mv->x() - st->x() + mv->width()); ny = mv->y() - st->y(); if (nx < 2 && ny > -mv->height() && ny < st->height()) //left return true; /*****************/ nx = abs (mv->x() - st->x() - st->width()); ny = mv->y() - st->y(); if (nx < 2 && ny > -mv->height() && ny < st->height()) //right return true; return false; } void Dock::addActions (QList actions) { if(!m_mainWidget) { qFatal("Dock: main widget is null"); } for (int i = 0; iaddActions (actions); } bool Dock::isUnder(QWidget* upper, QWidget* nether, int dy) { int nx = upper->x() - nether->x(); return abs (upper->y() + upper->height() -dy - nether->y()) < 2 && nx > -upper->width() && nx < nether->width(); } void Dock::align(QWidget* w, int dy) { for (int i = 0; imove(m_widgetList.at(i)->x(), m_widgetList.at(i)->y()+dy); align(m_widgetList.at(i), dy); } } } qmmp-0.7.4/src/plugins/Ui/skinned/skinned.pro0000664000175000017500000000661412256224735017670 0ustar useruserinclude(../../plugins.pri) FORMS += \ forms/preseteditor.ui \ forms/playlistbrowser.ui \ forms/popupsettings.ui \ forms/shortcutdialog.ui \ forms/skinnedsettings.ui \ forms/hotkeyeditor.ui HEADERS += mainwindow.h \ button.h \ display.h \ skin.h \ titlebar.h \ positionbar.h \ number.h \ playlist.h \ listwidget.h \ pixmapwidget.h \ playlisttitlebar.h \ playlistslider.h \ dock.h \ eqwidget.h \ eqtitlebar.h \ eqslider.h \ togglebutton.h \ eqgraph.h \ mainvisual.h \ inlines.h \ fft.h \ textscroller.h \ monostereo.h \ playstatus.h \ volumebar.h \ balancebar.h \ symboldisplay.h \ playlistcontrol.h \ eqpreset.h \ preseteditor.h \ timeindicator.h \ keyboardmanager.h \ skinreader.h \ visualmenu.h \ titlebarcontrol.h \ shadedvisual.h \ shadedbar.h \ cursorimage.h \ playlistbrowser.h \ playlistselector.h \ popupwidget.h \ popupsettings.h \ windowsystem.h \ actionmanager.h \ shortcutitem.h \ shortcutdialog.h \ skinnedfactory.h \ skinnedsettings.h \ hotkeyeditor.h SOURCES += mainwindow.cpp \ button.cpp \ display.cpp \ skin.cpp \ titlebar.cpp \ positionbar.cpp \ number.cpp \ playlist.cpp \ listwidget.cpp \ pixmapwidget.cpp \ playlisttitlebar.cpp \ playlistslider.cpp \ dock.cpp \ eqwidget.cpp \ eqtitlebar.cpp \ eqslider.cpp \ togglebutton.cpp \ eqgraph.cpp \ mainvisual.cpp \ fft.c \ textscroller.cpp \ monostereo.cpp \ playstatus.cpp \ volumebar.cpp \ balancebar.cpp \ symboldisplay.cpp \ playlistcontrol.cpp \ eqpreset.cpp \ preseteditor.cpp \ timeindicator.cpp \ keyboardmanager.cpp \ skinreader.cpp \ visualmenu.cpp \ titlebarcontrol.cpp \ shadedvisual.cpp \ shadedbar.cpp \ cursorimage.cpp \ playlistbrowser.cpp \ playlistselector.cpp \ popupwidget.cpp \ popupsettings.cpp \ windowsystem.cpp \ actionmanager.cpp \ shortcutitem.cpp \ shortcutdialog.cpp \ skinnedfactory.cpp \ skinnedsettings.cpp \ hotkeyeditor.cpp TEMPLATE = lib unix:QMAKE_LIBDIR += ../../../../lib unix:LIBS += -lqmmpui -lqmmp win32:QMAKE_LIBDIR += ../../../../bin win32:LIBS += -lqmmpui0 -lqmmp0 CONFIG += release \ warn_on \ plugin TARGET = $$PLUGINS_PREFIX/Ui/skinned unix:LIBS += -lqmmp -lqmmpui win32:LIBS += -lqmmp0 -lqmmpui0 RESOURCES = resources/resources.qrc default/default.qrc unix{ isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Ui INSTALLS += target CONFIG += link_pkgconfig PKGCONFIG += x11 } INCLUDEPATH += ../../../ RESOURCES += translations/translations.qrc TRANSLATIONS = translations/skinned_plugin_ru.ts \ translations/skinned_plugin_tr.ts \ translations/skinned_plugin_zh_CN.ts \ translations/skinned_plugin_cs.ts \ translations/skinned_plugin_pt_BR.ts \ translations/skinned_plugin_uk_UA.ts \ translations/skinned_plugin_zh_TW.ts \ translations/skinned_plugin_de.ts \ translations/skinned_plugin_pl_PL.ts \ translations/skinned_plugin_it.ts \ translations/skinned_plugin_lt.ts \ translations/skinned_plugin_hu.ts \ translations/skinned_plugin_nl.ts \ translations/skinned_plugin_ja.ts \ translations/skinned_plugin_es.ts \ translations/skinned_plugin_sk.ts qmmp-0.7.4/src/plugins/Ui/skinned/eqgraph.cpp0000664000175000017500000001043312256224735017640 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "skin.h" #include "eqgraph.h" EQGraph::EQGraph (QWidget *parent) : PixmapWidget (parent) { m_skin = Skin::instance(); setPixmap (m_skin->getEqPart (Skin::EQ_GRAPH)); clear(); m_ratio = m_skin->ratio(); draw(); connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); } EQGraph::~EQGraph() {} void EQGraph::addValue (int value) { if (m_values.size() >= 10) return; m_values.append (value); if (m_values.size() == 10) { draw(); } } void EQGraph::clear () { m_values.clear(); update(); } void EQGraph::init_spline (double * x, double * y, int n, double * y2) { int i, k; double p, qn, sig, un, *u; u = new double[n]; y2[0] = u[0] = 0.0; for (i = 1; i < n - 1; i++) { sig = ((double) x[i] - x[i - 1]) / ((double) x[i + 1] - x[i - 1]); p = sig * y2[i - 1] + 2.0; y2[i] = (sig - 1.0) / p; u[i] = (((double) y[i + 1] - y[i]) / (x[i + 1] - x[i])) - (((double) y[i] - y[i - 1]) / (x[i] - x[i - 1])); u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p; } qn = un = 0.0; y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0); for (k = n - 2; k >= 0; k--) y2[k] = y2[k] * y2[k + 1] + u[k]; delete[] u; } double EQGraph::eval_spline (double xa[], double ya[], double y2a[], int n, double x) { int klo, khi, k; double h, b, a; klo = 0; khi = n - 1; while (khi - klo > 1) { k = (khi + klo) >> 1; if (xa[k] > x) khi = k; else klo = k; } h = xa[khi] - xa[klo]; a = (xa[khi] - x) / h; b = (x - xa[klo]) / h; return (a * ya[klo] + b * ya[khi] + ((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0); } void EQGraph::draw() { QPixmap pixmap = m_skin->getEqPart (Skin::EQ_GRAPH); if (pixmap.isNull()) pixmap = QPixmap(113*m_ratio,19*m_ratio); if (m_values.size()!=10) { setPixmap (pixmap); return; } int i, y; double x[] = { 0, 11, 23, 35, 47, 59, 71, 83, 97, 109 }, yf[10]; double *bands = new double[10]; for (int i = 0; i < 10; ++i) { bands[i] = m_values.at (i); } init_spline (x, bands, 10, yf); for (i = 0; i < 113; i++) { y = 9 - (int) ((eval_spline (x, bands, yf, 10, i) * 9.0) / 20.0); if (y < 0) y = 0; if (y > 18) y = 18; QPainter paint (&pixmap); paint.drawPixmap (i*m_ratio, y*m_ratio, m_skin->getEqSpline (y)); } setPixmap (pixmap); delete [] bands; } void EQGraph::updateSkin() { m_ratio = m_skin->ratio(); draw(); setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); } qmmp-0.7.4/src/plugins/Ui/skinned/playlistslider.h0000664000175000017500000000432712256224735020727 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTSLIDER_H #define PLAYLISTSLIDER_H #include class Skin; class PixmapWidget; /** @author Ilya Kotov */ class PlayListSlider : public QWidget { Q_OBJECT public: PlayListSlider(QWidget *parent = 0); ~PlayListSlider(); public slots: void setPos(int pos, int max); signals: void sliderMoved (int); private slots: void updateSkin(); private: Skin *m_skin; PixmapWidget *m_scroll; int m_old; bool m_moving, m_pressed; int press_pos; int m_min, m_max, m_value, pos, m_pos; int convert(int); // value = convert(position); protected: void paintEvent(QPaintEvent*); void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqslider.cpp0000664000175000017500000001025012256224735020016 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "skin.h" #include "eqslider.h" EqSlider::EqSlider(QWidget *parent): PixmapWidget(parent) { m_skin = Skin::instance(); connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); setPixmap(m_skin->getEqSlider(0)); m_moving = false; m_min = -20; m_max = 20; m_old = m_value = 0; draw(false); setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); } EqSlider::~EqSlider() {} void EqSlider::mousePressEvent(QMouseEvent *e) { m_moving = true; press_pos = e->y(); if (e->button() == Qt::MidButton) { m_value = 0; emit sliderMoved(m_value); m_old = m_value; } else if (m_posy() && e->y()ratio()) { press_pos = e->y()-m_pos; } else { m_value = convert(qMax(qMin(height()-12*m_skin->ratio(),e->y()-6*m_skin->ratio()),0)); press_pos = 6*m_skin->ratio(); if (m_value!=m_old) { emit sliderMoved(m_value); m_old = m_value; } } draw(); } void EqSlider::mouseReleaseEvent(QMouseEvent*) { m_moving = false; draw(false); } void EqSlider::mouseMoveEvent(QMouseEvent* e) { if (m_moving) { int po = e->y(); po = po - press_pos; if (0<=po && po<=height()-12*m_skin->ratio()) { m_value = convert(po); draw(); if (m_value!=m_old) { m_old = m_value; //qDebug ("%d",-m_value); emit sliderMoved(-m_value); } } } } double EqSlider::value() { return - m_value; } void EqSlider::setValue(double p) { if (m_moving) return; m_value = -p; draw(false); } void EqSlider::setMax(double m) { m_max = m; draw(false); } void EqSlider::updateSkin() { resize(m_skin->getEqSlider(0).size()); draw(false); setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); } void EqSlider::draw(bool pressed) { int p=int(ceil(double(m_value-m_min)*(height()-12*m_skin->ratio())/(m_max-m_min))); m_pixmap = m_skin->getEqSlider(27-27*(m_value-m_min)/(m_max-m_min)); QPainter paint(&m_pixmap); if (pressed) paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_P)); else paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_N)); setPixmap(m_pixmap); m_pos = p; } double EqSlider::convert(int p) { return (m_max - m_min)*(p)/(height() - 12*m_skin->ratio()) + m_min; } void EqSlider::wheelEvent(QWheelEvent *e) { m_value -= e->delta()/60; m_value = m_value > m_max ? m_max : m_value; m_value = m_value < m_min ? m_min : m_value; draw(false); emit sliderMoved(m_value); } qmmp-0.7.4/src/plugins/Ui/skinned/playlistselector.h0000664000175000017500000000610112256224735021255 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTSELECTOR_H #define PLAYLISTSELECTOR_H #include #include #include class QFontMetrics; class QFont; class QMouseEvent; class QMenu; class PlayListManager; class PlayList; class Skin; /** @author Ilya Kotov */ class PlayListSelector : public QWidget { Q_OBJECT public: PlayListSelector(PlayListManager *manager, QWidget *parent = 0); ~PlayListSelector(); void readSettings(); private slots: void updateTabs(); void updateSkin(); void renamePlaylist(); private: void paintEvent(QPaintEvent *); void mousePressEvent (QMouseEvent *e); void mouseReleaseEvent (QMouseEvent *e); void mouseDoubleClickEvent (QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); void resizeEvent (QResizeEvent *); void updateOffsets(); void loadColors(); void drawButtons(); void updateScrollers(); QRect firstVisible(); QRect lastVisible(); int findPlayList(QPoint pos); int findButton(QPoint pos); PlayListManager *m_pl_manager; QFontMetrics *m_metrics; QFont m_font; QMenu *m_menu; bool m_scrollable; QList m_rects; QList m_extra_rects; Skin *m_skin; QColor m_normal, m_current, m_normal_bg, m_selected_bg; QPixmap m_pixmap; bool m_show_new_pl_button; int m_offset, m_offset_max, m_press_offset; bool m_moving; QPoint m_mouse_pos; QString m_pl_separator; QString m_pl_button; int m_pressed_button; enum BUTTON { BUTTON_UNKNOWN = -1, BUTTON_NEW_PL, BUTTON_LEFT, BUTTON_RIGHT }; }; #endif // PLAYLISTSELECTOR_H qmmp-0.7.4/src/plugins/Ui/skinned/textscroller.h0000664000175000017500000000534712256224735020420 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TEXTSCROLLER_H #define TEXTSCROLLER_H #include #include class QTimer; class QMenu; class QAction; class Skin; class SoundCore; /** @author Ilya Kotov */ class TextScroller : public QWidget { Q_OBJECT public: TextScroller(QWidget *parent = 0); virtual ~TextScroller(); void setText(const QString &text); public slots: void clear(); private slots: void setProgress(int); void addOffset(); void updateSkin(); void processState(Qmmp::State state); void processMetaData(); void updateText(); private: void hideEvent(QHideEvent *); void showEvent(QShowEvent *); void paintEvent(QPaintEvent *); void mousePressEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void preparePixmap(const QString &text, bool scrollable = false); QString m_defautText; QString m_bufferText; QString m_sliderText; QString m_titleText; QPixmap m_pixmap; int m_x1, m_x2, m_ratio; bool m_scroll, m_bitmap, m_pressed; int m_press_pos; QFont m_font; QFontMetrics *m_metrics; Skin *m_skin; QColor m_color; QTimer *m_timer; QMenu *m_menu; QAction *m_scrollAction, *m_transparencyAction; SoundCore *m_core; }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqtitlebar.cpp0000664000175000017500000001403012256224735020342 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "eqwidget.h" #include "skin.h" #include "shadedbar.h" #include "dock.h" #include "mainwindow.h" #include "button.h" #include "eqtitlebar.h" EqTitleBar::EqTitleBar(QWidget *parent) : PixmapWidget(parent) { m_volumeBar = 0; m_balanceBar = 0; m_shade2 = 0; m_left = 0; m_right = 0; m_shaded = false; m_align = false; m_skin = Skin::instance(); m_eq = parentWidget(); m_mw = qobject_cast(m_eq->parent()); m_close = new Button(this, Skin::EQ_BT_CLOSE_N, Skin::EQ_BT_CLOSE_P, Skin::CUR_EQCLOSE); connect(m_close, SIGNAL(clicked()),m_eq, SIGNAL(closed())); m_shade = new Button(this, Skin::EQ_BT_SHADE1_N, Skin::EQ_BT_SHADE1_P, Skin::CUR_EQNORMAL); connect(m_shade, SIGNAL(clicked()), SLOT(shade())); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); if (settings.value("Skinned/eq_shaded", false).toBool()) shade(); m_align = true; setActive(false); setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); updatePositions(); } EqTitleBar::~EqTitleBar() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Skinned/eq_shaded", m_shaded); } void EqTitleBar::updatePositions() { int r = m_skin->ratio(); m_close->move(r*264,r*3); m_shade->move(r*254,r*3); if(m_volumeBar) m_volumeBar->move(r*61,r*4); if(m_balanceBar) m_balanceBar->move(r*164,r*4); if(m_shade2) m_shade2->move(r*254,r*3); } void EqTitleBar::setActive(bool active) { if (active) { if (m_shaded) setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); else setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); } else { if (m_shaded) setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_I)); else setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_I)); } } void EqTitleBar::setVolume(int left, int right) { m_left = left; m_right = right; if (m_volumeBar && m_balanceBar) { int maxVol = qMax(left, right); m_volumeBar->setValue(maxVol); if (maxVol && !m_volumeBar->isPressed()) m_balanceBar->setValue((right - left)*100/maxVol); } } void EqTitleBar::mousePressEvent(QMouseEvent* event) { switch ((int) event->button ()) { case Qt::LeftButton: m_pos = event->pos(); break; case Qt::RightButton: m_mw->menu()->exec(event->globalPos()); } } void EqTitleBar::mouseMoveEvent(QMouseEvent* event) { if (m_pos.x() < width() - 30 * m_skin->ratio()) { QPoint npos = (event->globalPos()-m_pos); Dock::instance()->move(m_eq, npos); } } void EqTitleBar::mouseReleaseEvent(QMouseEvent*) { Dock::instance()->updateDock(); } void EqTitleBar::mouseDoubleClickEvent (QMouseEvent *) { EqTitleBar::shade(); } void EqTitleBar::shade() { m_shaded = !m_shaded; int r = m_skin->ratio(); if (m_shaded) { setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); m_shade->hide(); m_shade2 = new Button(this, Skin::EQ_BT_SHADE2_N, Skin::EQ_BT_SHADE2_P, Skin::CUR_EQNORMAL); m_shade2->move(r*254,r*3); connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); m_shade2->show(); m_volumeBar = new ShadedBar(this, Skin::EQ_VOLUME1, Skin::EQ_VOLUME2, Skin::EQ_VOLUME3); m_volumeBar->move(r*61,r*4); m_volumeBar->show(); connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); m_balanceBar = new ShadedBar(this, Skin::EQ_BALANCE1, Skin::EQ_BALANCE2, Skin::EQ_BALANCE3); m_balanceBar->move(r*164,r*4); m_balanceBar->setRange(-100, 100); m_balanceBar->show(); connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); setVolume(m_left, m_right); //show current volume and balance } else { setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); m_shade2->deleteLater(); m_volumeBar->deleteLater(); m_balanceBar->deleteLater(); m_volumeBar = 0; m_balanceBar = 0; m_shade2 = 0; m_shade->show(); } qobject_cast(m_eq)->setMimimalMode(m_shaded); if (m_align) Dock::instance()->align(m_eq, m_shaded? -102*r: 102*r); } void EqTitleBar::updateVolume() { m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); } void EqTitleBar::updateSkin() { setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); updatePositions(); } qmmp-0.7.4/src/plugins/Ui/skinned/cursorimage.h0000664000175000017500000000302312256224735020173 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Erik Ölsar * * erlk.ozlr@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CURSORIMAGE_H #define CURSORIMAGE_H QCursor createCursor(QString path); #endif qmmp-0.7.4/src/plugins/Ui/skinned/skinnedsettings.cpp0000664000175000017500000002367412256224735021440 0ustar useruser/*************************************************************************** * Copyright (C) 2011-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "skinreader.h" #include "skin.h" #include "popupsettings.h" #include "skinnedsettings.h" SkinnedSettings::SkinnedSettings(QWidget *parent) : QWidget(parent) { ui.setupUi(this); ui.listWidget->setIconSize (QSize (105,34)); m_skin = Skin::instance(); m_reader = new SkinReader(this); connect(ui.skinReloadButton, SIGNAL (clicked()), SLOT(loadSkins())); readSettings(); loadSkins(); loadFonts(); //setup icons ui.skinInstallButton->setIcon(QIcon::fromTheme("list-add")); ui.skinReloadButton->setIcon(QIcon::fromTheme("view-refresh")); ui.popupTemplateButton->setIcon(QIcon::fromTheme("configure")); } SkinnedSettings::~SkinnedSettings() {} void SkinnedSettings::on_listWidget_itemClicked(QListWidgetItem *) { int row = ui.listWidget->currentRow(); QString path; if (m_skinList.at (row).isDir()) { path = m_skinList.at (row).canonicalFilePath(); m_skin->setSkin (path); } else if (m_skinList.at (row).isFile()) { m_reader->unpackSkin(m_skinList.at (row).canonicalFilePath()); m_skin->setSkin(QDir::homePath() +"/.qmmp/cache/skin"); } if(ui.listWidget->currentItem()) m_currentSkinName = ui.listWidget->currentItem()->text(); else m_currentSkinName.clear(); } void SkinnedSettings::on_plFontButton_clicked() { bool ok; QFont font = ui.plFontLabel->font(); font = QFontDialog::getFont (&ok, font, this); if (ok) { ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); ui.plFontLabel->setFont(font); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Skinned/pl_font", font.toString()); } } void SkinnedSettings::on_mainFontButton_clicked() { bool ok; QFont font = ui.mainFontLabel->font(); font = QFontDialog::getFont (&ok, font, this); if (ok) { ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); ui.mainFontLabel->setFont(font); QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.setValue ("Skinned/mw_font", font.toString()); } } void SkinnedSettings::on_skinInstallButton_clicked() { QStringList files = FileDialog::getOpenFileNames(this,tr("Select Skin Files"), QDir::homePath(), tr("Skin files") + " (*.tar.gz *.tgz *.tar.bz2 *.zip *.wsz)"); foreach(QString path, files) { QFile file(path); file.copy(QDir::homePath() +"/.qmmp/skins/" + QFileInfo(path).fileName()); } loadSkins(); } void SkinnedSettings::showEvent(QShowEvent *) { ui.hiddenCheckBox->setEnabled(UiHelper::instance()->visibilityControl()); ui.hideOnCloseCheckBox->setEnabled(UiHelper::instance()->visibilityControl()); } void SkinnedSettings::loadFonts() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); QString fontname = settings.value ("Skinned/pl_font").toString(); QFont font = QApplication::font(); if(!fontname.isEmpty()) font.fromString(fontname); ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); ui.plFontLabel->setFont(font); font = QApplication::font (); fontname = settings.value ("Skinned/mw_font").toString(); if(!fontname.isEmpty()) font.fromString(fontname); ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); ui.mainFontLabel->setFont(font); ui.useBitmapCheckBox->setChecked(settings.value("Skinned/bitmap_font", false).toBool()); } void SkinnedSettings::findSkins(const QString &path) { QDir dir(path); dir.setFilter (QDir::Dirs | QDir::NoDotAndDotDot); QList fileList = dir.entryInfoList(); if (fileList.count() == 0) return; foreach (QFileInfo fileInfo, fileList) { QPixmap preview = Skin::getPixmap ("main", QDir(fileInfo.filePath ())); if (!preview.isNull()) { QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); item->setIcon (preview); item->setToolTip(tr("Unarchived skin") + " " + fileInfo.filePath ()); ui.listWidget->addItem (item); m_skinList << fileInfo; } } } void SkinnedSettings::loadSkins() { m_reader->generateThumbs(); m_skinList.clear(); ui.listWidget->clear(); QFileInfo fileInfo (":/default"); QPixmap preview = Skin::getPixmap ("main", QDir (fileInfo.filePath())); QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); item->setIcon (preview); ui.listWidget->addItem (item); m_skinList << fileInfo; if(item->text() == m_currentSkinName) ui.listWidget->setCurrentItem(item); findSkins(QDir::homePath() +"/.qmmp/skins"); #if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN) findSkins(qApp->applicationDirPath()+"/skins"); #else findSkins(qApp->applicationDirPath()+"/../share/qmmp/skins"); #endif foreach(QString path, m_reader->skins()) { QListWidgetItem *item = new QListWidgetItem (path.section('/', -1)); item->setIcon (m_reader->getPreview(path)); item->setToolTip(tr("Archived skin") + " " + path); ui.listWidget->addItem (item); m_skinList << QFileInfo(path); if(item->text() == m_currentSkinName) ui.listWidget->setCurrentItem(item); } } void SkinnedSettings::on_popupTemplateButton_clicked() { PopupSettings *p = new PopupSettings(this); p->exec(); p->deleteLater(); } void SkinnedSettings::readSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); //playlist ui.protocolCheckBox->setChecked(settings.value ("pl_show_protocol", false).toBool()); ui.numbersCheckBox->setChecked(settings.value ("pl_show_numbers", true).toBool()); ui.alignCheckBox->setChecked(settings.value ("pl_align_numbers", false).toBool()); ui.anchorCheckBox->setChecked(settings.value("pl_show_anchor", false).toBool()); ui.playlistsCheckBox->setChecked(settings.value("pl_show_plalists", false).toBool()); ui.popupCheckBox->setChecked(settings.value("pl_show_popup", false).toBool()); ui.plSeplineEdit->setText(settings.value("pl_separator", "|").toString()); ui.showNewPLCheckBox->setChecked(settings.value("pl_show_create_button", false).toBool()); //transparency ui.mwTransparencySlider->setValue(100 - settings.value("mw_opacity", 1.0).toDouble()*100); ui.eqTransparencySlider->setValue(100 - settings.value("eq_opacity", 1.0).toDouble()*100); ui.plTransparencySlider->setValue(100 - settings.value("pl_opacity", 1.0).toDouble()*100); //view ui.skinCursorsCheckBox->setChecked(settings.value("skin_cursors", false).toBool()); m_currentSkinName = settings.value("skin_name", "default").toString(); ui.hiddenCheckBox->setChecked(settings.value("start_hidden", false).toBool()); ui.hideOnCloseCheckBox->setChecked(settings.value("hide_on_close", false).toBool()); settings.endGroup(); } void SkinnedSettings::writeSettings() { QSettings settings (Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Skinned"); settings.setValue ("pl_show_protocol", ui.protocolCheckBox->isChecked()); settings.setValue ("pl_show_numbers", ui.numbersCheckBox->isChecked()); settings.setValue ("pl_align_numbers", ui.alignCheckBox->isChecked()); settings.setValue ("pl_show_anchor", ui.anchorCheckBox->isChecked()); settings.setValue ("pl_show_plalists", ui.playlistsCheckBox->isChecked()); settings.setValue ("pl_show_popup", ui.popupCheckBox->isChecked()); settings.setValue ("pl_separator", ui.plSeplineEdit->text()); settings.setValue ("pl_show_create_button", ui.showNewPLCheckBox->isChecked()); settings.setValue ("mw_opacity", 1.0 - (double)ui.mwTransparencySlider->value()/100); settings.setValue ("eq_opacity", 1.0 - (double)ui.eqTransparencySlider->value()/100); settings.setValue ("pl_opacity", 1.0 - (double)ui.plTransparencySlider->value()/100); settings.setValue ("bitmap_font", ui.useBitmapCheckBox->isChecked()); settings.setValue ("skin_cursors", ui.skinCursorsCheckBox->isChecked()); settings.setValue ("skin_name", m_currentSkinName); settings.setValue ("start_hidden", ui.hiddenCheckBox->isChecked()); settings.setValue ("hide_on_close", ui.hideOnCloseCheckBox->isChecked()); settings.endGroup(); } qmmp-0.7.4/src/plugins/Ui/skinned/volumebar.h0000664000175000017500000000456112256224735017657 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VOLUMEBAR_H #define VOLUMEBAR_H #include "pixmapwidget.h" class Skin; class MainWindow; /** @author Ilya Kotov */ class VolumeBar : public PixmapWidget { Q_OBJECT public: VolumeBar(QWidget *parent = 0); ~VolumeBar(); int value() { return m_value; } int isPressed() { return m_moving; } public slots: void setValue(int); void setMax(int); signals: void sliderMoved (int); void sliderPressed(); void sliderReleased(); private slots: void updateSkin(); private: Skin *m_skin; bool m_moving; int press_pos; int m_max, m_min, m_pos, m_value, m_old; QPixmap m_pixmap; MainWindow *mw; int convert(int); // value = convert(position); void draw(bool pressed = true); protected: void mousePressEvent(QMouseEvent*); void mouseReleaseEvent(QMouseEvent*); void mouseMoveEvent(QMouseEvent*); }; #endif qmmp-0.7.4/src/plugins/Ui/skinned/eqwidget.h0000664000175000017500000000603512256224735017472 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EQWIDGET_H #define EQWIDGET_H #include "pixmapwidget.h" #include /** @author Ilya Kotov */ class QMenu; class Skin; class EqTitleBar; class EqSlider; class ToggleButton; class EQGraph; class Button; class EQPreset; class PlayListItem; class SoundCore; class EqWidget : public PixmapWidget { Q_OBJECT public: EqWidget(QWidget *parent = 0); ~EqWidget(); /*! * necessary for auto-load presets */ void loadPreset(const QString &name); void setMimimalMode(bool b = true); signals: void closed(); private slots: void updateSkin(); void readEq(); void writeEq(); void showPresetsMenu(); void reset(); void showEditor(); void savePreset(); void saveAutoPreset(); void setPreset(EQPreset*); void deletePreset(EQPreset*); void importWinampEQF(); private: void updatePositions(); void readSettings(); void writeSettings(); void createActions(); void updateMask(); EQPreset *findPreset(const QString &name); //events virtual void keyPressEvent (QKeyEvent *); virtual void changeEvent(QEvent*); virtual void closeEvent(QCloseEvent*); #ifdef Q_WS_X11 virtual bool event (QEvent *event); #endif Skin *m_skin; EqTitleBar *m_titleBar; EqSlider *m_preamp; Button *m_presetButton; QList m_sliders; QPoint m_pos; ToggleButton *m_on; ToggleButton *m_autoButton; EQGraph *m_eqg; QMenu *m_presetsMenu; QList m_presets; QList m_autoPresets; QString m_autoName; bool m_shaded; }; #endif qmmp-0.7.4/src/plugins/Effect/0000775000175000017500000000000012256224735014670 5ustar useruserqmmp-0.7.4/src/plugins/Effect/bs2b/0000775000175000017500000000000012256224735015520 5ustar useruserqmmp-0.7.4/src/plugins/Effect/bs2b/bs2bplugin.cpp0000664000175000017500000000624712256224735020304 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * Copyright (C) 2009 by Sebastian Pipping * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "bs2bplugin.h" Bs2bPlugin *Bs2bPlugin::m_instance = 0; Bs2bPlugin::Bs2bPlugin() : Effect() { m_instance = this; m_bs2b_handler = bs2b_open(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); bs2b_set_level(m_bs2b_handler, settings.value("bs2b/level", BS2B_DEFAULT_CLEVEL).toUInt()); m_chan = 0; } Bs2bPlugin::~Bs2bPlugin() { m_instance = 0; bs2b_close(m_bs2b_handler); } #define CASE_BS2B(bitsPerSample, dataType, functionToCall, samples, out_data) \ case bitsPerSample: \ { \ dataType * data = reinterpret_cast(out_data); \ functionToCall(m_bs2b_handler, data, samples); \ } \ break; void Bs2bPlugin::applyEffect(Buffer *b) { if(m_chan != 2) return; uint samples = b->nbytes / audioParameters().sampleSize() / 2; m_mutex.lock(); switch (format()) { CASE_BS2B(Qmmp::PCM_S8, int8_t, bs2b_cross_feed_s8, samples, b->data) CASE_BS2B(Qmmp::PCM_S16LE, int16_t, bs2b_cross_feed_s16le, samples, b->data) //CASE_BS2B(Qmmp::PCM_S24LE, bs2b_int24_t, bs2b_cross_feed_s24le, samples, out_data) CASE_BS2B(Qmmp::PCM_S32LE, int32_t, bs2b_cross_feed_s32le, samples, b->data) default: ; // noop } m_mutex.unlock(); } void Bs2bPlugin::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_chan = chan; Effect::configure(freq, chan, format); bs2b_set_srate(m_bs2b_handler,freq); } void Bs2bPlugin::setCrossfeedLevel(uint32_t level) { m_mutex.lock(); bs2b_set_level(m_bs2b_handler, level); m_mutex.unlock(); } Bs2bPlugin* Bs2bPlugin::instance() { return m_instance; } qmmp-0.7.4/src/plugins/Effect/bs2b/CMakeLists.txt0000664000175000017500000000313412256224735020261 0ustar useruserproject(libbs2b) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libbs2b_SRCS bs2bplugin.cpp settingsdialog.cpp effectbs2bfactory.cpp ) SET(libbs2b_HDRS bs2bplugin.h ) SET(libbs2b_MOC_HDRS settingsdialog.h effectbs2bfactory.h ) SET(libbs2b_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libbs2b_RCC_SRCS ${libbs2b_RCCS}) QT4_WRAP_CPP(libbs2b_MOC_SRCS ${libbs2b_MOC_HDRS}) pkg_search_module(BS2B libbs2b>=3.0.0) include_directories(${BS2B_INCLUDE_DIRS}) link_directories(${BS2B_LIBRARY_DIRS}) ADD_DEFINITIONS(${BS2B_CFLAGS}) # user interface SET(libbs2b_UIS settingsdialog.ui ) QT4_WRAP_UI(libbs2b_UIS_H ${libbs2b_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(BS2B_FOUND) ADD_LIBRARY(bs2b MODULE ${libbs2b_SRCS} ${libbs2b_MOC_SRCS} ${libbs2b_UIS_H} ${libbs2b_RCC_SRCS} ${libbs2b_HDRS}) add_dependencies(bs2b qmmp) target_link_libraries(bs2b ${QT_LIBRARIES} -lqmmp ${BS2B_LDFLAGS}) install(TARGETS bs2b DESTINATION ${LIB_DIR}/qmmp/Effect) ENDIF(BS2B_FOUND) qmmp-0.7.4/src/plugins/Effect/bs2b/settingsdialog.cpp0000664000175000017500000000700312256224735021244 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "bs2bplugin.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); ui.feedSlider->setRange(BS2B_MINFEED, BS2B_MAXFEED); ui.freqSlider->setRange(BS2B_MINFCUT, BS2B_MAXFCUT); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_level = settings.value("bs2b/level", BS2B_DEFAULT_CLEVEL).toUInt(); ui.feedSlider->setValue(m_level >> 16); ui.freqSlider->setValue(m_level & 0xffff); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("bs2b/level", ui.feedSlider->value() << 16 | ui.freqSlider->value()); QDialog::accept(); } void SettingsDialog::SettingsDialog::reject() { if (Bs2bPlugin::instance()) //restore crossfeed settings Bs2bPlugin::instance()->setCrossfeedLevel(m_level); QDialog::reject(); } void SettingsDialog::on_freqSlider_valueChanged (int value) { ui.freqLabel->setText(QString(tr("%1 Hz, %2 us")).arg(value).arg(bs2b_level_delay(value))); if (Bs2bPlugin::instance()) Bs2bPlugin::instance()->setCrossfeedLevel(ui.feedSlider->value() << 16 | ui.freqSlider->value()); } void SettingsDialog::on_feedSlider_valueChanged (int value) { ui.feedLabel->setText(QString(tr("%1 dB")).arg((double)value/10)); if (Bs2bPlugin::instance()) Bs2bPlugin::instance()->setCrossfeedLevel(ui.feedSlider->value() << 16 | ui.freqSlider->value()); } void SettingsDialog::on_defaultButton_pressed() { ui.feedSlider->setValue(BS2B_DEFAULT_CLEVEL >> 16); ui.freqSlider->setValue(BS2B_DEFAULT_CLEVEL & 0xffff); } void SettingsDialog::on_cmButton_pressed () { ui.feedSlider->setValue(BS2B_CMOY_CLEVEL >> 16); ui.freqSlider->setValue(BS2B_CMOY_CLEVEL & 0xffff); } void SettingsDialog::on_jmButton_pressed () { ui.feedSlider->setValue(BS2B_JMEIER_CLEVEL >> 16); ui.freqSlider->setValue(BS2B_JMEIER_CLEVEL & 0xffff); } qmmp-0.7.4/src/plugins/Effect/bs2b/bs2bplugin.h0000664000175000017500000000374612256224735017752 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef BS2BPLUGIN_H #define BS2BPLUGIN_H #include #include #include /** @author Ilya Kotov */ class Bs2bPlugin : public Effect { public: Bs2bPlugin(); virtual ~Bs2bPlugin(); void applyEffect(Buffer *b); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); void setCrossfeedLevel(uint32_t level); static Bs2bPlugin* instance(); private: t_bs2bdp m_bs2b_handler; int m_chan; QMutex m_mutex; static Bs2bPlugin *m_instance; }; #endif qmmp-0.7.4/src/plugins/Effect/bs2b/effectbs2bfactory.h0000664000175000017500000000366612256224735021301 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTBS2BFACTORY_H #define EFFECTBS2BFACTORY_H #include #include #include /** @author Ilya Kotov */ class EffectBs2bFactory : public QObject, public EffectFactory { Q_OBJECT Q_INTERFACES(EffectFactory); public: const EffectProperties properties() const; Effect *create(); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Effect/bs2b/settingsdialog.ui0000664000175000017500000000737112256224735021107 0ustar useruser SettingsDialog 0 0 383 123 BS2B Plugin Settings 6 9 6 6 Crossfeed level Qt::Horizontal - Qt::Horizontal - Default C.Moy J. Meier Qt::Horizontal 142 20 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 76 91 88 buttonBox rejected() SettingsDialog reject() 326 78 139 60 qmmp-0.7.4/src/plugins/Effect/bs2b/translations/0000775000175000017500000000000012256224735020241 5ustar useruserqmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_zh_CN.ts0000664000175000017500000000662312256224735024107 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B 插件 About BS2B Effect Plugin 关于 BS2B 特效插件 This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. 此版本的 Qmmp 插件基于 Boris Mikhaylov 的耳机 DSP 特效 "Bauer stereophonic-to-binaural", 精简的 bs2b 。 Visit %1 for more details 访问 %1 了解更多情况 Compiled against libbs2b-%1 编译依赖 libbs2b-%1 Developers: 开发者: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings BS2B 插件设置 Crossfeed level 串扰水平 - Default 默认 C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_zh_TW.ts0000664000175000017500000000661712256224735024144 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B 插件 About BS2B Effect Plugin 關於BS2B 特效插件 This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. 此版本的 Qmmp 插件基於 Boris Mikhaylov 的耳機 DSP 特效 "Bauer stereophonic-to-binaural", 簡單的 bs2b. Visit %1 for more details 訪問 %1 了解更多內容 Compiled against libbs2b-%1 編譯依賴 libbs2b-%1 Developers: 開發者: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings BS2B 插件設置 Crossfeed level 串擾水平 - Default 預設 C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_gl_ES.ts0000664000175000017500000000660612256224735024100 0ustar useruser EffectBs2bFactory BS2B Plugin Engadido BS2B About BS2B Effect Plugin Sobre o engadido de efecto BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Este engadido é a versión de Qmmp do efecto headphone DSP de Boris Mikhaylov "Bauer stereophonic-to-binaural", abreviado bs2b. Visit %1 for more details Visita %1 para máis detalles Compiled against libbs2b-%1 Compilado con libbs2b-%1 Developers: Desenvolvedores: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Opcións do engadido BS2B Crossfeed level Nivel de alimentación cruzada - - Default Por defecto C.Moy C. Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/translations.qrc0000664000175000017500000000142512256224735023473 0ustar useruser bs2b_plugin_ru.qm bs2b_plugin_uk_UA.qm bs2b_plugin_zh_CN.qm bs2b_plugin_zh_TW.qm bs2b_plugin_tr.qm bs2b_plugin_cs.qm bs2b_plugin_pt_BR.qm bs2b_plugin_de.qm bs2b_plugin_pl_PL.qm bs2b_plugin_fr.qm bs2b_plugin_it.qm bs2b_plugin_kk.qm bs2b_plugin_lt.qm bs2b_plugin_hu.qm bs2b_plugin_nl.qm bs2b_plugin_ja.qm bs2b_plugin_sk.qm bs2b_plugin_es.qm bs2b_plugin_he.qm bs2b_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_de.ts0000664000175000017500000000654512256224735023501 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B-Modul About BS2B Effect Plugin Über BS2B-Effekt-Modul This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Das ist das Qmmp-Modul von Boris Mikhaylovs Kopfhörer-DSP-Effekt „Bauer stereophonic-to-binaural”, abgekürzt bs2b. Visit %1 for more details Besuchen Sie %1 für mehr Informationen Compiled against libbs2b-%1 Kompiliert gegen libbs2b-%1 Developers: Entwickler: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Einstellungen BS2B-Modul Crossfeed level Crossfeed-Stärke - - Default Voreinstellung C.Moy C.Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_cs.ts0000664000175000017500000000651712256224735023515 0ustar useruser EffectBs2bFactory BS2B Plugin Modul BS2B About BS2B Effect Plugin O efektovém modulu BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Toto je modul Qmmp pro digitální efekt Borise Michajlova „Bauer stereophonic-to-binaural“, zkracovaný bs2b. Visit %1 for more details Pro podrobnosti navštivte %1 Compiled against libbs2b-%1 Sestaveno s libbs2b-%1 Developers: Vývojáři: Ilya Kotov Ilja Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Nastavení modulu BS2B Crossfeed level Úrovně přeslechu - - Default Výchozí C.Moy C. Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 µs %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_es.ts0000664000175000017500000000661012256224735023511 0ustar useruser EffectBs2bFactory BS2B Plugin Módulo BS2B About BS2B Effect Plugin Sobre el módulo de efectos BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Esta es la versión para Qmmp del módulo de efecto auricular DSP de Boris Mikhaylov "Bauer stereophonic-to-binaural", abreviado bs2b. Visit %1 for more details Visita %1 para más detalles Compiled against libbs2b-%1 Compilado con libbs2b-%1 Developers: Desarrolladores: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Configuración del módulo BS2B Crossfeed level Nivel de alimentación - - Default Predeterminado C.Moy C.Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_fr.ts0000664000175000017500000000645612256224735023521 0ustar useruser EffectBs2bFactory BS2B Plugin About BS2B Effect Plugin This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Visit %1 for more details Compiled against libbs2b-%1 Developers: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_he.ts0000664000175000017500000000666512256224735023510 0ustar useruser EffectBs2bFactory BS2B Plugin תוספת BS2B About BS2B Effect Plugin אודות תוספת אפקט BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. זוהי גירסת תוספת של אפקט אוזניית DSP של Boris Mikhaylov "‫Bauer stereophonic-to-binaural", ובקיצור bs2b. Visit %1 for more details ניתן לבקר אצל %1 למידע נוסף Compiled against libbs2b-%1 הודרה כנגד libbs2b-%1 Developers: מפתחים: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings הגדרות תוספת BS2B Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB %1 דציבל qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_hu.ts0000664000175000017500000000645612256224735023526 0ustar useruser EffectBs2bFactory BS2B Plugin About BS2B Effect Plugin This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Visit %1 for more details Compiled against libbs2b-%1 Developers: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_ja.ts0000664000175000017500000000705112256224735023474 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B プラグイン About BS2B Effect Plugin BS2B 効果プラグインについて This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. これは "Bauer stereophonic-to-binaural" (BS2B) に基づき Борис Михайлов (Boris Mikhaylov) 氏が作成したヘッドフォン用 DSP 効果ライブラリを利用するための QMMP 用プラグインです。 Visit %1 for more details 詳しい情報は %1 でご覧ください Compiled against libbs2b-%1 libbs2b-%1 対応でコンパイル Developers: 開発者: Ilya Kotov Илья Котов (Ilya Kotov) Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings BS2B プラグイン設定 Crossfeed level クロスフィード レベル - - Default 初期設定値 C.Moy C.Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_it.ts0000664000175000017500000000656612256224735023530 0ustar useruser EffectBs2bFactory BS2B Plugin Modulo BS2B About BS2B Effect Plugin Info sul modulo effetti BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Versione per Qmmp del modulo headphone DSP effect "Bauer stereophonic-to-binaural" di Boris Mikhaylov, abbreviato in bs2b Visit %1 for more details Visita %1 per maggiori informazioni Compiled against libbs2b-%1 Compilato con libbs2b-%1 Developers: Sviluppatori: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Impostazioni del modulo BS2B Crossfeed level livello di fuoco incrociato - - Default Default C.Moy C.Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_kk.ts0000664000175000017500000000645612256224735023517 0ustar useruser EffectBs2bFactory BS2B Plugin About BS2B Effect Plugin This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Visit %1 for more details Compiled against libbs2b-%1 Developers: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_lt.ts0000664000175000017500000000653712256224735023531 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B įskiepis About BS2B Effect Plugin Apie BS2B įskiepį This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Boriso Mikhaylovo ausinių DSP efektas "Bauer stereophonic-to-binaural", sutrumpinimas bs2b. Visit %1 for more details Daugiau informacijos %1 Compiled against libbs2b-%1 Surinkta iš libbs2b-%1 Developers: Sukūrė: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings BS2B įskiepio nustatymai Crossfeed level Suliejimo nustatymai - Default Numatytas C.Moy C.Moy J. Meier J. Meier %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_nl.ts0000664000175000017500000000656412256224735023523 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B Module About BS2B Effect Plugin Over de BS2B Effecten Module This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Dit is de Qmmp module versie van Boris Mikhaylov's "Headset DSP effect" Bauer stereofonisch-naar-'binaural', afgekort bs2b. Visit %1 for more details Bezoek %1 voor meer details Compiled against libbs2b-%1 Gecompileerd tegen libbs2b-%1 Developers: Ontwikkelaars: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings BS2B Module Instellingen Crossfeed level Niveau van overloop (crossfade) - Default Standaard C.Moy J. Meier %1 Hz, %2 us %1 Hz, %2 µs %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_pl.ts0000664000175000017500000000651512256224735023521 0ustar useruser EffectBs2bFactory BS2B Plugin Wtyczka BS2B About BS2B Effect Plugin O wtyczce BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Jest to wersja wtyczki efektu DSP dla słuchawek autorstwa Boris Mikhaylov'a "Bauer stereophonic-to-binaural", w skrócie bs2b. Visit %1 for more details Odwiedź %1 po więcej informacji Compiled against libbs2b-%1 Skompilowane z biblioteką w wersji-%1 Developers: Autorzy: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Ustawienia wtyczki BS2B Crossfeed level Poziom Crossfeed - Default Domyślny C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_ru.ts0000664000175000017500000000706212256224735023532 0ustar useruser EffectBs2bFactory BS2B Plugin Модуль BS2B About BS2B Effect Plugin О модуле эффектов BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Этот модуль добавляет эффект "Bauer stereophonic-to-binaural" (сокращённо bs2b) Бориса Михайлова. Visit %1 for more details Для получения информации посетите %1 Compiled against libbs2b-%1 Собрано с libbs2b-%1 Developers: Разработчики: Ilya Kotov Илья Котов Sebastian Pipping SettingsDialog BS2B Plugin Settings Настройки модуля BS2B Crossfeed level Уровень взаимосмешения - Default По умолчанию C.Moy J. Meier %1 Hz, %2 us %1 Гц, %2 мкс %1 dB %1 дБ qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_sk.ts0000664000175000017500000000645612256224735023527 0ustar useruser EffectBs2bFactory BS2B Plugin About BS2B Effect Plugin This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Visit %1 for more details Compiled against libbs2b-%1 Developers: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_tr.ts0000664000175000017500000000660312256224735023531 0ustar useruser EffectBs2bFactory BS2B Plugin BS2B Eklentisi About BS2B Effect Plugin BS2B Efekt Eklentisi Hakkında This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Bu eklenti Boris Mikhaylov'un "Bauer-stereophonic-to-binaural", kısaca bs2b, kulaklık DSP efektinin Qmmp sürümüdür. Visit %1 for more details Detaylar için %1 adresini ziyaret edin Compiled against libbs2b-%1 libbs2b-%1 ile derlenmiştir Developers: Geliştiriciler: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog %1 Hz, %2 us %1 Hz, %2 us %1 dB %1 dB BS2B Plugin Settings BS2B Eklenti Ayarları Crossfeed level Crossfeed seviyesi - - Default Öntanımlı C.Moy C.Moy J. Meier J. Meier qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_uk_UA.ts0000664000175000017500000000706212256224735024110 0ustar useruser EffectBs2bFactory BS2B Plugin Модуль BS2B About BS2B Effect Plugin Про модуль ефектів BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Цей модуль додає ефект "Bauer stereophonic-to-binaural" (скорочено bs2b) Бориса Михайлова. Visit %1 for more details Для отримання інформації відвідайте %1 Compiled against libbs2b-%1 Зібрано з libbs2b-%1 Developers: Розробники: Ilya Kotov Ілля Котов <forkotov02@hotmail.ru> Sebastian Pipping Sebastian Pipping <sebastian@pipping.org> SettingsDialog BS2B Plugin Settings Налаштування модуля BS2B Crossfeed level Рівень взаємозмішування - Default За умовчанням C.Moy J. Meier %1 Hz, %2 us %1 Гц, %2 мкс %1 dB %1 дБ qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_pl_PL.ts0000664000175000017500000000651512256224735024114 0ustar useruser EffectBs2bFactory BS2B Plugin Wtyczka BS2B About BS2B Effect Plugin O wtyczce BS2B This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Jest to wersja wtyczki efektu DSP dla słuchawek autorstwa Boris Mikhaylov'a "Bauer stereophonic-to-binaural", w skrócie bs2b. Visit %1 for more details Odwiedź %1 po więcej informacji Compiled against libbs2b-%1 Skompilowane z biblioteką w wersji-%1 Developers: Autorzy: Ilya Kotov Ilya Kotov Sebastian Pipping Sebastian Pipping SettingsDialog BS2B Plugin Settings Ustawienia wtyczki BS2B Crossfeed level Poziom Crossfeed - Default Domyślny C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/translations/bs2b_plugin_pt_BR.ts0000664000175000017500000000645612256224735024120 0ustar useruser EffectBs2bFactory BS2B Plugin About BS2B Effect Plugin This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP effect "Bauer stereophonic-to-binaural", abbreviated bs2b. Visit %1 for more details Compiled against libbs2b-%1 Developers: Ilya Kotov Sebastian Pipping SettingsDialog BS2B Plugin Settings Crossfeed level - Default C.Moy J. Meier %1 Hz, %2 us %1 dB qmmp-0.7.4/src/plugins/Effect/bs2b/bs2b.pro0000664000175000017500000000257012256224735017076 0ustar useruserinclude(../../plugins.pri) HEADERS += bs2bplugin.h \ effectbs2bfactory.h \ settingsdialog.h SOURCES += bs2bplugin.cpp \ effectbs2bfactory.cpp \ settingsdialog.cpp TARGET =$$PLUGINS_PREFIX/Effect/bs2b INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/bs2b_plugin_cs.ts \ translations/bs2b_plugin_de.ts \ translations/bs2b_plugin_zh_CN.ts \ translations/bs2b_plugin_zh_TW.ts \ translations/bs2b_plugin_uk_UA.ts \ translations/bs2b_plugin_pl.ts \ translations/bs2b_plugin_ru.ts \ translations/bs2b_plugin_it.ts \ translations/bs2b_plugin_tr.ts \ translations/bs2b_plugin_lt.ts \ translations/bs2b_plugin_nl.ts \ translations/bs2b_plugin_ja.ts \ translations/bs2b_plugin_es.ts RESOURCES = translations/translations.qrc FORMS += settingsdialog.ui unix { isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Effect INSTALLS += target PKGCONFIG += libbs2b LIBS += -lqmmp -L/usr/lib -I/usr/include QMAKE_CLEAN =$$PLUGINS_PREFIX/Effect/libbs2b.so } win32 { QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lbs2b } qmmp-0.7.4/src/plugins/Effect/bs2b/effectbs2bfactory.cpp0000664000175000017500000000623612256224735021630 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "effectbs2bfactory.h" #include "settingsdialog.h" #include "bs2bplugin.h" const EffectProperties EffectBs2bFactory::properties() const { EffectProperties properties; properties.name = tr("BS2B Plugin"); properties.shortName = "bs2b"; properties.hasSettings = true; properties.hasAbout = true; return properties; } Effect *EffectBs2bFactory::create() { return new Bs2bPlugin(); } void EffectBs2bFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s ->show(); } void EffectBs2bFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About BS2B Effect Plugin"), "

"+tr("This is the Qmmp plugin version of Boris Mikhaylov's headphone DSP " "effect \"Bauer stereophonic-to-binaural\", abbreviated bs2b.")+"

"+ QString("

" + tr("Visit %1 for more details")+"

") .arg("http://bs2b.sourceforge.net/")+ QString("

" + tr("Compiled against libbs2b-%1") + "

").arg(BS2B_VERSION_STR)+ "

"+tr("Developers:")+"
"+ tr("Ilya Kotov") + " <forkotov02@hotmail.ru>"+"
"+ tr("Sebastian Pipping") + " <sebastian@pipping.org>"+"

"); } QTranslator *EffectBs2bFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/bs2b_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(bs2b,EffectBs2bFactory) qmmp-0.7.4/src/plugins/Effect/bs2b/settingsdialog.h0000664000175000017500000000410712256224735020713 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); virtual void reject(); private slots: void on_freqSlider_valueChanged (int value); void on_feedSlider_valueChanged (int value); void on_defaultButton_pressed(); void on_cmButton_pressed (); void on_jmButton_pressed (); private: Ui::SettingsDialog ui; uint32_t m_level; }; #endif qmmp-0.7.4/src/plugins/Effect/srconverter/0000775000175000017500000000000012256224735017244 5ustar useruserqmmp-0.7.4/src/plugins/Effect/srconverter/CMakeLists.txt0000664000175000017500000000345312256224735022011 0ustar useruserproject(libsrconverter) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) pkg_check_modules(SAMPLERATE samplerate) include_directories(${SAMPLERATE_INCLUDE_DIRS}) link_directories(${SAMPLERATE_LIBRARY_DIRS}) ADD_DEFINITIONS(${SAMPLERATE_CFLAGS}) SET(libsrconverter_SRCS srconverter.cpp settingsdialog.cpp effectsrconverterfactory.cpp ) SET(libsrconverter_HDRS srconverter.h ) SET(libsrconverter_MOC_HDRS settingsdialog.h effectsrconverterfactory.h ) SET(libsrconverter_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libsrconverter_RCC_SRCS ${libsrconverter_RCCS}) QT4_WRAP_CPP(libsrconverter_MOC_SRCS ${libsrconverter_MOC_HDRS}) # user interface SET(libsrconverter_UIS settingsdialog.ui ) QT4_WRAP_UI(libsrconverter_UIS_H ${libsrconverter_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(SAMPLERATE_FOUND) ADD_LIBRARY(srconverter MODULE ${libsrconverter_SRCS} ${libsrconverter_MOC_SRCS} ${libsrconverter_UIS_H} ${libsrconverter_RCC_SRCS} ${libsrconverter_HDRS}) add_dependencies(srconverter qmmp) target_link_libraries(srconverter ${QT_LIBRARIES} -lqmmp ${SAMPLERATE_LDFLAGS}) install(TARGETS srconverter DESTINATION ${LIB_DIR}/qmmp/Effect) ENDIF(SAMPLERATE_FOUND) qmmp-0.7.4/src/plugins/Effect/srconverter/srconverter.cpp0000664000175000017500000001241012256224735022322 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "srconverter.h" SRConverter::SRConverter() : Effect() { int converter_type_array[] = {SRC_SINC_BEST_QUALITY, SRC_SINC_MEDIUM_QUALITY, SRC_SINC_FASTEST, SRC_ZERO_ORDER_HOLD, SRC_LINEAR}; m_src_state = 0; m_srcError = 0; m_sz = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_overSamplingFs = settings.value("SRC/sample_rate",48000).toInt(); m_converter_type = converter_type_array[settings.value("SRC/engine", 0).toInt()]; } SRConverter::~SRConverter() { freeSRC(); m_src_data.data_in = 0; m_src_data.data_out = 0; m_src_data.end_of_input = 0; m_src_data.input_frames = 0; m_src_data.output_frames = 0; m_sz = 0; } void SRConverter::applyEffect(Buffer *b) { if (m_src_state && b->nbytes > 0) { m_src_data.end_of_input = 0; m_src_data.input_frames = b->nbytes / m_sz / channels(); m_src_data.data_in = new float [m_src_data.input_frames * channels()]; m_src_data.output_frames = m_src_data.src_ratio * m_src_data.input_frames + 1; m_src_data.data_out = new float [m_src_data.output_frames * channels()]; if(format() == Qmmp::PCM_S16LE) { src_short_to_float_array((short*) b->data, m_src_data.data_in, m_src_data.input_frames * channels()); } else { qint32 *data = (int *) b->data; if(format() == Qmmp::PCM_S24LE) { uint samples = b->size >> 2; for(unsigned int i = 0; i < samples; ++i) { if(data[i] & 0x800000) data[i] |= 0xff000000; } } src_int_to_float_array((int*) b->data, m_src_data.data_in, m_src_data.input_frames * channels()); } if ((m_srcError = src_process(m_src_state, &m_src_data)) > 0) { qWarning("SRConverter: src_process(): %s\n", src_strerror(m_srcError)); } else { uchar *out_data = new uchar[m_src_data.output_frames_gen * channels() * m_sz];; if(format() == Qmmp::PCM_S16LE) { src_float_to_short_array(m_src_data.data_out, (short*)out_data, m_src_data.output_frames_gen * channels()); } else { src_float_to_int_array(m_src_data.data_out, (int*)out_data, m_src_data.output_frames_gen * channels()); } b->nbytes = m_src_data.output_frames_gen * channels() * m_sz; if(b->nbytes > b->size) { delete [] b->data; b->data = out_data; } else { memcpy(b->data, out_data, b->nbytes); delete [] out_data; } } delete [] m_src_data.data_in; delete [] m_src_data.data_out; } } void SRConverter::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { freeSRC(); if(freq != m_overSamplingFs && format != Qmmp::PCM_S8) { m_src_state = src_new(m_converter_type, chan, &m_srcError); if (m_src_state) { m_src_data.src_ratio = (float)m_overSamplingFs/(float)freq; src_set_ratio(m_src_state, m_src_data.src_ratio); } else qDebug("SRConverter: src_new(): %s", src_strerror(m_srcError)); } Effect::configure(m_overSamplingFs, chan, format); m_sz = audioParameters().sampleSize(); } void SRConverter::freeSRC() { if (m_src_state) { src_reset(m_src_state); src_delete(m_src_state); } m_src_state = 0; } qmmp-0.7.4/src/plugins/Effect/srconverter/srconverter.pro0000664000175000017500000000254512256224735022350 0ustar useruserinclude(../../plugins.pri) HEADERS += srconverter.h \ effectsrconverterfactory.h \ settingsdialog.h SOURCES += srconverter.cpp \ effectsrconverterfactory.cpp \ settingsdialog.cpp TARGET=$$PLUGINS_PREFIX/Effect/srconverter QMAKE_CLEAN =$$PLUGINS_PREFIX/Effect/libsrconverter.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig PKGCONFIG += samplerate TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp -L/usr/lib -I/usr/include TRANSLATIONS = translations/srconverter_plugin_cs.ts \ translations/srconverter_plugin_de.ts \ translations/srconverter_plugin_zh_CN.ts \ translations/srconverter_plugin_zh_TW.ts \ translations/srconverter_plugin_uk_UA.ts \ translations/srconverter_plugin_pl.ts \ translations/srconverter_plugin_ru.ts \ translations/srconverter_plugin_it.ts \ translations/srconverter_plugin_tr.ts \ translations/srconverter_plugin_lt.ts \ translations/srconverter_plugin_nl.ts \ translations/srconverter_plugin_ja.ts \ translations/srconverter_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Effect INSTALLS += target FORMS += settingsdialog.ui qmmp-0.7.4/src/plugins/Effect/srconverter/settingsdialog.cpp0000664000175000017500000000423312256224735022772 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); ui.srSpinBox->setValue(settings.value("SRC/sample_rate",48000).toInt()); ui.engineComboBox->setCurrentIndex(settings.value("SRC/engine", 0).toInt()); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("SRC/sample_rate",ui.srSpinBox->value()); settings.setValue("SRC/engine", ui.engineComboBox->currentIndex()); QDialog::accept(); } qmmp-0.7.4/src/plugins/Effect/srconverter/settingsdialog.ui0000664000175000017500000000635712256224735022636 0ustar useruser SettingsDialog 0 0 338 99 Sample Rate Converter Plugin Settings Sample Rate (Hz): 96000 100 48000 Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation Qt::Horizontal 228 24 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 76 91 88 buttonBox rejected() SettingsDialog reject() 326 78 139 60 qmmp-0.7.4/src/plugins/Effect/srconverter/translations/0000775000175000017500000000000012256224735021765 5ustar useruserqmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_zh_TW.ts0000664000175000017500000000521712256224735027407 0ustar useruser EffectSRConverterFactory SRC Plugin SRC 插件 About Sample Rate Converter Plugin 關於取樣率轉換插件 Qmmp Sample Rate Converter Plugin Qmmp 取樣率轉換插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings 取樣率轉換插件設定 Sample Rate (Hz): 取樣率 (Hz): Interpolation Engine: 內插引擎: Best Sinc Interpolation 最好 SINC 插入 (高品質) Medium Sinc Interpolation 一般 SINC 插入 (中品質) Fastest Sinc Interpolation 最快 SINC 插入 (低品質) ZOH Interpolation 零階保持插入 (ZOH) Linear Interpolation 線性插入 qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_de.ts0000664000175000017500000000521712256224735026744 0ustar useruser EffectSRConverterFactory SRC Plugin SRC-Modul About Sample Rate Converter Plugin Über „Sample Rate Converter“-Modul Qmmp Sample Rate Converter Plugin Qmmp „Sample Rate Converter“-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Einstellungen „Sample Rate Converter“-Modul Sample Rate (Hz): Abtastrate (Hz): Interpolation Engine: Interpolation: Best Sinc Interpolation Sinc (hohe Qualität) Medium Sinc Interpolation Sinc (mittlere Qualität) Fastest Sinc Interpolation Sinc (schnell) ZOH Interpolation Zero-Order-Hold (ZOH) Linear Interpolation Linear qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_cs.ts0000664000175000017500000000525112256224735026757 0ustar useruser EffectSRConverterFactory SRC Plugin Modul SRC About Sample Rate Converter Plugin O modulu SRC Qmmp Sample Rate Converter Plugin Modul Qmmp pro konverzi vzorkovací frekvence Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Nastavení modulu SRC Sample Rate (Hz): Vzorkovací frekvence (Hz): Interpolation Engine: Způsob interpolace: Best Sinc Interpolation Nejlepší interpolace pomocí sinc Medium Sinc Interpolation Střední interpolace pomocí sinc Fastest Sinc Interpolation Nejrychlejší interpolace pomocí sinc ZOH Interpolation Interpolace ZOH Linear Interpolation Lineární interpolace qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_es.ts0000664000175000017500000000532312256224735026761 0ustar useruser EffectSRConverterFactory SRC Plugin Módulo SRC About Sample Rate Converter Plugin Acerca del módulo de conversión de frecuencia Qmmp Sample Rate Converter Plugin Módulo de conversión de frecuencia para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Configuración del módulo de conversión de frecuencia Sample Rate (Hz): Frecuencia (Hz): Interpolation Engine: Motor de interpolación: Best Sinc Interpolation Interpolación sinc mejor Medium Sinc Interpolation Interpolación sinc media Fastest Sinc Interpolation Interpolación sinc rápida ZOH Interpolation Interpolación ZOH Linear Interpolation Interpolación linear qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_fr.ts0000664000175000017500000000507612256224735026766 0ustar useruser EffectSRConverterFactory SRC Plugin About Sample Rate Converter Plugin Qmmp Sample Rate Converter Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate (Hz): Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_he.ts0000664000175000017500000000552712256224735026754 0ustar useruser EffectSRConverterFactory SRC Plugin תוספת SRC About Sample Rate Converter Plugin אודות תוספת ממיר שיעור דגימה Qmmp Sample Rate Converter Plugin תוספת ממיר שיעור דגימה Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings הגדרות תוספת ממיר שיעור דגימה Sample Rate (Hz): שיעור דגימה (הרץ): Interpolation Engine: מנוע אינטרפולציה: Best Sinc Interpolation אינטרפולציה Sinc הטובה ביותר Medium Sinc Interpolation אינטרפולציה Sinc בינונית Fastest Sinc Interpolation אינטרפולציה Sinc הכי מהירה ZOH Interpolation אינטרפולציית ZOH Linear Interpolation אינטרפולציה לינארית qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_hu.ts0000664000175000017500000000507612256224735026773 0ustar useruser EffectSRConverterFactory SRC Plugin About Sample Rate Converter Plugin Qmmp Sample Rate Converter Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate (Hz): Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_ja.ts0000664000175000017500000000534612256224735026751 0ustar useruser EffectSRConverterFactory SRC Plugin SRC プラグイン About Sample Rate Converter Plugin サンプルレートコンバータープラグインについて Qmmp Sample Rate Converter Plugin QMMP サンプルレートコンバータープラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings サンプルレートコンバーターの設定 Sample Rate (Hz): サンプルレート (Hz): Interpolation Engine: 補間エンジン: Best Sinc Interpolation 最良 Sinc 補間 Medium Sinc Interpolation 中庸 Sinc 補間 Fastest Sinc Interpolation 最速 Sinc 補間 ZOH Interpolation ZOH 補間 Linear Interpolation 線形補間 qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_it.ts0000664000175000017500000000520512256224735026765 0ustar useruser EffectSRConverterFactory SRC Plugin Modulo SRC About Sample Rate Converter Plugin Info sul modulo di conversione campionamento Qmmp Sample Rate Converter Plugin Modulo di conversione campionamento Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Impostazioni del modulo di conversione campionamento Sample Rate (Hz): Campionamento (Hz): Interpolation Engine: Interpolazione: Best Sinc Interpolation Migliore Medium Sinc Interpolation Media Fastest Sinc Interpolation Veloce ZOH Interpolation Interpolazione Zero-Order-Hold (ZOH) Linear Interpolation Lineare qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_kk.ts0000664000175000017500000000507612256224735026764 0ustar useruser EffectSRConverterFactory SRC Plugin About Sample Rate Converter Plugin Qmmp Sample Rate Converter Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate (Hz): Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_lt.ts0000664000175000017500000000523712256224735026775 0ustar useruser EffectSRConverterFactory SRC Plugin SRC įskiepis About Sample Rate Converter Plugin Apie SRC įskiepį Qmmp Sample Rate Converter Plugin Qmmp SRC įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukurta: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings SRC įskiepio nustatymai Sample Rate (Hz): Diskretizacijos dažnis (Hz): Interpolation Engine: Interpoliacijos variklis: Best Sinc Interpolation Geriausias interpoliacijos lygis Medium Sinc Interpolation Vidutinis interpoliacijos lygis Fastest Sinc Interpolation Greičiausias interpoliacijos lygis ZOH Interpolation ZOH interpoliacija Linear Interpolation Linijinė interpoliacija qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_nl.ts0000664000175000017500000000525012256224735026762 0ustar useruser EffectSRConverterFactory SRC Plugin SRC Module About Sample Rate Converter Plugin Over de Sample Rate Converter Module Qmmp Sample Rate Converter Plugin Sample Rate Converter Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate Converter Module Instellingen Sample Rate (Hz): Sample frequentie (Hz): Interpolation Engine: Interpolatie Engine: Best Sinc Interpolation Beste Sinc Interpolatie Medium Sinc Interpolation Medium Sinc Interpolatie Fastest Sinc Interpolation Snelste Sinc Interpolatie ZOH Interpolation ZOH Interpolatie Linear Interpolation Lineaire Interpolatie qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_pl.ts0000664000175000017500000000523012256224735026762 0ustar useruser EffectSRConverterFactory SRC Plugin Wtyczka SRC About Sample Rate Converter Plugin O wtyczce Sample Rate Converter Qmmp Sample Rate Converter Plugin Wtyczka Sample Rate Converter dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Ustawienia wtyczki Sample Rate Converter Sample Rate (Hz): Próbkowanie (Hz): Interpolation Engine: Rodzaj interpolacji: Best Sinc Interpolation SINC (najlepsza jakość) Medium Sinc Interpolation SINC (średnia jakość) Fastest Sinc Interpolation SINC (najszybsza) ZOH Interpolation Interpolacja (ZOH) Linear Interpolation Interpolacja liniowa qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_ru.ts0000664000175000017500000000544012256224735027000 0ustar useruser EffectSRConverterFactory SRC Plugin Модуль SRC About Sample Rate Converter Plugin О модуле передискретизации Qmmp Sample Rate Converter Plugin Модуль передискретизации для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Настройки модуля передескретизации Sample Rate (Hz): Частота дискретизации (Гц): Interpolation Engine: Алгоритм интерполяции: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_sk.ts0000664000175000017500000000507612256224735026774 0ustar useruser EffectSRConverterFactory SRC Plugin About Sample Rate Converter Plugin Qmmp Sample Rate Converter Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate (Hz): Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_tr.ts0000664000175000017500000000535212256224735027001 0ustar useruser EffectSRConverterFactory SRC Plugin SRC Eklentisi About Sample Rate Converter Plugin Örnekleme Oranı Dönüştürücü Eklentisi Hakkında Qmmp Sample Rate Converter Plugin Qmmp Örnekleme Oranı Dönüştürücü Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Örnekleme Oranı Dönüştürücü Eklentisi Ayarları Sample Rate (Hz): Örnekleme Oranı (Hz): Interpolation Engine: İnterpolasyon Motoru: Best Sinc Interpolation Best Sinc İnterpolasyonu Medium Sinc Interpolation Medium Sinc İnterpolasyonu Fastest Sinc Interpolation Fastest Sinc İnterpolasyonu ZOH Interpolation ZOH İnterpolasyonu Linear Interpolation Doğrusal İnterpolasyon qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_gl_ES.ts0000664000175000017500000000526112256224735027344 0ustar useruser EffectSRConverterFactory SRC Plugin Engadido SRC About Sample Rate Converter Plugin Sobre o engadido Sample Rate Converter Qmmp Sample Rate Converter Plugin Engadido Qmmp Sample Rate Converter Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Opcións do engadido Sample Rate Converter Sample Rate (Hz): Frecuencia (Hz): Interpolation Engine: Motor de interpolación: Best Sinc Interpolation Best Sinc Interpolation Medium Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation ZOH Interpolation Linear Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/translations.qrc0000664000175000017500000000164112256224735025217 0ustar useruser srconverter_plugin_ru.qm srconverter_plugin_uk_UA.qm srconverter_plugin_zh_CN.qm srconverter_plugin_zh_TW.qm srconverter_plugin_tr.qm srconverter_plugin_cs.qm srconverter_plugin_pt_BR.qm srconverter_plugin_de.qm srconverter_plugin_pl_PL.qm srconverter_plugin_fr.qm srconverter_plugin_it.qm srconverter_plugin_kk.qm srconverter_plugin_lt.qm srconverter_plugin_hu.qm srconverter_plugin_nl.qm srconverter_plugin_ja.qm srconverter_plugin_sk.qm srconverter_plugin_es.qm srconverter_plugin_he.qm srconverter_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_uk_UA.ts0000664000175000017500000000560012256224735027354 0ustar useruser EffectSRConverterFactory SRC Plugin Модуль SRC About Sample Rate Converter Plugin Про модуль Sample Rate Converter Qmmp Sample Rate Converter Plugin Модуль Sample Rate Converter для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Налаштування модуля Sample Rate Converter Sample Rate (Hz): Дискретизація семпла (Гц): Interpolation Engine: Технологія інтерполяції: Best Sinc Interpolation Кращий синк інтерполяції Medium Sinc Interpolation Середній синк інтерполяції Fastest Sinc Interpolation Найшвидший синк інтерполяції ZOH Interpolation Інтерполяція ZOH Linear Interpolation Лінійна інтерполяція qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_pl_PL.ts0000664000175000017500000000523012256224735027355 0ustar useruser EffectSRConverterFactory SRC Plugin Wtyczka SRC About Sample Rate Converter Plugin O wtyczce Sample Rate Converter Qmmp Sample Rate Converter Plugin Wtyczka Sample Rate Converter dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Ustawienia wtyczki Sample Rate Converter Sample Rate (Hz): Próbkowanie (Hz): Interpolation Engine: Rodzaj interpolacji: Best Sinc Interpolation SINC (najlepsza jakość) Medium Sinc Interpolation SINC (średnia jakość) Fastest Sinc Interpolation SINC (najszybsza) ZOH Interpolation Interpolacja (ZOH) Linear Interpolation Interpolacja liniowa qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_pt_BR.ts0000664000175000017500000000507612256224735027365 0ustar useruser EffectSRConverterFactory SRC Plugin About Sample Rate Converter Plugin Qmmp Sample Rate Converter Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings Sample Rate (Hz): Interpolation Engine: Best Sinc Interpolation Medium Sinc Interpolation Fastest Sinc Interpolation ZOH Interpolation Linear Interpolation qmmp-0.7.4/src/plugins/Effect/srconverter/translations/srconverter_plugin_zh_CN.ts0000664000175000017500000000521712256224735027355 0ustar useruser EffectSRConverterFactory SRC Plugin SRC 插件 About Sample Rate Converter Plugin 关于取样率转换插件 Qmmp Sample Rate Converter Plugin Qmmp 取样率转换插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Sample Rate Converter Plugin Settings 取样率转换插件设置 Sample Rate (Hz): 取样率 (Hz): Interpolation Engine: 内插引擎: Best Sinc Interpolation 最好 SINC 插入 (高品质) Medium Sinc Interpolation 一般 SINC 插入 (中品质) Fastest Sinc Interpolation 最快 SINC 插入 (低品质) ZOH Interpolation 零阶保持插入 (ZOH) Linear Interpolation 线性插入 qmmp-0.7.4/src/plugins/Effect/srconverter/effectsrconverterfactory.h0000664000175000017500000000371312256224735024542 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTSRCONVERTERFACTORY_H #define EFFECTSRCONVERTERFACTORY_H #include #include #include /** @author Ilya Kotov */ class EffectSRConverterFactory : public QObject, public EffectFactory { Q_OBJECT Q_INTERFACES(EffectFactory); public: const EffectProperties properties() const; Effect *create(); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Effect/srconverter/srconverter.h0000664000175000017500000000375312256224735022001 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SRCONVERTER_H #define SRCONVERTER_H #include #include /** @author Ilya Kotov */ class SRConverter : public Effect { public: SRConverter(); virtual ~SRConverter(); void applyEffect(Buffer *b); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); private: void freeSRC(); SRC_STATE *m_src_state; SRC_DATA m_src_data; quint32 m_overSamplingFs; int m_srcError; int m_converter_type; int m_sz; //sample size quint32 m_freq; }; #endif qmmp-0.7.4/src/plugins/Effect/srconverter/effectsrconverterfactory.cpp0000664000175000017500000000530712256224735025076 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "srconverter.h" #include "effectsrconverterfactory.h" const EffectProperties EffectSRConverterFactory::properties() const { EffectProperties properties; properties.name = tr("SRC Plugin"); properties.shortName = "SRC"; properties.hasSettings = true; properties.hasAbout = true; properties.priority = EffectProperties::EFFECT_PRIORITY_HIGH; return properties; } Effect *EffectSRConverterFactory::create() { return new SRConverter(); } void EffectSRConverterFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s ->show(); } void EffectSRConverterFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Sample Rate Converter Plugin"), tr("Qmmp Sample Rate Converter Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *EffectSRConverterFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/srconverter_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(srconverter, EffectSRConverterFactory) qmmp-0.7.4/src/plugins/Effect/srconverter/settingsdialog.h0000664000175000017500000000344712256224735022445 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Effect/CMakeLists.txt0000664000175000017500000000114612256224735017432 0ustar useruserSET(USE_SRC TRUE CACHE BOOL "enable/disable SRC plugin") SET(USE_BS2B TRUE CACHE BOOL "enable/disable bs2b plugin") SET(USE_LADSPA TRUE CACHE BOOL "enable/disable ladspa plugin") SET(USE_CROSSFADE TRUE CACHE BOOL "enable/disable crossfade plugin") SET(USE_STEREO TRUE CACHE BOOL "enable/disable extra stereo plugin") IF(USE_SRC) add_subdirectory(srconverter) ENDIF(USE_SRC) IF(USE_BS2B) add_subdirectory(bs2b) ENDIF(USE_BS2B) IF(USE_LADSPA) add_subdirectory(ladspa) ENDIF(USE_LADSPA) IF(USE_CROSSFADE) add_subdirectory(crossfade) ENDIF(USE_CROSSFADE) IF(USE_STEREO) add_subdirectory(stereo) ENDIF(USE_STEREO) qmmp-0.7.4/src/plugins/Effect/crossfade/0000775000175000017500000000000012256224735016641 5ustar useruserqmmp-0.7.4/src/plugins/Effect/crossfade/crossfadeplugin.cpp0000664000175000017500000001115612256224735022541 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * Copyright (C) 2009 by Sebastian Pipping * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "crossfadeplugin.h" CrossfadePlugin::CrossfadePlugin() : Effect() { m_buffer = 0; m_buffer_at = 0; m_buffer_size = 0; m_core = SoundCore::instance() ; m_handler = StateHandler::instance(); m_state = WAITING; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_overlap = settings.value("Crossfade/overlap", 6000).toLongLong(); } CrossfadePlugin::~CrossfadePlugin() { if(m_buffer) free(m_buffer); } void CrossfadePlugin::applyEffect(Buffer *b) { switch (m_state) { case WAITING: if((m_core->totalTime() > m_overlap + 2000) && (m_core->totalTime() - m_handler->elapsed() < m_overlap + 2000)) { StateHandler::instance()->sendNextTrackRequest(); m_state = CHECKING; } return; case CHECKING: //next source has been received and current engine will be used to play it if(SoundCore::instance()->nextTrackAccepted()) m_state = PREPARING; else return; case PREPARING: if(m_core->totalTime() && (m_core->totalTime() - m_handler->elapsed() < m_overlap)) { if(m_buffer_at + b->nbytes > m_buffer_size) { m_buffer_size = m_buffer_at + b->nbytes; m_buffer = (uchar *)realloc(m_buffer, m_buffer_size); } memcpy(m_buffer + m_buffer_at, b->data, b->nbytes); m_buffer_at += b->nbytes; b->nbytes = 0; return; } else if(m_buffer_at > 0) m_state = PROCESSING; else return; case PROCESSING: if (m_buffer_at > 0) { double volume = (double)m_buffer_at/m_buffer_size; uint size = qMin((ulong)m_buffer_at, b->nbytes); if(format() == Qmmp::PCM_S16LE) mix16(b->data, m_buffer, size >> 1, volume); else if(format() == Qmmp::PCM_S8) mix8(b->data, m_buffer, size, volume); else //PCM_24LE, PCM_32LE mix32(b->data, m_buffer, size >> 2, volume); m_buffer_at -= size; memmove(m_buffer, m_buffer + size, m_buffer_at); } else m_state = WAITING; default: ; } return; } void CrossfadePlugin::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { Effect::configure(freq, chan, format); } void CrossfadePlugin::mix8(uchar *cur_buf, uchar *prev_buf, uint samples, double volume) { for (uint i = 0; i < samples; i++) { cur_buf[i] = cur_buf[i]*(1.0 - volume)+prev_buf[i]*volume; } } void CrossfadePlugin::mix16(uchar *cur_buf, uchar *prev_buf, uint samples, double volume) { for (uint i = 0; i < samples; i++) { ((short*)cur_buf)[i] =((short*)cur_buf)[i]*(1.0 - volume)+((short*)prev_buf)[i]*volume; } } void CrossfadePlugin::mix32(uchar *cur_buf, uchar *prev_buf, uint samples, double volume) { for (uint i = 0; i < samples; i++) { ((qint32*)cur_buf)[i] =((qint32*)cur_buf)[i]*(1.0 - volume)+((qint32*)prev_buf)[i]*volume; } } qmmp-0.7.4/src/plugins/Effect/crossfade/effectcrossfadefactory.h0000664000175000017500000000370512256224735023535 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTCROSSFADEFACTORY_H #define EFFECTCROSSFADEFACTORY_H #include #include #include /** @author Ilya Kotov */ class EffectCrossfadeFactory : public QObject, public EffectFactory { Q_OBJECT Q_INTERFACES(EffectFactory); public: const EffectProperties properties() const; Effect *create(); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Effect/crossfade/CMakeLists.txt0000664000175000017500000000301512256224735021400 0ustar useruserproject(libcrossfade) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libcrossfade_SRCS crossfadeplugin.cpp settingsdialog.cpp effectcrossfadefactory.cpp ) SET(libcrossfade_HDRS crossfadeplugin.h ) SET(libcrossfade_MOC_HDRS settingsdialog.h effectcrossfadefactory.h ) SET(libcrossfade_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libcrossfade_RCC_SRCS ${libcrossfade_RCCS}) QT4_WRAP_CPP(libcrossfade_MOC_SRCS ${libcrossfade_MOC_HDRS}) # user interface SET(libcrossfade_UIS settingsdialog.ui ) QT4_WRAP_UI(libcrossfade_UIS_H ${libcrossfade_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(crossfade MODULE ${libcrossfade_SRCS} ${libcrossfade_MOC_SRCS} ${libcrossfade_UIS_H} ${libcrossfade_RCC_SRCS} ${libcrossfade_HDRS}) add_dependencies(crossfade qmmp) target_link_libraries(crossfade ${QT_LIBRARIES} -lqmmp) install(TARGETS crossfade DESTINATION ${LIB_DIR}/qmmp/Effect) qmmp-0.7.4/src/plugins/Effect/crossfade/crossfadeplugin.h0000664000175000017500000000452312256224735022206 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CROSSFADEPLUGIN_H #define CROSSFADEPLUGIN_H #include #include class SoundCore; class StateHandler; /** @author Ilya Kotov */ class CrossfadePlugin : public Effect { public: CrossfadePlugin(); virtual ~CrossfadePlugin(); void applyEffect(Buffer *b); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); private: enum State { WAITING = 0, CHECKING, PREPARING, PROCESSING, }; void mix8(uchar *cur_buf, uchar *prev_buf, uint samples, double volume); void mix16(uchar *cur_buf, uchar *prev_buf, uint samples, double volume); void mix32(uchar *cur_buf, uchar *prev_buf, uint samples, double volume); uchar *m_buffer; ulong m_buffer_at; ulong m_buffer_size; qint64 m_overlap; int m_state; SoundCore *m_core; StateHandler *m_handler; }; #endif qmmp-0.7.4/src/plugins/Effect/crossfade/crossfade.pro0000664000175000017500000000264612256224735021344 0ustar useruserinclude(../../plugins.pri) HEADERS += crossfadeplugin.h \ effectcrossfadefactory.h \ settingsdialog.h SOURCES += crossfadeplugin.cpp \ effectcrossfadefactory.cpp \ settingsdialog.cpp TARGET =$$PLUGINS_PREFIX/Effect/crossfade INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/crossfade_plugin_cs.ts \ translations/crossfade_plugin_de.ts \ translations/crossfade_plugin_zh_CN.ts \ translations/crossfade_plugin_zh_TW.ts \ translations/crossfade_plugin_uk_UA.ts \ translations/crossfade_plugin_pl.ts \ translations/crossfade_plugin_ru.ts \ translations/crossfade_plugin_it.ts \ translations/crossfade_plugin_tr.ts \ translations/crossfade_plugin_lt.ts \ translations/crossfade_plugin_nl.ts \ translations/crossfade_plugin_ja.ts \ translations/crossfade_plugin_es.ts RESOURCES = translations/translations.qrc FORMS += settingsdialog.ui unix { isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Effect INSTALLS += target LIBS += -lqmmp -L/usr/lib -I/usr/include QMAKE_CLEAN =$$PLUGINS_PREFIX/Effect/libcrossfade.so } win32 { QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 } qmmp-0.7.4/src/plugins/Effect/crossfade/effectcrossfadefactory.cpp0000664000175000017500000000526212256224735024070 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "effectcrossfadefactory.h" #include "settingsdialog.h" #include "crossfadeplugin.h" const EffectProperties EffectCrossfadeFactory::properties() const { EffectProperties properties; properties.name = tr("Crossfade Plugin"); properties.shortName = "crossfade"; properties.hasSettings = true; properties.hasAbout = true; properties.priority = EffectProperties::EFFECT_PRIORITY_LOW; return properties; } Effect *EffectCrossfadeFactory::create() { return new CrossfadePlugin(); } void EffectCrossfadeFactory::showSettings(QWidget *parent) { SettingsDialog *dialog = new SettingsDialog(parent); dialog->show(); } void EffectCrossfadeFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Crossfade Plugin"), tr("Qmmp Crossfade Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *EffectCrossfadeFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/crossfade_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(crossfade,EffectCrossfadeFactory) qmmp-0.7.4/src/plugins/Effect/crossfade/settingsdialog.cpp0000664000175000017500000000401612256224735022366 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); ui.overlapSpinBox->setValue(settings.value("Crossfade/overlap",6000).toInt()); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Crossfade/overlap", ui.overlapSpinBox->value()); QDialog::accept(); } qmmp-0.7.4/src/plugins/Effect/crossfade/settingsdialog.ui0000664000175000017500000000502512256224735022222 0ustar useruser SettingsDialog 0 0 275 65 Crossfade Plugin Settings 6 6 6 Overlap: 0 0 ms 3000 12000 500 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 76 91 88 buttonBox rejected() SettingsDialog reject() 326 78 139 60 qmmp-0.7.4/src/plugins/Effect/crossfade/translations/0000775000175000017500000000000012256224735021362 5ustar useruserqmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_de.ts0000664000175000017500000000311112256224735025725 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Crossfade-Modul About Crossfade Plugin Über Crossfade-Modul Qmmp Crossfade Plugin Qmmp Crossfade-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Einstellungen Crossfade-Modul Overlap: Überblenden: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_cs.ts0000664000175000017500000000311412256224735025745 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Modul prolínání About Crossfade Plugin O modulu prolínání Qmmp Crossfade Plugin Modul prolínání Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Nastavení modulu prolínání Overlap: Překryv: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_es.ts0000664000175000017500000000313612256224735025753 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Módulo Crossfade About Crossfade Plugin Acerca del módulo Crossfade Qmmp Crossfade Plugin Módulo Crossfade para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Configuración del módulo Crossfade Overlap: Solapar: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_fr.ts0000664000175000017500000000306412256224735025753 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_he.ts0000664000175000017500000000317512256224735025743 0ustar useruser EffectCrossfadeFactory Crossfade Plugin תוספת עמעום About Crossfade Plugin אודות תוספת עמעום Qmmp Crossfade Plugin תוספת עמעום Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings הגדרות תוספת עמעום Overlap: חפיפיה: ms מ״ש qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_hu.ts0000664000175000017500000000306412256224735025760 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_ja.ts0000664000175000017500000000322612256224735025736 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Crossfade プラグイン About Crossfade Plugin Crossfade プラグインについて Qmmp Crossfade Plugin QMMP Crossfade プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Crossfade プラグイン設定 Overlap: オーバーラップ: ms ミリ秒 qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_it.ts0000664000175000017500000000306112256224735025755 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_kk.ts0000664000175000017500000000306412256224735025751 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_lt.ts0000664000175000017500000000314612256224735025764 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Crossfade įskiepis About Crossfade Plugin Apie crossfade įskiepį Qmmp Crossfade Plugin Qmmp Crossfade įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Crossfade įskiepio nustatymai Overlap: Suliejimas: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_nl.ts0000664000175000017500000000307312256224735025755 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Overlap Module About Crossfade Plugin Over de Overlap Module Qmmp Crossfade Plugin Overlap Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overloop Module Instellingen Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_pl.ts0000664000175000017500000000311312256224735025752 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Wtyczka Crossfade About Crossfade Plugin O wtyczce Crossfade Qmmp Crossfade Plugin Wtyczka Crossfade dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Ustawienia wtyczki Crossfade Overlap: Nakładanie: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_ru.ts0000664000175000017500000000322212256224735025766 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Модуль Crossfade About Crossfade Plugin О модуле crossfade Qmmp Crossfade Plugin Модуль crossfade для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Настройки модуля crossfade Overlap: Перекрытие: ms мс qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_sk.ts0000664000175000017500000000306412256224735025761 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_tr.ts0000664000175000017500000000306412256224735025771 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_uk_UA.ts0000664000175000017500000000322512256224735026347 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Модуль Crossfade About Crossfade Plugin Про модуль crossfade Qmmp Crossfade Plugin Модуль crossfade для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Налаштування модуля crossfade Overlap: Перекриття: ms мс qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_pl_PL.ts0000664000175000017500000000311512256224735026347 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Wtyczka Crossfade About Crossfade Plugin O wtyczce Crossfade Qmmp Crossfade Plugin Wtyczka Crossfade dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Ustawienia wtyczki Crossfade Overlap: Nakładanie: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/translations.qrc0000664000175000017500000000157112256224735024616 0ustar useruser crossfade_plugin_ru.qm crossfade_plugin_uk_UA.qm crossfade_plugin_zh_CN.qm crossfade_plugin_zh_TW.qm crossfade_plugin_tr.qm crossfade_plugin_cs.qm crossfade_plugin_pt_BR.qm crossfade_plugin_de.qm crossfade_plugin_pl_PL.qm crossfade_plugin_fr.qm crossfade_plugin_it.qm crossfade_plugin_kk.qm crossfade_plugin_lt.qm crossfade_plugin_hu.qm crossfade_plugin_nl.qm crossfade_plugin_ja.qm crossfade_plugin_sk.qm crossfade_plugin_es.qm crossfade_plugin_he.qm crossfade_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_pt_BR.ts0000664000175000017500000000306412256224735026352 0ustar useruser EffectCrossfadeFactory Crossfade Plugin About Crossfade Plugin Qmmp Crossfade Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Overlap: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_zh_CN.ts0000664000175000017500000000313412256224735026343 0ustar useruser EffectCrossfadeFactory Crossfade Plugin 交叉衰落插件 About Crossfade Plugin 关于交叉衰落插件 Qmmp Crossfade Plugin Qmmp 交叉衰落插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings 交叉衰落插件设置 Overlap: 重叠: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_zh_TW.ts0000664000175000017500000000313312256224735026374 0ustar useruser EffectCrossfadeFactory Crossfade Plugin 交叉衰落插件 About Crossfade Plugin 關於交叉衰落插件 Qmmp Crossfade Plugin Qmmp 交叉衰落插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings 交叉衰落插件設定 Overlap: 重迭: ms qmmp-0.7.4/src/plugins/Effect/crossfade/translations/crossfade_plugin_gl_ES.ts0000664000175000017500000000313212256224735026331 0ustar useruser EffectCrossfadeFactory Crossfade Plugin Engadido Crossfade About Crossfade Plugin Sobre o engadido Crossfade Qmmp Crossfade Plugin Engadido Crossfade Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Crossfade Plugin Settings Opcións do engadido Crossfade Overlap: Solapamento: ms ms qmmp-0.7.4/src/plugins/Effect/crossfade/settingsdialog.h0000664000175000017500000000344612256224735022041 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Effect/ladspa/0000775000175000017500000000000012256224735016134 5ustar useruserqmmp-0.7.4/src/plugins/Effect/ladspa/ladspaslider.h0000664000175000017500000000406112256224735020755 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LADSPASLIDER_H #define LADSPASLIDER_H #include #include "ladspa.h" class QDoubleSpinBox; class QSlider; /** @author Ilya Kotov */ class LADSPASlider : public QWidget { Q_OBJECT public: LADSPASlider(double min, double max, double step, LADSPA_Data *value, QWidget *parent = 0); private slots: void setValue(double); void setValue(int); private: QDoubleSpinBox *m_spinBox; QSlider *m_slider; LADSPA_Data *m_value; double m_min; double m_max; double m_step; }; #endif // LADSPASLIDER_H qmmp-0.7.4/src/plugins/Effect/ladspa/effectladspafactory.cpp0000664000175000017500000000553012256224735022654 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "ladspahelper.h" #include "effectladspafactory.h" const EffectProperties EffectLADSPAFactory::properties() const { EffectProperties properties; properties.name = tr("LADSPA Plugin"); properties.shortName = "ladspa"; properties.hasSettings = true; properties.hasAbout = true; return properties; } Effect *EffectLADSPAFactory::create() { return new LADSPAHelper(); } void EffectLADSPAFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void EffectLADSPAFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About LADSPA Host for Qmmp"), tr("LADSPA Host for Qmmp")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Based on the LADSPA Host for BMP")+"\n"+ tr("BMP-ladspa developers:")+"\n"+ tr("Nick Lamb ")+"\n"+ tr("Giacomo Lozito ")); } QTranslator *EffectLADSPAFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/ladspa_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(ladspa,EffectLADSPAFactory) qmmp-0.7.4/src/plugins/Effect/ladspa/ladspabutton.h0000664000175000017500000000347312256224735021014 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LADSPABUTTON_H #define LADSPABUTTON_H #include #include "ladspa.h" class LADSPAHost; /** @author Ilya Kotov */ class LADSPAButton : public QCheckBox { Q_OBJECT public: LADSPAButton(LADSPA_Data *value, QWidget *parent = 0); private slots: void enable(bool yes); private: LADSPA_Data *m_value; }; #endif // LADSPABUTTON_H qmmp-0.7.4/src/plugins/Effect/ladspa/ladspahost.h0000664000175000017500000000647212256224735020460 0ustar useruser/*************************************************************************** * Copyright (C) 2002,2003 Nick Lamb * * Copyright (C) 2005 Giacomo Lozito * * Copyright (C) 2009 by Ilya Kotov * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LADSPAHOST_H #define LADSPAHOST_H #include #include #include #include #include "ladspa.h" class QWidget; #define MAX_SAMPLES 8192 #define MAX_KNOBS 64 /** @author Ilya Kotov */ class LADSPAPlugin { public: QString name; QString fileName; long id; long unique_id; bool stereo; }; class LADSPAControl { public: enum Type { BUTTON = 0, SLIDER, LABEL }; double min; double max; double step; LADSPA_Data *value; int type; QString name; }; class LADSPAEffect { public: void *library; QString fileName; bool stereo; const LADSPA_Descriptor *descriptor; LADSPA_Handle handle; /* left or mono */ LADSPA_Handle handle2; /* right stereo */ LADSPA_Data knobs[MAX_KNOBS]; QList controls; }; class LADSPAHost : public QObject { Q_OBJECT public: LADSPAHost(QObject *parent); virtual ~LADSPAHost(); int applyEffect(qint16 *d, int length); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); QList plugins(); QList effects(); LADSPAEffect *addPlugin(LADSPAPlugin * plugin); void unload(LADSPAEffect *instance); static LADSPAHost* instance(); private: void bootPlugin(LADSPAEffect *instance); void findAllPlugins(); void findPlugins(const QString &path); LADSPAEffect *load(const QString &path, long num); void portAssign(LADSPAEffect *instance); void initialize(LADSPAEffect *instance); QList m_plugins; QList m_effects; LADSPA_Data m_left[MAX_SAMPLES], m_right[MAX_SAMPLES], m_trash[MAX_SAMPLES]; static LADSPAHost *m_instance; int m_chan, m_prec; quint32 m_freq; }; #endif qmmp-0.7.4/src/plugins/Effect/ladspa/CMakeLists.txt0000664000175000017500000000311112256224735020670 0ustar useruserproject(libladspa) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libladspa_SRCS ladspahost.cpp ladspahelper.cpp ladspaslider.cpp ladspabutton.cpp settingsdialog.cpp effectladspafactory.cpp ) SET(libladspa_HDRS ladspahelper.h ) SET(libladspa_MOC_HDRS ladspahost.h ladspaslider.h ladspabutton.h settingsdialog.h effectladspafactory.h ) SET(libladspa_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libladspa_RCC_SRCS ${libladspa_RCCS}) QT4_WRAP_CPP(libladspa_MOC_SRCS ${libladspa_MOC_HDRS}) # user interface SET(libladspa_UIS settingsdialog.ui ) QT4_WRAP_UI(libladspa_UIS_H ${libladspa_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(ladspa MODULE ${libladspa_SRCS} ${libladspa_MOC_SRCS} ${libladspa_UIS_H} ${libladspa_RCC_SRCS} ${libladspa_HDRS}) add_dependencies(ladspa qmmp) target_link_libraries(ladspa ${QT_LIBRARIES} -lqmmp ${CMAKE_DL_LIBS}) install(TARGETS ladspa DESTINATION ${LIB_DIR}/qmmp/Effect) qmmp-0.7.4/src/plugins/Effect/ladspa/ladspahelper.h0000664000175000017500000000343312256224735020754 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef LADSPAHELPER_H #define LADSPAHELPER_H #include /** @author Ilya Kotov */ class LADSPAHelper : public Effect { public: LADSPAHelper(); virtual ~LADSPAHelper(); void applyEffect(Buffer *b); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); }; #endif // LADSPAHELPER_H qmmp-0.7.4/src/plugins/Effect/ladspa/ladspahelper.cpp0000664000175000017500000000367612256224735021320 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "ladspahost.h" #include "ladspahelper.h" LADSPAHelper::LADSPAHelper() : Effect() { if(!LADSPAHost::instance()) new LADSPAHost(qApp); } LADSPAHelper::~LADSPAHelper() {} void LADSPAHelper::applyEffect(Buffer *b) { LADSPAHost::instance()->applyEffect((qint16 *)b->data, b->nbytes); } void LADSPAHelper::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { LADSPAHost::instance()->configure(freq,chan,format); Effect::configure(freq, chan, format); } qmmp-0.7.4/src/plugins/Effect/ladspa/settingsdialog.cpp0000664000175000017500000001225612256224735021666 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "ladspaslider.h" #include "ladspabutton.h" #include "ladspahost.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); ui.loadButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowRight)); ui.unloadButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowLeft)); m_model = new QStandardItemModel(0, 2, this); m_model->setHeaderData(0, Qt::Horizontal, tr("UID")); m_model->setHeaderData(1, Qt::Horizontal, tr("Name")); ui.pluginsTreeView->setModel(m_model); if(!LADSPAHost::instance()) new LADSPAHost(qApp); QList plugin_list = LADSPAHost::instance()->plugins(); for(int i = 0; i < plugin_list.size(); ++i) { m_model->insertRow(i); m_model->setData(m_model->index(i, 0), (uint) plugin_list[i]->unique_id); m_model->setData(m_model->index(i, 1), plugin_list[i]->name); } ui.pluginsTreeView->resizeColumnToContents (0); ui.pluginsTreeView->resizeColumnToContents (1); updateRunningPlugins(); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::on_loadButton_clicked() { LADSPAHost *l = LADSPAHost::instance(); QModelIndex index = ui.pluginsTreeView->currentIndex (); if(index.isValid()) { l->addPlugin(l->plugins().at(index.row())); updateRunningPlugins(); } } void SettingsDialog::on_unloadButton_clicked() { LADSPAHost *l = LADSPAHost::instance(); QModelIndex index = ui.runningListWidget->currentIndex (); if(index.isValid()) { l->unload(l->effects().at(index.row())); updateRunningPlugins(); } } void SettingsDialog::on_configureButton_clicked() { LADSPAHost *l = LADSPAHost::instance(); QModelIndex index = ui.runningListWidget->currentIndex (); if(!index.isValid()) return; LADSPAEffect *effect = l->effects().at(index.row()); QDialog *dialog = new QDialog(this); dialog->setWindowTitle(effect->descriptor->Name); QFormLayout *formLayout = new QFormLayout(dialog); LADSPAButton *button = 0; LADSPASlider *slider = 0; QLabel *label = 0; foreach(LADSPAControl *c, effect->controls) { switch ((int) c->type) { case LADSPAControl::BUTTON: button = new LADSPAButton(c->value, dialog); button->setText(c->name); formLayout->addRow(button); break; case LADSPAControl::SLIDER: slider = new LADSPASlider(c->min, c->max, c->step, c->value, dialog); formLayout->addRow(c->name, slider); break; case LADSPAControl::LABEL: label = new QLabel(this); label->setText(QString("%1").arg(*c->value)); label->setFrameStyle(QFrame::StyledPanel); label->setFrameShadow(QFrame::Sunken); formLayout->addRow(c->name, label); } } if (effect->controls.isEmpty()) { QLabel *label = new QLabel(tr("This LADSPA plugin has no user controls"), dialog); formLayout->addRow(label); } dialog->setLayout(formLayout); dialog->setFixedSize(dialog->sizeHint()); dialog->exec(); dialog->deleteLater(); } void SettingsDialog::accept() { QDialog::accept(); } void SettingsDialog::updateRunningPlugins() { ui.runningListWidget->clear(); QList plugin_list = LADSPAHost::instance()->effects(); for(int i = 0; i < plugin_list.size(); ++i) ui.runningListWidget->addItem(plugin_list[i]->descriptor->Name); } qmmp-0.7.4/src/plugins/Effect/ladspa/settingsdialog.ui0000664000175000017500000000715412256224735021522 0ustar useruser SettingsDialog 0 0 427 406 LADSPA Plugin Catalog 6 6 6 false Qt::Vertical 20 124 > < Qt::Vertical 20 123 Qt::Horizontal 343 23 Configure 0 0 QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 76 91 88 buttonBox rejected() SettingsDialog reject() 326 78 139 60 qmmp-0.7.4/src/plugins/Effect/ladspa/effectladspafactory.h0000664000175000017500000000367412256224735022330 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTLADSPAFACTORY_H #define EFFECTLADSPAFACTORY_H #include #include #include /** @author Ilya Kotov */ class EffectLADSPAFactory : public QObject, public EffectFactory { Q_OBJECT Q_INTERFACES(EffectFactory); public: const EffectProperties properties() const; Effect *create(); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Effect/ladspa/translations/0000775000175000017500000000000012256224735020655 5ustar useruserqmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_CN.ts0000664000175000017500000000622012256224735025130 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA 插件 About LADSPA Host for Qmmp 关于 Qmmp LADSPA 主机 LADSPA Host for Qmmp Qmmp 的 LADSPA 主机 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP 基于 BMP 的 LADSPA 主机 BMP-ladspa developers: BMP-ladspa 开发者: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name 名称 This LADSPA plugin has no user controls LADSPA 插件用户设置 LADSPA Plugin Catalog LADSPA 插件目录 > < Configure 配置 qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_zh_TW.ts0000664000175000017500000000622012256224735025162 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA 插件 About LADSPA Host for Qmmp 關於 Qmmp LADSPA 主机 LADSPA Host for Qmmp Qmmp 的 LADSPA 主机 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP 基於 BMP 的 LADSPA 主机 BMP-ladspa developers: BMP-ladspa 開發者: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name 名稱 This LADSPA plugin has no user controls LADSPA 插件用戶設定 LADSPA Plugin Catalog LADSPA 插件目錄 > < Configure 配置 qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_gl_ES.ts0000664000175000017500000000626212256224735025126 0ustar useruser EffectLADSPAFactory LADSPA Plugin Engadido LADSPA About LADSPA Host for Qmmp Sobre LADSPA Host para Qmmp LADSPA Host for Qmmp LADSPA Host para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Baseado no LADSPA Host para BMP BMP-ladspa developers: Desenvolvedores de BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog Catálogo do engadido LADSPA > > < < Configure Configurar UID UID Name Nome This LADSPA plugin has no user controls Este engadido LADSPA non ten controis de usuario qmmp-0.7.4/src/plugins/Effect/ladspa/translations/translations.qrc0000664000175000017500000000147512256224735024114 0ustar useruser ladspa_plugin_ru.qm ladspa_plugin_uk_UA.qm ladspa_plugin_zh_CN.qm ladspa_plugin_zh_TW.qm ladspa_plugin_tr.qm ladspa_plugin_cs.qm ladspa_plugin_pt_BR.qm ladspa_plugin_de.qm ladspa_plugin_pl_PL.qm ladspa_plugin_fr.qm ladspa_plugin_it.qm ladspa_plugin_kk.qm ladspa_plugin_lt.qm ladspa_plugin_hu.qm ladspa_plugin_nl.qm ladspa_plugin_ja.qm ladspa_plugin_sk.qm ladspa_plugin_es.qm ladspa_plugin_he.qm ladspa_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_uk_UA.ts0000664000175000017500000000632212256224735025136 0ustar useruser EffectLADSPAFactory LADSPA Plugin Модуль LADSPA About LADSPA Host for Qmmp Про модуль LADSPA для Qmmp LADSPA Host for Qmmp LADSPA Host для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Базується на модулі LADSPA для BMP BMP-ladspa developers: Розробники BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Ім'я This LADSPA plugin has no user controls Цей модуль не містить налаштувань LADSPA Plugin Catalog Каталог модулів LADSPA > > < < Configure Налаштувати qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl_PL.ts0000664000175000017500000000612612256224735025142 0ustar useruser EffectLADSPAFactory LADSPA Plugin Wtyczka LADSPA About LADSPA Host for Qmmp O wtyczce LADSPA dla Qmmp LADSPA Host for Qmmp Host LADSPA dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Napisana przez: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Oparta na LADSPA Host dla BMP BMP-ladspa developers: Autorzy BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name Nazwa This LADSPA plugin has no user controls Ta wtyczka LADSPA nie posiada panelu sterowania LADSPA Plugin Catalog Menedżer wtyczek LADSPA > < Configure Konfiguracja qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_pt_BR.ts0000664000175000017500000000612512256224735025141 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog > < Configure UID Name This LADSPA plugin has no user controls qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_de.ts0000664000175000017500000000625012256224735024522 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA-Modul About LADSPA Host for Qmmp Über LADSPA-Host für Qmmp LADSPA Host for Qmmp LADSPA-Host für Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Basierend auf dem LADSPA-Host für BMP BMP-ladspa developers: BMP-LADSPA-Entwickler: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Name This LADSPA plugin has no user controls Dieses LADSPA-Modul hat keine Einstellungsmöglichkeiten LADSPA Plugin Catalog LADSPA-Modul-Katalog > > < < Configure Einrichten qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_cs.ts0000664000175000017500000000625512256224735024544 0ustar useruser EffectLADSPAFactory LADSPA Plugin Modul LADSPA About LADSPA Host for Qmmp O modulu LADSPA hostitele pro Qmmp LADSPA Host for Qmmp Hostitel LADSPA pro Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Založeno na hostiteli LADSPA pro BMP BMP-ladspa developers: Vývojáři BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Název This LADSPA plugin has no user controls Tento modul LADSPA nemá uživatelské ovládání LADSPA Plugin Catalog Katalog modulu LADSPA > > < < Configure Nastavit qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_es.ts0000664000175000017500000000630112256224735024536 0ustar useruser EffectLADSPAFactory LADSPA Plugin Módulo LADSPA About LADSPA Host for Qmmp Acerca del módulo LADSPA para Qmmp LADSPA Host for Qmmp Módulo LADSPA para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Basado en el módulo LADSPA para BMP BMP-ladspa developers: Desarrolladores de BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Nombre This LADSPA plugin has no user controls Este módulo LADSPA no tiene controles de usuario LADSPA Plugin Catalog Catálogo del módulo LADSPA > > < < Configure Configurar qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_fr.ts0000664000175000017500000000612512256224735024542 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog > < Configure UID Name This LADSPA plugin has no user controls qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_he.ts0000664000175000017500000000621312256224735024525 0ustar useruser EffectLADSPAFactory LADSPA Plugin תוספת LADSPA About LADSPA Host for Qmmp אודות מארח LADSPA עבור Qmmp LADSPA Host for Qmmp מארח LADSPA עבור Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Based on the LADSPA Host for BMP מבוססת על המארח LADSPA עבור BMP BMP-ladspa developers: מפתחי BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog קטלוג תוספת LADSPA > < < > Configure תצורה UID Name שם This LADSPA plugin has no user controls לתוספת LADSPA זו אין בקרי משתמש qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_hu.ts0000664000175000017500000000612512256224735024547 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog > < Configure UID Name This LADSPA plugin has no user controls qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_ja.ts0000664000175000017500000000640712256224735024530 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA プラグイン About LADSPA Host for Qmmp QMMP 用の LADSPA ホストについて LADSPA Host for Qmmp QMMP 用の LADSPA ホスト Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP 用 LADSPA ホストを基に作成 BMP-ladspa developers: BMP-ladspa 開発者: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog LADSPA プラグインカタログ > > < < Configure 調整 UID UID Name 名称 This LADSPA plugin has no user controls この LADSPA プラグインにユーザーが制御できる部分はありません qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_it.ts0000664000175000017500000000620312256224735024544 0ustar useruser EffectLADSPAFactory LADSPA Plugin Plugin LADSPA About LADSPA Host for Qmmp Informazioni su LADSPA per Qmmp LADSPA Host for Qmmp Host LADSPA per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autori: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Basato su Host LADSPA per BMP BMP-ladspa developers: Sviluppatori BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Nome This LADSPA plugin has no user controls QUesot plugin LADSPA non ha controlli LADSPA Plugin Catalog Catalogo Plugin LADSPA > > < < Configure Configura qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_kk.ts0000664000175000017500000000612512256224735024540 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog > < Configure UID Name This LADSPA plugin has no user controls qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_lt.ts0000664000175000017500000000632112256224735024550 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA Įskiepis About LADSPA Host for Qmmp Apie LADSPA įskiepį LADSPA Host for Qmmp LADSPA įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Sukurta "LADSPA Host for BMP" pagrindu BMP-ladspa developers: BMP LADSPA kurėjai Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name Pavadinimas This LADSPA plugin has no user controls Šis LADSPA įskiepis neturi nustatymų LADSPA Plugin Catalog LADSPA įskiepio katalogas > < Configure Nustatyti qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_nl.ts0000664000175000017500000000623112256224735024542 0ustar useruser EffectLADSPAFactory LADSPA Plugin LADSPA Module About LADSPA Host for Qmmp Over de LADSPA Module voor Qmmp LADSPA Host for Qmmp LADSPA Host voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Gebasseerd op de LADSPA Host voor BMP BMP-ladspa developers: BMP-ladspa ontwikkelaars: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name Naam This LADSPA plugin has no user controls Deze LADSPA module heeft geen instellingen LADSPA Plugin Catalog LADSPA Module Catalogus > < Configure Instellingen qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_pl.ts0000664000175000017500000000612612256224735024547 0ustar useruser EffectLADSPAFactory LADSPA Plugin Wtyczka LADSPA About LADSPA Host for Qmmp O wtyczce LADSPA dla Qmmp LADSPA Host for Qmmp Host LADSPA dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Napisana przez: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Oparta na LADSPA Host dla BMP BMP-ladspa developers: Autorzy BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name Nazwa This LADSPA plugin has no user controls Ta wtyczka LADSPA nie posiada panelu sterowania LADSPA Plugin Catalog Menedżer wtyczek LADSPA > < Configure Konfiguracja qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_ru.ts0000664000175000017500000000643512256224735024565 0ustar useruser EffectLADSPAFactory LADSPA Plugin Модуль LADSPA About LADSPA Host for Qmmp О модуле LADSPA для Qmmp LADSPA Host for Qmmp LADSPA Host для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP Разработан на основе модуля LADSPA для BMP BMP-ladspa developers: Разработчики BMP-ladspa: Nick Lamb <njl195@zepler.org.uk> Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID UID Name Имя This LADSPA plugin has no user controls Этот модуль не содержит настроек LADSPA Plugin Catalog Каталог модулей LADSPA > > < < Configure Настроить qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_sk.ts0000664000175000017500000000612512256224735024550 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog LADSPA Plugin Catalog > < Configure UID Name This LADSPA plugin has no user controls qmmp-0.7.4/src/plugins/Effect/ladspa/translations/ladspa_plugin_tr.ts0000664000175000017500000000610412256224735024555 0ustar useruser EffectLADSPAFactory LADSPA Plugin About LADSPA Host for Qmmp LADSPA Host for Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the LADSPA Host for BMP BMP-ladspa developers: Nick Lamb <njl195@zepler.org.uk> Giacomo Lozito <city_hunter@users.sf.net> SettingsDialog UID Name This LADSPA plugin has no user controls LADSPA Plugin Catalog > < Configure qmmp-0.7.4/src/plugins/Effect/ladspa/ladspaslider.cpp0000664000175000017500000000541212256224735021311 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "ladspaslider.h" LADSPASlider::LADSPASlider(double min, double max, double step, LADSPA_Data *value, QWidget *parent) : QWidget(parent) { m_min = min; m_max = max; m_step = step; m_value = value; m_slider = new QSlider(Qt::Horizontal, this); m_spinBox = new QDoubleSpinBox(this); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(m_slider); layout->addWidget(m_spinBox); layout->setContentsMargins (0, 0, 0, 0); setLayout(layout); m_spinBox->setRange(min, max); m_spinBox->setSingleStep(step); m_spinBox->setValue(*value); m_slider->setRange(0, (max-min)/step); m_slider->setSingleStep(1); m_slider->setPageStep(10); m_slider->setValue((*value-min)/step); connect(m_spinBox, SIGNAL(valueChanged (double)), SLOT(setValue(double))); connect(m_slider, SIGNAL(valueChanged (int)),SLOT(setValue(int))); } void LADSPASlider::setValue(double v) { *m_value = v; m_slider->blockSignals(true); m_slider->setValue((v-m_min)/m_step); m_slider->blockSignals(false); } void LADSPASlider::setValue(int v) { m_spinBox->blockSignals(true); m_spinBox->setValue(v*m_step + m_min); *m_value = v*m_step + m_min; m_spinBox->blockSignals(false); } qmmp-0.7.4/src/plugins/Effect/ladspa/ladspabutton.cpp0000664000175000017500000000335012256224735021341 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "ladspabutton.h" LADSPAButton::LADSPAButton(LADSPA_Data *value, QWidget *parent) : QCheckBox(parent) { m_value = value; setChecked(*value == 1.0); connect(this, SIGNAL(clicked (bool)), SLOT(enable(bool))); } void LADSPAButton::enable(bool yes) { *m_value = yes ? 1.0 : 0.0; } qmmp-0.7.4/src/plugins/Effect/ladspa/ladspa.h0000664000175000017500000006571112256224735017563 0ustar useruser/* ladspa.h Linux Audio Developer's Simple Plugin API Version 1.1[LGPL]. Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld. 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.1 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. */ #ifndef LADSPA_INCLUDED #define LADSPA_INCLUDED #define LADSPA_VERSION "1.1" #define LADSPA_VERSION_MAJOR 1 #define LADSPA_VERSION_MINOR 1 #ifdef __cplusplus extern "C" { #endif /*****************************************************************************/ /* Overview: There is a large number of synthesis packages in use or development on the Linux platform at this time. This API (`The Linux Audio Developer's Simple Plugin API') attempts to give programmers the ability to write simple `plugin' audio processors in C/C++ and link them dynamically (`plug') into a range of these packages (`hosts'). It should be possible for any host and any plugin to communicate completely through this interface. This API is deliberately short and simple. To achieve compatibility with a range of promising Linux sound synthesis packages it attempts to find the `greatest common divisor' in their logical behaviour. Having said this, certain limiting decisions are implicit, notably the use of a fixed type (LADSPA_Data) for all data transfer and absence of a parameterised `initialisation' phase. See below for the LADSPA_Data typedef. Plugins are expected to distinguish between control and audio data. Plugins have `ports' that are inputs or outputs for audio or control data and each plugin is `run' for a `block' corresponding to a short time interval measured in samples. Audio data is communicated using arrays of LADSPA_Data, allowing a block of audio to be processed by the plugin in a single pass. Control data is communicated using single LADSPA_Data values. Control data has a single value at the start of a call to the `run()' or `run_adding()' function, and may be considered to remain this value for its duration. The plugin may assume that all its input and output ports have been connected to the relevant data location (see the `connect_port()' function below) before it is asked to run. Plugins will reside in shared object files suitable for dynamic linking by dlopen() and family. The file will provide a number of `plugin types' that can be used to instantiate actual plugins (sometimes known as `plugin instances') that can be connected together to perform tasks. This API contains very limited error-handling. */ /*****************************************************************************/ /* Fundamental data type passed in and out of plugin. This data type is used to communicate audio samples and control values. It is assumed that the plugin will work sensibly given any numeric input value although it may have a preferred range (see hints below). For audio it is generally assumed that 1.0f is the `0dB' reference amplitude and is a `normal' signal level. */ typedef float LADSPA_Data; /*****************************************************************************/ /* Special Plugin Properties: Optional features of the plugin type are encapsulated in the LADSPA_Properties type. This is assembled by ORing individual properties together. */ typedef int LADSPA_Properties; /* Property LADSPA_PROPERTY_REALTIME indicates that the plugin has a real-time dependency (e.g. listens to a MIDI device) and so its output must not be cached or subject to significant latency. */ #define LADSPA_PROPERTY_REALTIME 0x1 /* Property LADSPA_PROPERTY_INPLACE_BROKEN indicates that the plugin may cease to work correctly if the host elects to use the same data location for both input and output (see connect_port()). This should be avoided as enabling this flag makes it impossible for hosts to use the plugin to process audio `in-place.' */ #define LADSPA_PROPERTY_INPLACE_BROKEN 0x2 /* Property LADSPA_PROPERTY_HARD_RT_CAPABLE indicates that the plugin is capable of running not only in a conventional host but also in a `hard real-time' environment. To qualify for this the plugin must satisfy all of the following: (1) The plugin must not use malloc(), free() or other heap memory management within its run() or run_adding() functions. All new memory used in run() must be managed via the stack. These restrictions only apply to the run() function. (2) The plugin will not attempt to make use of any library functions with the exceptions of functions in the ANSI standard C and C maths libraries, which the host is expected to provide. (3) The plugin will not access files, devices, pipes, sockets, IPC or any other mechanism that might result in process or thread blocking. (4) The plugin will take an amount of time to execute a run() or run_adding() call approximately of form (A+B*SampleCount) where A and B depend on the machine and host in use. This amount of time may not depend on input signals or plugin state. The host is left the responsibility to perform timings to estimate upper bounds for A and B. */ #define LADSPA_PROPERTY_HARD_RT_CAPABLE 0x4 #define LADSPA_IS_REALTIME(x) ((x) & LADSPA_PROPERTY_REALTIME) #define LADSPA_IS_INPLACE_BROKEN(x) ((x) & LADSPA_PROPERTY_INPLACE_BROKEN) #define LADSPA_IS_HARD_RT_CAPABLE(x) ((x) & LADSPA_PROPERTY_HARD_RT_CAPABLE) /*****************************************************************************/ /* Plugin Ports: Plugins have `ports' that are inputs or outputs for audio or data. Ports can communicate arrays of LADSPA_Data (for audio inputs/outputs) or single LADSPA_Data values (for control input/outputs). This information is encapsulated in the LADSPA_PortDescriptor type which is assembled by ORing individual properties together. Note that a port must be an input or an output port but not both and that a port must be a control or audio port but not both. */ typedef int LADSPA_PortDescriptor; /* Property LADSPA_PORT_INPUT indicates that the port is an input. */ #define LADSPA_PORT_INPUT 0x1 /* Property LADSPA_PORT_OUTPUT indicates that the port is an output. */ #define LADSPA_PORT_OUTPUT 0x2 /* Property LADSPA_PORT_CONTROL indicates that the port is a control port. */ #define LADSPA_PORT_CONTROL 0x4 /* Property LADSPA_PORT_AUDIO indicates that the port is a audio port. */ #define LADSPA_PORT_AUDIO 0x8 #define LADSPA_IS_PORT_INPUT(x) ((x) & LADSPA_PORT_INPUT) #define LADSPA_IS_PORT_OUTPUT(x) ((x) & LADSPA_PORT_OUTPUT) #define LADSPA_IS_PORT_CONTROL(x) ((x) & LADSPA_PORT_CONTROL) #define LADSPA_IS_PORT_AUDIO(x) ((x) & LADSPA_PORT_AUDIO) /*****************************************************************************/ /* Plugin Port Range Hints: The host may wish to provide a representation of data entering or leaving a plugin (e.g. to generate a GUI automatically). To make this more meaningful, the plugin should provide `hints' to the host describing the usual values taken by the data. Note that these are only hints. The host may ignore them and the plugin must not assume that data supplied to it is meaningful. If the plugin receives invalid input data it is expected to continue to run without failure and, where possible, produce a sensible output (e.g. a high-pass filter given a negative cutoff frequency might switch to an all-pass mode). Hints are meaningful for all input and output ports but hints for input control ports are expected to be particularly useful. More hint information is encapsulated in the LADSPA_PortRangeHintDescriptor type which is assembled by ORing individual hint types together. Hints may require further LowerBound and UpperBound information. All the hint information for a particular port is aggregated in the LADSPA_PortRangeHint structure. */ typedef int LADSPA_PortRangeHintDescriptor; /* Hint LADSPA_HINT_BOUNDED_BELOW indicates that the LowerBound field of the LADSPA_PortRangeHint should be considered meaningful. The value in this field should be considered the (inclusive) lower bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also specified then the value of LowerBound should be multiplied by the sample rate. */ #define LADSPA_HINT_BOUNDED_BELOW 0x1 /* Hint LADSPA_HINT_BOUNDED_ABOVE indicates that the UpperBound field of the LADSPA_PortRangeHint should be considered meaningful. The value in this field should be considered the (inclusive) upper bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also specified then the value of UpperBound should be multiplied by the sample rate. */ #define LADSPA_HINT_BOUNDED_ABOVE 0x2 /* Hint LADSPA_HINT_TOGGLED indicates that the data item should be considered a Boolean toggle. Data less than or equal to zero should be considered `off' or `false,' and data above zero should be considered `on' or `true.' LADSPA_HINT_TOGGLED may not be used in conjunction with any other hint except LADSPA_HINT_DEFAULT_0 or LADSPA_HINT_DEFAULT_1. */ #define LADSPA_HINT_TOGGLED 0x4 /* Hint LADSPA_HINT_SAMPLE_RATE indicates that any bounds specified should be interpreted as multiples of the sample rate. For instance, a frequency range from 0Hz to the Nyquist frequency (half the sample rate) could be requested by this hint in conjunction with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds at all must support this hint to retain meaning. */ #define LADSPA_HINT_SAMPLE_RATE 0x8 /* Hint LADSPA_HINT_LOGARITHMIC indicates that it is likely that the user will find it more intuitive to view values using a logarithmic scale. This is particularly useful for frequencies and gains. */ #define LADSPA_HINT_LOGARITHMIC 0x10 /* Hint LADSPA_HINT_INTEGER indicates that a user interface would probably wish to provide a stepped control taking only integer values. Any bounds set should be slightly wider than the actual integer range required to avoid floating point rounding errors. For instance, the integer set {0,1,2,3} might be described as [-0.1, 3.1]. */ #define LADSPA_HINT_INTEGER 0x20 /* The various LADSPA_HINT_HAS_DEFAULT_* hints indicate a `normal' value for the port that is sensible as a default. For instance, this value is suitable for use as an initial value in a user interface or as a value the host might assign to a control port when the user has not provided one. Defaults are encoded using a mask so only one default may be specified for a port. Some of the hints make use of lower and upper bounds, in which case the relevant bound or bounds must be available and LADSPA_HINT_SAMPLE_RATE must be applied as usual. The resulting default must be rounded if LADSPA_HINT_INTEGER is present. Default values were introduced in LADSPA v1.1. */ #define LADSPA_HINT_DEFAULT_MASK 0x3C0 /* This default values indicates that no default is provided. */ #define LADSPA_HINT_DEFAULT_NONE 0x0 /* This default hint indicates that the suggested lower bound for the port should be used. */ #define LADSPA_HINT_DEFAULT_MINIMUM 0x40 /* This default hint indicates that a low value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.75 + log(upper) * 0.25). Otherwise, this should be (lower * 0.75 + upper * 0.25). */ #define LADSPA_HINT_DEFAULT_LOW 0x80 /* This default hint indicates that a middle value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.5 + log(upper) * 0.5). Otherwise, this should be (lower * 0.5 + upper * 0.5). */ #define LADSPA_HINT_DEFAULT_MIDDLE 0xC0 /* This default hint indicates that a high value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.25 + log(upper) * 0.75). Otherwise, this should be (lower * 0.25 + upper * 0.75). */ #define LADSPA_HINT_DEFAULT_HIGH 0x100 /* This default hint indicates that the suggested upper bound for the port should be used. */ #define LADSPA_HINT_DEFAULT_MAXIMUM 0x140 /* This default hint indicates that the number 0 should be used. Note that this default may be used in conjunction with LADSPA_HINT_TOGGLED. */ #define LADSPA_HINT_DEFAULT_0 0x200 /* This default hint indicates that the number 1 should be used. Note that this default may be used in conjunction with LADSPA_HINT_TOGGLED. */ #define LADSPA_HINT_DEFAULT_1 0x240 /* This default hint indicates that the number 100 should be used. */ #define LADSPA_HINT_DEFAULT_100 0x280 /* This default hint indicates that the Hz frequency of `concert A' should be used. This will be 440 unless the host uses an unusual tuning convention, in which case it may be within a few Hz. */ #define LADSPA_HINT_DEFAULT_440 0x2C0 #define LADSPA_IS_HINT_BOUNDED_BELOW(x) ((x) & LADSPA_HINT_BOUNDED_BELOW) #define LADSPA_IS_HINT_BOUNDED_ABOVE(x) ((x) & LADSPA_HINT_BOUNDED_ABOVE) #define LADSPA_IS_HINT_TOGGLED(x) ((x) & LADSPA_HINT_TOGGLED) #define LADSPA_IS_HINT_SAMPLE_RATE(x) ((x) & LADSPA_HINT_SAMPLE_RATE) #define LADSPA_IS_HINT_LOGARITHMIC(x) ((x) & LADSPA_HINT_LOGARITHMIC) #define LADSPA_IS_HINT_INTEGER(x) ((x) & LADSPA_HINT_INTEGER) #define LADSPA_IS_HINT_HAS_DEFAULT(x) ((x) & LADSPA_HINT_DEFAULT_MASK) #define LADSPA_IS_HINT_DEFAULT_MINIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MINIMUM) #define LADSPA_IS_HINT_DEFAULT_LOW(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_LOW) #define LADSPA_IS_HINT_DEFAULT_MIDDLE(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MIDDLE) #define LADSPA_IS_HINT_DEFAULT_HIGH(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_HIGH) #define LADSPA_IS_HINT_DEFAULT_MAXIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MAXIMUM) #define LADSPA_IS_HINT_DEFAULT_0(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_0) #define LADSPA_IS_HINT_DEFAULT_1(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_1) #define LADSPA_IS_HINT_DEFAULT_100(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_100) #define LADSPA_IS_HINT_DEFAULT_440(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_440) typedef struct _LADSPA_PortRangeHint { /* Hints about the port. */ LADSPA_PortRangeHintDescriptor HintDescriptor; /* Meaningful when hint LADSPA_HINT_BOUNDED_BELOW is active. When LADSPA_HINT_SAMPLE_RATE is also active then this value should be multiplied by the relevant sample rate. */ LADSPA_Data LowerBound; /* Meaningful when hint LADSPA_HINT_BOUNDED_ABOVE is active. When LADSPA_HINT_SAMPLE_RATE is also active then this value should be multiplied by the relevant sample rate. */ LADSPA_Data UpperBound; } LADSPA_PortRangeHint; /*****************************************************************************/ /* Plugin Handles: This plugin handle indicates a particular instance of the plugin concerned. It is valid to compare this to NULL (0 for C++) but otherwise the host should not attempt to interpret it. The plugin may use it to reference internal instance data. */ typedef void * LADSPA_Handle; /*****************************************************************************/ /* Descriptor for a Type of Plugin: This structure is used to describe a plugin type. It provides a number of functions to examine the type, instantiate it, link it to buffers and workspaces and to run it. */ typedef struct _LADSPA_Descriptor { /* This numeric identifier indicates the plugin type uniquely. Plugin programmers may reserve ranges of IDs from a central body to avoid clashes. Hosts may assume that IDs are below 0x1000000. */ unsigned long UniqueID; /* This identifier can be used as a unique, case-sensitive identifier for the plugin type within the plugin file. Plugin types should be identified by file and label rather than by index or plugin name, which may be changed in new plugin versions. Labels must not contain white-space characters. */ const char * Label; /* This indicates a number of properties of the plugin. */ LADSPA_Properties Properties; /* This member points to the null-terminated name of the plugin (e.g. "Sine Oscillator"). */ const char * Name; /* This member points to the null-terminated string indicating the maker of the plugin. This can be an empty string but not NULL. */ const char * Maker; /* This member points to the null-terminated string indicating any copyright applying to the plugin. If no Copyright applies the string "None" should be used. */ const char * Copyright; /* This indicates the number of ports (input AND output) present on the plugin. */ unsigned long PortCount; /* This member indicates an array of port descriptors. Valid indices vary from 0 to PortCount-1. */ const LADSPA_PortDescriptor * PortDescriptors; /* This member indicates an array of null-terminated strings describing ports (e.g. "Frequency (Hz)"). Valid indices vary from 0 to PortCount-1. */ const char * const * PortNames; /* This member indicates an array of range hints for each port (see above). Valid indices vary from 0 to PortCount-1. */ const LADSPA_PortRangeHint * PortRangeHints; /* This may be used by the plugin developer to pass any custom implementation data into an instantiate call. It must not be used or interpreted by the host. It is expected that most plugin writers will not use this facility as LADSPA_Handle should be used to hold instance data. */ void * ImplementationData; /* This member is a function pointer that instantiates a plugin. A handle is returned indicating the new plugin instance. The instantiation function accepts a sample rate as a parameter. The plugin descriptor from which this instantiate function was found must also be passed. This function must return NULL if instantiation fails. Note that instance initialisation should generally occur in activate() rather than here. */ LADSPA_Handle (*instantiate)(const struct _LADSPA_Descriptor * Descriptor, unsigned long SampleRate); /* This member is a function pointer that connects a port on an instantiated plugin to a memory location at which a block of data for the port will be read/written. The data location is expected to be an array of LADSPA_Data for audio ports or a single LADSPA_Data value for control ports. Memory issues will be managed by the host. The plugin must read/write the data at these locations every time run() or run_adding() is called and the data present at the time of this connection call should not be considered meaningful. connect_port() may be called more than once for a plugin instance to allow the host to change the buffers that the plugin is reading or writing. These calls may be made before or after activate() or deactivate() calls. connect_port() must be called at least once for each port before run() or run_adding() is called. When working with blocks of LADSPA_Data the plugin should pay careful attention to the block size passed to the run function as the block allocated may only just be large enough to contain the block of samples. Plugin writers should be aware that the host may elect to use the same buffer for more than one port and even use the same buffer for both input and output (see LADSPA_PROPERTY_INPLACE_BROKEN). However, overlapped buffers or use of a single buffer for both audio and control data may result in unexpected behaviour. */ void (*connect_port)(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation); /* This member is a function pointer that initialises a plugin instance and activates it for use. This is separated from instantiate() to aid real-time support and so that hosts can reinitialise a plugin instance by calling deactivate() and then activate(). In this case the plugin instance must reset all state information dependent on the history of the plugin instance except for any data locations provided by connect_port() and any gain set by set_run_adding_gain(). If there is nothing for activate() to do then the plugin writer may provide a NULL rather than an empty function. When present, hosts must call this function once before run() (or run_adding()) is called for the first time. This call should be made as close to the run() call as possible and indicates to real-time plugins that they are now live. Plugins should not rely on a prompt call to run() after activate(). activate() may not be called again unless deactivate() is called first. Note that connect_port() may be called before or after a call to activate(). */ void (*activate)(LADSPA_Handle Instance); /* This method is a function pointer that runs an instance of a plugin for a block. Two parameters are required: the first is a handle to the particular instance to be run and the second indicates the block size (in samples) for which the plugin instance may run. Note that if an activate() function exists then it must be called before run() or run_adding(). If deactivate() is called for a plugin instance then the plugin instance may not be reused until activate() has been called again. If the plugin has the property LADSPA_PROPERTY_HARD_RT_CAPABLE then there are various things that the plugin should not do within the run() or run_adding() functions (see above). */ void (*run)(LADSPA_Handle Instance, unsigned long SampleCount); /* This method is a function pointer that runs an instance of a plugin for a block. This has identical behaviour to run() except in the way data is output from the plugin. When run() is used, values are written directly to the memory areas associated with the output ports. However when run_adding() is called, values must be added to the values already present in the memory areas. Furthermore, output values written must be scaled by the current gain set by set_run_adding_gain() (see below) before addition. run_adding() is optional. When it is not provided by a plugin, this function pointer must be set to NULL. When it is provided, the function set_run_adding_gain() must be provided also. */ void (*run_adding)(LADSPA_Handle Instance, unsigned long SampleCount); /* This method is a function pointer that sets the output gain for use when run_adding() is called (see above). If this function is never called the gain is assumed to default to 1. Gain information should be retained when activate() or deactivate() are called. This function should be provided by the plugin if and only if the run_adding() function is provided. When it is absent this function pointer must be set to NULL. */ void (*set_run_adding_gain)(LADSPA_Handle Instance, LADSPA_Data Gain); /* This is the counterpart to activate() (see above). If there is nothing for deactivate() to do then the plugin writer may provide a NULL rather than an empty function. Hosts must deactivate all activated units after they have been run() (or run_adding()) for the last time. This call should be made as close to the last run() call as possible and indicates to real-time plugins that they are no longer live. Plugins should not rely on prompt deactivation. Note that connect_port() may be called before or after a call to deactivate(). Deactivation is not similar to pausing as the plugin instance will be reinitialised when activate() is called to reuse it. */ void (*deactivate)(LADSPA_Handle Instance); /* Once an instance of a plugin has been finished with it can be deleted using the following function. The instance handle passed ceases to be valid after this call. If activate() was called for a plugin instance then a corresponding call to deactivate() must be made before cleanup() is called. */ void (*cleanup)(LADSPA_Handle Instance); } LADSPA_Descriptor; /**********************************************************************/ /* Accessing a Plugin: */ /* The exact mechanism by which plugins are loaded is host-dependent, however all most hosts will need to know is the name of shared object file containing the plugin types. To allow multiple hosts to share plugin types, hosts may wish to check for environment variable LADSPA_PATH. If present, this should contain a colon-separated path indicating directories that should be searched (in order) when loading plugin types. A plugin programmer must include a function called "ladspa_descriptor" with the following function prototype within the shared object file. This function will have C-style linkage (if you are using C++ this is taken care of by the `extern "C"' clause at the top of the file). A host will find the plugin shared object file by one means or another, find the ladspa_descriptor() function, call it, and proceed from there. Plugin types are accessed by index (not ID) using values from 0 upwards. Out of range indexes must result in this function returning NULL, so the plugin count can be determined by checking for the least index that results in NULL being returned. */ const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index); /* Datatype corresponding to the ladspa_descriptor() function. */ typedef const LADSPA_Descriptor * (*LADSPA_Descriptor_Function)(unsigned long Index); /**********************************************************************/ #ifdef __cplusplus } #endif #endif /* LADSPA_INCLUDED */ /* EOF */ qmmp-0.7.4/src/plugins/Effect/ladspa/ladspa.pro0000664000175000017500000000250112256224735020120 0ustar useruserinclude(../../plugins.pri) HEADERS += ladspahost.h \ effectladspafactory.h \ settingsdialog.h \ ladspaslider.h \ ladspa.h \ ladspahelper.h \ ladspabutton.h SOURCES += ladspahost.cpp \ effectladspafactory.cpp \ settingsdialog.cpp \ ladspaslider.cpp \ ladspahelper.cpp \ ladspabutton.cpp TARGET = $$PLUGINS_PREFIX/Effect/ladspa QMAKE_CLEAN = $$PLUGINS_PREFIX/Effect/libladspa.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp \ -L/usr/lib \ -I/usr/include linux-g++|linux-g++-32|linux-g++-64:LIBS += -ldl TRANSLATIONS = translations/ladspa_plugin_cs.ts \ translations/ladspa_plugin_de.ts \ translations/ladspa_plugin_zh_CN.ts \ translations/ladspa_plugin_zh_TW.ts \ translations/ladspa_plugin_uk_UA.ts \ translations/ladspa_plugin_pl.ts \ translations/ladspa_plugin_ru.ts \ translations/ladspa_plugin_it.ts \ translations/ladspa_plugin_tr.ts \ translations/ladspa_plugin_lt.ts \ translations/ladspa_plugin_nl.ts \ translations/ladspa_plugin_ja.ts \ translations/ladspa_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Effect INSTALLS += target FORMS += settingsdialog.ui qmmp-0.7.4/src/plugins/Effect/ladspa/settingsdialog.h0000664000175000017500000000377712256224735021343 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" class QStandardItemModel; /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private slots: void on_loadButton_clicked(); void on_unloadButton_clicked(); void on_configureButton_clicked(); private: void updateRunningPlugins(); Ui::SettingsDialog ui; QStandardItemModel *m_model; }; #endif qmmp-0.7.4/src/plugins/Effect/ladspa/ladspahost.cpp0000664000175000017500000004102212256224735021001 0ustar useruser/*************************************************************************** * Copyright (C) 2002-2003 Nick Lamb * * Copyright (C) 2005 Giacomo Lozito * * Copyright (C) 2009-2012 by Ilya Kotov * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include "ladspahost.h" #ifndef PATH_MAX #define PATH_MAX 4096 #endif LADSPAHost *LADSPAHost::m_instance = 0; LADSPAHost::LADSPAHost(QObject *parent) : QObject(parent) { m_chan = 0; m_prec = 0; m_freq = 0; m_instance = this; findAllPlugins(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); int p = settings.value("LADSPA/plugins_number", 0).toInt(); for(int i = 0; i < p; ++i) { QString section = QString("LADSPA_%1/").arg(i); int id = settings.value(section +"id").toInt(); QString file = settings.value(section +"file").toString(); int ports = settings.value(section +"ports").toInt(); LADSPAPlugin *plugin = 0; foreach(LADSPAPlugin *p, plugins()) { if(p->unique_id == id) { plugin = p; break; } } if(!plugin) continue; LADSPAEffect *effect = addPlugin(plugin); for(int j = 0; j < ports; ++j) { double value = settings.value(section + QString("port%1").arg(j)).toDouble(); effect->knobs[j] = value; } } } LADSPAHost::~LADSPAHost() { m_instance = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("LADSPA/plugins_number", m_effects.count()); for(int i = 0; i < m_effects.count(); ++i) { QString section = QString("LADSPA_%1/").arg(i); settings.setValue(section +"id", (quint64)m_effects[i]->descriptor->UniqueID); settings.setValue(section +"file", m_effects[i]->fileName); int ports = qMin((int)m_effects[i]->descriptor->PortCount, MAX_KNOBS); settings.setValue(section +"ports", ports); for(int j = 0; j < ports; ++j) { settings.setValue(section + QString("port%1").arg(j), m_effects[i]->knobs[j]); } } foreach(LADSPAEffect *effect, m_effects) unload(effect); } void LADSPAHost::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_chan = chan; m_prec = AudioParameters::sampleSize(format); m_freq = freq; foreach(LADSPAEffect *e, m_effects) { const LADSPA_Descriptor *descriptor = e->descriptor; if (e->handle) { if (descriptor->deactivate) descriptor->deactivate(e->handle); descriptor->cleanup(e->handle); e->handle = 0; } if (e->handle2) { if (descriptor->deactivate) descriptor->deactivate(e->handle2); descriptor->cleanup(e->handle2); e->handle2 = 0; } bootPlugin(e); } } LADSPAHost* LADSPAHost::instance() { return m_instance; } QList LADSPAHost::plugins() { return m_plugins; } QList LADSPAHost::effects() { return m_effects; } /*Based on xmms_ladspa */ void LADSPAHost::findAllPlugins() { while(!m_plugins.isEmpty()) /* empty list */ delete m_plugins.takeFirst(); QString ladspa_path = qgetenv("LADSPA_PATH"); QStringList directories; if (ladspa_path.isEmpty()) { /* Fallback, look in obvious places */ directories << "/usr/lib/ladspa"; directories << "/usr/local/lib/ladspa"; directories << "/usr/lib64/ladspa"; directories << "/usr/local/lib64/ladspa"; } else directories = ladspa_path.split(':'); foreach(QString dir, directories) findPlugins(dir); } LADSPAEffect *LADSPAHost::load(const QString &filename, long int num) { LADSPA_Descriptor_Function descriptor_fn; LADSPAEffect *instance = new LADSPAEffect; instance->fileName = filename; instance->library = dlopen(qPrintable(filename), RTLD_NOW); instance->handle = 0; instance->handle2 = 0; if (!instance->library) { delete instance; return 0; } descriptor_fn = (LADSPA_Descriptor_Function) dlsym(instance->library, "ladspa_descriptor"); if (!descriptor_fn) { dlclose(instance->library); delete instance; return 0; } instance->descriptor = descriptor_fn(num); return instance; } void LADSPAHost::unload(LADSPAEffect *instance) { const LADSPA_Descriptor *descriptor = instance->descriptor; if (instance->handle) { if (descriptor->deactivate) descriptor->deactivate(instance->handle); descriptor->cleanup(instance->handle); instance->handle = 0; } if (instance->handle2) { if (descriptor->deactivate) descriptor->deactivate(instance->handle2); descriptor->cleanup(instance->handle2); instance->handle2 = 0; } if (instance->library) { dlclose(instance->library); instance->library = 0; } m_effects.removeAll(instance); qDeleteAll(instance->controls); delete instance; } void LADSPAHost::bootPlugin(LADSPAEffect *instance) { const LADSPA_Descriptor *descriptor = instance->descriptor; instance->handle = descriptor->instantiate(descriptor, m_freq); if (m_chan > 1 && !instance->stereo) { /* Create an additional instance */ instance->handle2 = descriptor->instantiate(descriptor, m_freq); } portAssign(instance); if (descriptor->activate) { descriptor->activate(instance->handle); if (instance->handle2) descriptor->activate(instance->handle2); } } int LADSPAHost::applyEffect(qint16 *d, int length) { qint16 *raw16 = d; LADSPAEffect *instance; int k; if (m_effects.isEmpty()) return length; if (m_chan == 1) { for (k = 0; k < length >> 1; ++k) m_left[k] = (LADSPA_Data) raw16[k] / 32768.0f; foreach(instance, m_effects) { if (instance->handle) instance->descriptor->run(instance->handle, length >> 1); } for (k = 0; k < length >> 1; ++k) raw16[k] = qBound((int)(m_left[k] * 32768.0f), -32768, 32767); } else { for (k = 0; k < length >> 1; k += 2) { m_left[k >> 1] = (LADSPA_Data) raw16[k] / 32768.0f; m_right[k >> 1] = (LADSPA_Data) raw16[k+1] / 32768.0f; } foreach(instance, m_effects) { if (instance->handle) instance->descriptor->run(instance->handle, length >> 2); if (instance->handle2) instance->descriptor->run(instance->handle2, length >> 2); } for (k = 0; k < length >> 1; k += 2) { raw16[k] = qBound((int)(m_left[k >> 1] * 32768.0f), -32768, 32767); raw16[k+1] = qBound((int)(m_right[k >> 1] * 32768.0f), -32768, 32767); } } return length; } void LADSPAHost::portAssign(LADSPAEffect *instance) { unsigned long port; unsigned long inputs = 0, outputs = 0; const LADSPA_Descriptor *plugin = instance->descriptor; for (port = 0; port < plugin->PortCount; ++port) { if (LADSPA_IS_PORT_CONTROL(plugin->PortDescriptors[port])) { if (port < MAX_KNOBS) { plugin->connect_port(instance->handle, port, &(instance->knobs[port])); if (instance->handle2) plugin->connect_port(instance->handle2, port, &(instance->knobs[port])); } else { plugin->connect_port(instance->handle, port, m_trash); if (instance->handle2) plugin->connect_port(instance->handle2, port, m_trash); } } else if (LADSPA_IS_PORT_AUDIO(plugin->PortDescriptors[port])) { if (LADSPA_IS_PORT_INPUT(plugin->PortDescriptors[port])) { if (inputs == 0) { plugin->connect_port(instance->handle, port, m_left); if (instance->handle2) plugin->connect_port(instance->handle2, port, m_right); } else if (inputs == 1 && instance->stereo) { plugin->connect_port(instance->handle, port, m_right); } else { plugin->connect_port(instance->handle, port, m_trash); if (instance->handle2) plugin->connect_port(instance->handle2, port, m_trash); } inputs++; } else if (LADSPA_IS_PORT_OUTPUT(plugin->PortDescriptors[port])) { if (outputs == 0) { plugin->connect_port(instance->handle, port, m_left); if (instance->handle2) plugin->connect_port(instance->handle2, port, m_right); } else if (outputs == 1 && instance->stereo) { plugin->connect_port(instance->handle, port, m_right); } else { plugin->connect_port(instance->handle, port, m_trash); if (instance->handle2) plugin->connect_port(instance->handle2, port, m_trash); } outputs++; } } } } void LADSPAHost::findPlugins(const QString &path_entry) { LADSPAPlugin *plugin; void *library = 0; LADSPA_Descriptor_Function descriptor_fn; const LADSPA_Descriptor *descriptor; long int k; unsigned long int port, input, output; QDir dir (path_entry); dir.setFilter(QDir::Files | QDir::Hidden); dir.setSorting(QDir::Name); QFileInfoList files = dir.entryInfoList((QStringList() << "*.so")); foreach(QFileInfo file, files) { library = dlopen(qPrintable(file.absoluteFilePath ()), RTLD_LAZY); if (library == 0) { continue; } descriptor_fn = (LADSPA_Descriptor_Function) dlsym(library, "ladspa_descriptor"); if (descriptor_fn == 0) { dlclose(library); continue; } for (k = 0;; ++k) { descriptor = descriptor_fn(k); if (descriptor == 0) { break; } plugin = new LADSPAPlugin; plugin->name = strdup(descriptor->Name); plugin->fileName = file.absoluteFilePath (); plugin->id = k; plugin->unique_id = descriptor->UniqueID; for (input = output = port = 0; port < descriptor->PortCount; ++port) { if (LADSPA_IS_PORT_AUDIO(descriptor->PortDescriptors[port])) { if (LADSPA_IS_PORT_INPUT(descriptor->PortDescriptors[port])) input++; if (LADSPA_IS_PORT_OUTPUT(descriptor->PortDescriptors[port])) output++; } else if (LADSPA_IS_PORT_CONTROL(descriptor->PortDescriptors[port])) { } } plugin->stereo = (input >= 2 && output >= 2); m_plugins.append(plugin); } dlclose(library); } } LADSPAEffect *LADSPAHost::addPlugin(LADSPAPlugin *plugin) { if (!plugin) return 0; LADSPAEffect *instance; if (!(instance = load(plugin->fileName, plugin->id))) return 0; instance->stereo = plugin->stereo; if (m_chan && m_freq) bootPlugin(instance); initialize(instance); m_effects.append(instance); return instance; } void LADSPAHost::initialize(LADSPAEffect *instance) { const LADSPA_Descriptor *plugin = instance->descriptor; const LADSPA_PortRangeHint *hints = plugin->PortRangeHints; LADSPA_Data fact, min, max, step, start; for (unsigned long k = 0; k < MAX_KNOBS && k < plugin->PortCount; ++k) { if (!LADSPA_IS_PORT_CONTROL(plugin->PortDescriptors[k])) continue; LADSPAControl *c = new LADSPAControl; c->name = QString(plugin->PortNames[k]); if (LADSPA_IS_HINT_TOGGLED(hints[k].HintDescriptor)) { c->type = LADSPAControl::BUTTON; c->min = 0; c->max = 0; c->step = 0; c->value = &instance->knobs[k]; instance->controls << c; continue; } if (LADSPA_IS_HINT_SAMPLE_RATE(hints[k].HintDescriptor)) fact = m_freq; else fact = 1.0f; if (LADSPA_IS_HINT_BOUNDED_BELOW(hints[k].HintDescriptor)) min = hints[k].LowerBound * fact; else min = -10000.0f; if (LADSPA_IS_HINT_BOUNDED_ABOVE(hints[k].HintDescriptor)) max = hints[k].UpperBound * fact; else max = 10000.0f; /* infinity */ if (10000.0f <= max - min) { step = 5.0f; /* 100.0 ... lots */ } else if (100.0f < max - min) { step = 5.0f; /* 10.0 ... 100.0 */ } else if (10.0f < max - min) { step = 0.5f; /* 1.0 ... 10.0 */ } else if (1.0f < max - min) { step = 0.05f; /* 0.0 ... 1.0 */ } else { step = 0.005f; } if (LADSPA_IS_HINT_INTEGER(hints[k].HintDescriptor)) { if (step < 1.0f) step = 1.0f; } if (LADSPA_IS_HINT_DEFAULT_MINIMUM(hints[k].HintDescriptor)) start = min; else if (LADSPA_IS_HINT_DEFAULT_LOW(hints[k].HintDescriptor)) start = min * 0.75f + max * 0.25f; else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(hints[k].HintDescriptor)) start = min * 0.5f + max * 0.5f; else if (LADSPA_IS_HINT_DEFAULT_HIGH(hints[k].HintDescriptor)) start = min * 0.25f + max * 0.75f; else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(hints[k].HintDescriptor)) start = max; else if (LADSPA_IS_HINT_DEFAULT_0(hints[k].HintDescriptor)) start = 0.0f; else if (LADSPA_IS_HINT_DEFAULT_1(hints[k].HintDescriptor)) start = 1.0f; else if (LADSPA_IS_HINT_DEFAULT_100(hints[k].HintDescriptor)) start = 100.0f; else if (LADSPA_IS_HINT_DEFAULT_440(hints[k].HintDescriptor)) start = 440.0f; else if (LADSPA_IS_HINT_INTEGER(hints[k].HintDescriptor)) start = min; else if (max >= 0.0f && min <= 0.0f) start = 0.0f; else start = min * 0.5f + max * 0.5f; instance->knobs[k] = start; if(LADSPA_IS_PORT_OUTPUT(plugin->PortDescriptors[k])) c->type = LADSPAControl::LABEL; else c->type = LADSPAControl::SLIDER; c->min = min; c->max = max; c->step = step; c->value = &instance->knobs[k]; instance->controls << c; } } qmmp-0.7.4/src/plugins/Effect/stereo/0000775000175000017500000000000012256224735016171 5ustar useruserqmmp-0.7.4/src/plugins/Effect/stereo/effectstereofactory.h0000664000175000017500000000367412256224735022422 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef EFFECTSTEREOFACTORY_H #define EFFECTSTEREOFACTORY_H #include #include #include /** @author Ilya Kotov */ class EffectStereoFactory : public QObject, public EffectFactory { Q_OBJECT Q_INTERFACES(EffectFactory); public: const EffectProperties properties() const; Effect *create(); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Effect/stereo/stereoplugin.cpp0000664000175000017500000000703212256224735021417 0ustar useruser/*************************************************************************** * Copyright (C) 1999 by Johan Levin * * * * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "stereoplugin.h" StereoPlugin *StereoPlugin::m_instance = 0; StereoPlugin::StereoPlugin() : Effect() { m_instance = this; m_format = Qmmp::PCM_S16LE; m_avg = 0; m_ldiff = 0; m_rdiff = 0; m_tmp = 0; m_mul = 2.0; m_chan = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_mul = settings.value("extra_stereo/intensity", 1.0).toDouble(); } StereoPlugin::~StereoPlugin() { m_instance = 0; } void StereoPlugin::applyEffect(Buffer *b) { if(m_chan != 2) return; m_mutex.lock(); if(m_format == Qmmp::PCM_S16LE) { short *data = (short *)b->data; for (uint i = 0; i < b->nbytes >> 1; i += 2) { m_avg = (data[i] + data[i + 1]) / 2; m_ldiff = data[i] - m_avg; m_rdiff = data[i + 1] - m_avg; m_tmp = m_avg + m_ldiff * m_mul; data[i] = qBound(-32768.0, m_tmp, 32767.0); m_tmp = m_avg + m_rdiff * m_mul; data[i + 1] = qBound(-32768.0, m_tmp, 32767.0); } } else if(m_format == Qmmp::PCM_S24LE || m_format == Qmmp::PCM_S32LE) { int *data = (int *)b->data; for (uint i = 0; i < b->nbytes >> 2; i += 2) { m_avg = (data[i] + data[i + 1]) / 2; m_ldiff = data[i] - m_avg; m_rdiff = data[i + 1] - m_avg; m_tmp = m_avg + m_ldiff * m_mul; data[i] = m_tmp; m_tmp = m_avg + m_rdiff * m_mul; data[i + 1] = m_tmp; } } m_mutex.unlock(); } void StereoPlugin::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_chan = chan; m_format = format; Effect::configure(freq, chan, format); } void StereoPlugin::setIntensity(double level) { m_mutex.lock(); m_mul = level; m_mutex.unlock(); } StereoPlugin* StereoPlugin::instance() { return m_instance; } qmmp-0.7.4/src/plugins/Effect/stereo/CMakeLists.txt0000664000175000017500000000270212256224735020732 0ustar useruserproject(libstereo) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libstereo_SRCS stereoplugin.cpp settingsdialog.cpp effectstereofactory.cpp ) SET(libstereo_HDRS stereoplugin.h ) SET(libstereo_MOC_HDRS settingsdialog.h effectstereofactory.h ) SET(libstereo_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libstereo_RCC_SRCS ${libstereo_RCCS}) QT4_WRAP_CPP(libstereo_MOC_SRCS ${libstereo_MOC_HDRS}) # user interface SET(libstereo_UIS settingsdialog.ui ) QT4_WRAP_UI(libstereo_UIS_H ${libstereo_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(stereo MODULE ${libstereo_SRCS} ${libstereo_MOC_SRCS} ${libstereo_UIS_H} ${libstereo_RCC_SRCS} ${libstereo_HDRS}) add_dependencies(stereo qmmp) target_link_libraries(stereo ${QT_LIBRARIES} -lqmmp) install(TARGETS stereo DESTINATION ${LIB_DIR}/qmmp/Effect) qmmp-0.7.4/src/plugins/Effect/stereo/effectstereofactory.cpp0000664000175000017500000000525412256224735022751 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "effectstereofactory.h" #include "settingsdialog.h" #include "stereoplugin.h" const EffectProperties EffectStereoFactory::properties() const { EffectProperties properties; properties.name = tr("Extra Stereo Plugin"); properties.shortName = "stereo"; properties.hasSettings = true; properties.hasAbout = true; return properties; } Effect *EffectStereoFactory::create() { return new StereoPlugin(); } void EffectStereoFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s ->show(); } void EffectStereoFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Extra Stereo Plugin"), tr("Qmmp Extra Stereo Plugin")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Based on the Extra Stereo Plugin for Xmms by Johan Levin")); } QTranslator *EffectStereoFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/stereo_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(stereo,EffectStereoFactory) qmmp-0.7.4/src/plugins/Effect/stereo/settingsdialog.cpp0000664000175000017500000000505212256224735021717 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "stereoplugin.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_level = settings.value("extra_stereo/intensity", 1.0).toDouble(); ui.intensitySlider->setValue(m_level * 100 / 10.0); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("extra_stereo/intensity", ui.intensitySlider->value() * 10.0 / 100); QDialog::accept(); } void SettingsDialog::SettingsDialog::reject() { if (StereoPlugin::instance()) //restore settings StereoPlugin::instance()->setIntensity(m_level); QDialog::reject(); } void SettingsDialog::on_intensitySlider_valueChanged (int value) { double level = value * 10.0 / 100; ui.intensityLabel->setText(QString(tr("%1")).arg(level)); if (StereoPlugin::instance()) StereoPlugin::instance()->setIntensity(level); } qmmp-0.7.4/src/plugins/Effect/stereo/stereoplugin.h0000664000175000017500000000377412256224735021075 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef STEREOPLUGIN_H #define STEREOPLUGIN_H #include #include /** @author Ilya Kotov */ class StereoPlugin : public Effect { public: StereoPlugin(); virtual ~StereoPlugin(); void applyEffect(Buffer *b); void configure(quint32 freq, int chan, Qmmp::AudioFormat format); void setIntensity(double level); static StereoPlugin* instance(); private: int m_chan; QMutex m_mutex; double m_avg, m_ldiff, m_rdiff, m_tmp, m_mul; int m_format; static StereoPlugin *m_instance; }; #endif qmmp-0.7.4/src/plugins/Effect/stereo/settingsdialog.ui0000664000175000017500000000564712256224735021564 0ustar useruser SettingsDialog 0 0 383 69 Extra Stereo Plugin Settings 6 6 6 Effect intensity: 100 Qt::Horizontal 28 0 - Qt::Horizontal 229 23 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 76 91 88 buttonBox rejected() SettingsDialog reject() 326 78 139 60 qmmp-0.7.4/src/plugins/Effect/stereo/translations/0000775000175000017500000000000012256224735020712 5ustar useruserqmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_pt_BR.ts0000664000175000017500000000372012256224735025231 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_zh_CN.ts0000664000175000017500000000405012256224735025221 0ustar useruser EffectStereoFactory Extra Stereo Plugin 立体声扩展插件 About Extra Stereo Plugin 关于立体声扩展插件 Qmmp Extra Stereo Plugin Qmmp 立体声扩展插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin 基于 Johan Levin 的 Xmms 立体声扩展插件 SettingsDialog Extra Stereo Plugin Settings 立体声扩展插件设置 Effect intensity: 效果强度: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_zh_TW.ts0000664000175000017500000000404512256224735025257 0ustar useruser EffectStereoFactory Extra Stereo Plugin 立体聲擴展插件 About Extra Stereo Plugin 關於立体聲擴展插件 Qmmp Extra Stereo Plugin Qmmp 立体聲擴展插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin 基於 Johan Levin 的 Xmms 立体聲擴展插件 SettingsDialog Extra Stereo Plugin Settings 立体聲擴展插件設定 Effect intensity: 效果強度 - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/translations.qrc0000664000175000017500000000147512256224735024151 0ustar useruser stereo_plugin_ru.qm stereo_plugin_uk_UA.qm stereo_plugin_zh_CN.qm stereo_plugin_zh_TW.qm stereo_plugin_tr.qm stereo_plugin_cs.qm stereo_plugin_pt_BR.qm stereo_plugin_de.qm stereo_plugin_pl_PL.qm stereo_plugin_fr.qm stereo_plugin_it.qm stereo_plugin_kk.qm stereo_plugin_lt.qm stereo_plugin_hu.qm stereo_plugin_nl.qm stereo_plugin_ja.qm stereo_plugin_sk.qm stereo_plugin_es.qm stereo_plugin_he.qm stereo_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_gl_ES.ts0000664000175000017500000000405212256224735025213 0ustar useruser EffectStereoFactory Extra Stereo Plugin Engadido Extra Stereo About Extra Stereo Plugin Sobre o engadido Extra Stereo Qmmp Extra Stereo Plugin Engadido Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Baseado no engadido Extra Stereo para Xmms por Johan Levin SettingsDialog Extra Stereo Plugin Settings Opcións do engadido Extra Stereo Effect intensity: Intensidade do efecto: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_de.ts0000664000175000017500000000401712256224735024613 0ustar useruser EffectStereoFactory Extra Stereo Plugin Extra-Stereo-Modul About Extra Stereo Plugin Über Extra-Stereo-Modul Qmmp Extra Stereo Plugin Qmmp Extra-Stereo-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Basiert auf dem Extra-Stereo-Modul für XMMS von Johan Levin SettingsDialog Extra Stereo Plugin Settings Einstellungen Extra-Stereo-Modul Effect intensity: Effektintensität: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_cs.ts0000664000175000017500000000405212256224735024627 0ustar useruser EffectStereoFactory Extra Stereo Plugin Modul pro rozšířené stereo About Extra Stereo Plugin O modulu pro rozšířené stereo Qmmp Extra Stereo Plugin Modul Qmmp pro rozšířené stereo Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Založeno na Extra Stereo Plugin pro XMMS od Johana Levina SettingsDialog Extra Stereo Plugin Settings Nastavení rozšířeného sterea Effect intensity: Míra efektu: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_es.ts0000664000175000017500000000410412256224735024627 0ustar useruser EffectStereoFactory Extra Stereo Plugin Módulo de estéreo extra About Extra Stereo Plugin Acerca del módulo de estéreo extra Qmmp Extra Stereo Plugin Módulo de estéreo extra para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Basado en el módulo de estéreo extra para Xmms de Johan Levin SettingsDialog Extra Stereo Plugin Settings Configuración del módulo de estéreo extra Effect intensity: Intensidad del efecto: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_fr.ts0000664000175000017500000000372012256224735024632 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_he.ts0000664000175000017500000000416312256224735024621 0ustar useruser EffectStereoFactory Extra Stereo Plugin תוספת סטריאו נוסף About Extra Stereo Plugin אודות תוספת סטריאו נוסף Qmmp Extra Stereo Plugin תוספת סטריאו נוסף Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin מבוססת על תוספת סטריאו נוסף עבור Xmms מאת Johan Levin SettingsDialog Extra Stereo Plugin Settings הגדרות תוספת סטריאו נוסף Effect intensity: חוזק אפקט: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_hu.ts0000664000175000017500000000372012256224735024637 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_ja.ts0000664000175000017500000000414712256224735024621 0ustar useruser EffectStereoFactory Extra Stereo Plugin 拡張ステレオプラグイン About Extra Stereo Plugin 拡張ステレオプラグインについて Qmmp Extra Stereo Plugin QMMP 拡張ステレオプラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Johan Levin 作の XMMS 拡張ステレオプラグインを基に作成 SettingsDialog Extra Stereo Plugin Settings 拡張ステレオプラグイン設定 Effect intensity: 効力強度: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_it.ts0000664000175000017500000000367412256224735024647 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_kk.ts0000664000175000017500000000372012256224735024630 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_lt.ts0000664000175000017500000000411612256224735024642 0ustar useruser EffectStereoFactory Extra Stereo Plugin Ekstra Stereo įskiepis About Extra Stereo Plugin Apie Ekstra Stereo įskiepį Qmmp Extra Stereo Plugin Qmmp Ekstra tereo įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Sukurta Xmms Ekstra Stereo įskiepio pagrindu, kurio autorius Johan Levin SettingsDialog Extra Stereo Plugin Settings Extra stereo įskiepio nustatymai Effect intensity: Efekto stiprumas: - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_nl.ts0000664000175000017500000000404212256224735024632 0ustar useruser EffectStereoFactory Extra Stereo Plugin Extra Stereo Module About Extra Stereo Plugin Over de Extra Stereo Module Qmmp Extra Stereo Plugin Extra Stereo Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Gebasseerd op de Extra Stereo Module voor Xmms geschreven door Johan Levin SettingsDialog Extra Stereo Plugin Settings Extra Stereo Module Instellingen Effect intensity: Effectintensiteit: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_pl.ts0000664000175000017500000000401512256224735024634 0ustar useruser EffectStereoFactory Extra Stereo Plugin Wtyczka Extra Stereo About Extra Stereo Plugin O wtyczce Extra Stereo Qmmp Extra Stereo Plugin Wtyczka Extra Stereo dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Oparta na kodzie wtyczki Extra Stereo dla Xmms (Johan Levin) SettingsDialog Extra Stereo Plugin Settings Ustawienia wtyczki Extra Stereo Effect intensity: Intensywność: - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_ru.ts0000664000175000017500000000443412256224735024654 0ustar useruser EffectStereoFactory Extra Stereo Plugin Модуль расш. стереобазы About Extra Stereo Plugin О модуле расширения стереобащы Qmmp Extra Stereo Plugin Модуль расширения стереобазы для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Основан на базе модуля Extra Stereo для Xmms (разработчик: Johan Levin) SettingsDialog Extra Stereo Plugin Settings Настройки модуля расширения стереобазы Effect intensity: Интенсивность эффекта: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_sk.ts0000664000175000017500000000372012256224735024640 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_tr.ts0000664000175000017500000000367712256224735024663 0ustar useruser EffectStereoFactory Extra Stereo Plugin About Extra Stereo Plugin Qmmp Extra Stereo Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin SettingsDialog Extra Stereo Plugin Settings Effect intensity: - - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_uk_UA.ts0000664000175000017500000000436512256224735025235 0ustar useruser EffectStereoFactory Extra Stereo Plugin Модуль розширення стереобази About Extra Stereo Plugin Про модуль розширення стереобази Qmmp Extra Stereo Plugin Модуль розширення стереобази для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Базується на модулі розширення стерео для Xmms від Johan Levin SettingsDialog Extra Stereo Plugin Settings Налаштування модуля розширення стереобази Effect intensity: Глибина ефекту: - %1 qmmp-0.7.4/src/plugins/Effect/stereo/translations/stereo_plugin_pl_PL.ts0000664000175000017500000000402612256224735025231 0ustar useruser EffectStereoFactory Extra Stereo Plugin Wtyczka Ekstra Stereo About Extra Stereo Plugin O wtyczce Ekstra Stereo Qmmp Extra Stereo Plugin Wtyczka Ekstra Stereo dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the Extra Stereo Plugin for Xmms by Johan Levin Oparta na wtyczce Ekstra Stereo dla Xmms (Johan Levin) SettingsDialog Extra Stereo Plugin Settings Ustawienia wtyczki Ekstra Stereo Effect intensity: Intensywność efektu: - - %1 %1 qmmp-0.7.4/src/plugins/Effect/stereo/stereo.pro0000664000175000017500000000255312256224735020221 0ustar useruserinclude(../../plugins.pri) HEADERS += stereoplugin.h \ effectstereofactory.h \ settingsdialog.h SOURCES += stereoplugin.cpp \ effectstereofactory.cpp \ settingsdialog.cpp TARGET =$$PLUGINS_PREFIX/Effect/stereo INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/stereo_plugin_cs.ts \ translations/stereo_plugin_de.ts \ translations/stereo_plugin_zh_CN.ts \ translations/stereo_plugin_zh_TW.ts \ translations/stereo_plugin_uk_UA.ts \ translations/stereo_plugin_pl.ts \ translations/stereo_plugin_ru.ts \ translations/stereo_plugin_it.ts \ translations/stereo_plugin_tr.ts \ translations/stereo_plugin_lt.ts \ translations/stereo_plugin_nl.ts \ translations/stereo_plugin_ja.ts \ translations/stereo_plugin_es.ts RESOURCES = translations/translations.qrc FORMS += settingsdialog.ui unix { isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Effect INSTALLS += target LIBS += -lqmmp -L/usr/lib -I/usr/include QMAKE_CLEAN =$$PLUGINS_PREFIX/Effect/libstereo.so } win32 { QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 } qmmp-0.7.4/src/plugins/Effect/stereo/settingsdialog.h0000664000175000017500000000363612256224735021372 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); virtual void reject(); private slots: void on_intensitySlider_valueChanged (int value); private: Ui::SettingsDialog ui; double m_level; }; #endif qmmp-0.7.4/src/plugins/Effect/Effect.pro0000664000175000017500000000034412256224735016607 0ustar useruserinclude (../../../qmmp.pri) TEMPLATE = subdirs SUBDIRS += crossfade stereo contains(CONFIG, BS2B_PLUGIN){ SUBDIRS += bs2b } unix { SUBDIRS += srconverter contains(CONFIG, LADSPA_PLUGIN){ SUBDIRS += ladspa } } qmmp-0.7.4/src/plugins/Input/0000775000175000017500000000000012256224735014573 5ustar useruserqmmp-0.7.4/src/plugins/Input/aac/0000775000175000017500000000000012256224735015317 5ustar useruserqmmp-0.7.4/src/plugins/Input/aac/aacfile.h0000664000175000017500000000472112256224735017060 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef AACFILE_H #define AACFILE_H #include #include #include #include #include #include #include #include class QIODevice; class TagExtractor; class QBuffer; /** @author Ilya Kotov */ class AACFile { public: AACFile(QIODevice *i, bool metaData = true, bool adts = true); ~AACFile(); qint64 length(); quint32 bitrate(); quint32 samplerate(); int offset() const; bool isValid(); const QMap metaData(); private: void parseADTS(); void parseID3v2(); qint64 m_length; quint32 m_bitrate; int m_offset; QIODevice *m_input; bool m_isValid; quint32 m_samplerate; QMap m_metaData; }; class ID3v2Tag : public TagLib::ID3v2::Tag { public: ID3v2Tag(QByteArray *array, long offset); protected: void read (); private: QBuffer *m_buf; long m_offset; }; #endif qmmp-0.7.4/src/plugins/Input/aac/decoderaacfactory.cpp0000664000175000017500000000701712256224735021472 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "aacfile.h" #include "aacmetadatamodel.h" #include "decoder_aac.h" #include "decoderaacfactory.h" // DecoderAACFactory bool DecoderAACFactory::supports(const QString &source) const { return (source.right(4).toLower() == ".aac"); } bool DecoderAACFactory::canDecode(QIODevice *input) const { AACFile aac_file(input, false, false); return aac_file.isValid(); } const DecoderProperties DecoderAACFactory::properties() const { DecoderProperties properties; properties.name = tr("AAC Plugin"); properties.filters << "*.aac"; properties.description = tr("AAC Files"); properties.contentTypes << "audio/aacp" << "audio/aac"; properties.shortName = "aac"; properties.hasAbout = true; properties.hasSettings = false; return properties; } Decoder *DecoderAACFactory::create(const QString &, QIODevice *input) { return new DecoderAAC(input); } QList DecoderAACFactory::createPlayList(const QString &fileName, bool useMetaData) { FileInfo *info = new FileInfo(fileName); QFile file(fileName); if (file.open(QIODevice::ReadOnly)) { AACFile aac_file(&file, useMetaData); if (useMetaData) info->setMetaData(aac_file.metaData()); info->setLength(aac_file.length()); } QList list; list << info; return list; } MetaDataModel* DecoderAACFactory::createMetaDataModel(const QString &path, QObject *parent) { return new AACMetaDataModel(path, parent); } void DecoderAACFactory::showSettings(QWidget *) {} void DecoderAACFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About AAC Audio Plugin"), tr("Qmmp AAC Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderAACFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/aac_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(aac,DecoderAACFactory) qmmp-0.7.4/src/plugins/Input/aac/decoder_aac.cpp0000664000175000017500000001354412256224735020243 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "decoder_aac.h" #include "aacfile.h" #define AAC_BUFFER_SIZE 4096 // Decoder class DecoderAAC::DecoderAAC(QIODevice *i) : Decoder(i) { m_bitrate = 0; m_totalTime = 0; m_data = 0; m_input_buf = 0; m_input_at = 0; m_sample_buf = 0; m_sample_buf_at = 0; m_sample_buf_size = 0; } DecoderAAC::~DecoderAAC() { if (data()) { if (data()->handle) NeAACDecClose (data()->handle); delete data(); m_data = 0; } if (m_input_buf) delete [] m_input_buf; m_input_buf = 0; m_bitrate = 0; } bool DecoderAAC::initialize() { m_bitrate = 0; m_totalTime = 0; if (!input()) { qWarning("DecoderAAC: cannot initialize. No input."); return false; } if (!m_input_buf) m_input_buf = new char[AAC_BUFFER_SIZE]; m_input_at = 0; if (!input()->isOpen()) { if (!input()->open(QIODevice::ReadOnly)) { qWarning("DecoderAAC: %s", qPrintable(input()->errorString ())); return false; } } AACFile aac_file(input()); if (!aac_file.isValid()) { qWarning("DecoderAAC: unsupported AAC file"); return false; } //skip id3 tag and partial frame if(aac_file.offset() > 0) { qDebug("DecoderAAC: header offset = %d bytes", aac_file.offset()); char data[aac_file.offset()]; input()->read(data, aac_file.offset()); } m_totalTime = aac_file.length() * 1000; m_bitrate = aac_file.bitrate(); if (!m_data) m_data = new aac_data; data()->handle = NeAACDecOpen(); NeAACDecConfigurationPtr conf; conf = NeAACDecGetCurrentConfiguration(data()->handle); conf->downMatrix = 1; conf->defSampleRate = 44100; conf->dontUpSampleImplicitSBR = 0; conf->defObjectType = LC; conf->outputFormat = FAAD_FMT_16BIT; NeAACDecSetConfiguration(data()->handle, conf); m_input_at = input()->read((char *)m_input_buf, AAC_BUFFER_SIZE); #ifdef FAAD_MODIFIED uint32_t freq = 0; uint8_t chan = 0; #else unsigned long freq = 0; unsigned char chan = 0; #endif int res = NeAACDecInit (data()->handle, (unsigned char*) m_input_buf, m_input_at, &freq, &chan); if (res < 0) { qWarning("DecoderAAC: NeAACDecInit() failed"); return false; } if (!freq || !chan) { qWarning("DecoderAAC: invalid sound parameters"); return false; } memmove(m_input_buf, m_input_buf + res, m_input_at - res); m_input_at -= res; configure(freq, chan, Qmmp::PCM_S16LE); qDebug("DecoderAAC: initialize succes"); return true; } qint64 DecoderAAC::read(char *audio, qint64 maxSize) { NeAACDecFrameInfo frame_info; qint64 size = 0, to_read, read; bool eof = false; while(m_sample_buf_size <= 0 && !eof) { m_sample_buf_at = 0; if (m_input_at < AAC_BUFFER_SIZE) { to_read = AAC_BUFFER_SIZE - m_input_at; read = input()->read((char *) (m_input_buf + m_input_at), to_read); eof = (read != to_read); m_input_at += read; } m_sample_buf = NeAACDecDecode(data()->handle, &frame_info, (uchar *)m_input_buf, m_input_at); memmove(m_input_buf, m_input_buf + frame_info.bytesconsumed, m_input_at - frame_info.bytesconsumed); m_input_at -= frame_info.bytesconsumed; if (frame_info.error > 0) { m_input_at = 0; qDebug("DecoderAAC: %s", NeAACDecGetErrorMessage(frame_info.error)); return -1; } if(frame_info.samples > 0) m_bitrate = frame_info.bytesconsumed * 8 * frame_info.samplerate * frame_info.channels / frame_info.samples / 1000; m_sample_buf_size = frame_info.samples * 2; } if(m_sample_buf_size > 0) { size = qMin(m_sample_buf_size, maxSize); memcpy(audio, (char *)(m_sample_buf) + m_sample_buf_at, size); m_sample_buf_at += size; m_sample_buf_size -= size; } return size; } qint64 DecoderAAC::totalTime() { return m_totalTime; } int DecoderAAC::bitrate() { return m_bitrate; } void DecoderAAC::seek(qint64 pos) { input()->seek(pos * input()->size() / m_totalTime); NeAACDecPostSeekReset (data()->handle, 0); m_input_at = 0; } qmmp-0.7.4/src/plugins/Input/aac/CMakeLists.txt0000664000175000017500000000410612256224735020060 0ustar useruserproject(libaac) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckIncludeFileCXX) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libfaad CHECK_INCLUDE_FILE_CXX(neaacdec.h FAAD_FOUND) IF(FAAD_FOUND) SET(CMAKE_REQUIRED_LIBRARIES faad) CHECK_CXX_SOURCE_COMPILES(" #include #include #include #include int main(int argc, char **argv) { #ifdef OLD_FAAD_PROTO unsigned long int srate; #else uint32_t srate; #endif uint32_t l; uint8_t *d; unsigned char chan; void *_instance; NeAACDecInit2(_instance, d,l, &srate,&chan); return 0; }" FAAD_MODIFIED) IF(FAAD_MODIFIED) ADD_DEFINITIONS(-DFAAD_MODIFIED) ENDIF(FAAD_MODIFIED) ENDIF(FAAD_FOUND) include_directories(${TAGLIB_INCLUDE_DIRS}) link_directories(${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${TAGLIB_CFLAGS}) SET(libaac_SRCS decoder_aac.cpp decoderaacfactory.cpp aacmetadatamodel.cpp aacfile.cpp ) SET(libaac_HDRS decoder_aac.h aacfile.h ) SET(libaac_MOC_HDRS decoderaacfactory.h aacmetadatamodel.h ) SET(libaac_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libaac_RCC_SRCS ${libaac_RCCS}) QT4_WRAP_CPP(libaac_MOC_SRCS ${libaac_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(FAAD_FOUND) ADD_LIBRARY(aac MODULE ${libaac_SRCS} ${libaac_MOC_SRCS} ${libaac_RCC_SRCS} ${libaac_HDRS}) add_dependencies(aac qmmp) target_link_libraries(aac ${QT_LIBRARIES} -lqmmp -lfaad ${TAGLIB_LDFLAGS}) install(TARGETS aac DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(FAAD_FOUND) qmmp-0.7.4/src/plugins/Input/aac/decoderaacfactory.h0000664000175000017500000000444112256224735021135 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERAACFACTORY_H #define DECODERAACFACTORY_H #include #include #include #include #include #include #include #include class DecoderAACFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory) public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString&, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/aac/aacfile.cpp0000664000175000017500000002016412256224735017412 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "aacfile.h" #define MAX_CHANNELS 6 #define AAC_BUFFER_SIZE 4096 static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0}; AACFile::AACFile(QIODevice *i, bool metaData, bool adts) { m_isValid = false; m_length = 0; m_bitrate = 0; m_samplerate = 0; m_input = i; m_offset = 0; uchar buf[AAC_BUFFER_SIZE]; qint64 buf_at = i->peek((char *) buf, AAC_BUFFER_SIZE); int tag_size = 0; if (!memcmp(buf, "ID3", 3)) //TODO parse id3 tag { /* high bit is not used */ tag_size = (buf[6] << 21) | (buf[7] << 14) | (buf[8] << 7) | (buf[9] << 0); tag_size += 10; if (buf_at - tag_size < 4) { qWarning("AACFile: invalid tag size"); return; } memmove (buf, buf + tag_size, buf_at - tag_size); buf_at -= tag_size; m_offset = tag_size; if (metaData) parseID3v2(); //parse id3v2 tags } int adts_offset = 0; while(adts_offset < buf_at - 6) { //try to determnate header type; if (buf[adts_offset] == 0xff && ((buf[adts_offset+1] & 0xf6) == 0xf0)) { int frame_length = ((((unsigned int)buf[adts_offset+3] & 0x3)) << 11) | (((unsigned int)buf[adts_offset+4]) << 3) | (buf[adts_offset+5] >> 5); if(adts_offset + frame_length > buf_at - 6) break; //check second sync word if ((buf[adts_offset + frame_length] == 0xFF) && ((buf[adts_offset + frame_length + 1] & 0xF6) == 0xF0)) { qDebug("AACFile: ADTS header found"); } else break; if (!i->isSequential() && adts) parseADTS(); m_isValid = true; m_offset += adts_offset; return; } adts_offset++; } if (memcmp(buf, "ADIF", 4) == 0) { qDebug("AACFile: ADIF header found"); int skip_size = (buf[4] & 0x80) ? 9 : 0; m_bitrate = ((buf[4 + skip_size] & 0x0F)<<19) | (buf[5 + skip_size]<<11) | (buf[6 + skip_size]<<3) | (buf[7 + skip_size] & 0xE0); if (!i->isSequential ()) m_length = (qint64) (((float)i->size()*8.f)/((float)m_bitrate) + 0.5f); else m_length = 0; m_bitrate = (int)((float)m_bitrate/1000.0f + 0.5f); m_isValid = true; } } AACFile::~AACFile() {} qint64 AACFile::length() { return m_length; } quint32 AACFile::bitrate() { return m_bitrate; } quint32 AACFile::samplerate() { return m_samplerate; } int AACFile::offset() const { return m_offset; } bool AACFile::isValid() { return m_isValid; } const QMap AACFile::metaData() { return m_metaData; } void AACFile::parseADTS() { uchar buf[FAAD_MIN_STREAMSIZE*MAX_CHANNELS]; qint64 buf_at = 0; int frames, frame_length; int t_framelength = 0; float frames_per_sec, bytes_per_frame; qint64 pos = m_input->pos(); m_input->seek(0); buf_at = m_input->read((char *)buf, FAAD_MIN_STREAMSIZE*MAX_CHANNELS); for (int i = 0; i < buf_at - 1; i++) { if (buf[i] == 0xff && (buf[i+1]&0xf6) == 0xf0) { memmove (buf, buf + i, buf_at - i); buf_at -= i; break; } } /* Read all frames to ensure correct time and bitrate */ for (frames = 0; /* */; frames++) { //qDebug("frame header = %d", buf[0]); buf_at += m_input->read((char *)buf + buf_at, FAAD_MIN_STREAMSIZE*MAX_CHANNELS - buf_at); if (buf_at > 7) { /* check syncword */ if (!((buf[0] == 0xFF)&&((buf[1] & 0xF6) == 0xF0))) break; if (frames == 0) m_samplerate = adts_sample_rates[(buf[2]&0x3c)>>2]; frame_length = ((((unsigned int)buf[3] & 0x3)) << 11) | (((unsigned int)buf[4]) << 3) | (buf[5] >> 5); t_framelength += frame_length; if (frame_length > buf_at) break; buf_at -= frame_length; memmove(buf, buf + frame_length, buf_at); } else { break; } } m_input->seek(pos); frames_per_sec = (float) m_samplerate/1024.0f; if (frames != 0) bytes_per_frame = (float)t_framelength/(float)(frames*1000); else bytes_per_frame = 0; m_bitrate = (quint32)(8. * bytes_per_frame * frames_per_sec + 0.5); if (frames_per_sec != 0) m_length = frames/frames_per_sec; else m_length = 1; } void AACFile::parseID3v2() { QByteArray array = m_input->peek(2048); int offset = array.indexOf("ID3"); if (offset < 0) return; ID3v2Tag taglib_tag(&array, offset); if (taglib_tag.isEmpty()) return; TagLib::String album = taglib_tag.album(); TagLib::String artist = taglib_tag.artist(); TagLib::String comment = taglib_tag.comment(); TagLib::String genre = taglib_tag.genre(); TagLib::String title = taglib_tag.title(); QTextCodec *codec = QTextCodec::codecForName ("UTF-8"); bool utf = true; m_metaData.insert(Qmmp::ALBUM, codec->toUnicode(album.toCString(utf)).trimmed()); m_metaData.insert(Qmmp::ARTIST, codec->toUnicode(artist.toCString(utf)).trimmed()); m_metaData.insert(Qmmp::COMMENT, codec->toUnicode(comment.toCString(utf)).trimmed()); m_metaData.insert(Qmmp::GENRE, codec->toUnicode(genre.toCString(utf)).trimmed()); m_metaData.insert(Qmmp::TITLE, codec->toUnicode(title.toCString(utf)).trimmed()); m_metaData.insert(Qmmp::YEAR, QString::number(taglib_tag.year())); m_metaData.insert(Qmmp::TRACK, QString::number(taglib_tag.track())); } ID3v2Tag::ID3v2Tag(QByteArray *array, long offset) : TagLib::ID3v2::Tag() { m_buf = new QBuffer(array); m_buf->open(QIODevice::ReadOnly); m_offset = offset; read(); } void ID3v2Tag::read () { m_buf->seek(m_offset); uint to_read = TagLib::ID3v2::Header::size(); if (to_read > AAC_BUFFER_SIZE - uint(m_offset)) return; header()->setData(TagLib::ByteVector(m_buf->read(to_read).data(), to_read)); to_read = header()->tagSize(); if (!to_read || AAC_BUFFER_SIZE < m_offset + TagLib::ID3v2::Header::size()) return; QByteArray array = m_buf->read(to_read); TagLib::ByteVector v(array.data(), array.size()); parse(v); } qmmp-0.7.4/src/plugins/Input/aac/aac.pro0000664000175000017500000000217712256224735016574 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decoderaacfactory.h \ decoder_aac.h \ aacfile.h \ aacmetadatamodel.h SOURCES += decoder_aac.cpp \ decoderaacfactory.cpp \ aacfile.cpp \ aacmetadatamodel.cpp TARGET = $$PLUGINS_PREFIX/Input/aac QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libaac.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp \ -lfaad \ -L/usr/lib \ -I/usr/include PKGCONFIG += taglib TRANSLATIONS = translations/aac_plugin_ru.ts \ translations/aac_plugin_uk_UA.ts \ translations/aac_plugin_zh_CN.ts \ translations/aac_plugin_zh_TW.ts \ translations/aac_plugin_cs.ts \ translations/aac_plugin_pl.ts \ translations/aac_plugin_de.ts \ translations/aac_plugin_it.ts \ translations/aac_plugin_tr.ts \ translations/aac_plugin_lt.ts \ translations/aac_plugin_nl.ts \ translations/aac_plugin_ja.ts \ translations/aac_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target qmmp-0.7.4/src/plugins/Input/aac/translations/0000775000175000017500000000000012256224735020040 5ustar useruserqmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_pt_BR.ts0000664000175000017500000000462612256224735023610 0ustar useruser AACMetaDataModel Length Sample rate Hz Bitrate kbps KB File size DecoderAACFactory AAC Plugin AAC Files About AAC Audio Plugin Qmmp AAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_zh_CN.ts0000664000175000017500000000461112256224735023575 0ustar useruser AACMetaDataModel Length 长度 Sample rate 取样率 Hz Bitrate 比特率 kbps KB File size 文件大小 DecoderAACFactory AAC Plugin AAC 插件 AAC Files AAC 文件 About AAC Audio Plugin 关于 AAC 音频插件 Qmmp AAC Audio Plugin Qmmp AAC 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_zh_TW.ts0000664000175000017500000000453312256224735023632 0ustar useruser AACMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Bitrate 比特率 kbps kbps KB KB File size 文件大小 DecoderAACFactory AAC Plugin AAC 插件 AAC Files AAC 檔案 About AAC Audio Plugin 關於 AAC 聲訊插件 Qmmp AAC Audio Plugin Qmmp AAC 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_gl_ES.ts0000664000175000017500000000460712256224735023572 0ustar useruser AACMetaDataModel Length Lonxitude Sample rate Frecuencia de mostra Hz Hz Bitrate Taxa de bits kbps kbps KB KB File size Tamaño de ficheiro DecoderAACFactory AAC Plugin Engadido AAC AAC Files Ficheiros AAC About AAC Audio Plugin Sobre o engadido Audio AAC Qmmp AAC Audio Plugin Engadido de audio AAC de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/translations.qrc0000664000175000017500000000140112256224735023264 0ustar useruser aac_plugin_ru.qm aac_plugin_uk_UA.qm aac_plugin_zh_CN.qm aac_plugin_zh_TW.qm aac_plugin_tr.qm aac_plugin_cs.qm aac_plugin_pt_BR.qm aac_plugin_de.qm aac_plugin_pl_PL.qm aac_plugin_fr.qm aac_plugin_it.qm aac_plugin_kk.qm aac_plugin_lt.qm aac_plugin_hu.qm aac_plugin_nl.qm aac_plugin_ja.qm aac_plugin_sk.qm aac_plugin_es.qm aac_plugin_he.qm aac_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_uk_UA.ts0000664000175000017500000000466212256224735023606 0ustar useruser AACMetaDataModel Length Тривалість Sample rate Частота Hz Гц Bitrate Бітрейт kbps Кб/с KB Кб File size Розмір файлу DecoderAACFactory AAC Plugin Модуль AAC AAC Files Файли AAC About AAC Audio Plugin Про аудіо-модуль AAC Qmmp AAC Audio Plugin Модуль AAC для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_pl_PL.ts0000664000175000017500000000454712256224735023612 0ustar useruser AACMetaDataModel Length Długość Sample rate Próbkowanie Hz Bitrate Szybkość transmisji kbps KB File size Wilekość pliku DecoderAACFactory AAC Plugin Wtyczka AAC AAC Files Pliki AAC About AAC Audio Plugin O wtyczce dźwiękowej AAC Qmmp AAC Audio Plugin Wtyczka AAC dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_de.ts0000664000175000017500000000452512256224735023170 0ustar useruser AACMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Bitrate Bitrate kbps kbps KB KB File size Dateigröße DecoderAACFactory AAC Plugin AAC-Modul AAC Files AAC-Dateien About AAC Audio Plugin Über AAC-Audio-Modul Qmmp AAC Audio Plugin Qmmp AAC-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_cs.ts0000664000175000017500000000454012256224735023202 0ustar useruser AACMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Bitrate Datový tok kbps kbps KB KiB File size Velikost souboru DecoderAACFactory AAC Plugin Modul AAC AAC Files Soubory AAC About AAC Audio Plugin O modulu AAC Qmmp AAC Audio Plugin Vstupní modul Qmmp AAC Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_es.ts0000664000175000017500000000460012256224735023201 0ustar useruser AACMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Bitrate Tasa de bits kbps kbps KB KB File size Tamaño del archivo DecoderAACFactory AAC Plugin Módulo AAC AAC Files Archivos AAC About AAC Audio Plugin Acerca del módulo de sonido AAC Qmmp AAC Audio Plugin Módulo de sonido AAC para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_fr.ts0000664000175000017500000000462612256224735023211 0ustar useruser AACMetaDataModel Length Sample rate Hz Bitrate kbps KB File size DecoderAACFactory AAC Plugin AAC Files About AAC Audio Plugin Qmmp AAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_he.ts0000664000175000017500000000465512256224735023200 0ustar useruser AACMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Bitrate שיעור סיביות kbps KB ק״ב File size גודל קובץ DecoderAACFactory AAC Plugin תוספת AAC AAC Files קבצי AAC About AAC Audio Plugin אודות תוספת שמע AAC Qmmp AAC Audio Plugin תוספת שמע AAC ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_hu.ts0000664000175000017500000000462612256224735023216 0ustar useruser AACMetaDataModel Length Sample rate Hz Bitrate kbps KB File size DecoderAACFactory AAC Plugin AAC Files About AAC Audio Plugin Qmmp AAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_ja.ts0000664000175000017500000000471712256224735023175 0ustar useruser AACMetaDataModel Length 演奏時間 Sample rate サンプルレート Hz Hz Bitrate ビットレート kbps キロビット毎秒 KB KiB File size ファイルの大きさ DecoderAACFactory AAC Plugin AAC プラグイン AAC Files AAC ファイル About AAC Audio Plugin AAC 音響プラグインについて Qmmp AAC Audio Plugin QMMP AAC 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_it.ts0000664000175000017500000000455112256224735023213 0ustar useruser AACMetaDataModel Length Durata Sample rate Campionamento Hz Hz Bitrate bit/sec kbps kbps KB KB File size Dimensione file DecoderAACFactory AAC Plugin Modulo AAC AAC Files Brani AAC About AAC Audio Plugin Informazioni sul modulo Audio AAC Qmmp AAC Audio Plugin Modulo Audio AAC per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_kk.ts0000664000175000017500000000462612256224735023207 0ustar useruser AACMetaDataModel Length Sample rate Hz Bitrate kbps KB File size DecoderAACFactory AAC Plugin AAC Files About AAC Audio Plugin Qmmp AAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_lt.ts0000664000175000017500000000453412256224735023217 0ustar useruser AACMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Bitrate Kokybė kbps kbps KB КB File size Bylos dydis DecoderAACFactory AAC Plugin AAC įskiepis AAC Files AAC bylos About AAC Audio Plugin Apie AAC išvesties įrenginį Qmmp AAC Audio Plugin Qmmp AAC įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_nl.ts0000664000175000017500000000454512256224735023213 0ustar useruser AACMetaDataModel Length Lengte Sample rate Sample frequentie Hz Bitrate Bitsnelheid kbps KB File size Bestandsgrootte DecoderAACFactory AAC Plugin AAC Module AAC Files AAC Bestanden About AAC Audio Plugin Over de AAC Audio Module Qmmp AAC Audio Plugin AAC Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_pl.ts0000664000175000017500000000454712256224735023217 0ustar useruser AACMetaDataModel Length Długość Sample rate Próbkowanie Hz Bitrate Szybkość transmisji kbps KB File size Wilekość pliku DecoderAACFactory AAC Plugin Wtyczka AAC AAC Files Pliki AAC About AAC Audio Plugin O wtyczce dźwiękowej AAC Qmmp AAC Audio Plugin Wtyczka AAC dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_ru.ts0000664000175000017500000000472312256224735023226 0ustar useruser AACMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Bitrate Битовая частота kbps Кб/с KB КБ File size Размер файла DecoderAACFactory AAC Plugin Модуль AAC AAC Files Файлы AAC About AAC Audio Plugin Об аудио-модуле AAC Qmmp AAC Audio Plugin Модуль AAC для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_sk.ts0000664000175000017500000000462612256224735023217 0ustar useruser AACMetaDataModel Length Sample rate Hz Bitrate kbps KB File size DecoderAACFactory AAC Plugin AAC Files About AAC Audio Plugin Qmmp AAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/translations/aac_plugin_tr.ts0000664000175000017500000000467712256224735023235 0ustar useruser AACMetaDataModel Length Sample rate Hz Hz Bitrate kbps kbps KB KB File size DecoderAACFactory AAC Plugin AAC Eklentisi AAC Files AAC Dosyaları About AAC Audio Plugin AAC Ses Eklentisi Hakkında Qmmp AAC Audio Plugin Qmmp AAC Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/aac/aacmetadatamodel.h0000664000175000017500000000342512256224735020742 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef AACMETADATAMODEL_H #define AACMETADATAMODEL_H #include class AACMetaDataModel : public MetaDataModel { Q_OBJECT public: AACMetaDataModel(const QString &path, QObject *parent); ~AACMetaDataModel(); QHash audioProperties(); private: QString m_path; }; #endif // AACMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/aac/aacmetadatamodel.cpp0000664000175000017500000000450212256224735021272 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "aacfile.h" #include "aacmetadatamodel.h" AACMetaDataModel::AACMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_path = path; } AACMetaDataModel::~AACMetaDataModel() {} QHash AACMetaDataModel::audioProperties() { QHash ap; QFile input(m_path); if (!input.open(QIODevice::ReadOnly)) return ap; AACFile f(&input); QString text; text = QString("%1").arg(f.length()/60); text +=":"+QString("%1").arg(f.length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); text = QString("%1").arg(f.samplerate()); ap.insert(tr("Sample rate"), text+" "+tr("Hz")); text = QString("%1").arg(f.bitrate()); ap.insert(tr("Bitrate"), text+" "+tr("kbps")); text = QString("%1 "+tr("KB")).arg(input.size()/1024); ap.insert(tr("File size"), text); return ap; } qmmp-0.7.4/src/plugins/Input/aac/decoder_aac.h0000664000175000017500000000425512256224735017707 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_AAC_H #define DECODER_AAC_H #include #include struct aac_data { NeAACDecHandle handle; }; class DecoderAAC : public Decoder { public: DecoderAAC(QIODevice *); virtual ~DecoderAAC(); struct aac_data *data() { return m_data; } // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: struct aac_data *m_data; char* m_input_buf; void* m_sample_buf; int m_sample_buf_at; qint64 m_sample_buf_size; int m_bitrate; ulong m_input_at, m_output_at; double m_frameSize; qint64 m_totalTime; }; #endif // __decoder_aac_h qmmp-0.7.4/src/plugins/Input/cue/0000775000175000017500000000000012256224735015347 5ustar useruserqmmp-0.7.4/src/plugins/Input/cue/cue.pro0000664000175000017500000000303212256224735016643 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decodercuefactory.h \ cueparser.h \ decoder_cue.h \ settingsdialog.h \ cuemetadatamodel.h SOURCES += decoder_cue.cpp \ decodercuefactory.cpp \ cueparser.cpp \ settingsdialog.cpp \ cuemetadatamodel.cpp win32:HEADERS += ../../../../src/qmmp/decoder.h \ ../../../../src/qmmp/statehandler.h TARGET = $$PLUGINS_PREFIX/Input/cue unix:QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libcue.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib unix{ QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp -L/usr/lib contains(CONFIG, WITH_ENCA){ CONFIG += link_pkgconfig PKGCONFIG += enca DEFINES += WITH_ENCA } } win32{ QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 } TRANSLATIONS = translations/cue_plugin_ru.ts \ translations/cue_plugin_uk_UA.ts \ translations/cue_plugin_zh_CN.ts \ translations/cue_plugin_zh_TW.ts \ translations/cue_plugin_cs.ts \ translations/cue_plugin_pl.ts \ translations/cue_plugin_de.ts \ translations/cue_plugin_it.ts \ translations/cue_plugin_tr.ts \ translations/cue_plugin_lt.ts \ translations/cue_plugin_nl.ts \ translations/cue_plugin_ja.ts \ translations/cue_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input desktop.files = qmmp_cue.desktop desktop.path = /share/applications INSTALLS += target \ desktop } qmmp-0.7.4/src/plugins/Input/cue/cuemetadatamodel.cpp0000664000175000017500000000462112256224735021354 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "cueparser.h" #include "cuemetadatamodel.h" CUEMetaDataModel::CUEMetaDataModel(const QString &url, QObject *parent) : MetaDataModel(parent) { m_parser = new CUEParser(url); if (m_parser->count() == 0) { qWarning("CUEMetaDataModel: invalid cue file"); return; } int track = url.section("#", -1).toInt(); m_path = m_parser->filePath(track); } CUEMetaDataModel::~CUEMetaDataModel() { delete m_parser; } QHash CUEMetaDataModel::audioProperties() { QHash ap; MetaDataModel *model = MetaDataManager::instance()->createMetaDataModel(m_path); if(model) { ap = model->audioProperties(); model->deleteLater(); } return ap; } QPixmap CUEMetaDataModel::cover() { return MetaDataManager::instance()->getCover(m_path); } QString CUEMetaDataModel::coverPath() { return MetaDataManager::instance()->getCoverPath(m_path); } qmmp-0.7.4/src/plugins/Input/cue/qmmp_cue.desktop0000664000175000017500000000152212256224735020550 0ustar useruser[Desktop Entry] X-Desktop-File-Install-Version=0.15 Name=Open cue album in Qmmp Name[cs]=Otevřít album cue v Qmmp Name[ru]=Открыть альбом cue в Qmmp Name[uk]=Відкрити альбом cue Name[zh_CN]=打开 CUE Name[zh_TW]=打開 CUE Name[he]=פתח אלבום cue בתוך Qmmp Comment=Open cue file(s) in the directory Comment[cs]=Otevřít cue soubor(y) v adresáři Comment[ru]=Открыть cue-файл(ы) в директории Comment[uk]=Відкрити cue-файл(и) в теці Comment[zh_CN]=在本目录打开 CUE 文件 Comment[zh_TW]=在本目錄打開 CUE 檔案 Comment[he]=פתח קבצי cue המצויים בתוך המדור Exec=sh -c "qmmp '%F'/*.cue" Icon=qmmp Categories=AudioVideo;Player;Audio;Qt; MimeType=inode/directory; Type=Application X-KDE-StartupNotify=false NoDisplay=true Terminal=false qmmp-0.7.4/src/plugins/Input/cue/cueparser.h0000664000175000017500000000466512256224735017524 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CUEPARSER_H #define CUEPARSER_H #include #include #include #include #include #include /** @author Ilya Kotov */ class CUEParser { public: CUEParser(const QString &url); ~CUEParser(); QList createPlayList(); const QString filePath(int track) const; qint64 offset(int track) const; qint64 length(int track) const; int count() const; FileInfo *info(int track); const QString trackURL(int track) const; const QMap replayGain(int track) const; private: struct CUETrack { FileInfo info; qint64 offset; QString file; QMap replayGain; }; QList m_tracks; bool m_dirty; QStringList splitLine(const QString &line); qint64 getLength(const QString &str); QString getDirtyPath(const QString &cue_path, const QString &path); }; #endif qmmp-0.7.4/src/plugins/Input/cue/cueparser.cpp0000664000175000017500000002546112256224735020054 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #ifdef WITH_ENCA #include #endif #include "cueparser.h" CUEParser::CUEParser(const QString &url) { QString fileName = url; if(url.contains("://")) { QString p = fileName; p.remove("cue://"); p.remove(QRegExp("#\\d+$")); fileName = p; } QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { qDebug("CUEParser: error: %s", qPrintable(file.errorString())); return; } QTextStream textStream (&file); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("CUE"); m_dirty = settings.value("dirty_cue", false).toBool(); QTextCodec *codec = 0; #ifdef WITH_ENCA EncaAnalyser analyser = 0; if(settings.value("use_enca", false).toBool()) { analyser = enca_analyser_alloc(settings.value("enca_lang").toByteArray ().constData()); if(analyser) { enca_set_threshold(analyser, 1.38); EncaEncoding encoding = enca_analyse(analyser, (uchar *)file.readAll().constData(), file.size()); file.reset(); if(encoding.charset != ENCA_CS_UNKNOWN) { codec = QTextCodec::codecForName(enca_charset_name(encoding.charset,ENCA_NAME_STYLE_ENCA)); //qDebug("CUEParser: detected charset: %s", // enca_charset_name(encoding.charset,ENCA_NAME_STYLE_ENCA)); } } } #endif if(!codec) codec = QTextCodec::codecForName(settings.value("encoding","UTF-8").toByteArray ()); if(!codec) codec = QTextCodec::codecForName("UTF-8"); settings.endGroup(); //qDebug("CUEParser: using %s encoding", codec->name().constData()); textStream.setCodec(codec); QString album, genre, date, comment, artist, file_path; double album_gain = 0.0, album_peak = 0.0; while (!textStream.atEnd()) { QString line = textStream.readLine().trimmed(); QStringList words = splitLine(line); if (words.size() < 2) continue; if (words[0] == "FILE") { file_path = getDirtyPath(fileName, QFileInfo(fileName).dir().filePath(words[1])); } else if (words[0] == "PERFORMER") { if(m_tracks.isEmpty()) artist = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::ARTIST, words[1]); } else if (words[0] == "TITLE") { if(m_tracks.isEmpty()) album = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::TITLE, words[1]); } else if (words[0] == "TRACK") { QString path = fileName; FileInfo info("cue://" + path + QString("#%1").arg(words[1].toInt())); info.setMetaData(Qmmp::TRACK, words[1].toInt()); info.setMetaData(Qmmp::ALBUM, album); info.setMetaData(Qmmp::GENRE, genre); info.setMetaData(Qmmp::YEAR, date); info.setMetaData(Qmmp::COMMENT, comment); info.setMetaData(Qmmp::ARTIST, artist); m_tracks << new CUETrack; m_tracks.last()->info = info; m_tracks.last()->offset = 0; m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_GAIN, album_gain); m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_PEAK, album_peak); } else if (words[0] == "INDEX" && words[1] == "01") { if (m_tracks.isEmpty()) continue; m_tracks.last()->offset = getLength(words[2]); m_tracks.last()->file = file_path; } else if (words[0] == "REM") { if (words.size() < 3) continue; if (words[1] == "GENRE") genre = words[2]; else if (words[1] == "DATE") date = words[2]; else if (words[1] == "COMMENT") comment = words[2]; else if (words[1] == "REPLAYGAIN_ALBUM_GAIN") album_gain = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_ALBUM_PEAK") album_peak = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_TRACK_GAIN" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_GAIN, words[2].toDouble()); else if (words[1] == "REPLAYGAIN_TRACK_PEAK" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_PEAK, words[2].toDouble()); } } file.close(); #ifdef WITH_ENCA if(analyser) enca_analyser_free(analyser); #endif if(m_tracks.isEmpty()) { qWarning("CUEParser: invalid cue file"); return; } //skip invalid cue sheet foreach(CUETrack *track, m_tracks) { if(!QFile::exists(track->file)) { qDeleteAll(m_tracks); m_tracks.clear(); break; } } //calculate lengths for(int i = 0; i < m_tracks.count(); ++i) { QString file_path = m_tracks[i]->file; if((i < m_tracks.count() - 1) && (file_path == m_tracks[i+1]->file)) m_tracks[i]->info.setLength(m_tracks[i+1]->offset - m_tracks[i]->offset); else { QList f_list = MetaDataManager::instance()->createPlayList(file_path, false); qint64 l = f_list.isEmpty() ? 0 : f_list.at(0)->length() * 1000; if (l > m_tracks[i]->offset) m_tracks[i]->info.setLength(l - m_tracks[i]->offset); else m_tracks[i]->info.setLength(0); qDeleteAll(f_list); f_list.clear(); } } } CUEParser::~CUEParser() { qDeleteAll(m_tracks); m_tracks.clear(); } QList CUEParser::createPlayList() { QList list; foreach(CUETrack *track, m_tracks) { list << new FileInfo(track->info); list.last()->setLength(track->info.length()/1000); } return list; } const QString CUEParser::filePath(int track) const { return (track <= m_tracks.count()) ? m_tracks[track - 1]->file : QString(); } qint64 CUEParser::offset(int track) const { return m_tracks.at(track - 1)->offset; } qint64 CUEParser::length(int track) const { return m_tracks.at(track - 1)->info.length(); } int CUEParser::count() const { return m_tracks.count(); } FileInfo *CUEParser::info(int track) { return &m_tracks.at(track - 1)->info; } const QString CUEParser::trackURL(int track) const { return m_tracks.at(track - 1)->info.path(); } const QMap CUEParser::replayGain(int track) const { return m_tracks.at(track - 1)->replayGain; } QStringList CUEParser::splitLine(const QString &line) { //qDebug("raw string = %s",qPrintable(line)); QStringList list; QString buf = line.trimmed(); if (buf.isEmpty()) return list; while (!buf.isEmpty()) { //qDebug(qPrintable(buf)); if (buf.startsWith('"')) { int end = buf.indexOf('"',1); if(end == -1) //ignore invalid line { list.clear(); qWarning("CUEParser: unable to parse line: %s",qPrintable(line)); return list; } list << buf.mid (1, end - 1); buf.remove (0, end+1); } else { int end = buf.indexOf(' ', 0); if (end < 0) end = buf.size(); list << buf.mid (0, end); buf.remove (0, end); } buf = buf.trimmed(); } return list; } qint64 CUEParser::getLength(const QString &str) { QStringList list = str.split(":"); if (list.size() == 2) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000; else if (list.size() == 3) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000 + list.at(2).toInt()*1000/75; return 0; } QString CUEParser::getDirtyPath(const QString &cue_path, const QString &path) { if((QFile::exists(path) && Decoder::findByPath(path)) || !m_dirty) return path; QStringList candidates; QDirIterator it(QFileInfo(path).dir().path(), QDir::Files); while (it.hasNext()) { it.next(); QString f = it.filePath(); if ((f != cue_path) && Decoder::findByPath(f)) candidates.push_back(f); } if (candidates.empty()) return path; else if (candidates.count() == 1) return candidates.first(); int dot = cue_path.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(cue_path.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } dot = path.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(path.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } return path; } qmmp-0.7.4/src/plugins/Input/cue/CMakeLists.txt0000664000175000017500000000360612256224735020114 0ustar useruserproject(libcue) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) IF(USE_ENCA AND ENCA_FOUND) ADD_DEFINITIONS(-DWITH_ENCA) include_directories(${ENCA_INCLUDE_DIRS}) link_directories(${ENCA_LIBRARY_DIRS}) ADD_DEFINITIONS(${ENCA_CFLAGS}) ENDIF(USE_ENCA AND ENCA_FOUND) SET(libcue_SRCS decoder_cue.cpp decodercuefactory.cpp settingsdialog.cpp cueparser.cpp cuemetadatamodel.cpp ) SET(libcue_HDRS decoder_cue.h cueparser.h ) SET(libcue_MOC_HDRS decodercuefactory.h settingsdialog.h cuemetadatamodel.h ) SET(libcue_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libcue_RCC_SRCS ${libcue_RCCS}) QT4_WRAP_CPP(libcue_MOC_SRCS ${libcue_MOC_HDRS}) # user interface SET(libcue_UIS settingsdialog.ui ) QT4_WRAP_UI(libcue_UIS_H ${libcue_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(cue MODULE ${libcue_SRCS} ${libcue_MOC_SRCS} ${libcue_RCC_SRCS} ${libcue_UIS_H} ${libcue_HDRS}) add_dependencies(cue qmmp) IF(USE_ENCA AND ENCA_FOUND) target_link_libraries(cue ${QT_LIBRARIES} -lqmmp ${ENCA_LDFLAGS}) ELSE(USE_ENCA AND ENCA_FOUND) target_link_libraries(cue ${QT_LIBRARIES} -lqmmp) ENDIF(USE_ENCA AND ENCA_FOUND) install(TARGETS cue DESTINATION ${LIB_DIR}/qmmp/Input) IF(USE_DIR_ASSOC) install(FILES qmmp_cue.desktop DESTINATION share/applications) ENDIF(USE_DIR_ASSOC) qmmp-0.7.4/src/plugins/Input/cue/cuemetadatamodel.h0000664000175000017500000000355512256224735021026 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CUEMETADATAMODEL_H #define CUEMETADATAMODEL_H #include class CUEParser; class CUEMetaDataModel : public MetaDataModel { Q_OBJECT public: CUEMetaDataModel(const QString &url, QObject *parent); ~CUEMetaDataModel(); QHash audioProperties(); QPixmap cover(); QString coverPath(); private: CUEParser *m_parser; QString m_path; }; #endif // CUEMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/cue/settingsdialog.cpp0000664000175000017500000000775112256224735021105 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #ifdef WITH_ENCA #include #endif #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); findCodecs(); foreach (QTextCodec *codec, codecs) ui.cueEncComboBox->addItem(codec->name()); #ifdef WITH_ENCA size_t n = 0; const char **langs = enca_get_languages(&n); for (size_t i = 0; i < n; ++i) ui.encaAnalyserComboBox->addItem(langs[i]); #endif QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("CUE"); int pos = ui.cueEncComboBox->findText(settings.value("encoding","UTF-8").toString()); ui.cueEncComboBox->setCurrentIndex(pos); #ifdef WITH_ENCA ui.autoCharsetCheckBox->setChecked(settings.value("use_enca", false).toBool()); pos = ui.encaAnalyserComboBox->findText(settings.value("enca_lang", langs[n-1]).toString()); ui.encaAnalyserComboBox->setCurrentIndex(pos); #else ui.autoCharsetCheckBox->setEnabled(false); #endif ui.dirtyCueCheckBox->setChecked(settings.value("dirty_cue", false).toBool()); settings.endGroup(); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("CUE"); settings.setValue("encoding", ui.cueEncComboBox->currentText()); #ifdef WITH_ENCA settings.setValue("use_enca", ui.autoCharsetCheckBox->isChecked()); settings.setValue("enca_lang", ui.encaAnalyserComboBox->currentText()); #endif settings.setValue("dirty_cue", ui.dirtyCueCheckBox->isChecked()); settings.endGroup(); QDialog::accept(); } void SettingsDialog::findCodecs() { QMap codecMap; QRegExp iso8859RegExp("ISO[- ]8859-([0-9]+).*"); foreach (int mib, QTextCodec::availableMibs()) { QTextCodec *codec = QTextCodec::codecForMib(mib); QString sortKey = codec->name().toUpper(); int rank; if (sortKey.startsWith("UTF-8")) { rank = 1; } else if (sortKey.startsWith("UTF-16")) { rank = 2; } else if (iso8859RegExp.exactMatch(sortKey)) { if (iso8859RegExp.cap(1).size() == 1) rank = 3; else rank = 4; } else { rank = 5; } sortKey.prepend(QChar('0' + rank)); codecMap.insert(sortKey, codec); } codecs = codecMap.values(); } qmmp-0.7.4/src/plugins/Input/cue/settingsdialog.ui0000664000175000017500000000763112256224735020735 0ustar useruser SettingsDialog 0 0 255 205 CUE Plugin Settings 6 6 6 Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection true Language: false Qt::TabFocus Qt::LeftToRight Default encoding: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 196 112 95 53 buttonBox rejected() SettingsDialog reject() 216 112 130 63 autoCharsetCheckBox toggled(bool) encaAnalyserComboBox setEnabled(bool) 90 40 166 64 qmmp-0.7.4/src/plugins/Input/cue/translations/0000775000175000017500000000000012256224735020070 5ustar useruserqmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_pl_PL.ts0000664000175000017500000000501212256224735023656 0ustar useruser DecoderCUEFactory CUE Plugin Wtyczka CUE CUE Files Pliki CUE About CUE Audio Plugin O wtyczce CUE Audio Qmmp CUE Audio Plugin O wtyczce CUE dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Ustawienia wtyczki CUE Common settings Ogólne opcje Load incorrect cue sheets if possible Załaduj niewłaściwy plik CUE jeśli możliwe CUE encoding Kodowanie CUE Automatic charset detection Automatyczne wykrywanie kodowania Language: Język: Default encoding: Domyślne kodowanie: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_pt_BR.ts0000664000175000017500000000473612256224735023672 0ustar useruser DecoderCUEFactory CUE Plugin CUE Files About CUE Audio Plugin Qmmp CUE Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/translations.qrc0000664000175000017500000000140112256224735023314 0ustar useruser cue_plugin_ru.qm cue_plugin_uk_UA.qm cue_plugin_zh_CN.qm cue_plugin_zh_TW.qm cue_plugin_tr.qm cue_plugin_cs.qm cue_plugin_pt_BR.qm cue_plugin_de.qm cue_plugin_pl_PL.qm cue_plugin_fr.qm cue_plugin_it.qm cue_plugin_kk.qm cue_plugin_lt.qm cue_plugin_hu.qm cue_plugin_nl.qm cue_plugin_ja.qm cue_plugin_sk.qm cue_plugin_es.qm cue_plugin_he.qm cue_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_zh_CN.ts0000664000175000017500000000473412256224735023663 0ustar useruser DecoderCUEFactory CUE Plugin CUE 插件 CUE Files CUE 文件 About CUE Audio Plugin 关于 CUE 音频插件 Qmmp CUE Audio Plugin Qmmp CUE 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings CUE 插件设置 Common settings 基本设置 Load incorrect cue sheets if possible CUE encoding CUE 编码 Automatic charset detection 自动检测字符集 Language: 语言: Default encoding: 默认编码: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_zh_TW.ts0000664000175000017500000000473412256224735023715 0ustar useruser DecoderCUEFactory CUE Plugin CUE 插件 CUE Files CUE 檔案 About CUE Audio Plugin 關於 CUE 聲訊插件 Qmmp CUE Audio Plugin Qmmp CUE 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings CUE 插件設置 Common settings 基本設定 Load incorrect cue sheets if possible CUE encoding CUE 編碼 Automatic charset detection 自動檢測字符集 Language: 語言: Default encoding: 默認編碼: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_gl_ES.ts0000664000175000017500000000510712256224735023646 0ustar useruser DecoderCUEFactory CUE Plugin Engadido CUE CUE Files Ficheiros CUE About CUE Audio Plugin Sobre o engadido de audio CUE Qmmp CUE Audio Plugin Engadido de audio CUE de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Preferencias do engadido CUE Common settings Opcións comúns Load incorrect cue sheets if possible Cargar follas cue incorrectas se é posible CUE encoding Codificación CUE Automatic charset detection Detección automática de conxunto de caracteres Language: Idioma: Default encoding: Codificación por defecto: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_de.ts0000664000175000017500000000500212256224735023237 0ustar useruser DecoderCUEFactory CUE Plugin CUE-Modul CUE Files CUE-Dateien About CUE Audio Plugin Über CUE-Audio-Modul Qmmp CUE Audio Plugin Qmmp CUE-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Einstellungen CUE-Modul Common settings Allgemeine Einstellungen Load incorrect cue sheets if possible CUE encoding CUE-Kodierung Automatic charset detection Automatisches Erkennen des Zeichensatzes Language: Sprache: Default encoding: Standardkodierung: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_cs.ts0000664000175000017500000000476612256224735023274 0ustar useruser DecoderCUEFactory CUE Plugin Modul CUE CUE Files Soubory CUE About CUE Audio Plugin O modulu CUE Qmmp CUE Audio Plugin Modul Qmmp CUE Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Nastavení modulu CUE Common settings Obecná nastavení Load incorrect cue sheets if possible Nahrávat i neplatné cue, je-li to možné CUE encoding Kódování CUE Automatic charset detection Autodetekce znakové sady Language: Jazyk: Default encoding: Výchozí kódování: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_es.ts0000664000175000017500000000506012256224735023262 0ustar useruser DecoderCUEFactory CUE Plugin Módulo CUE CUE Files Archivos CUE About CUE Audio Plugin Acerca del módulo de audio CUE Qmmp CUE Audio Plugin Módulo de audio CUE para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Configuración del módulo CUE Common settings Opciones comunes Load incorrect cue sheets if possible CUE encoding Codificación CUE Automatic charset detection Detección automática del juego de caracteres Language: Lenguaje: Default encoding: Codificación predeterminada qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_fr.ts0000664000175000017500000000473612256224735023273 0ustar useruser DecoderCUEFactory CUE Plugin CUE Files About CUE Audio Plugin Qmmp CUE Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_he.ts0000664000175000017500000000516512256224735023255 0ustar useruser DecoderCUEFactory CUE Plugin תוספת CUE CUE Files קבצי CUE About CUE Audio Plugin אודות תוספת CUE שמע Qmmp CUE Audio Plugin תוספת CUE שמע ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings הגדרות תוספת CUE Common settings הגדרות כלליות Load incorrect cue sheets if possible טען גיליונות cue לא קורקטיים במידת האפשר CUE encoding קידוד CUE Automatic charset detection איתור מערך-תווים אוטומטית Language: שפה: Default encoding: קידוד משתמט: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_hu.ts0000664000175000017500000000473612256224735023300 0ustar useruser DecoderCUEFactory CUE Plugin CUE Files About CUE Audio Plugin Qmmp CUE Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_ja.ts0000664000175000017500000000517412256224735023253 0ustar useruser DecoderCUEFactory CUE Plugin CUE プラグイン CUE Files CUE ファイル About CUE Audio Plugin CUE 音響プラグインについて Qmmp CUE Audio Plugin QMMP CUE 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings CUE プラグイン設定 Common settings 共通設定 Load incorrect cue sheets if possible CUE シートに間違いがあってもできるだけ読み込む CUE encoding CUE 文字符号化形式 Automatic charset detection 文字セット自動検知 Language: 言語: Default encoding: 文字符号化形式(初期設定値): qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_it.ts0000664000175000017500000000502712256224735023272 0ustar useruser DecoderCUEFactory CUE Plugin Modulo CUE CUE Files Brani CUE About CUE Audio Plugin Informazioni sul Modulo audio CUE Qmmp CUE Audio Plugin Modulo audio CUE per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Impostazioni del modulo CUE Common settings Load incorrect cue sheets if possible CUE encoding Codifica CUE Automatic charset detection Rilevazione automaticamente del set di caratteri Language: Lingua: Default encoding: Codifica predefeinita qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_kk.ts0000664000175000017500000000473612256224735023271 0ustar useruser DecoderCUEFactory CUE Plugin CUE Files About CUE Audio Plugin Qmmp CUE Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_lt.ts0000664000175000017500000000501012256224735023265 0ustar useruser DecoderCUEFactory CUE Plugin CUE įskiepis CUE Files CUE bylos About CUE Audio Plugin Apie CUE audio įskiepį Qmmp CUE Audio Plugin Qmmp CUE audio įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė:Ilya Kotov SettingsDialog CUE Plugin Settings CUE įskiepio nustatymai Common settings Bendri nustatymai Load incorrect cue sheets if possible Jei įmanoma įkelti neteisingą CUE informaciją CUE encoding CUE kodavimas Automatic charset detection Automatinis koduotės aptikimas Language: Kalba: Default encoding: Kodavinas pagal nutylėjimą: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_nl.ts0000664000175000017500000000477412256224735023277 0ustar useruser DecoderCUEFactory CUE Plugin CUE Module CUE Files CUE Bestanden About CUE Audio Plugin Over de CUE Audio Module Qmmp CUE Audio Plugin CUE Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings CUE Module Instellingen Common settings Algemene Instellingen Load incorrect cue sheets if possible CUE encoding CUE codering Automatic charset detection Automatische tekenset detectie Language: Taal: Default encoding: Standaard codering: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_pl.ts0000664000175000017500000000501212256224735023263 0ustar useruser DecoderCUEFactory CUE Plugin Wtyczka CUE CUE Files Pliki CUE About CUE Audio Plugin O wtyczce CUE Audio Qmmp CUE Audio Plugin O wtyczce CUE dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Ustawienia wtyczki CUE Common settings Ogólne opcje Load incorrect cue sheets if possible Załaduj niewłaściwy plik CUE jeśli możliwe CUE encoding Kodowanie CUE Automatic charset detection Automatyczne wykrywanie kodowania Language: Język: Default encoding: Domyślne kodowanie: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_ru.ts0000664000175000017500000000525512256224735023307 0ustar useruser DecoderCUEFactory CUE Plugin Модуль CUE CUE Files Файлы CUE About CUE Audio Plugin Об аудио-модуле CUE Qmmp CUE Audio Plugin Аудио-модуль CUE для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов SettingsDialog CUE Plugin Settings Настройки модуля CUE Common settings Основные настройки Load incorrect cue sheets if possible Загружать cue с ошибками, если возможно CUE encoding Кодировка CUE Automatic charset detection Определять кодировку автоматически Language: Язык: Default encoding: Кодировка по умолчанию: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_sk.ts0000664000175000017500000000473612256224735023301 0ustar useruser DecoderCUEFactory CUE Plugin CUE Files About CUE Audio Plugin Qmmp CUE Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_tr.ts0000664000175000017500000000500212256224735023274 0ustar useruser DecoderCUEFactory CUE Plugin CUE Eklentisi CUE Files CUE Dosyaları About CUE Audio Plugin CUE Ses Eklentisi Hakkında Qmmp CUE Audio Plugin Qmmp CUE Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings CUE Eklenti Ayarları Common settings Load incorrect cue sheets if possible CUE encoding Automatic charset detection Language: Default encoding: qmmp-0.7.4/src/plugins/Input/cue/translations/cue_plugin_uk_UA.ts0000664000175000017500000000532212256224735023660 0ustar useruser DecoderCUEFactory CUE Plugin Модуль CUE CUE Files Файли CUE About CUE Audio Plugin Про аудіо-модуль CUE Qmmp CUE Audio Plugin Аудіо-модуль CUE для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog CUE Plugin Settings Налаштування модуля CUE Common settings Базові налаштування Load incorrect cue sheets if possible Завантажувати cue з помилками, якщо можливо CUE encoding Кодування CUE Automatic charset detection Визначати кодування атвоматично Language: Мова: Default encoding: Кодування за умовчанням: qmmp-0.7.4/src/plugins/Input/cue/decodercuefactory.cpp0000664000175000017500000000752512256224735021556 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "decoder_cue.h" #include "cuemetadatamodel.h" #include "cueparser.h" #include "settingsdialog.h" #include "decodercuefactory.h" // DecoderCUEFactory bool DecoderCUEFactory::supports(const QString &source) const { return source.right(4).toLower() == ".cue"; } bool DecoderCUEFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderCUEFactory::properties() const { DecoderProperties properties; properties.name = tr("CUE Plugin"); properties.shortName = "cue"; properties.filters << "*.cue"; properties.description = tr("CUE Files"); //properties.contentType = "application/ogg;audio/x-vorbis+ogg"; properties.protocols << "cue"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = true; properties.noOutput = true; return properties; } Decoder *DecoderCUEFactory::create(const QString &path, QIODevice *input) { Q_UNUSED(input); return new DecoderCUE(path); } QList DecoderCUEFactory::createPlayList(const QString &fileName, bool useMetaData) { Q_UNUSED(useMetaData); CUEParser parser(fileName); if(fileName.contains("://")) { QList list; int track = fileName.section("#", -1).toInt(); if (!parser.count() || track <= 0 || track > parser.count()) return list; list = parser.createPlayList(); FileInfo *info = list.takeAt(track - 1); qDeleteAll(list); return QList() << info; } else return parser.createPlayList(); } MetaDataModel* DecoderCUEFactory::createMetaDataModel(const QString &path, QObject *parent) { return path.startsWith("cue://") ? new CUEMetaDataModel(path, parent) : 0; } void DecoderCUEFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void DecoderCUEFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About CUE Audio Plugin"), tr("Qmmp CUE Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderCUEFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/cue_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(cue,DecoderCUEFactory) qmmp-0.7.4/src/plugins/Input/cue/decodercuefactory.h0000664000175000017500000000445112256224735021216 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERCUEFACTORY_H #define DECODERCUEFACTORY_H #include #include #include #include #include #include #include #include #include class DecoderCUEFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/cue/decoder_cue.cpp0000664000175000017500000001356712256224735020330 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "cueparser.h" #include "decoder_cue.h" DecoderCUE::DecoderCUE(const QString &url) : Decoder() { m_path = url; m_decoder = 0; m_parser = 0; m_track = 0; m_buf = 0; m_input = 0; } DecoderCUE::~DecoderCUE() { if(m_decoder) delete m_decoder; m_decoder = 0; if(m_parser) delete m_parser; m_parser = 0; if(m_buf) delete [] m_buf; m_buf = 0; if(m_input) m_input->deleteLater(); m_input = 0; } bool DecoderCUE::initialize() { m_parser = new CUEParser(m_path); if (m_parser->count() == 0) { qWarning("DecoderCUE: invalid cue file"); return false; } m_track = m_path.section("#", -1).toInt(); m_path = m_parser->filePath(m_track); if (!QFile::exists(m_path)) { qWarning("DecoderCUE: file \"%s\" doesn't exist", qPrintable(m_path)); return false; } DecoderFactory *df = Decoder::findByPath(m_path); if (!df) { qWarning("DecoderCUE: unsupported file format"); return false; } m_length = m_parser->length(m_track); m_offset = m_parser->offset(m_track); if(!df->properties().noInput) { m_input = new QFile(m_path); if(!m_input->open(QIODevice::ReadOnly)) { qWarning("DecoderCUE: error: %s", qPrintable(m_input->errorString())); return false; } } m_decoder = df->create(m_path, m_input); if(!m_decoder->initialize()) { qWarning("DecoderCUE: invalid audio file"); return false; } m_decoder->seek(m_offset); configure(m_decoder->audioParameters().sampleRate(), m_decoder->audioParameters().channels(), m_decoder->audioParameters().format()); setReplayGainInfo(m_parser->replayGain(m_track)); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; m_totalBytes = 0; m_sz = audioParameters().sampleSize() * audioParameters().channels(); addMetaData(m_parser->info(m_track)->metaData()); return true; } qint64 DecoderCUE::totalTime() { return m_decoder ? m_length : 0; } void DecoderCUE::seek(qint64 pos) { m_decoder->seek(m_offset + pos); m_totalBytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * pos/1000; } qint64 DecoderCUE::read(char *data, qint64 size) { if(length_in_bytes - m_totalBytes < m_sz) //end of cue track return 0; qint64 len = 0; if(m_buf) //read remaining data first { len = qMin(m_buf_size, size); memmove(data, m_buf, len); if(size >= m_buf_size) { delete[] m_buf; m_buf = 0; m_buf_size = 0; } else memmove(m_buf, m_buf + len, size - len); } else len = m_decoder->read(data, size); if(len <= 0) //end of file return 0; if(len + m_totalBytes <= length_in_bytes) { m_totalBytes += len; return len; } qint64 len2 = qMax(qint64(0), length_in_bytes - m_totalBytes); len2 = (len2 / m_sz) * m_sz; //whole of samples of each channel m_totalBytes += len2; //save data of the next track if(m_buf) delete[] m_buf; m_buf_size = len - len2; m_buf = new char[m_buf_size]; memmove(m_buf, data + len2, m_buf_size); return len2; } int DecoderCUE::bitrate() { return m_decoder->bitrate(); } const QString DecoderCUE::nextURL() { if(m_track +1 <= m_parser->count() && m_parser->filePath(m_track) == m_parser->filePath(m_track + 1)) return m_parser->trackURL(m_track + 1); else return QString(); } void DecoderCUE::next() { if(m_track +1 <= m_parser->count()) { m_track++; m_length = m_parser->length(m_track); m_offset = m_parser->offset(m_track); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; addMetaData(m_parser->info(m_track)->metaData()); setReplayGainInfo(m_parser->replayGain(m_track)); m_totalBytes = 0; } } qmmp-0.7.4/src/plugins/Input/cue/settingsdialog.h0000664000175000017500000000354012256224735020542 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: void findCodecs(); Ui::SettingsDialog ui; QList codecs; }; #endif qmmp-0.7.4/src/plugins/Input/cue/decoder_cue.h0000664000175000017500000000433712256224735017770 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_CUE_H #define DECODER_CUE_H #include #include class Output; class QIDevice; class CUEParser; class DecoderCUE : public Decoder { public: DecoderCUE(const QString &url); virtual ~DecoderCUE(); // Standard Decoder API bool initialize(); qint64 totalTime(); void seek(qint64); qint64 read(char *data, qint64 size); int bitrate(); const QString nextURL(); void next(); private: Decoder *m_decoder; qint64 m_length; qint64 m_offset; qint64 length_in_bytes; qint64 m_totalBytes; QString m_path; CUEParser *m_parser; int m_track; char *m_buf; //buffer for remainig data qint64 m_buf_size; qint64 m_sz; //sample size QIODevice *m_input; }; #endif // DECODER_CUE_H qmmp-0.7.4/src/plugins/Input/gme/0000775000175000017500000000000012256224735015343 5ustar useruserqmmp-0.7.4/src/plugins/Input/gme/decoder_gme.cpp0000664000175000017500000000667012256224735020315 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "gmehelper.h" #include "decoder_gme.h" // Decoder class DecoderGme::DecoderGme(const QString &path) : Decoder() { m_path = path; m_emu = 0; } DecoderGme::~DecoderGme() {} bool DecoderGme::initialize() { int track = m_path.section("#", -1).toInt(); m_emu = m_helper.load(m_path); if(!m_emu) return false; int count = gme_track_count(m_emu); if(track > count + 1 || track < 0) { qWarning("DecoderGme: track number is out of range"); gme_delete(m_emu); m_emu = 0; return false; } gme_start_track(m_emu, track - 1); gme_info_t *track_info; if(!gme_track_info(m_emu, &track_info, track - 1)) { if(track_info->length <= 0) track_info->length = track_info->intro_length + track_info->loop_length * 2; } if(track_info->length <= 0) track_info->length = (long) (2.5 * 60 * 1000); if(track_info->length < m_helper.fadeLength()) track_info->length += m_helper.fadeLength(); gme_set_fade(m_emu, track_info->length - m_helper.fadeLength()); QMap metadata; metadata.insert(Qmmp::TITLE, track_info->song); metadata.insert(Qmmp::ARTIST, track_info->author); metadata.insert(Qmmp::COMMENT, track_info->comment); metadata.insert(Qmmp::TRACK, QString("%1").arg(track)); metadata.insert(Qmmp::URL, m_path); addMetaData(metadata); m_totalTime = track_info->length; gme_free_info(track_info); configure(44100, 2); qDebug("DecoderGme: initialize succes"); return true; } qint64 DecoderGme::totalTime() { return m_totalTime; } void DecoderGme::seek(qint64 pos) { gme_seek(m_emu, pos); } int DecoderGme::bitrate() { return 8; } qint64 DecoderGme::read(char *data, qint64 size) { if(gme_track_ended(m_emu)) return 0; if(m_totalTime && gme_tell(m_emu) > m_totalTime) return 0; if (gme_play(m_emu, size/2, (short*)data)) { return 0; } return size; } qmmp-0.7.4/src/plugins/Input/gme/CMakeLists.txt0000664000175000017500000000344712256224735020113 0ustar useruserproject(libgme) INCLUDE(CheckIncludeFileCXX) cmake_minimum_required(VERSION 2.6.0) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libgme CHECK_INCLUDE_FILE_CXX(gme/gme.h GME_HEADER_FOUND) FIND_LIBRARY(GME_LIB NAME gme PATHS /usr/lib /usr/lib32 /usr/local/lib /usr/local/lib32) IF(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND")) SET(GME_FOUND TRUE CACHE INTERNAL "GME") MESSAGE(STATUS "Found Game Music Emu: ${GME_LIB}") ELSE(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND")) MESSAGE(STATUS "Could not find Game Music Emu library") ENDIF(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND")) SET(libgme_SRCS decoder_gme.cpp decodergmefactory.cpp gmehelper.cpp ) SET(libgme_HDRS decoder_gme.h gmehelper.h ) SET(libgme_MOC_HDRS decodergmefactory.h ) SET(libgme_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libgme_RCC_SRCS ${libgme_RCCS}) QT4_WRAP_CPP(libgme_MOC_SRCS ${libgme_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(GME_FOUND) ADD_LIBRARY(gme MODULE ${libgme_SRCS} ${libgme_MOC_SRCS} ${libgme_RCC_SRCS} ${libgme_HDRS}) add_dependencies(gme qmmp) target_link_libraries(gme ${QT_LIBRARIES} -lqmmp ${GME_LIB}) install(TARGETS gme DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(GME_FOUND) qmmp-0.7.4/src/plugins/Input/gme/decodergmefactory.h0000664000175000017500000000451712256224735021211 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERGMEFACTORY_H #define DECODERGMEFACTORY_H #include #include #include #include #include #include #include #include /** @author Ilya Kotov */ class DecoderGmeFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *input); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/gme/gme.pro0000664000175000017500000000260412256224735016637 0ustar useruserinclude(../../plugins.pri) HEADERS += decodergmefactory.h \ decoder_gme.h \ gmehelper.h SOURCES += decoder_gme.cpp \ decodergmefactory.cpp \ gmehelper.cpp TARGET = $$PLUGINS_PREFIX/Input/gme QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libgme.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib TRANSLATIONS = translations/gme_plugin_it.ts \ translations/gme_plugin_ru.ts \ translations/gme_plugin_cs.ts \ translations/gme_plugin_de.ts \ translations/gme_plugin_zh_CN.ts \ translations/gme_plugin_zh_TW.ts \ translations/gme_plugin_uk_UA.ts \ translations/gme_plugin_pl.ts \ translations/gme_plugin_tr.ts \ translations/gme_plugin_lt.ts \ translations/gme_plugin_nl.ts \ translations/gme_plugin_ja.ts RESOURCES = translations/translations.qrc unix{ isEmpty (LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp \ -L/usr/lib \ -L/usr/local/lib \ -I/usr/include \ -I/usr/local/include \ -lgme } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lgme.dll } qmmp-0.7.4/src/plugins/Input/gme/translations/0000775000175000017500000000000012256224735020064 5ustar useruserqmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_uk_UA.ts0000664000175000017500000000306012256224735023645 0ustar useruser DecoderGmeFactory GME Plugin Модуль GME Game Music Files Програми звукогенераторів About GME Audio Plugin Про аудіо-модуль GME Qmmp GME Audio Plugin Аудіо-модуль GME для Qmmp This plugin uses Game_Music_Emu library to play game music files Для відтворення використовується бібліотека Game_Music_Emu Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_pl_PL.ts0000664000175000017500000000272712256224735023660 0ustar useruser DecoderGmeFactory GME Plugin Wtyczka GME Game Music Files Game Music Files About GME Audio Plugin O wtyczce dźwiękowej GME Qmmp GME Audio Plugin Wtyczka dźwiękowa GME dla Qmmp This plugin uses Game_Music_Emu library to play game music files Ta wtyczka używa biblioteki Game_Music_Emu do odtwarzania plików muzycznych z gier Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_pt_BR.ts0000664000175000017500000000255612256224735023660 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/translations.qrc0000664000175000017500000000140112256224735023310 0ustar useruser gme_plugin_ru.qm gme_plugin_uk_UA.qm gme_plugin_zh_CN.qm gme_plugin_zh_TW.qm gme_plugin_tr.qm gme_plugin_cs.qm gme_plugin_pt_BR.qm gme_plugin_de.qm gme_plugin_pl_PL.qm gme_plugin_fr.qm gme_plugin_it.qm gme_plugin_kk.qm gme_plugin_lt.qm gme_plugin_hu.qm gme_plugin_nl.qm gme_plugin_ja.qm gme_plugin_sk.qm gme_plugin_es.qm gme_plugin_he.qm gme_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_zh_CN.ts0000664000175000017500000000271612256224735023651 0ustar useruser DecoderGmeFactory GME Plugin GME 插件 Game Music Files Game 音乐文件 About GME Audio Plugin 关于 GME 音频插件 Qmmp GME Audio Plugin Qmmp GME 音频插件 This plugin uses Game_Music_Emu library to play game music files 此插件使用 Game_Music_Emu 库来播放 game 音乐文件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_zh_TW.ts0000664000175000017500000000266612256224735023707 0ustar useruser DecoderGmeFactory GME Plugin GME 插件 Game Music Files Game 音頻文件 About GME Audio Plugin 關於 Game 音頻文件 Qmmp GME Audio Plugin Qmmp Game 音頻文件 This plugin uses Game_Music_Emu library to play game music files 此插件使用 Game_Music_Emu 庫播放 Game 音頻文件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_gl_ES.ts0000664000175000017500000000272412256224735023640 0ustar useruser DecoderGmeFactory GME Plugin Engadido GME Game Music Files Game Music Files About GME Audio Plugin Sobre o engadido GME Qmmp GME Audio Plugin Engadido GME de Qmmp This plugin uses Game_Music_Emu library to play game music files Este engadido usa a librería Game_Music_Emu para reproducir ficheiros de xogo de música Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_de.ts0000664000175000017500000000275312256224735023241 0ustar useruser DecoderGmeFactory GME Plugin GME-Modul Game Music Files Musikdateien aus Spielen (Game Music) About GME Audio Plugin Über GME-Audio-Modul Qmmp GME Audio Plugin Qmmp GME-Audio-Modul This plugin uses Game_Music_Emu library to play game music files Dieses Modul verwendet die Bibliothek „Game_Music_Emu“, um Musikdateien aus Spielen abzuspielen Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_cs.ts0000664000175000017500000000270012256224735023246 0ustar useruser DecoderGmeFactory GME Plugin Modul GME Game Music Files Soubory s hudbou z her About GME Audio Plugin O modulu GME Qmmp GME Audio Plugin Modul Qmmp GME This plugin uses Game_Music_Emu library to play game music files Tento modul využívá knihovnu Game_Music_Emu pro přehrávání souborů s hudbou z her Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_es.ts0000664000175000017500000000255612256224735023261 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_fr.ts0000664000175000017500000000255612256224735023261 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_he.ts0000664000175000017500000000303712256224735023241 0ustar useruser DecoderGmeFactory GME Plugin תוספת GME Game Music Files קבצי מוזיקה של משחק About GME Audio Plugin אודות תוספת שמע GME Qmmp GME Audio Plugin תוספת שמע GME ‫Qmmp This plugin uses Game_Music_Emu library to play game music files תוספת זו מנצלת את ספריית Game_Music_Emu להנגנת קבצי מוזיקה של משחק Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_hu.ts0000664000175000017500000000255612256224735023266 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_ja.ts0000664000175000017500000000306012256224735023233 0ustar useruser DecoderGmeFactory GME Plugin GME プラグイン Game Music Files ゲーム音楽ファイル About GME Audio Plugin GME 音響プラグインについて Qmmp GME Audio Plugin QMMP 用 GME 音響プラグイン This plugin uses Game_Music_Emu library to play game music files このプラグインは Game_Music_Emu ライブラリを用いてゲーム音楽ファイルを再生します。 Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_it.ts0000664000175000017500000000263312256224735023262 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_kk.ts0000664000175000017500000000255612256224735023257 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_lt.ts0000664000175000017500000000272712256224735023271 0ustar useruser DecoderGmeFactory GME Plugin GME įskiepis Game Music Files Žaidimų muzikos bylos About GME Audio Plugin Apie GME Audio įskiepį Qmmp GME Audio Plugin Qmmp GME Audio įskiepis This plugin uses Game_Music_Emu library to play game music files Šis įskiepis naudoja Game_Music_Emu biblioteką žaidimų muzikos bylų grojimui Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_nl.ts0000664000175000017500000000274512256224735023263 0ustar useruser DecoderGmeFactory GME Plugin GME Module Game Music Files Spel Muziek Bestanden About GME Audio Plugin Over de GME Audio Module Qmmp GME Audio Plugin GME Audio Module voor Qmmp This plugin uses Game_Music_Emu library to play game music files Deze module faciliteert in het afspelen van spelmuziek door gebruik van de Game_Music_Emu bibliotheek Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_pl.ts0000664000175000017500000000272712256224735023265 0ustar useruser DecoderGmeFactory GME Plugin Wtyczka GME Game Music Files Game Music Files About GME Audio Plugin O wtyczce dźwiękowej GME Qmmp GME Audio Plugin Wtyczka dźwiękowa GME dla Qmmp This plugin uses Game_Music_Emu library to play game music files Ta wtyczka używa biblioteki Game_Music_Emu do odtwarzania plików muzycznych z gier Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_ru.ts0000664000175000017500000000306512256224735023274 0ustar useruser DecoderGmeFactory GME Plugin Модуль GME Game Music Files Программы звукогенераторов About GME Audio Plugin Об аудио-модуле GME Qmmp GME Audio Plugin Аудио-модуль GME для Qmmp This plugin uses Game_Music_Emu library to play game music files Для воспроизведения используется библиотека Game_Music_Emu Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_sk.ts0000664000175000017500000000255612256224735023267 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/translations/gme_plugin_tr.ts0000664000175000017500000000263512256224735023275 0ustar useruser DecoderGmeFactory GME Plugin Game Music Files About GME Audio Plugin Qmmp GME Audio Plugin This plugin uses Game_Music_Emu library to play game music files Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/gme/gmehelper.h0000664000175000017500000000360012256224735017463 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef GMEHELPER_H #define GMEHELPER_H #include #include #include #include /** @author Ilya Kotov */ class GmeHelper { public: GmeHelper(); ~GmeHelper(); Music_Emu *load(const QString &url, int sample_rate = 44100); QList createPlayList(bool meta); int fadeLength(); private: Music_Emu *m_emu; QString m_path; }; #endif // GMEHELPER_H qmmp-0.7.4/src/plugins/Input/gme/decodergmefactory.cpp0000664000175000017500000001060512256224735021537 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "gmehelper.h" #include "decoder_gme.h" #include "decodergmefactory.h" // DecoderGmeFactory bool DecoderGmeFactory::supports(const QString &source) const { foreach(QString filter, properties().filters) { QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if (regexp.exactMatch(source)) return true; } return false; } bool DecoderGmeFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderGmeFactory::properties() const { DecoderProperties properties; properties.name = tr("GME Plugin"); properties.filters << "*.ay" << "*.gms" << "*.gym" << "*.hes" << "*.kss" << "*.nsf" << "*.nsfe"; properties.filters << "*.sap" << "*.spc" << "*.vgm" << "*.vgz"; properties.description = tr("Game Music Files"); //properties.contentType = ; properties.shortName = "gme"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = true; properties.protocols << "gme"; return properties; } Decoder *DecoderGmeFactory::create(const QString &path, QIODevice *input) { Q_UNUSED(input); return new DecoderGme(path); } QList DecoderGmeFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; GmeHelper helper; //is it one track? if(fileName.contains("://")) { QString path = fileName; path.remove("gme://"); path.remove(QRegExp("#\\d+$")); int track = fileName.section("#", -1).toInt(); list = createPlayList(path, true); if (list.isEmpty() || track <= 0 || track > list.count()) { qDeleteAll(list); list.clear(); return list; } FileInfo *info = list.takeAt(track - 1); qDeleteAll(list); return QList() << info; } Music_Emu *emu = helper.load(fileName); if(!emu) { qWarning("DecoderGmeFactory: unable to open file"); return list; } list = helper.createPlayList(useMetaData); return list; } MetaDataModel* DecoderGmeFactory::createMetaDataModel(const QString &path, QObject *parent) { Q_UNUSED(path); Q_UNUSED(parent); return 0; } void DecoderGmeFactory::showSettings(QWidget *parent) { Q_UNUSED(parent); } void DecoderGmeFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About GME Audio Plugin"), tr("Qmmp GME Audio Plugin")+"\n"+ tr("This plugin uses Game_Music_Emu library to play game music files")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderGmeFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/gme_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(gme,DecoderGmeFactory) qmmp-0.7.4/src/plugins/Input/gme/gmehelper.cpp0000664000175000017500000000737512256224735020033 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "gmehelper.h" #define FADE_LENGTH 8000 GmeHelper::GmeHelper() { m_emu = 0; } GmeHelper::~GmeHelper() { if(m_emu) gme_delete(m_emu); m_emu = 0; } Music_Emu *GmeHelper::load(const QString &url, int sample_rate) { if(m_emu) gme_delete(m_emu); m_emu = 0; QString path = url; if(url.contains("://")) { path.remove("gme://"); path.remove(QRegExp("#\\d+$")); } const char *err = 0; gme_type_t file_type; if((err = gme_identify_file(qPrintable(path),&file_type))) { qWarning("GmeHelper: %s", err); return 0; } if(!file_type) { qWarning("DecoderGme: unsupporetd music type"); return 0; } if(!(m_emu = gme_new_emu(file_type, sample_rate))) { qWarning("GmeHelper: out of memory"); return 0; } if((err = gme_load_file(m_emu, qPrintable(path)))) { qWarning("GmeHelper: %s", err); return 0; } QString m3u_path = path.left(path.lastIndexOf(".")); m3u_path.append(".m3u"); gme_load_m3u(m_emu, qPrintable(m3u_path)); m_path = path; return m_emu; } QList GmeHelper::createPlayList(bool meta) { QList list; if(!m_emu) return list; int count = gme_track_count(m_emu); gme_info_t *track_info; for(int i = 0; i < count; ++i) { FileInfo *info = new FileInfo(); if(!gme_track_info(m_emu, &track_info, i)) { if(track_info->length <= 0) track_info->length = track_info->intro_length + track_info->loop_length * 2; } if(track_info->length <= 0) track_info->length = (long) (2.5 * 60 * 1000); if(track_info->length < FADE_LENGTH) track_info->length += FADE_LENGTH; if(meta) { info->setMetaData(Qmmp::TITLE, track_info->song); info->setMetaData(Qmmp::ARTIST, track_info->author); info->setMetaData(Qmmp::COMMENT, track_info->comment); info->setMetaData(Qmmp::TRACK, i+1); } info->setPath("gme://" + m_path + QString("#%1").arg(i+1)); info->setLength(track_info->length/1000); gme_free_info(track_info); list << info; } return list; } int GmeHelper::fadeLength() { return FADE_LENGTH; } qmmp-0.7.4/src/plugins/Input/gme/decoder_gme.h0000664000175000017500000000375112256224735017757 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_GME_H #define DECODER_GME_H #include #include class GmeHelper; /** @author Ilya Kotov */ class DecoderGme : public Decoder { public: DecoderGme(const QString &path); virtual ~DecoderGme(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *data, qint64 size); void seek(qint64); private: GmeHelper m_helper; Music_Emu *m_emu; qint64 m_totalTime; QString m_path; }; #endif // DECODER_GME_H qmmp-0.7.4/src/plugins/Input/mad/0000775000175000017500000000000012256224735015334 5ustar useruserqmmp-0.7.4/src/plugins/Input/mad/tagextractor.cpp0000664000175000017500000001074412256224735020555 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "tagextractor.h" TagExtractor::TagExtractor(QIODevice *d) { m_d = d; } TagExtractor::~TagExtractor() { } const QMap TagExtractor::id3v2tag() { QByteArray array = m_d->peek(2048); int offset = array.indexOf("ID3"); if (offset < 0) return m_tag; ID3v2Tag taglib_tag(&array, offset); if (taglib_tag.isEmpty()) return m_tag; TagLib::String album = taglib_tag.album(); TagLib::String artist = taglib_tag.artist(); TagLib::String comment = taglib_tag.comment(); TagLib::String genre = taglib_tag.genre(); TagLib::String title = taglib_tag.title(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MAD"); QByteArray name = settings.value("ID3v2_encoding","UTF-8").toByteArray (); bool utf = false; QTextCodec *codec = 0; if (name.contains("UTF")) { codec = QTextCodec::codecForName ("UTF-8"); utf = true; } else codec = QTextCodec::codecForName(name); settings.endGroup(); if (!codec) codec = QTextCodec::codecForName ("UTF-8"); m_tag.insert(Qmmp::ALBUM, codec->toUnicode(album.toCString(utf)).trimmed()); m_tag.insert(Qmmp::ARTIST, codec->toUnicode(artist.toCString(utf)).trimmed()); m_tag.insert(Qmmp::COMMENT, codec->toUnicode(comment.toCString(utf)).trimmed()); m_tag.insert(Qmmp::GENRE, codec->toUnicode(genre.toCString(utf)).trimmed()); m_tag.insert(Qmmp::TITLE, codec->toUnicode(title.toCString(utf)).trimmed()); m_tag.insert(Qmmp::YEAR, QString::number(taglib_tag.year())); m_tag.insert(Qmmp::TRACK, QString::number(taglib_tag.track())); if(!taglib_tag.frameListMap()["TCOM"].isEmpty()) { TagLib::String composer = taglib_tag.frameListMap()["TCOM"].front()->toString(); m_tag.insert(Qmmp::COMPOSER, codec->toUnicode(composer.toCString(utf)).trimmed()); } if(!taglib_tag.frameListMap()["TPOS"].isEmpty()) { TagLib::String disc = taglib_tag.frameListMap()["TPOS"].front()->toString(); m_tag.insert(Qmmp::DISCNUMBER, QString(disc.toCString()).trimmed()); } return m_tag; } ID3v2Tag::ID3v2Tag(QByteArray *array, long offset) : TagLib::ID3v2::Tag() { m_buf = new QBuffer(array); m_buf->open(QIODevice::ReadOnly); m_offset = offset; read(); } void ID3v2Tag::read () { m_buf->seek(m_offset); uint to_read = TagLib::ID3v2::Header::size(); if (to_read > 2048 - uint(m_offset)) return; header()->setData(TagLib::ByteVector(m_buf->read(to_read).data(), to_read)); to_read = header()->tagSize(); if (!to_read || 2048 < m_offset + TagLib::ID3v2::Header::size()) return; QByteArray array = m_buf->read(to_read); TagLib::ByteVector v(array.data(), array.size()); parse(v); } qmmp-0.7.4/src/plugins/Input/mad/decodermadfactory.h0000664000175000017500000000446112256224735021171 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERMADFACTORY_H #define DECODERMADFACTORY_H #include #include #include #include #include #include #include #include class DecoderMADFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *input); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/mad/decodermadfactory.cpp0000664000175000017500000002135312256224735021523 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include "mpegmetadatamodel.h" #include "replaygainreader.h" #include "settingsdialog.h" #include "decoder_mad.h" #include "decodermadfactory.h" // DecoderMADFactory bool DecoderMADFactory::supports(const QString &source) const { QString ext = source.right(4).toLower(); if (ext == ".mp1" || ext == ".mp2" || ext == ".mp3") return true; else if (ext == ".wav") //check for mp3 wav files { QFile file(source); file.open(QIODevice::ReadOnly); char buf[22]; file.peek(buf,sizeof(buf)); file.close(); if (!memcmp(buf + 8, "WAVE", 4) && !memcmp(buf + 20, "U" ,1)) { return true; } } return false; } bool DecoderMADFactory::canDecode(QIODevice *input) const { char buf[16 * 512]; if (input->peek(buf,sizeof(buf)) == sizeof(buf)) { struct mad_stream stream; struct mad_header header; int dec_res; mad_stream_init (&stream); mad_header_init (&header); mad_stream_buffer (&stream, (unsigned char *) buf, sizeof(buf)); stream.error = MAD_ERROR_NONE; while ((dec_res = mad_header_decode(&header, &stream)) == -1 && MAD_RECOVERABLE(stream.error)) ; return dec_res != -1 ? true: false; } return false; } const DecoderProperties DecoderMADFactory::properties() const { DecoderProperties properties; properties.name = tr("MPEG Plugin"); properties.shortName = "mad"; properties.filters << "*.mp1" << "*.mp2" << "*.mp3" << "*.wav"; properties.description = tr("MPEG Files"); properties.contentTypes << "audio/mp3" << "audio/mpeg"; properties.hasAbout = true; properties.hasSettings = true; return properties; } Decoder *DecoderMADFactory::create(const QString &url, QIODevice *input) { Decoder *d = new DecoderMAD(input); if(!url.contains("://")) //local file { ReplayGainReader rg(url); d->setReplayGainInfo(rg.replayGainInfo()); } return d; } QList DecoderMADFactory::createPlayList(const QString &fileName, bool useMetaData) { FileInfo *info = new FileInfo(fileName); TagLib::Tag *tag = 0; TagLib::MPEG::File fileRef(fileName.toLocal8Bit ().constData()); if (useMetaData) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MAD"); QTextCodec *codec = 0; uint tag_array[3]; tag_array[0] = settings.value("tag_1", SettingsDialog::ID3v2).toInt(); tag_array[1] = settings.value("tag_2", SettingsDialog::Disabled).toInt(); tag_array[2] = settings.value("tag_3", SettingsDialog::Disabled).toInt(); QByteArray name; for (int i = 0; i < 3; ++i) { switch ((uint) tag_array[i]) { case SettingsDialog::ID3v1: codec = QTextCodec::codecForName(settings.value("ID3v1_encoding","ISO-8859-1") .toByteArray ()); tag = fileRef.ID3v1Tag(); break; case SettingsDialog::ID3v2: name = settings.value("ID3v2_encoding","UTF-8").toByteArray (); if (name.contains("UTF")) codec = QTextCodec::codecForName ("UTF-8"); else codec = QTextCodec::codecForName(name); tag = fileRef.ID3v2Tag(); break; case SettingsDialog::APE: codec = QTextCodec::codecForName ("UTF-8"); tag = fileRef.APETag(); break; case SettingsDialog::Disabled: break; } if (tag && !tag->isEmpty()) break; } settings.endGroup(); if (!codec) codec = QTextCodec::codecForName ("UTF-8"); if (tag && codec) { bool utf = codec->name ().contains("UTF"); TagLib::String album = tag->album(); TagLib::String artist = tag->artist(); TagLib::String comment = tag->comment(); TagLib::String genre = tag->genre(); TagLib::String title = tag->title(); info->setMetaData(Qmmp::ALBUM, codec->toUnicode(album.toCString(utf)).trimmed()); info->setMetaData(Qmmp::ARTIST, codec->toUnicode(artist.toCString(utf)).trimmed()); info->setMetaData(Qmmp::COMMENT, codec->toUnicode(comment.toCString(utf)).trimmed()); info->setMetaData(Qmmp::GENRE, codec->toUnicode(genre.toCString(utf)).trimmed()); info->setMetaData(Qmmp::TITLE, codec->toUnicode(title.toCString(utf)).trimmed()); info->setMetaData(Qmmp::YEAR, tag->year()); info->setMetaData(Qmmp::TRACK, tag->track()); if(tag == fileRef.ID3v2Tag()) { if(!fileRef.ID3v2Tag()->frameListMap()["TCOM"].isEmpty()) { TagLib::String composer; composer = fileRef.ID3v2Tag()->frameListMap()["TCOM"].front()->toString(); info->setMetaData(Qmmp::COMPOSER, codec->toUnicode(composer.toCString(utf)).trimmed()); } if(!fileRef.ID3v2Tag()->frameListMap()["TPOS"].isEmpty()) { TagLib::String disc = fileRef.ID3v2Tag()->frameListMap()["TPOS"].front()->toString(); info->setMetaData(Qmmp::DISCNUMBER, QString(disc.toCString()).trimmed()); } } } } if (fileRef.audioProperties()) info->setLength(fileRef.audioProperties()->length()); QList list; list << info; return list; } MetaDataModel* DecoderMADFactory::createMetaDataModel(const QString &path, QObject *parent) { return new MPEGMetaDataModel(path, parent); } void DecoderMADFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s -> show(); } void DecoderMADFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About MPEG Audio Plugin"), tr("Qmmp MPEG Audio Plugin")+"\n"+ tr("Compiled against libmad version:")+" "+ QString("%1.%2.%3%4").arg(MAD_VERSION_MAJOR) .arg(MAD_VERSION_MINOR) .arg(MAD_VERSION_PATCH).arg(MAD_VERSION_EXTRA)+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Source code based on mq3 and madplay projects") ); } QTranslator *DecoderMADFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/mad_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(mad, DecoderMADFactory) qmmp-0.7.4/src/plugins/Input/mad/mpegmetadatamodel.h0000664000175000017500000000470512256224735021165 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MPEGMETADATAMODEL_H #define MPEGMETADATAMODEL_H #include #include class QTextCodec; class MPEGMetaDataModel : public MetaDataModel { Q_OBJECT public: MPEGMetaDataModel(const QString &path, QObject *parent); ~MPEGMetaDataModel(); QHash audioProperties(); QList tags(); QPixmap cover(); private: QList m_tags; TagLib::MPEG::File *m_file; }; class MpegFileTagModel : public TagModel { public: MpegFileTagModel(TagLib::MPEG::File *file, TagLib::MPEG::File::TagTypes tagType); ~MpegFileTagModel(); const QString name(); QList keys(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); bool exists(); void create(); void remove(); void save(); private: QTextCodec *m_codec; TagLib::MPEG::File *m_file; TagLib::Tag *m_tag; TagLib::MPEG::File::TagTypes m_tagType; }; #endif // MPEGMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/mad/mad.pro0000664000175000017500000000274412256224735016626 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decodermadfactory.h \ decoder_mad.h \ settingsdialog.h \ tagextractor.h \ mpegmetadatamodel.h \ replaygainreader.h SOURCES += decoder_mad.cpp \ decodermadfactory.cpp \ settingsdialog.cpp \ tagextractor.cpp \ mpegmetadatamodel.cpp \ replaygainreader.cpp TARGET = $$PLUGINS_PREFIX/Input/mad INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib TRANSLATIONS = translations/mad_plugin_ru.ts \ translations/mad_plugin_uk_UA.ts \ translations/mad_plugin_zh_CN.ts \ translations/mad_plugin_zh_TW.ts \ translations/mad_plugin_cs.ts \ translations/mad_plugin_pl.ts \ translations/mad_plugin_de.ts \ translations/mad_plugin_it.ts \ translations/mad_plugin_tr.ts \ translations/mad_plugin_tr.ts \ translations/mad_plugin_lt.ts \ translations/mad_plugin_nl.ts \ translations/mad_plugin_ja.ts \ translations/mad_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp -lmad PKGCONFIG += taglib mad QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libmad.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lmad -ltag.dll } qmmp-0.7.4/src/plugins/Input/mad/CMakeLists.txt0000664000175000017500000000345712256224735020105 0ustar useruserproject(libmad) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libmad pkg_search_module(MAD libmad mad) include_directories(${MAD_INCLUDE_DIRS} ${TAGLIB_INCLUDE_DIRS}) link_directories(${MAD_LIBRARY_DIRS} ${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${MAD_CFLAGS} ${TAGLIB_CFLAGS}) SET(libmad_SRCS decoder_mad.cpp decodermadfactory.cpp settingsdialog.cpp tagextractor.cpp mpegmetadatamodel.cpp replaygainreader.cpp ) SET(libmad_HDRS decoder_mad.h tagextractor.h replaygainreader.h ) SET(libmad_MOC_HDRS settingsdialog.h decodermadfactory.h mpegmetadatamodel.h ) SET(libmad_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libmad_RCC_SRCS ${libmad_RCCS}) QT4_WRAP_CPP(libmad_MOC_SRCS ${libmad_MOC_HDRS}) # user interface SET(libmad_UIS settingsdialog.ui ) QT4_WRAP_UI(libmad_UIS_H ${libmad_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(MAD_FOUND) ADD_LIBRARY(mad MODULE ${libmad_SRCS} ${libmad_MOC_SRCS} ${libmad_UIS_H} ${libmad_RCC_SRCS} ${libmad_HDRS}) add_dependencies(mad qmmp) target_link_libraries(mad ${QT_LIBRARIES} -lqmmp ${MAD_LDFLAGS} ${TAGLIB_LDFLAGS}) install(TARGETS mad DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(MAD_FOUND) qmmp-0.7.4/src/plugins/Input/mad/settingsdialog.cpp0000664000175000017500000000775512256224735021076 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); findCodecs(); foreach (QTextCodec *codec, codecs) { ui.id3v1EncComboBox->addItem(codec->name()); ui.id3v2EncComboBox->addItem(codec->name()); } QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MAD"); int pos = ui.id3v1EncComboBox->findText (settings.value("ID3v1_encoding","ISO-8859-1").toString()); ui.id3v1EncComboBox->setCurrentIndex(pos); pos = ui.id3v2EncComboBox->findText (settings.value("ID3v2_encoding","UTF-8").toString()); ui.id3v2EncComboBox->setCurrentIndex(pos); ui.firstTagComboBox->setCurrentIndex(settings.value("tag_1", ID3v2).toInt()); ui.secondTagComboBox->setCurrentIndex(settings.value("tag_2", Disabled).toInt()); ui.thirdTagComboBox->setCurrentIndex(settings.value("tag_3", Disabled).toInt()); settings.endGroup(); connect(ui.buttonBox, SIGNAL(accepted()), SLOT(writeSettings())); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::writeSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MAD"); settings.setValue("ID3v1_encoding", ui.id3v1EncComboBox->currentText()); settings.setValue("ID3v2_encoding", ui.id3v2EncComboBox->currentText()); settings.setValue("tag_1", ui.firstTagComboBox->currentIndex()); settings.setValue("tag_2", ui.secondTagComboBox->currentIndex()); settings.setValue("tag_3", ui.thirdTagComboBox->currentIndex()); settings.endGroup(); accept(); } void SettingsDialog::findCodecs() { QMap codecMap; QRegExp iso8859RegExp("ISO[- ]8859-([0-9]+).*"); foreach (int mib, QTextCodec::availableMibs()) { QTextCodec *codec = QTextCodec::codecForMib(mib); QString sortKey = codec->name().toUpper(); int rank; if (sortKey.startsWith("UTF-8")) { rank = 1; } else if (sortKey.startsWith("UTF-16")) { rank = 2; } else if (iso8859RegExp.exactMatch(sortKey)) { if (iso8859RegExp.cap(1).size() == 1) rank = 3; else rank = 4; } else { rank = 5; } sortKey.prepend(QChar('0' + rank)); codecMap.insert(sortKey, codec); } codecs = codecMap.values(); } qmmp-0.7.4/src/plugins/Input/mad/tagextractor.h0000664000175000017500000000423112256224735020214 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef TAGEXTRACTOR_H #define TAGEXTRACTOR_H #include #include #include #include #include #include #include class QIODevice; class QBuffer; class QByteArray; /** @author Ilya Kotov */ class TagExtractor { public: TagExtractor(QIODevice *d); ~TagExtractor(); const QMap id3v2tag(); private: QMap m_tag; QIODevice *m_d; }; class ID3v2Tag : public TagLib::ID3v2::Tag { public: ID3v2Tag(QByteArray *array, long offset); protected: void read (); private: QBuffer *m_buf; long m_offset; }; #endif qmmp-0.7.4/src/plugins/Input/mad/settingsdialog.ui0000664000175000017500000002133012256224735020712 0ustar useruser SettingsDialog 0 0 238 243 MPEG Plugin Settings 6 6 6 Tag Priority 0 0 First: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 ID3v1 ID3v2 APE Disabled 0 0 Second: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 ID3v1 ID3v2 APE Disabled 0 0 Third: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 ID3v1 ID3v2 APE Disabled Qt::Horizontal 40 20 Encodings 0 0 ID3v1 encoding: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 0 ID3v2 encoding: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Qt::Horizontal 125 18 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox rejected() SettingsDialog reject() 162 245 70 244 qmmp-0.7.4/src/plugins/Input/mad/translations/0000775000175000017500000000000012256224735020055 5ustar useruserqmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_zh_CN.ts0000664000175000017500000001602712256224735023633 0ustar useruser DecoderMADFactory MPEG Plugin MPEG 插件 MPEG Files MPEG 文件 About MPEG Audio Plugin 关于 MPEG 音频插件 Qmmp MPEG Audio Plugin Qmmp MPEG 音频插件 Compiled against libmad version: 编译基于 libmad 版本: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format 格式 Bitrate 比特率 kbps Sample rate 取样率 Hz Mode 风格 KB File size 文件大小 Protection 保护 Yes No Copyright 版权 Original 原创 SettingsDialog ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: ID3v1 编码: ID3v2 encoding: ID3v2 编码: MPEG Plugin Settings MPEG 插件设置 Tag Priority 标签优先 First: 第一: APE APE Disabled 无效 Second: 第二: Third: 第三: Encodings 编码 qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_zh_TW.ts0000664000175000017500000001603612256224735023665 0ustar useruser DecoderMADFactory MPEG Plugin MPEG 插件 MPEG Files MPEG 檔案 About MPEG Audio Plugin 關於 MPEG 聲訊插件 Qmmp MPEG Audio Plugin Qmmp MPEG 聲訊插件 Compiled against libmad version: 編譯基於 libmad 的版本: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format 格式 Bitrate 比特率 kbps Sample rate 取樣率 Hz Hz Mode 風格 KB KB File size 文件大小 Protection 保護 Yes No Copyright 版權 Original 原創 SettingsDialog ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: ID3v1 編碼: ID3v2 encoding: ID3v2 編碼: MPEG Plugin Settings MPEG 插件設定 Tag Priority 標簽優先 First: 第一: APE APE Disabled 無效 Second: 第二: Third: 第三: Encodings 編碼 qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_gl_ES.ts0000664000175000017500000001613612256224735023624 0ustar useruser DecoderMADFactory MPEG Plugin Engadido MPEG MPEG Files Ficheiros MPEG About MPEG Audio Plugin Sobre o engadido MPEG Qmmp MPEG Audio Plugin Engadido audio MPEG de Qmmp Compiled against libmad version: Compilado coa versión libmad: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Código fonte baseado nos proxectos mq3 e madplay MPEGMetaDataModel Format Formato Bitrate Taxa de bits kbps kbps Sample rate Frecuencia de mostra Hz Hz Mode Modo KB KB File size Tamaño de ficheiro Protection Protección Yes Si No Non Copyright Copyright Original Orixinal SettingsDialog MPEG Plugin Settings Preferencias do engadido MPEG Tag Priority Prioridade de etiquetas First: Primeira: ID3v1 ID3v1 ID3v2 ID3v2 APE APE Disabled Desactivado Second: Segunda: Third: Terceira: Encodings Codificacións ID3v1 encoding: Codificación ID3v1: ID3v2 encoding: Codificación ID3v2: qmmp-0.7.4/src/plugins/Input/mad/translations/translations.qrc0000664000175000017500000000140112256224735023301 0ustar useruser mad_plugin_ru.qm mad_plugin_uk_UA.qm mad_plugin_zh_CN.qm mad_plugin_zh_TW.qm mad_plugin_tr.qm mad_plugin_cs.qm mad_plugin_pt_BR.qm mad_plugin_de.qm mad_plugin_pl_PL.qm mad_plugin_fr.qm mad_plugin_it.qm mad_plugin_kk.qm mad_plugin_lt.qm mad_plugin_hu.qm mad_plugin_nl.qm mad_plugin_ja.qm mad_plugin_sk.qm mad_plugin_es.qm mad_plugin_he.qm mad_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_uk_UA.ts0000664000175000017500000001642412256224735023637 0ustar useruser DecoderMADFactory MPEG Plugin Модуль MPEG MPEG Files Файли MPEG About MPEG Audio Plugin Про аудіо-модуль MPEG Qmmp MPEG Audio Plugin Аудіо-модуль MPEG для Qmmp Compiled against libmad version: Зібрано з версією libmad: Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Вихідні коди базуються на проектах mq3 та madplay MPEGMetaDataModel Format Формат Bitrate Бітрейт kbps Кб/с Sample rate Частота Hz Гц Mode Режим KB Кб File size Розмір файла Protection Захищено Yes Так No Ні Copyright Авторське право Original Оригінал SettingsDialog ID3v1 ID3v2 ID3v1 encoding: Кодування ID3v1: ID3v2 encoding: Кодування ID3v2: MPEG Plugin Settings Налаштування модуля MPEG Tag Priority Пріоритет тегу First: Перший: APE APE Disabled Вимкнути Second: Другий: Third: Третій: Encodings Кодування qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_de.ts0000664000175000017500000001604012256224735023215 0ustar useruser DecoderMADFactory MPEG Plugin MPEG-Modul MPEG Files MPEG-Dateien About MPEG Audio Plugin Über MPEG-Audio-Modul Qmmp MPEG Audio Plugin Qmmp MPEG-Audio-Modul Compiled against libmad version: Kompiliert gegen libmad-Version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Basiert auf Code von den mq3- und madplay-Projekten MPEGMetaDataModel Format Format Bitrate Bitrate kbps kbps Sample rate Abtastrate Hz Hz Mode Modus KB KB File size Dateigröße Protection Geschützt Yes Ja No Nein Copyright Copyright Original Original SettingsDialog MPEG Plugin Settings Einstellungen MPEG-Modul ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: ID3v1-Kodierung: ID3v2 encoding: ID3v2-Kodierung: Tag Priority Tag-Priorität First: Erster: APE APE Disabled Deaktiviert Second: Zweiter: Third: Dritter: Encodings Kodierungen qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_cs.ts0000664000175000017500000001605212256224735023235 0ustar useruser DecoderMADFactory MPEG Plugin Modul MPEG MPEG Files Soubory MPEG About MPEG Audio Plugin O modulu MPEG Qmmp MPEG Audio Plugin Vstupní modul Qmmp MPEG Compiled against libmad version: Zkompilováno s libmad verze: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Zdrojový kód je založen na projektech mq3 a madplay MPEGMetaDataModel Format Formát Bitrate Datový tok kbps kbps Sample rate Vzorkovací frekvence Hz Hz Mode Režim KB KiB File size Velikost souboru Protection Ochrana Yes Ano No Ne Copyright Copyright Original Originál SettingsDialog MPEG Plugin Settings Nastavení pluginu MPEG ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: Kódování ID3v1: ID3v2 encoding: Kódování ID3v2: Tag Priority Priorita tagu First: První: APE APE Disabled Zakázáno Second: Druhý: Third: Třetí: Encodings Kódování qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_es.ts0000664000175000017500000001607712256224735023246 0ustar useruser DecoderMADFactory MPEG Plugin Módulo MPEG MPEG Files Archivos MPEG About MPEG Audio Plugin Acerca del módulo de audio MPEG Qmmp MPEG Audio Plugin Módulo de audio MPEG para Qmmp Compiled against libmad version: Compilado con libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Formato Bitrate Tasa de bits kbps kbps Sample rate Frecuencia Hz Hz Mode Modo KB KB File size Tamaño del archivo Protection Protección Yes No No Copyright Copyright Original Original SettingsDialog MPEG Plugin Settings Configuración del módulo MPEG ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: Codificación ID3v1: ID3v2 encoding: Codificación ID3v2: Tag Priority Prioridad de etiquetas First: Primera: APE APE Disabled Deshabilitado Second: Segunda: Third: Tercera: Encodings Codificaciones qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_fr.ts0000664000175000017500000001631412256224735023240 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Files About MPEG Audio Plugin Qmmp MPEG Audio Plugin Compiled against libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings Tag Priority First: ID3v1 ID3v2 APE Disabled Second: Third: Encodings ID3v1 encoding: ID3v2 encoding: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_he.ts0000664000175000017500000001625412256224735023230 0ustar useruser DecoderMADFactory MPEG Plugin תוספת MPEG MPEG Files קבצי MPEG About MPEG Audio Plugin אודות תוספת שמע MPEG Qmmp MPEG Audio Plugin תוספת שמע MPEG ‫Qmmp Compiled against libmad version: הודרה כנגדlibmad גירסה: Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Source code based on mq3 and madplay projects קוד מקור מבוסס על פרויקטים mq3 וגם madplay MPEGMetaDataModel Format פורמט Bitrate שיעור סיביות kbps Sample rate שיעור דגימה Hz הרץ Mode מצב KB ק״ב File size גודל קובץ Protection הגנה Yes כן No לא Copyright זכויות יוצרים Original מקורי SettingsDialog MPEG Plugin Settings הגדרות תוספת MPEG Tag Priority עדיפות תגית First: ראשונה: ID3v1 ID3v2 APE Disabled מנוטרלת Second: שניה: Third: שלישית: Encodings קידוד ID3v1 encoding: קידוד ID3v1: ID3v2 encoding: קידוד ID3v2: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_hu.ts0000664000175000017500000001631412256224735023245 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Files About MPEG Audio Plugin Qmmp MPEG Audio Plugin Compiled against libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings Tag Priority First: ID3v1 ID3v2 APE Disabled Second: Third: Encodings ID3v1 encoding: ID3v2 encoding: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_ja.ts0000664000175000017500000001637612256224735023233 0ustar useruser DecoderMADFactory MPEG Plugin MPEG プラグイン MPEG Files MPEG ファイル About MPEG Audio Plugin MPEG 音響プラグインについて Qmmp MPEG Audio Plugin QMMP MPEG 音響プラグイン Compiled against libmad version: コンパイル時に使われた libmad の版はつぎのとおり: Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects ソースコードは mq3 と madplay の両プロジェクトから流用 MPEGMetaDataModel Format 形式 Bitrate ビットレート kbps キロビット毎秒 Sample rate サンプルレート Hz Hz Mode モード KB KiB File size ファイルの大きさ Protection 保護 Yes する No しない Copyright 著作権 Original 原作 SettingsDialog MPEG Plugin Settings MPEG プラグイン設定 Tag Priority タグ優先度 First: 第一: ID3v1 ID3v1 ID3v2 ID3v2 APE APE Disabled 無効 Second: 第二: Third: 第三: Encodings 文字符号化の形式 ID3v1 encoding: ID3v1 用文字符号化形式: ID3v2 encoding: ID3v2 用文字符号化形式: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_it.ts0000664000175000017500000001602212256224735023241 0ustar useruser DecoderMADFactory MPEG Plugin Modulo MPEG MPEG Files Brani MPEG About MPEG Audio Plugin Info sul modulo audio MPEG Qmmp MPEG Audio Plugin Modulo audio MPEG per Qmmp Compiled against libmad version: Compilato con libmad-Version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Formato Bitrate bit al secondo kbps kbps Sample rate Campionamento Hz Hz Mode Modo KB KB File size Dimensione file Protection Protezione Yes No No Copyright Copyright Original Originale SettingsDialog MPEG Plugin Settings Impostazioni modulo MPEG ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: Codifica ID3v1: ID3v2 encoding: Codifica ID3v2: Tag Priority Priorità etichettatura First: Prima: APE APE Disabled Disabilitata Second: Seconda: Third: Terza: Encodings Codifiche qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_kk.ts0000664000175000017500000001631412256224735023236 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Files About MPEG Audio Plugin Qmmp MPEG Audio Plugin Compiled against libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings Tag Priority First: ID3v1 ID3v2 APE Disabled Second: Third: Encodings ID3v1 encoding: ID3v2 encoding: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_lt.ts0000664000175000017500000001602212256224735023244 0ustar useruser DecoderMADFactory MPEG Plugin MPEG įskiepis MPEG Files MPEG bylos About MPEG Audio Plugin Apie MPEG audio įskiepį Qmmp MPEG Audio Plugin Qmmp MPEG įskiepis Compiled against libmad version: Sukurta libmad pagrindu: Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Kodas sukurtas mq3 ir madplay projektų kodais MPEGMetaDataModel Format Formatas Bitrate Kokybė kbps kbps Sample rate Dažnis Hz Hz Mode Metodas KB КB File size Bylos dydis Protection Apsauga Yes Taip No Ne Copyright Copyright Original Originalas SettingsDialog ID3v1 ID3v1 ID3v2 ID3v2 ID3v1 encoding: ID3v1 koduotė: ID3v2 encoding: ID3v2 koduotė: MPEG Plugin Settings MPEG įskiepio nustatymai Tag Priority Tag pirmenybė First: Pirmas: APE APE Disabled Išjungta Second: Antras: Third: Trečias: Encodings Koduotės qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_nl.ts0000664000175000017500000001606612256224735023246 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Module MPEG Files MPEG Bestanden About MPEG Audio Plugin Over de MPEG Audio Module Qmmp MPEG Audio Plugin MPEG Audio Module voor Qmmp Compiled against libmad version: Gecompileerd tegen libmad met versie: Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Broncode gebasseerd op 'mq3' en 'madplay' projecten MPEGMetaDataModel Format Formaat Bitrate Bitsnelheid kbps Sample rate Sample frequentie Hz Mode Stand KB File size Bestandsgrootte Protection Bescherming Yes Ja No Nee Copyright Original Origineel SettingsDialog MPEG Plugin Settings MPEG Module Instellingen ID3v1 ID3v2 ID3v1 encoding: ID3v1 codering: ID3v2 encoding: ID3v2 codering: Tag Priority Tag prioriteit First: Primair: APE Disabled Uitgeschakeld Second: Secundair: Third: Tertiair: Encodings Codering qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_pl.ts0000664000175000017500000001607712256224735023252 0ustar useruser DecoderMADFactory MPEG Plugin Wtyczka MPEG MPEG Files Pliki MPEG About MPEG Audio Plugin O wtyczce Audio MPEG Qmmp MPEG Audio Plugin Wtyczka MPEG Audio dla Qmmp Compiled against libmad version: Skompilowane przy użyciu biblioteki libmad w wersji: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Kod źródłowy oparty na projektach mq3 oraz madplay MPEGMetaDataModel Format Format Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Mode Tryb KB File size Wielkość pliku Protection Zabezpieczenie Yes Tak No Nie Copyright Prawa autorskie Original Oryginał SettingsDialog MPEG Plugin Settings Ustawienia wtyczki MPEG Tag Priority Priorytet tagów First: Pierwszy: ID3v1 ID3v2 APE Disabled Wyłączone Second: Drugi: Third: Trzeci: Encodings Kodowania ID3v1 encoding: Kodowanie ID3v1: ID3v2 encoding: Kodowanie ID3v2: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_ru.ts0000664000175000017500000001645112256224735023261 0ustar useruser DecoderMADFactory MPEG Plugin Модуль MPEG MPEG Files Файлы MPEG About MPEG Audio Plugin Об аудио-модуле MPEG Qmmp MPEG Audio Plugin Аудио-модуль MPEG для Qmmp Compiled against libmad version: Собрано с версией libmad: Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Исходный код снован на проектах mq3 и madplay MPEGMetaDataModel Format Формат Bitrate Битовая частота kbps Кб/с Sample rate Дискретизация Hz Гц Mode Режим KB КБ File size Размер файла Protection Защита Yes Да No Нет Copyright Авторские права Original Оригинальный SettingsDialog ID3v1 ID3v2 ID3v1 encoding: Кодировка ID3v1: ID3v2 encoding: Кодировка ID3v2: MPEG Plugin Settings Настройка модуля MPEG Tag Priority Приоритет тегов First: Первый: APE APE Disabled Выключен Second: Второй: Third: Третий: Encodings Кодировки qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_sk.ts0000664000175000017500000001631412256224735023246 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Files About MPEG Audio Plugin Qmmp MPEG Audio Plugin Compiled against libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings Tag Priority First: ID3v1 ID3v2 APE Disabled Second: Third: Encodings ID3v1 encoding: ID3v2 encoding: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_tr.ts0000664000175000017500000001624312256224735023257 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Eklentisi MPEG Files MPEG Dosyaları About MPEG Audio Plugin MPEG Ses Eklentisi Hakkında Qmmp MPEG Audio Plugin Qmmp MPEG Ses Eklentisi Compiled against libmad version: Derlendiği libmad sürümü: Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings MPEG Eklenti Ayarları Tag Priority Etiket Önceliği First: İlk: ID3v1 ID3v1 ID3v2 ID3v2 APE APE Disabled Etkisiz Second: İkinci: Third: Üçüncü: Encodings Kodlamalar ID3v1 encoding: ID3v1 kodlaması: ID3v2 encoding: ID3v2 kodlaması: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_pl_PL.ts0000664000175000017500000001607712256224735023645 0ustar useruser DecoderMADFactory MPEG Plugin Wtyczka MPEG MPEG Files Pliki MPEG About MPEG Audio Plugin O wtyczce Audio MPEG Qmmp MPEG Audio Plugin Wtyczka MPEG Audio dla Qmmp Compiled against libmad version: Skompilowane przy użyciu biblioteki libmad w wersji: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects Kod źródłowy oparty na projektach mq3 oraz madplay MPEGMetaDataModel Format Format Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Mode Tryb KB File size Wielkość pliku Protection Zabezpieczenie Yes Tak No Nie Copyright Prawa autorskie Original Oryginał SettingsDialog MPEG Plugin Settings Ustawienia wtyczki MPEG Tag Priority Priorytet tagów First: Pierwszy: ID3v1 ID3v2 APE Disabled Wyłączone Second: Drugi: Third: Trzeci: Encodings Kodowania ID3v1 encoding: Kodowanie ID3v1: ID3v2 encoding: Kodowanie ID3v2: qmmp-0.7.4/src/plugins/Input/mad/translations/mad_plugin_pt_BR.ts0000664000175000017500000001631412256224735023637 0ustar useruser DecoderMADFactory MPEG Plugin MPEG Files About MPEG Audio Plugin Qmmp MPEG Audio Plugin Compiled against libmad version: Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 and madplay projects MPEGMetaDataModel Format Bitrate kbps Sample rate Hz Mode KB File size Protection Yes No Copyright Original SettingsDialog MPEG Plugin Settings Tag Priority First: ID3v1 ID3v2 APE Disabled Second: Third: Encodings ID3v1 encoding: ID3v2 encoding: qmmp-0.7.4/src/plugins/Input/mad/replaygainreader.h0000664000175000017500000000370712256224735021032 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAINREADER_H #define REPLAYGAINREADER_H #include #include #include #include /** @author Ilya Kotov */ class ReplayGainReader { public: ReplayGainReader(const QString &path); QMap replayGainInfo() const; private: void readAPE(TagLib::APE::Tag *tag); void setValue(Qmmp::ReplayGainKey key, QString value); QMap m_values; }; #endif // REPLAYGAINREADER_H qmmp-0.7.4/src/plugins/Input/mad/replaygainreader.cpp0000664000175000017500000000555012256224735021363 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { TagLib::MPEG::File fileRef(path.toLocal8Bit ().constData()); if(fileRef.APETag()) readAPE(fileRef.APETag()); } QMap ReplayGainReader::replayGainInfo() const { return m_values; } void ReplayGainReader::readAPE(TagLib::APE::Tag *tag) { TagLib::APE::ItemListMap items = tag->itemListMap(); if (items.contains("REPLAYGAIN_TRACK_GAIN")) setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].values()[0])); if (items.contains("REPLAYGAIN_TRACK_PEAK")) setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].values()[0])); if (items.contains("REPLAYGAIN_ALBUM_GAIN")) setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN,TStringToQString(items["REPLAYGAIN_ALBUM_GAIN"].values()[0])); if (items.contains("REPLAYGAIN_ALBUM_PEAK")) setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK,TStringToQString(items["REPLAYGAIN_ALBUM_PEAK"].values()[0])); } void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) { value.remove(" dB"); if(value.isEmpty()) return; bool ok; double v = value.toDouble(&ok); if(ok) m_values[key] = v; } qmmp-0.7.4/src/plugins/Input/mad/settingsdialog.h0000664000175000017500000000363112256224735020530 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); enum TagType {ID3v1 = 0, ID3v2, APE, Disabled}; private slots: void writeSettings(); private: void findCodecs(); Ui::SettingsDialog ui; QList codecs; }; #endif qmmp-0.7.4/src/plugins/Input/mad/mpegmetadatamodel.cpp0000664000175000017500000002615512256224735021523 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mpegmetadatamodel.h" MPEGMetaDataModel::MPEGMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_file = new TagLib::MPEG::File(path.toLocal8Bit().constData()); m_tags << new MpegFileTagModel(m_file, TagLib::MPEG::File::ID3v1); m_tags << new MpegFileTagModel(m_file, TagLib::MPEG::File::ID3v2); m_tags << new MpegFileTagModel(m_file, TagLib::MPEG::File::APE); } MPEGMetaDataModel::~MPEGMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); delete m_file; } QHash MPEGMetaDataModel::audioProperties() { QHash ap; QString text; QString v; switch((int)m_file->audioProperties()->version()) { case TagLib::MPEG::Header::Version1: v = "1"; break; case TagLib::MPEG::Header::Version2: v = "2"; break; case TagLib::MPEG::Header::Version2_5: v = "2.5"; } text = QString("MPEG-%1 layer %2").arg(v).arg(m_file->audioProperties()->layer()); ap.insert(tr("Format"), text); text = QString("%1").arg(m_file->audioProperties()->bitrate()); ap.insert(tr("Bitrate"), text+" "+tr("kbps")); text = QString("%1").arg(m_file->audioProperties()->sampleRate()); ap.insert(tr("Sample rate"), text+" "+tr("Hz")); switch (m_file->audioProperties()->channelMode()) { case TagLib::MPEG::Header::Stereo: ap.insert(tr("Mode"), "Stereo"); break; case TagLib::MPEG::Header::JointStereo: ap.insert(tr("Mode"), "Joint stereo"); break; case TagLib::MPEG::Header::DualChannel: ap.insert(tr("Mode"), "Dual channel"); break; case TagLib::MPEG::Header::SingleChannel: ap.insert(tr("Mode"), "Single channel"); break; } text = QString("%1 "+tr("KB")).arg(m_file->length()/1024); ap.insert(tr("File size"), text); if (m_file->audioProperties()->protectionEnabled()) ap.insert(tr("Protection"), tr("Yes")); else ap.insert(tr("Protection"), tr("No")); if (m_file->audioProperties()->isCopyrighted()) ap.insert(tr("Copyright"), tr("Yes")); else ap.insert(tr("Copyright"), tr("No")); if (m_file->audioProperties()->isOriginal()) ap.insert(tr("Original"), tr("Yes")); else ap.insert(tr("Original"), tr("No")); return ap; } QList MPEGMetaDataModel::tags() { return m_tags; } QPixmap MPEGMetaDataModel::cover() { if(!m_file->ID3v2Tag()) return QPixmap(); TagLib::ID3v2::FrameList frames = m_file->ID3v2Tag()->frameListMap()["APIC"]; if(frames.isEmpty()) return QPixmap(); for(TagLib::ID3v2::FrameList::Iterator it = frames.begin(); it != frames.end(); ++it) { TagLib::ID3v2::AttachedPictureFrame *frame = static_cast(*it); if(frame && frame->type() == TagLib::ID3v2::AttachedPictureFrame::FrontCover) { QPixmap cover; cover.loadFromData((const uchar *)frame->picture().data(), frame->picture().size()); return cover; } } return QPixmap(); } MpegFileTagModel::MpegFileTagModel(TagLib::MPEG::File *file, TagLib::MPEG::File::TagTypes tagType) : TagModel() { m_tagType = tagType; m_file = file; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("MAD"); if (m_tagType == TagLib::MPEG::File::ID3v1) { m_tag = m_file->ID3v1Tag(); m_codec = QTextCodec::codecForName(settings.value("ID3v1_encoding", "ISO-8859-1").toByteArray ()); if (!m_codec) QTextCodec::codecForName ("ISO-8859-1"); } else if (m_tagType == TagLib::MPEG::File::ID3v2) { m_tag = m_file->ID3v2Tag(); m_codec = QTextCodec::codecForName(settings.value("ID3v2_encoding", "UTF-8").toByteArray ()); if (!m_codec) QTextCodec::codecForName ("UTF-8"); } else { m_tag = m_file->APETag(); m_codec = QTextCodec::codecForName ("UTF-8"); } settings.endGroup(); } MpegFileTagModel::~MpegFileTagModel() {} const QString MpegFileTagModel::name() { if (m_tagType == TagLib::MPEG::File::ID3v1) return "ID3v1"; else if (m_tagType == TagLib::MPEG::File::ID3v2) return "ID3v2"; return "APE"; } QList MpegFileTagModel::keys() { QList list = TagModel::keys(); if (m_tagType == TagLib::MPEG::File::ID3v2) return list; list.removeAll(Qmmp::COMPOSER); list.removeAll(Qmmp::DISCNUMBER); return list; } const QString MpegFileTagModel::value(Qmmp::MetaData key) { QTextCodec *codec = m_codec; if (m_tag) { bool utf = codec->name().contains("UTF"); if (utf) codec = QTextCodec::codecForName ("UTF-8"); TagLib::String str; switch((int) key) { case Qmmp::TITLE: str = m_tag->title(); break; case Qmmp::ARTIST: str = m_tag->artist(); break; case Qmmp::ALBUM: str = m_tag->album(); break; case Qmmp::COMMENT: str = m_tag->comment(); break; case Qmmp::GENRE: str = m_tag->genre(); break; case Qmmp::COMPOSER: if(m_tagType == TagLib::MPEG::File::ID3v2 && !m_file->ID3v2Tag()->frameListMap()["TCOM"].isEmpty()) str = m_file->ID3v2Tag()->frameListMap()["TCOM"].front()->toString(); break; case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); case Qmmp::DISCNUMBER: if(m_tagType == TagLib::MPEG::File::ID3v2 && !m_file->ID3v2Tag()->frameListMap()["TPOS"].isEmpty()) str = m_file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString(); } return codec->toUnicode(str.toCString(utf)).trimmed(); } return QString(); } void MpegFileTagModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String::Type type = TagLib::String::Latin1; if (m_tagType == TagLib::MPEG::File::ID3v1) { if(m_codec->name().contains("UTF")) //utf is unsupported return; } else if (m_tagType == TagLib::MPEG::File::ID3v2) { if (m_codec->name().contains("UTF")) { type = TagLib::String::UTF8; if (m_codec->name().contains("UTF-16")) type = TagLib::String::UTF16; else if (m_codec->name().contains("UTF-16LE")) type = TagLib::String::UTF16LE; else if (m_codec->name().contains("UTF-16BE")) type = TagLib::String::UTF16BE; m_codec = QTextCodec::codecForName ("UTF-8"); TagLib::ID3v2::FrameFactory *factory = TagLib::ID3v2::FrameFactory::instance(); factory->setDefaultTextEncoding(type); m_file->setID3v2FrameFactory(factory); type = TagLib::String::UTF8; } //save additional tags TagLib::ByteVector id3v2_key; if (key == Qmmp::COMPOSER) id3v2_key = "TCOM"; //composer else if (key == Qmmp::DISCNUMBER) id3v2_key = "TPOS"; //disc number if (!id3v2_key.isEmpty()) { TagLib::String composer = TagLib::String(m_codec->fromUnicode(value).constData(), type); TagLib::ID3v2::Tag *id3v2_tag = dynamic_cast(m_tag); if(value.isEmpty()) id3v2_tag->removeFrames(id3v2_key); else if(!id3v2_tag->frameListMap()[id3v2_key].isEmpty()) id3v2_tag->frameListMap()[id3v2_key].front()->setText(composer); else { TagLib::ID3v2::TextIdentificationFrame *frame; frame = new TagLib::ID3v2::TextIdentificationFrame(id3v2_key, type); frame->setText(composer); id3v2_tag->addFrame(frame); } return; } } else if(m_tagType == TagLib::MPEG::File::APE) type = TagLib::String::UTF8; TagLib::String str = TagLib::String(m_codec->fromUnicode(value).constData(), type); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); break; case Qmmp::ARTIST: m_tag->setArtist(str); break; case Qmmp::ALBUM: m_tag->setAlbum(str); break; case Qmmp::COMMENT: m_tag->setComment(str); break; case Qmmp::GENRE: m_tag->setGenre(str); break; case Qmmp::YEAR: m_tag->setYear(value.toInt()); break; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); } } bool MpegFileTagModel::exists() { return (m_tag != 0); } void MpegFileTagModel::create() { if (m_tag) return; if (m_tagType == TagLib::MPEG::File::ID3v1) m_tag = m_file->ID3v1Tag(true); else if (m_tagType == TagLib::MPEG::File::ID3v2) m_tag = m_file->ID3v2Tag(true); else if (m_tagType == TagLib::MPEG::File::APE) m_tag = m_file->APETag(true); } void MpegFileTagModel::remove() { m_tag = 0; } void MpegFileTagModel::save() { if(m_tag) m_file->save(m_tagType, false); else m_file->strip(m_tagType); } qmmp-0.7.4/src/plugins/Input/mad/decoder_mad.cpp0000664000175000017500000003526512256224735020301 0ustar useruser/*************************************************************************** * Based on mq3 and madplay projects * * * * Copyright (c) 2000-2001 Brad Hughes * * Copyright (C) 2000-2004 Robert Leslie * * Copyright (C) 2009-2012 Ilya Kotov forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "tagextractor.h" #include "decoder_mad.h" #define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g') #define INPUT_BUFFER_SIZE (32*1024) #define USE_DITHERING DecoderMAD::DecoderMAD(QIODevice *i) : Decoder(i) { m_inited = false; m_totalTime = 0; m_channels = 0; m_bitrate = 0; m_freq = 0; m_len = 0; m_input_buf = 0; m_input_bytes = 0; m_output_bytes = 0; m_output_at = 0; m_skip_frames = 0; m_eof = false; m_left_dither.random = 0; m_left_dither.error[0] = 0; m_left_dither.error[1] = 0; m_left_dither.error[2] = 0; m_right_dither.random = 0; m_right_dither.error[0] = 0; m_right_dither.error[1] = 0; m_right_dither.error[2] = 0; } DecoderMAD::~DecoderMAD() { deinit(); if (m_input_buf) { qDebug("DecoderMAD: deleting input_buf"); delete [] m_input_buf; m_input_buf = 0; } } bool DecoderMAD::initialize() { m_inited = false; m_totalTime = 0; m_channels = 0; m_bitrate = 0; m_freq = 0; m_len = 0; m_input_bytes = 0; m_output_bytes = 0; m_output_at = 0; if (!input()) { qWarning("DecoderMAD: cannot initialize. No input."); return false; } if (!m_input_buf) m_input_buf = new char[INPUT_BUFFER_SIZE]; if (!input()->isOpen()) { if (!input()->open(QIODevice::ReadOnly)) { qWarning("DecoderMAD: %s", qPrintable(input()->errorString ())); return false; } } if (input()->isSequential ()) //for streams only { TagExtractor extractor(input()); if(!extractor.id3v2tag().isEmpty()) addMetaData(extractor.id3v2tag()); } mad_stream_init(&m_stream); mad_frame_init(&m_frame); mad_synth_init(&m_synth); if (!findHeader()) { qDebug("DecoderMAD: Can't find a valid MPEG header."); return false; } mad_stream_buffer(&m_stream, (unsigned char *) m_input_buf, m_input_bytes); m_stream.error = MAD_ERROR_BUFLEN; mad_frame_mute (&m_frame); m_stream.next_frame = 0; m_stream.sync = 0; configure(m_freq, m_channels, Qmmp::PCM_S16LE); m_inited = true; return true; } void DecoderMAD::deinit() { if (!m_inited) return; mad_synth_finish(&m_synth); mad_frame_finish(&m_frame); mad_stream_finish(&m_stream); m_inited = false; m_totalTime = 0; m_channels = 0; m_bitrate = 0; m_freq = 0; m_len = 0; m_input_bytes = 0; m_output_bytes = 0; m_output_at = 0; m_skip_frames = 0; m_eof = false; } bool DecoderMAD::findXingHeader(struct mad_bitptr ptr, unsigned int bitlen) { if (bitlen < 64 || mad_bit_read(&ptr, 32) != XING_MAGIC) goto fail; xing.flags = mad_bit_read(&ptr, 32); bitlen -= 64; if (xing.flags & XING_FRAMES) { if (bitlen < 32) goto fail; xing.frames = mad_bit_read(&ptr, 32); bitlen -= 32; } if (xing.flags & XING_BYTES) { if (bitlen < 32) goto fail; xing.bytes = mad_bit_read(&ptr, 32); bitlen -= 32; } if (xing.flags & XING_TOC) { int i; if (bitlen < 800) goto fail; for (i = 0; i < 100; ++i) xing.toc[i] = mad_bit_read(&ptr, 8); bitlen -= 800; } if (xing.flags & XING_SCALE) { if (bitlen < 32) goto fail; xing.scale = mad_bit_read(&ptr, 32); bitlen -= 32; } return true; fail: xing.flags = 0; xing.frames = 0; xing.bytes = 0; xing.scale = 0; return false; } bool DecoderMAD::findHeader() { bool result = false; int count = 0; bool has_xing = false; bool is_vbr = false; mad_timer_t duration = mad_timer_zero; struct mad_header header; mad_header_init (&header); forever { m_input_bytes = 0; if (m_stream.error == MAD_ERROR_BUFLEN || !m_stream.buffer) { size_t remaining = 0; if (!m_stream.next_frame) { remaining = m_stream.bufend - m_stream.next_frame; memmove (m_input_buf, m_stream.next_frame, remaining); } m_input_bytes = input()->read(m_input_buf + remaining, INPUT_BUFFER_SIZE - remaining); if (m_input_bytes <= 0) break; mad_stream_buffer(&m_stream, (unsigned char *) m_input_buf + remaining, m_input_bytes); m_stream.error = MAD_ERROR_NONE; } if (mad_header_decode(&header, &m_stream) < 0) { if(m_stream.error == MAD_ERROR_LOSTSYNC) { uint tagSize = findID3v2((uchar *)m_stream.this_frame, (ulong) (m_stream.bufend - m_stream.this_frame)); if (tagSize > 0) mad_stream_skip(&m_stream, tagSize); continue; } else if (m_stream.error == MAD_ERROR_BUFLEN || MAD_RECOVERABLE(m_stream.error)) continue; else { qDebug ("DecoderMAD: Can't decode header: %s", mad_stream_errorstr(&m_stream)); break; } } result = true; if (input()->isSequential()) break; count ++; //try to detect xing header if (count == 1) { m_frame.header = header; if (mad_frame_decode(&m_frame, &m_stream) != -1 && findXingHeader(m_stream.anc_ptr, m_stream.anc_bitlen)) { is_vbr = true; qDebug ("DecoderMAD: Xing header detected"); if (xing.flags & XING_FRAMES) { has_xing = true; count = xing.frames; break; } } } //try to detect VBR if (!is_vbr && !(count > 15)) { if (m_bitrate && header.bitrate != m_bitrate) { qDebug ("DecoderMAD: VBR detected"); is_vbr = true; } else m_bitrate = header.bitrate; } else if (!is_vbr) { qDebug ("DecoderMAD: Fixed rate detected"); break; } mad_timer_add (&duration, header.duration); } if (!result) return false; if (!is_vbr && !input()->isSequential()) { double time = (input()->size() * 8.0) / (header.bitrate); double timefrac = (double)time - ((long)(time)); mad_timer_set(&duration, (long)time, (long)(timefrac*100), 100); } else if (has_xing) { mad_timer_multiply (&header.duration, count); duration = header.duration; } m_totalTime = mad_timer_count(duration, MAD_UNITS_MILLISECONDS); qDebug ("DecoderMAD: Total time: %ld", long(m_totalTime)); m_freq = header.samplerate; m_channels = MAD_NCHANNELS(&header); m_bitrate = header.bitrate / 1000; mad_header_finish(&header); input()->seek(0); m_input_bytes = 0; return true; } qint64 DecoderMAD::totalTime() { if (!m_inited) return 0; return m_totalTime; } int DecoderMAD::bitrate() { return int(m_bitrate); } qint64 DecoderMAD::read(char *data, qint64 size) { forever { if(((m_stream.error == MAD_ERROR_BUFLEN) || !m_stream.buffer) && !m_eof) { m_eof = !fillBuffer(); } if(mad_frame_decode(&m_frame, &m_stream) < 0) { switch((int) m_stream.error) { case MAD_ERROR_LOSTSYNC: { //skip ID3v2 tag uint tagSize = findID3v2((uchar *)m_stream.this_frame, (ulong) (m_stream.bufend - m_stream.this_frame)); if (tagSize > 0) { mad_stream_skip(&m_stream, tagSize); qDebug("DecoderMAD: %d bytes skipped", tagSize); } continue; } case MAD_ERROR_BUFLEN: if(m_eof) return 0; continue; default: if (!MAD_RECOVERABLE(m_stream.error)) return 0; else continue; } } if(m_skip_frames) { m_skip_frames--; continue; } mad_synth_frame(&m_synth, &m_frame); return madOutput(data, size); } } void DecoderMAD::seek(qint64 pos) { if(m_totalTime > 0) { qint64 seek_pos = qint64(pos * input()->size() / m_totalTime); input()->seek(seek_pos); mad_frame_mute(&m_frame); mad_synth_mute(&m_synth); m_stream.error = MAD_ERROR_BUFLEN; m_stream.sync = 0; m_input_bytes = 0; m_stream.next_frame = 0; m_skip_frames = 2; } } bool DecoderMAD::fillBuffer() { if (m_stream.next_frame) { m_input_bytes = &m_input_buf[m_input_bytes] - (char *) m_stream.next_frame; memmove(m_input_buf, m_stream.next_frame, m_input_bytes); } int len = input()->read((char *) m_input_buf + m_input_bytes, INPUT_BUFFER_SIZE - m_input_bytes); if (!len) { qDebug("DecoderMAD: end of file"); return false; } else if(len < 0) { qWarning("DecoderMAD: error"); return false; } m_input_bytes += len; mad_stream_buffer(&m_stream, (unsigned char *) m_input_buf, m_input_bytes); return true; } uint DecoderMAD::findID3v2(uchar *data, ulong size) //retuns ID3v2 tag size { if (size < 10) return 0; if (((data[0] == 'I' && data[1] == 'D' && data[2] == '3') || //ID3v2 tag (data[0] == '3' && data[1] == 'D' && data[2] == 'I')) && //ID3v2 footer data[3] < 0xff && data[4] < 0xff && data[6] < 0x80 && data[7] < 0x80 && data[8] < 0x80 && data[9] < 0x80) { TagLib::ByteVector byteVector((char *)data, size); TagLib::ID3v2::Header header(byteVector); return header.tagSize(); } return 0; } unsigned long DecoderMAD::prng(unsigned long state) // 32-bit pseudo-random number generator { return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; } // gather signal statistics while clipping void DecoderMAD::clip(mad_fixed_t *sample) { enum { MIN = -MAD_F_ONE, MAX = MAD_F_ONE - 1 }; if (*sample > MAX) *sample = MAX; else if (*sample < MIN) *sample = MIN; } long DecoderMAD::audio_linear_dither(unsigned int bits, mad_fixed_t sample, struct audio_dither *dither) { unsigned int scalebits; mad_fixed_t output, mask, random; /* noise shape */ sample += dither->error[0] - dither->error[1] + dither->error[2]; dither->error[2] = dither->error[1]; dither->error[1] = dither->error[0] / 2; /* bias */ output = sample + (1L << (MAD_F_FRACBITS + 1 - bits - 1)); scalebits = MAD_F_FRACBITS + 1 - bits; mask = (1L << scalebits) - 1; /* dither */ random = prng(dither->random); output += (random & mask) - (dither->random & mask); dither->random = random; /* clip */ clip(&output); /* quantize */ output &= ~mask; /* error feedback */ dither->error[0] = sample - output; /* scale */ return output >> scalebits; } //generic linear sample quantize routine long DecoderMAD::audio_linear_round(unsigned int bits, mad_fixed_t sample) { /* round */ sample += (1L << (MAD_F_FRACBITS - bits)); /* clip */ clip(&sample); /* quantize and scale */ return sample >> (MAD_F_FRACBITS + 1 - bits); } qint64 DecoderMAD::madOutput(char *data, qint64 size) { unsigned int samples, channels; mad_fixed_t const *left, *right; samples = m_synth.pcm.length; channels = m_synth.pcm.channels; left = m_synth.pcm.samples[0]; right = m_synth.pcm.samples[1]; m_bitrate = m_frame.header.bitrate / 1000; m_output_at = 0; m_output_bytes = 0; if(samples * channels * 2 > size) { qWarning("DecoderMad: input buffer is too small"); samples = size / channels / 2; } while (samples--) { signed int sample; #ifdef USE_DITHERING sample = audio_linear_dither(16, *left++, &m_left_dither); #else sample = audio_linear_round(16, *left++); #endif *(data + m_output_at++) = ((sample >> 0) & 0xff); *(data + m_output_at++) = ((sample >> 8) & 0xff); m_output_bytes += 2; if (channels == 2) { #ifdef USE_DITHERING sample = audio_linear_dither(16, *right++, &m_right_dither); #else sample = audio_linear_round(16, *right++); #endif *(data + m_output_at++) = ((sample >> 0) & 0xff); *(data + m_output_at++) = ((sample >> 8) & 0xff); m_output_bytes += 2; } } return m_output_bytes; } qmmp-0.7.4/src/plugins/Input/mad/decoder_mad.h0000664000175000017500000000664612256224735017747 0ustar useruser/*************************************************************************** * Based on mq3 and madplay projects * * * * Copyright (c) 2000-2001 Brad Hughes * * Copyright (C) 2000-2004 Robert Leslie * * Copyright (C) 2009-2012 Ilya Kotov forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_MAD_H #define DECODER_MAD_H class QIODevice; class DecoderMAD; #include #include "decodermadfactory.h" extern "C" { #include } class DecoderMAD : public Decoder { public: DecoderMAD(QIODevice *i); virtual ~DecoderMAD(); // standard decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *data, qint64 size); void seek(qint64); private: // helper functions qint64 madOutput(char *data, qint64 size); bool fillBuffer(); void deinit(); bool findHeader(); bool findXingHeader(struct mad_bitptr, unsigned int); uint findID3v2(uchar *data, ulong size); bool m_inited, m_eof; qint64 m_totalTime; int m_channels, m_skip_frames; uint m_bitrate; long m_freq, m_len; qint64 m_output_bytes, m_output_at; // file input buffer char *m_input_buf; qint64 m_input_bytes; // MAD decoder struct { int flags; unsigned long frames; unsigned long bytes; unsigned char toc[100]; long scale; } xing; enum { XING_FRAMES = 0x0001, XING_BYTES = 0x0002, XING_TOC = 0x0004, XING_SCALE = 0x0008 }; struct audio_dither { mad_fixed_t error[3]; mad_fixed_t random; }; struct mad_stream m_stream; struct mad_frame m_frame; struct mad_synth m_synth; struct audio_dither m_left_dither, m_right_dither; //converter functions unsigned long prng(unsigned long state); void clip(mad_fixed_t *sample); long audio_linear_dither(unsigned int bits, mad_fixed_t sample, struct audio_dither *dither); long audio_linear_round(unsigned int bits, mad_fixed_t sample); }; #endif // DECODER_MAD_H qmmp-0.7.4/src/plugins/Input/mpc/0000775000175000017500000000000012256224735015352 5ustar useruserqmmp-0.7.4/src/plugins/Input/mpc/decoder_mpc.cpp0000664000175000017500000001773412256224735020336 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "decoder_mpc.h" // this function used from xmms inline static void copyBuffer(MPC_SAMPLE_FORMAT* pInBuf, char* pOutBuf, unsigned pLength) { unsigned pSize = 16; int clipMin = -1 << (pSize - 1); int clipMax = (1 << (pSize - 1)) - 1; int floatScale = 1 << (pSize - 1); for (unsigned n = 0; n < 2 * pLength; n++) { int val; #ifdef MPC_FIXED_POINT val = shiftSigned(pInBuf[n], pSize - MPC_FIXED_POINT_SCALE_SHIFT); #else val = (int) (pInBuf[n] * floatScale); #endif if (val < clipMin) val = clipMin; else if (val > clipMax) val = clipMax; unsigned shift = 0; do { pOutBuf[n * 2 + (shift / 8)] = (unsigned char) ((val >> shift) & 0xFF); shift += 8; } while (shift < pSize); } } // mpc callbacks #ifdef MPC_OLD_API static mpc_int32_t mpc_callback_read (void *data, void *buffer, mpc_int32_t size) { DecoderMPC *dmpc = (DecoderMPC *) data; #else static mpc_int32_t mpc_callback_read (mpc_reader *reader, void *buffer, mpc_int32_t size) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; #endif qint64 res; res = dmpc->input()->read((char *)buffer, size); return res; } #ifdef MPC_OLD_API static mpc_bool_t mpc_callback_seek (void *data, mpc_int32_t offset) { DecoderMPC *dmpc = (DecoderMPC *) data; #else static mpc_bool_t mpc_callback_seek (mpc_reader *reader, mpc_int32_t offset) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; #endif return dmpc->input()->seek(offset); } #ifdef MPC_OLD_API static mpc_int32_t mpc_callback_tell (void *data) { DecoderMPC *dmpc = (DecoderMPC *) data; #else static mpc_int32_t mpc_callback_tell (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; #endif return dmpc->input()->pos (); } #ifdef MPC_OLD_API static mpc_bool_t mpc_callback_canseek (void *data) { DecoderMPC *dmpc = (DecoderMPC *) data; #else static mpc_bool_t mpc_callback_canseek (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; #endif return !dmpc->input()->isSequential () ; } #ifdef MPC_OLD_API static mpc_int32_t mpc_callback_get_size (void *data) { DecoderMPC *dmpc = (DecoderMPC *) data; #else static mpc_int32_t mpc_callback_get_size (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; #endif return dmpc->input()->size(); } // Decoder class DecoderMPC::DecoderMPC(QIODevice *i) : Decoder(i) { m_len = 0; m_bitrate = 0; m_totalTime = 0.0; m_data = 0; } DecoderMPC::~DecoderMPC() { m_len = 0; if (data()) { #ifndef MPC_OLD_API if (data()->demuxer) mpc_demux_exit (data()->demuxer); data()->demuxer = 0; #endif delete data(); m_data = 0; } } bool DecoderMPC::initialize() { m_bitrate = 0; m_totalTime = 0; if (!input()) { qWarning("DecoderMPC: cannot initialize. No input."); return false; } if (!input()->isOpen()) { if (!input()->open(QIODevice::ReadOnly)) { qWarning("DecoderMPC: unable to open input."); return false; } } if (!m_data) { m_data = new mpc_data; } qDebug("DecoderMPC: setting callbacks"); m_data->reader.read = mpc_callback_read; m_data->reader.seek = mpc_callback_seek; m_data->reader.tell = mpc_callback_tell; m_data->reader.canseek = mpc_callback_canseek; m_data->reader.get_size = mpc_callback_get_size; m_data->reader.data = this; #ifdef MPC_OLD_API mpc_streaminfo_init (&m_data->info); if (mpc_streaminfo_read (&m_data->info, &m_data->reader) != ERROR_CODE_OK) return false; #else m_data->demuxer = mpc_demux_init (&m_data->reader); if (!m_data->demuxer) return false; mpc_demux_get_info (m_data->demuxer, &m_data->info); #endif int chan = data()->info.channels; configure(data()->info.sample_freq, chan, Qmmp::PCM_S16LE); QMap rg_info; //replay gain information #ifdef MPC_OLD_API mpc_decoder_setup (&data()->decoder, &data()->reader); //mpc_decoder_scale_output (&data()->decoder, 3.0); if (!mpc_decoder_initialize (&data()->decoder, &data()->info)) { qWarning("DecoderMPC: cannot get info."); return false; } rg_info[Qmmp::REPLAYGAIN_ALBUM_GAIN] = data()->info.gain_album/100.0; rg_info[Qmmp::REPLAYGAIN_TRACK_GAIN] = data()->info.gain_title/100.0; rg_info[Qmmp::REPLAYGAIN_ALBUM_PEAK] = data()->info.peak_album/32768.0; rg_info[Qmmp::REPLAYGAIN_TRACK_PEAK] = data()->info.peak_title/32768.0; #else rg_info[Qmmp::REPLAYGAIN_ALBUM_GAIN] = data()->info.gain_album/256.0; rg_info[Qmmp::REPLAYGAIN_TRACK_GAIN] = data()->info.gain_title/256.0; rg_info[Qmmp::REPLAYGAIN_ALBUM_PEAK] = pow(10, data()->info.peak_album/256.0/20.0); rg_info[Qmmp::REPLAYGAIN_TRACK_PEAK] = pow(10, data()->info.peak_title/256.0/20.0); #endif setReplayGainInfo(rg_info); m_totalTime = mpc_streaminfo_get_length(&data()->info) * 1000; qDebug("DecoderMPC: initialize succes"); return true; } qint64 DecoderMPC::totalTime() { return m_totalTime; } int DecoderMPC::bitrate() { return m_bitrate; } qint64 DecoderMPC::read(char *audio, qint64 maxSize) { #ifdef MPC_OLD_API mpc_uint32_t vbrAcc = 0; mpc_uint32_t vbrUpd = 0; MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH]; m_len = mpc_decoder_decode (&data()->decoder, buffer, &vbrAcc, &vbrUpd); copyBuffer(buffer, audio, qMin(m_len,long(maxSize/4))); m_len = m_len * 4; m_bitrate = vbrUpd * data()->info.sample_freq / 1152000; #else mpc_frame_info frame; mpc_status err; MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH]; frame.buffer = (MPC_SAMPLE_FORMAT *) &buffer; m_len = 0; while (!m_len) { err = mpc_demux_decode (m_data->demuxer, &frame); if (err != MPC_STATUS_OK || frame.bits == -1) { m_len = 0; qDebug("finished"); return 0; } else { m_len = frame.samples; copyBuffer(buffer, audio, qMin(m_len,long(maxSize/4))); m_len = m_len * 4; } } m_bitrate = frame.bits * data()->info.sample_freq / 1152000; #endif return m_len; } void DecoderMPC::seek(qint64 pos) { #ifdef MPC_OLD_API mpc_decoder_seek_seconds(&data()->decoder, pos/1000); #else mpc_demux_seek_second(data()->demuxer, (double)pos/1000); #endif } qmmp-0.7.4/src/plugins/Input/mpc/CMakeLists.txt0000664000175000017500000000413212256224735020112 0ustar useruserproject(libmpc) INCLUDE(CheckIncludeFileCXX) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libmpc CHECK_INCLUDE_FILE_CXX(mpc/mpcdec.h MPC_HEADER_NEW_FOUND) IF(NOT MPC_HEADER_NEW_FOUND) CHECK_INCLUDE_FILE_CXX(mpcdec/mpcdec.h MPC_HEADER_OLD_FOUND) ADD_DEFINITIONS(-DMPC_OLD_API) ENDIF(NOT MPC_HEADER_NEW_FOUND) FIND_LIBRARY(MPC_LIB NAME mpcdec PATHS /usr/lib /usr/lib32 /usr/local/lib /usr/local/lib32) IF((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) SET(MPC_FOUND TRUE CACHE INTERNAL "mpc") MESSAGE(STATUS "Found MusePack: ${MPC_LIB}") ELSE((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) MESSAGE(STATUS "Could not find MusePack library") ENDIF((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) include_directories(${TAGLIB_INCLUDE_DIRS}) link_directories(${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${TAGLIB_CFLAGS}) SET(libmpc_SRCS decoder_mpc.cpp decodermpcfactory.cpp mpcmetadatamodel.cpp ) SET(libmpc_HDRS decoder_mpc.h ) SET(libmpc_MOC_HDRS decodermpcfactory.h mpcmetadatamodel.h ) SET(libmpc_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libmpc_RCC_SRCS ${libmpc_RCCS}) QT4_WRAP_CPP(libmpc_MOC_SRCS ${libmpc_MOC_HDRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(MPC_FOUND) ADD_LIBRARY(mpc MODULE ${libmpc_SRCS} ${libmpc_MOC_SRCS} ${libmpc_RCC_SRCS} ${libmpc_HDRS}) add_dependencies(mpc qmmp) target_link_libraries(mpc ${QT_LIBRARIES} -lqmmp ${MPC_LIB} ${TAGLIB_LDFLAGS}) install(TARGETS mpc DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(MPC_FOUND) qmmp-0.7.4/src/plugins/Input/mpc/mpcmetadatamodel.h0000664000175000017500000000467112256224735021034 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MPCMETADATAMODEL_H #define MPCMETADATAMODEL_H #include #include #include class QTextCodec; class MPCMetaDataModel : public MetaDataModel { Q_OBJECT public: MPCMetaDataModel(const QString &path, QObject *parent); ~MPCMetaDataModel(); QHash audioProperties(); QList tags(); private: QList m_tags; TagLib::MPC::File *m_file; }; class MPCFileTagModel : public TagModel { public: MPCFileTagModel(TagLib::MPC::File *file, TagLib::MPC::File::TagTypes tagType); ~MPCFileTagModel(); const QString name(); QList keys(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); bool exists(); void create(); void remove(); void save(); private: QTextCodec *m_codec; TagLib::MPC::File *m_file; TagLib::Tag *m_tag; TagLib::MPC::File::TagTypes m_tagType; }; #endif // MPCMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/mpc/mpcmetadatamodel.cpp0000664000175000017500000001334012256224735021360 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "mpcmetadatamodel.h" MPCMetaDataModel::MPCMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_file = new TagLib::MPC::File (path.toLocal8Bit().constData()); m_tags << new MPCFileTagModel(m_file, TagLib::MPC::File::ID3v1); m_tags << new MPCFileTagModel(m_file, TagLib::MPC::File::APE); } MPCMetaDataModel::~MPCMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); delete m_file; } QHash MPCMetaDataModel::audioProperties() { QHash ap; QString text = QString("%1").arg(m_file->audioProperties()->length()/60); text +=":"+QString("%1").arg(m_file->audioProperties()->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(m_file->audioProperties()->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(m_file->audioProperties()->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(m_file->audioProperties()->bitrate())); ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(m_file->length()/1024)); return ap; } QList MPCMetaDataModel::tags() { return m_tags; } MPCFileTagModel::MPCFileTagModel(TagLib::MPC::File *file, TagLib::MPC::File::TagTypes tagType) : TagModel() { m_tagType = tagType; m_file = file; if (m_tagType == TagLib::MPC::File::ID3v1) { m_tag = m_file->ID3v1Tag(); m_codec = QTextCodec::codecForName("ISO-8859-1"); } else { m_tag = m_file->APETag(); m_codec = QTextCodec::codecForName ("UTF-8"); } } MPCFileTagModel::~MPCFileTagModel() {} const QString MPCFileTagModel::name() { if (m_tagType == TagLib::MPC::File::ID3v1) return "ID3v1"; return "APE"; } QList MPCFileTagModel::keys() { QList list = TagModel::keys(); list.removeAll(Qmmp::COMPOSER); list.removeAll(Qmmp::DISCNUMBER); return list; } const QString MPCFileTagModel::value(Qmmp::MetaData key) { if (m_tag) { bool utf = m_codec->name().contains("UTF"); TagLib::String str; switch((int) key) { case Qmmp::TITLE: str = m_tag->title(); break; case Qmmp::ARTIST: str = m_tag->artist(); break; case Qmmp::ALBUM: str = m_tag->album(); break; case Qmmp::COMMENT: str = m_tag->comment(); break; case Qmmp::GENRE: str = m_tag->genre(); break; case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); } return m_codec->toUnicode(str.toCString(utf)).trimmed(); } return QString(); } void MPCFileTagModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String::Type type = TagLib::String::Latin1; if (m_tagType == TagLib::MPC::File::ID3v1) { if(m_codec->name().contains("UTF")) //utf is unsupported return; } else if(m_tagType == TagLib::MPC::File::APE) type = TagLib::String::UTF8; TagLib::String str = TagLib::String(m_codec->fromUnicode(value).constData(), type); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); break; case Qmmp::ARTIST: m_tag->setArtist(str); break; case Qmmp::ALBUM: m_tag->setAlbum(str); break; case Qmmp::COMMENT: m_tag->setComment(str); break; case Qmmp::GENRE: m_tag->setGenre(str); break; case Qmmp::YEAR: m_tag->setYear(value.toInt()); break; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); } } bool MPCFileTagModel::exists() { return (m_tag != 0); } void MPCFileTagModel::create() { if (m_tag) return; if (m_tagType == TagLib::MPC::File::ID3v1) m_tag = m_file->ID3v1Tag(true); else m_tag = m_file->APETag(true); } void MPCFileTagModel::remove() { m_tag = 0; } void MPCFileTagModel::save() { if(!m_tag) m_file->strip(m_tagType); m_file->save(); } qmmp-0.7.4/src/plugins/Input/mpc/mpc.pro0000664000175000017500000000260312256224735016654 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decodermpcfactory.h \ decoder_mpc.h \ mpcmetadatamodel.h SOURCES += decoder_mpc.cpp \ decodermpcfactory.cpp \ mpcmetadatamodel.cpp TARGET = $$PLUGINS_PREFIX/Input/mpc INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/mpc_plugin_ru.ts \ translations/mpc_plugin_uk_UA.ts \ translations/mpc_plugin_zh_CN.ts \ translations/mpc_plugin_zh_TW.ts \ translations/mpc_plugin_cs.ts \ translations/mpc_plugin_pl.ts \ translations/mpc_plugin_de.ts \ translations/mpc_plugin_it.ts \ translations/mpc_plugin_tr.ts \ translations/mpc_plugin_lt.ts \ translations/mpc_plugin_nl.ts \ translations/mpc_plugin_ja.ts \ translations/mpc_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target PKGCONFIG += taglib LIBS += -lqmmp -lmpcdec -I/usr/include exists(/usr/include/mpcdec/mpcdec.h):DEFINES += MPC_OLD_API QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libmpc.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lmpcdec -ltag.dll DEFINES += MPC_OLD_API } qmmp-0.7.4/src/plugins/Input/mpc/translations/0000775000175000017500000000000012256224735020073 5ustar useruserqmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_pl_PL.ts0000664000175000017500000000507412256224735023674 0ustar useruser DecoderMPCFactory Musepack Plugin Wtyczka Musepack Musepack Files Pliki Musepack About Musepack Audio Plugin O wtyczce Musepack Audio Qmmp Musepack Audio Plugin Wtyczka Musepack Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_de.ts0000664000175000017500000000505312256224735023253 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack-Modul Musepack Files Musepack-Dateien About Musepack Audio Plugin Über Musepack-Audio-Modul Qmmp Musepack Audio Plugin Qmmp Musepack-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Channels Kanäle Bitrate Bitrate kbps kbps File size Dateigröße KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_cs.ts0000664000175000017500000000507612256224735023275 0ustar useruser DecoderMPCFactory Musepack Plugin Modul Musepack Musepack Files Soubory Musepack About Musepack Audio Plugin O modulu Musepack Qmmp Musepack Audio Plugin Vstupní modul Qmmp Musepack Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů Bitrate Datový tok kbps kbps File size Velikost souboru KB KiB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_es.ts0000664000175000017500000000512412256224735023271 0ustar useruser DecoderMPCFactory Musepack Plugin Módulo Musepack Musepack Files Archivos Musepack About Musepack Audio Plugin Acerca del módulo de audio Musepack Qmmp Musepack Audio Plugin Módulo de audio Musepack para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Channels Canales Bitrate Tasa de bits kbps kbps File size Tamaño del archivo KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_fr.ts0000664000175000017500000000514312256224735023272 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Files About Musepack Audio Plugin Qmmp Musepack Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_he.ts0000664000175000017500000000521012256224735023252 0ustar useruser DecoderMPCFactory Musepack Plugin תוספת Musepack Musepack Files קבצי Musepack About Musepack Audio Plugin אודות תוספת שמע Musepack Qmmp Musepack Audio Plugin תוספת שמע Musepack ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> MPCMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Channels ערוצים Bitrate שיעור סיביות kbps File size גודל קובץ KB ק״ב qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_hu.ts0000664000175000017500000000514312256224735023277 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Files About Musepack Audio Plugin Qmmp Musepack Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_ja.ts0000664000175000017500000000524712256224735023262 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack プラグイン Musepack Files Musepack ファイル About Musepack Audio Plugin Musepack 音響プラグインについて Qmmp Musepack Audio Plugin QMMP Musepack 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> MPCMetaDataModel Length 長さ Sample rate サンプルレート Hz Hz Channels チャンネル Bitrate ビットレート kbps キロビット毎秒 File size ファイルの大きさ KB KiB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_it.ts0000664000175000017500000000506712256224735023304 0ustar useruser DecoderMPCFactory Musepack Plugin Modulo Musepack Musepack Files Brani Musepack About Musepack Audio Plugin Info sul modulo audio Musepack Qmmp Musepack Audio Plugin Modulo audio Musepack per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Durata Sample rate Campionamento Hz Hz Channels Canali Bitrate bit al seconod kbps kbps File size Nome file KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_kk.ts0000664000175000017500000000514312256224735023270 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Files About Musepack Audio Plugin Qmmp Musepack Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_lt.ts0000664000175000017500000000505212256224735023301 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack įskiepis Musepack Files Musepack bylos About Musepack Audio Plugin Apie Qmmp Musepack įskiepį Qmmp Musepack Audio Plugin Qmmp Musepack įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Channels Kanalai Bitrate Kokybė kbps kbps File size Bylos dydis KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_nl.ts0000664000175000017500000000507112256224735023274 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Module Musepack Files Musepack Bestanden About Musepack Audio Plugin Over de Musepack Audio Module Qmmp Musepack Audio Plugin Musepack Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Duur Sample rate Sample frequentie Hz Channels Kanalen Bitrate Bitsnelheid kbps File size Bestandsgrootte KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_pl.ts0000664000175000017500000000507412256224735023301 0ustar useruser DecoderMPCFactory Musepack Plugin Wtyczka Musepack Musepack Files Pliki Musepack About Musepack Audio Plugin O wtyczce Musepack Audio Qmmp Musepack Audio Plugin Wtyczka Musepack Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_ru.ts0000664000175000017500000000527312256224735023315 0ustar useruser DecoderMPCFactory Musepack Plugin Модуль Musepack Musepack Files Файлы Musepack About Musepack Audio Plugin Об аудио-модуле Musepack Qmmp Musepack Audio Plugin Аудио-модуль Musepack для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> MPCMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Channels Каналов Bitrate Битовая частота kbps Кб/с File size Размер файла KB КБ qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_sk.ts0000664000175000017500000000514312256224735023300 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Files About Musepack Audio Plugin Qmmp Musepack Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_tr.ts0000664000175000017500000000524012256224735023306 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Eklentisi Musepack Files Musepack Dosyaları About Musepack Audio Plugin Musepack Ses Eklentisi Hakkında Qmmp Musepack Audio Plugin Qmmp Musepack Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Hz Channels Bitrate kbps kbps File size KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_pt_BR.ts0000664000175000017500000000514312256224735023671 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack Files About Musepack Audio Plugin Qmmp Musepack Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/mpc/translations/translations.qrc0000664000175000017500000000140112256224735023317 0ustar useruser mpc_plugin_ru.qm mpc_plugin_uk_UA.qm mpc_plugin_zh_CN.qm mpc_plugin_zh_TW.qm mpc_plugin_tr.qm mpc_plugin_cs.qm mpc_plugin_pt_BR.qm mpc_plugin_de.qm mpc_plugin_pl_PL.qm mpc_plugin_fr.qm mpc_plugin_it.qm mpc_plugin_kk.qm mpc_plugin_lt.qm mpc_plugin_hu.qm mpc_plugin_nl.qm mpc_plugin_ja.qm mpc_plugin_sk.qm mpc_plugin_es.qm mpc_plugin_he.qm mpc_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_zh_CN.ts0000664000175000017500000000514412256224735023665 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack 插件 Musepack Files Musepack 文件 About Musepack Audio Plugin 关于 Musepack 音频插件 Qmmp Musepack Audio Plugin Qmmp Musepack 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length 长度 Sample rate 取样率 Hz Channels 声音通道 Bitrate 比特率 kbps File size 文件大小 KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_zh_TW.ts0000664000175000017500000000515412256224735023720 0ustar useruser DecoderMPCFactory Musepack Plugin Musepack 插件 Musepack Files Musepack 檔案 About Musepack Audio Plugin 關於 Musepack 聲訊插件 Qmmp Musepack Audio Plugin Qmmp Musepack 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Channels 聲音通道 Bitrate 比特率 kbps kbps File size 文件大小 KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_gl_ES.ts0000664000175000017500000000510712256224735023654 0ustar useruser DecoderMPCFactory Musepack Plugin Engadido Musepack Musepack Files Ficheiros Musepack About Musepack Audio Plugin Sobre o engadido Musepack Qmmp Musepack Audio Plugin Engadido Musepack de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> MPCMetaDataModel Length Lonxitude Sample rate Taxa de mostra Hz Hz Channels Canais Bitrate Taxa de bits kbps kbps File size Tamaño de ficheiro KB KB qmmp-0.7.4/src/plugins/Input/mpc/translations/mpc_plugin_uk_UA.ts0000664000175000017500000000523012256224735023664 0ustar useruser DecoderMPCFactory Musepack Plugin Модуль Musepack Musepack Files Файли Musepack About Musepack Audio Plugin Про аудіо-модуль Musepack Qmmp Musepack Audio Plugin Аудіо-модуль Musepack для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> MPCMetaDataModel Length Тривалість Sample rate Частота Hz Гц Channels Канали Bitrate Бітрейт kbps Кб/с File size Розмір файлу KB Кб qmmp-0.7.4/src/plugins/Input/mpc/decodermpcfactory.cpp0000664000175000017500000001135112256224735021554 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "mpcmetadatamodel.h" #include "decoder_mpc.h" #include "decodermpcfactory.h" // DecoderMPCFactory bool DecoderMPCFactory::supports(const QString &source) const { return (source.right(4).toLower() == ".mpc"); } bool DecoderMPCFactory::canDecode(QIODevice *input) const { char buf[36]; if (input->peek(buf, 4) != 4) return false; if(!memcmp(buf, "MP+", 3)) return true; #ifndef MPC_OLD_API if(!memcmp(buf, "MPCK", 4)) return true; #endif return false; } const DecoderProperties DecoderMPCFactory::properties() const { DecoderProperties properties; properties.name = tr("Musepack Plugin"); properties.filters << "*.mpc"; properties.description = tr("Musepack Files"); //properties.contentType = ; properties.shortName = "mpc"; properties.hasAbout = true; properties.hasSettings = false; return properties; } Decoder *DecoderMPCFactory::create(const QString &, QIODevice *i) { return new DecoderMPC(i); } QList DecoderMPCFactory::createPlayList(const QString &fileName, bool useMetaData) { FileInfo *info = new FileInfo(fileName); TagLib::MPC::File fileRef(fileName.toLocal8Bit().constData()); TagLib::APE::Tag *tag = useMetaData ? fileRef.APETag() : 0; if (tag && !tag->isEmpty()) { info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(tag->album().toCString(true)).trimmed()); info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(tag->artist().toCString(true)).trimmed()); info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(tag->comment().toCString(true)).trimmed()); info->setMetaData(Qmmp::GENRE, QString::fromUtf8(tag->genre().toCString(true)).trimmed()); info->setMetaData(Qmmp::TITLE, QString::fromUtf8(tag->title().toCString(true)).trimmed()); info->setMetaData(Qmmp::YEAR, tag->year()); info->setMetaData(Qmmp::TRACK, tag->track()); } if (fileRef.audioProperties()) info->setLength(fileRef.audioProperties()->length()); //additional metadata if(tag) { TagLib::APE::Item fld; if(!(fld = tag->itemListMap()["COMPOSER"]).isEmpty()) info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); } QList list; list << info; return list; } MetaDataModel* DecoderMPCFactory::createMetaDataModel(const QString &path, QObject *parent) { return new MPCMetaDataModel(path, parent); } void DecoderMPCFactory::showSettings(QWidget *) {} void DecoderMPCFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Musepack Audio Plugin"), tr("Qmmp Musepack Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderMPCFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/mpc_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(mpc,DecoderMPCFactory) qmmp-0.7.4/src/plugins/Input/mpc/decodermpcfactory.h0000664000175000017500000000445212256224735021225 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERMPCFACTORY_H #define DECODERMPCFACTORY_H #include #include #include #include #include #include #include #include class DecoderMPCFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &url, QIODevice *i); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/mpc/decoder_mpc.h0000664000175000017500000000427512256224735017777 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_MPC_H #define DECODER_MPC_H #ifdef MPC_OLD_API #include #else #include #endif #include struct mpc_data { #ifdef MPC_OLD_API mpc_decoder decoder; #else mpc_demux *demuxer; #endif mpc_reader reader; mpc_streaminfo info; }; class DecoderMPC : public Decoder { public: DecoderMPC(QIODevice *i); virtual ~DecoderMPC(); struct mpc_data *data() { return m_data; } // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: struct mpc_data *m_data; long m_len; int m_bitrate; qint64 m_totalTime; }; #endif // __decoder_mpc_h qmmp-0.7.4/src/plugins/Input/flac/0000775000175000017500000000000012256224735015500 5ustar useruserqmmp-0.7.4/src/plugins/Input/flac/decoderflacfactory.cpp0000664000175000017500000001643512256224735022040 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "cueparser.h" #include "decoder_flac.h" #include "flacmetadatamodel.h" #include "decoderflacfactory.h" // DecoderFLACFactory bool DecoderFLACFactory::supports(const QString &source) const { return source.endsWith(".flac", Qt::CaseInsensitive) || source.endsWith(".oga", Qt::CaseInsensitive); } bool DecoderFLACFactory::canDecode(QIODevice *input) const { char buf[36]; if (input->peek(buf, 36) != 36) return false; if(!memcmp(buf, "fLaC", 4)) //native flac return true; if(!memcmp(buf, "OggS", 4) && !memcmp(buf + 29, "FLAC", 4)) //ogg flac return true; return false; } const DecoderProperties DecoderFLACFactory::properties() const { DecoderProperties properties; properties.name = tr("FLAC Plugin"); properties.filters << "*.flac" << "*.oga"; properties.description = tr("FLAC Files"); properties.contentTypes << "audio/x-flac" << "audio/flac"; properties.shortName = "flac"; properties.protocols << "flac"; properties.hasAbout = true; properties.hasSettings = false; return properties; } Decoder *DecoderFLACFactory::create(const QString &path, QIODevice *i) { return new DecoderFLAC(path, i); } QList DecoderFLACFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; TagLib::Ogg::XiphComment *tag = 0; TagLib::FLAC::Properties *ap = 0; TagLib::FLAC::File *flacFile = 0; TagLib::Ogg::FLAC::File *oggFlacFile = 0; //extract metadata of the one cue track if(fileName.contains("://")) { QString path = fileName; path.remove("flac://"); path.remove(QRegExp("#\\d+$")); int track = fileName.section("#", -1).toInt(); list = createPlayList(path, true); if (list.isEmpty() || track <= 0 || track > list.count()) { qDeleteAll(list); list.clear(); return list; } FileInfo *info = list.takeAt(track - 1); qDeleteAll(list); return QList() << info; } if(fileName.endsWith(".flac", Qt::CaseInsensitive)) { flacFile = new TagLib::FLAC::File(fileName.toLocal8Bit().constData()); tag = useMetaData ? flacFile->xiphComment() : 0; ap = flacFile->audioProperties(); } else if(fileName.endsWith(".oga", Qt::CaseInsensitive)) { oggFlacFile = new TagLib::Ogg::FLAC::File(fileName.toLocal8Bit().constData()); tag = useMetaData ? oggFlacFile->tag() : 0; ap = oggFlacFile->audioProperties(); } else return list; FileInfo *info = new FileInfo(fileName); if (tag && !tag->isEmpty()) { info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(tag->album().toCString(true)).trimmed()); info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(tag->artist().toCString(true)).trimmed()); info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(tag->comment().toCString(true)).trimmed()); info->setMetaData(Qmmp::GENRE, QString::fromUtf8(tag->genre().toCString(true)).trimmed()); info->setMetaData(Qmmp::TITLE, QString::fromUtf8(tag->title().toCString(true)).trimmed()); info->setMetaData(Qmmp::YEAR, tag->year()); info->setMetaData(Qmmp::TRACK, tag->track()); if (tag->fieldListMap().contains("CUESHEET")) { CUEParser parser(tag->fieldListMap()["CUESHEET"].toString().toCString(true), fileName); if(tag->contains("DISCNUMBER") && !tag->fieldListMap()["DISCNUMBER"].isEmpty()) { TagLib::StringList fld; fld = tag->fieldListMap()["DISCNUMBER"]; int i; for(i=1; i<=parser.count(); i++) { parser.info(i)->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); } } list = parser.createPlayList(); delete info; if(flacFile) delete flacFile; if(oggFlacFile) delete oggFlacFile; return list; } //additional metadata TagLib::StringList fld; if(!(fld = tag->fieldListMap()["COMPOSER"]).isEmpty()) info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); if(!(fld = tag->fieldListMap()["DISCNUMBER"]).isEmpty()) info->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); } if(ap) info->setLength(ap->length()); list << info; if(flacFile) delete flacFile; if(oggFlacFile) delete oggFlacFile; return list; } MetaDataModel*DecoderFLACFactory::createMetaDataModel(const QString &path, QObject *parent) { if (!path.contains("://") || path.startsWith("flac://")) return new FLACMetaDataModel(path, parent); else return 0; } void DecoderFLACFactory::showSettings(QWidget *) {} void DecoderFLACFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About FLAC Audio Plugin"), tr("Qmmp FLAC Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderFLACFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/flac_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(flac,DecoderFLACFactory) qmmp-0.7.4/src/plugins/Input/flac/cueparser.h0000664000175000017500000000472712256224735017654 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CUEPARSER_H #define CUEPARSER_H #include #include #include #include #include #include #include /** @author Ilya Kotov */ class CUEParser { public: CUEParser(const QByteArray &array, const QString &fileName); ~CUEParser(); QList createPlayList(); const QString filePath() const; qint64 offset(int track) const; qint64 length(int track) const; int count() const; FileInfo *info(int track); const QString trackURL(int track) const; const QMap replayGain(int track) const; private: struct CUETrack { FileInfo info; qint64 offset; QMap replayGain; }; QList m_tracks; bool m_dirty; QStringList splitLine(const QString &line); qint64 getLength(const QString &str); QString getDirtyPath(const QString &cue, const QString &path); QString m_filePath; }; #endif qmmp-0.7.4/src/plugins/Input/flac/cueparser.cpp0000664000175000017500000002047312256224735020203 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "cueparser.h" CUEParser::CUEParser(const QByteArray &array, const QString &fileName) { QString album, genre, date, comment; QTextStream textStream (array); textStream.setCodec("UTF-8"); m_filePath = fileName; QString artist; double album_peak = 0.0, album_gain = 0.0; while (!textStream.atEnd()) { QString line = textStream.readLine().trimmed(); QStringList words = splitLine(line); if (words.size() < 2) continue; if (words[0] == "PERFORMER") { if(m_tracks.isEmpty()) artist = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::ARTIST, words[1]); } else if (words[0] == "TITLE") { if(m_tracks.isEmpty()) album = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::TITLE, words[1]); } else if (words[0] == "TRACK") { FileInfo info("flac://" + fileName + QString("#%1").arg(words[1].toInt())); info.setMetaData(Qmmp::TRACK, words[1].toInt()); info.setMetaData(Qmmp::ALBUM, album); info.setMetaData(Qmmp::GENRE, genre); info.setMetaData(Qmmp::YEAR, date); info.setMetaData(Qmmp::COMMENT, comment); info.setMetaData(Qmmp::ARTIST, artist); m_tracks << new CUETrack; m_tracks.last()->info = info; m_tracks.last()->offset = 0; m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_GAIN, album_gain); m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_PEAK, album_peak); } else if (words[0] == "INDEX" && words[1] == "01") { if (m_tracks.isEmpty()) continue; m_tracks.last()->offset = getLength(words[2]); int c = m_tracks.count(); if(c > 1) m_tracks[c - 2]->info.setLength(m_tracks[c - 1]->offset - m_tracks[c - 2]->offset); } else if (words[0] == "REM") { if (words.size() < 3) continue; if (words[1] == "GENRE") genre = words[2]; else if (words[1] == "DATE") date = words[2]; else if (words[1] == "COMMENT") comment = words[2]; else if (words[1] == "REPLAYGAIN_ALBUM_GAIN") album_gain = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_ALBUM_PEAK") album_peak = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_TRACK_GAIN" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_GAIN, words[2].toDouble()); else if (words[1] == "REPLAYGAIN_TRACK_PEAK" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_PEAK, words[2].toDouble()); } } if(m_tracks.isEmpty()) { qWarning("CUEParser: invalid cue file"); return; } //calculate last item length QList f_list = MetaDataManager::instance()->createPlayList(m_filePath, false); qint64 l = f_list.isEmpty() ? 0 : f_list.at(0)->length() * 1000; if (l > m_tracks.last()->offset) m_tracks.last()->info.setLength(l - m_tracks.last()->offset); else m_tracks.last()->info.setLength(0); } CUEParser::~CUEParser() { qDeleteAll(m_tracks); m_tracks.clear(); } QList CUEParser::createPlayList() { QList list; foreach(CUETrack *track, m_tracks) { list << new FileInfo(track->info); list.last()->setLength(track->info.length()/1000); } return list; } const QString CUEParser::filePath() const { return m_filePath; } qint64 CUEParser::offset(int track) const { return m_tracks.at(track - 1)->offset; } qint64 CUEParser::length(int track) const { return m_tracks.at(track - 1)->info.length(); } int CUEParser::count() const { return m_tracks.count(); } FileInfo *CUEParser::info(int track) { return &m_tracks.at(track - 1)->info; } const QString CUEParser::trackURL(int track) const { return m_tracks.at(track - 1)->info.path(); } const QMap CUEParser::replayGain(int track) const { return m_tracks.at(track - 1)->replayGain; } QStringList CUEParser::splitLine(const QString &line) { //qDebug("raw string = %s",qPrintable(line)); QStringList list; QString buf = line.trimmed(); if (buf.isEmpty()) return list; while (!buf.isEmpty()) { //qDebug(qPrintable(buf)); if (buf.startsWith('"')) { int end = buf.indexOf('"',1); if(end == -1) //ignore invalid line { list.clear(); qWarning("CUEParser: unable to parse line: %s",qPrintable(line)); return list; } list << buf.mid (1, end - 1); buf.remove (0, end+1); } else { int end = buf.indexOf(' ', 0); if (end < 0) end = buf.size(); list << buf.mid (0, end); buf.remove (0, end); } buf = buf.trimmed(); } return list; } qint64 CUEParser::getLength(const QString &str) { QStringList list = str.split(":"); if (list.size() == 2) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000; else if (list.size() == 3) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000 + list.at(2).toInt()*1000/75; return 0; } QString CUEParser::getDirtyPath(const QString &cue, const QString &path) { if (Decoder::findByPath(path) || ! m_dirty) return path; QStringList candidates; QDirIterator it(QFileInfo(path).dir().path(), QDir::Files); while (it.hasNext()) { it.next(); QString f = it.filePath(); if ((f != cue) && Decoder::findByPath(f)) candidates.push_back(f); } if (candidates.empty()) return path; else if (candidates.count() == 1) return candidates.first(); int dot = cue.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(cue.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } dot = path.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(path.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } return path; } qmmp-0.7.4/src/plugins/Input/flac/decoder_flac.cpp0000664000175000017500000004132212256224735020600 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ /* The code is based on MOC by Damian Pietras and libxmms-flac written by Josh Coalson. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "replaygainreader.h" #include "cueparser.h" #include "decoder_flac.h" static size_t pack_pcm_signed (FLAC__byte *data, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, unsigned bps) { FLAC__byte * const start = data; FLAC__int32 sample; const FLAC__int32 *input_; unsigned samples, channel; unsigned bytes_per_sample; unsigned incr; if(bps == 24) // we encode to 32-bit words bps = 32; bytes_per_sample = bps / 8; incr = bytes_per_sample * channels; for (channel = 0; channel < channels; channel++) { samples = wide_samples; data = start + bytes_per_sample * channel; input_ = input[channel]; while (samples--) { sample = *input_++; switch (bps) { case 8: data[0] = sample; break; case 16: data[1] = (FLAC__byte)(sample >> 8) & 0xff; data[0] = (FLAC__byte)sample & 0xff; break; case 32: data[3] = (FLAC__byte)(sample >> 16) & 0xff; data[2] = (FLAC__byte)(sample >> 8) & 0xff; data[1] = (FLAC__byte)sample & 0xff; data[0] = 0; } data += incr; } } return wide_samples * channels * bytes_per_sample; } static int flac_decode (void *void_data, char *buf, int buf_len) { DecoderFLAC *dflac = (DecoderFLAC *) void_data; unsigned to_copy; if (!dflac->data()->sample_buffer_fill) { if (FLAC__stream_decoder_get_state(dflac->data()->decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) { return 0; } if (!FLAC__stream_decoder_process_single( dflac->data()->decoder)) { return 0; } } to_copy = qMin((unsigned)buf_len, dflac->data()->sample_buffer_fill); memcpy (buf, dflac->data()->sample_buffer, to_copy); memmove (dflac->data()->sample_buffer, dflac->data()->sample_buffer + to_copy, dflac->data()->sample_buffer_fill - to_copy); dflac->data()->sample_buffer_fill -= to_copy; return to_copy; } static FLAC__StreamDecoderReadStatus flac_callback_read (const FLAC__StreamDecoder*, FLAC__byte buffer[], size_t *bytes, void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; qint64 res = dflac->data()->input->read((char *)buffer, *bytes); dflac->data()->last_bytes += res; if (res > 0) { *bytes = res; return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; } if (res == 0) { *bytes = res; return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; } return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } static FLAC__StreamDecoderWriteStatus flac_callback_write (const FLAC__StreamDecoder *, const FLAC__Frame *frame, const FLAC__int32* const buffer[], void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; const unsigned wide_samples = frame->header.blocksize; if (dflac->data()->abort) return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; dflac->data()->bitrate = dflac->data()->last_bytes * 8.0 * frame->header.sample_rate / frame->header.blocksize / 1000.0; dflac->data()->last_bytes = 0; dflac->data()->sample_buffer_fill = pack_pcm_signed ( dflac->data()->sample_buffer, buffer, wide_samples, dflac->data()->channels, dflac->data()->bits_per_sample); return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } static FLAC__StreamDecoderTellStatus flac_callback_tell (const FLAC__StreamDecoder *, FLAC__uint64 *offset, void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; *offset = dflac->data()->input->pos (); return FLAC__STREAM_DECODER_TELL_STATUS_OK; } static FLAC__StreamDecoderSeekStatus flac_callback_seek (const FLAC__StreamDecoder *, FLAC__uint64 offset, void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; return dflac->data()->input->seek(offset) ? FLAC__STREAM_DECODER_SEEK_STATUS_OK : FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; } static FLAC__StreamDecoderLengthStatus flac_callback_length (const FLAC__StreamDecoder *, FLAC__uint64 *stream_length, void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; *stream_length = dflac->data()->input->size(); return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; } static void flac_callback_metadata (const FLAC__StreamDecoder *, const FLAC__StreamMetadata *metadata, void *client_data) { DecoderFLAC *dflac = (DecoderFLAC *) client_data; if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { qDebug ("DecoderFLAC: getting metadata info"); dflac->data()->total_samples = (unsigned)(metadata->data.stream_info.total_samples & 0xffffffff); dflac->data()->bits_per_sample = metadata->data.stream_info.bits_per_sample; dflac->data()->channels = metadata->data.stream_info.channels; dflac->data()->sample_rate = metadata->data.stream_info.sample_rate; dflac->data()->length = dflac->data()->total_samples * 1000 / dflac->data()->sample_rate; } } static FLAC__bool flac_callback_eof (const FLAC__StreamDecoder *, void *) { return false; } static void flac_callback_error (const FLAC__StreamDecoder *, FLAC__StreamDecoderErrorStatus status, void *) { Q_UNUSED(status); } // Decoder class DecoderFLAC::DecoderFLAC(const QString &path, QIODevice *i) : Decoder(i) { m_data = 0; m_path = path; m_data = new flac_data; m_data->decoder = NULL; data()->input = i; m_parser = 0; length_in_bytes = 0; m_totalBytes = 0; m_sz = 0; m_buf = 0; m_offset = 0; } DecoderFLAC::~DecoderFLAC() { deinit(); if (data()) { if (data()->decoder) FLAC__stream_decoder_delete (data()->decoder); delete data(); m_data = 0; } if(m_buf) delete[] m_buf; m_buf = 0; } bool DecoderFLAC::initialize() { if (!data()->input) { if (m_path.startsWith("flac://")) //embeded cue track { QString p = m_path; p.remove("flac://"); p.remove(QRegExp("#\\d+$")); TagLib::FLAC::File fileRef(p.toLocal8Bit().constData()); //looking for cuesheet comment TagLib::Ogg::XiphComment *xiph_comment = fileRef.xiphComment(); if (xiph_comment && xiph_comment->fieldListMap().contains("CUESHEET")) { qDebug("DecoderFLAC: using cuesheet xiph comment."); m_parser = new CUEParser(xiph_comment->fieldListMap()["CUESHEET"].toString() .toCString(true), p); m_track = m_path.section("#", -1).toInt(); if(m_track > m_parser->count()) { qWarning("DecoderFLAC: invalid cuesheet xiph comment"); return false; } data()->input = new QFile(p); data()->input->open(QIODevice::ReadOnly); if(xiph_comment->contains("DISCNUMBER") && !xiph_comment->fieldListMap()["DISCNUMBER"].isEmpty()) { m_parser->info(m_track)->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(xiph_comment->fieldListMap()["DISCNUMBER"].toString().toCString(true)).trimmed()); } QMap metaData = m_parser->info(m_track)->metaData(); addMetaData(metaData); //send metadata } else { qWarning("DecoderFLAC: unable to find cuesheet comment."); return false; } } else { qWarning("DecoderFLAC: cannot initialize. No input."); return false; } } if (!data()->input->isOpen()) { qWarning("DecoderFLAC: unable to open input file"); return false; } m_data->bitrate = -1; m_data->abort = 0; m_data->sample_buffer_fill = 0; m_data->last_bytes = 0; if (!m_data->decoder) { qDebug("DecoderFLAC: creating FLAC__StreamDecoder"); m_data->decoder = FLAC__stream_decoder_new (); } char buf[500]; //skip id3v2 data()->input->peek(buf, sizeof(buf)); ulong id3v2_size = findID3v2(buf, sizeof(buf)); if(id3v2_size) { qDebug("DecoderFLAC: skipping id3v2 tag (%lu bytes)", id3v2_size); data()->input->seek(id3v2_size); } data()->input->peek(buf,sizeof(buf)); data()->input->seek(0); qDebug("DecoderFLAC: setting callbacks"); if(!memcmp(buf, "OggS", 4)) { if(!FLAC_API_SUPPORTS_OGG_FLAC) { qWarning("DecoderFLAC: unsupported format"); return false; } if (FLAC__stream_decoder_init_ogg_stream( m_data->decoder, flac_callback_read, flac_callback_seek, flac_callback_tell, flac_callback_length, flac_callback_eof, flac_callback_write, flac_callback_metadata, flac_callback_error, this) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { data()->ok = 0; return false; } } else if (!memcmp(buf, "fLaC", 4)) { if (FLAC__stream_decoder_init_stream( m_data->decoder, flac_callback_read, flac_callback_seek, flac_callback_tell, flac_callback_length, flac_callback_eof, flac_callback_write, flac_callback_metadata, flac_callback_error, this) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { data()->ok = 0; return false; } } else { qWarning("DecoderFLAC: unsupported format"); return false; } if (!FLAC__stream_decoder_process_until_end_of_metadata( data()->decoder)) { data()->ok = 0; return false; } switch(data()->bits_per_sample) { case 8: configure(data()->sample_rate, data()->channels, Qmmp::PCM_S8); break; case 16: configure(data()->sample_rate, data()->channels, Qmmp::PCM_S16LE); break; case 24: case 32: configure(data()->sample_rate, data()->channels, Qmmp::PCM_S32LE); break; default: return false; } if(!m_path.contains("://")) { ReplayGainReader rg(m_path); setReplayGainInfo(rg.replayGainInfo()); } if(m_parser) { m_length = m_parser->length(m_track); m_offset = m_parser->offset(m_track); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; setReplayGainInfo(m_parser->replayGain(m_track)); seek(0); } m_totalBytes = 0; m_sz = audioParameters().sampleSize() * audioParameters().channels(); qDebug("DecoderFLAC: initialize succes"); return true; } qint64 DecoderFLAC::totalTime() { if(m_parser) return m_length; return data()->length; } int DecoderFLAC::bitrate() { return data()->bitrate; } void DecoderFLAC::seek(qint64 time) { m_totalBytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * time/1000; if(m_parser) time += m_offset; FLAC__uint64 target_sample = FLAC__uint64(time * data()->total_samples /data()->length); FLAC__stream_decoder_seek_absolute(data()->decoder, target_sample); } qint64 DecoderFLAC::read(char *data, qint64 size) { if(m_parser) { if(length_in_bytes - m_totalBytes < m_sz) //end of cue track return 0; qint64 len = 0; if(m_buf) //read remaining data first { len = qMin(m_buf_size, size); memmove(data, m_buf, len); if(size >= m_buf_size) { delete[] m_buf; m_buf = 0; m_buf_size = 0; } else memmove(m_buf, m_buf + len, size - len); } else len = flac_decode (this, data, size); if(len <= 0) //end of file return 0; if(len + m_totalBytes <= length_in_bytes) { m_totalBytes += len; return len; } qint64 len2 = qMax(qint64(0), length_in_bytes - m_totalBytes); len2 = (len2 / m_sz) * m_sz; //returned size must contain integer number of samples m_totalBytes += len2; //save data of the next track if(m_buf) delete[] m_buf; m_buf_size = len - len2; m_buf = new char[m_buf_size]; memmove(m_buf, data + len2, m_buf_size); return len2; } return flac_decode (this, data, size); } void DecoderFLAC::deinit() { if (data()->decoder) FLAC__stream_decoder_finish (data()->decoder); if (!input() && data()->input) //delete internal input only { data()->input->close(); delete data()->input; data()->input = 0; }; if(m_parser) delete m_parser; m_parser = 0; } const QString DecoderFLAC::nextURL() { if(m_parser && m_track +1 <= m_parser->count()) return m_parser->trackURL(m_track + 1); else return QString(); } void DecoderFLAC::next() { if(m_parser && m_track +1 <= m_parser->count()) { m_track++; m_offset = m_parser->length(m_track); m_length = m_parser->length(m_track); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; addMetaData(m_parser->info(m_track)->metaData()); setReplayGainInfo(m_parser->replayGain(m_track)); m_totalBytes = 0; } } uint DecoderFLAC::findID3v2(char *data, ulong size) //retuns ID3v2 tag size { if (size < 10) return 0; if (!memcmp(data, "ID3", 3)) { TagLib::ByteVector byteVector(data, size); TagLib::ID3v2::Header header(byteVector); return header.completeTagSize(); } return 0; } qmmp-0.7.4/src/plugins/Input/flac/CMakeLists.txt0000664000175000017500000000341012256224735020236 0ustar useruserproject(libflac) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libflac pkg_search_module(FLAC flac) IF(NOT FLAC_LINK_FLAGS) SET(FLAC_LINK_FLAGS -lFLAC) ENDIF(NOT FLAC_LINK_FLAGS) include_directories(${FLAC_INCLUDE_DIRS} ${TAGLIB_INCLUDE_DIRS}) link_directories(${FLAC_LIBRARY_DIRS} ${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${FLAC_CFLAGS}) ADD_DEFINITIONS(${TAGLIB_CFLAGS}) SET(libflac_SRCS decoder_flac.cpp decoderflacfactory.cpp flacmetadatamodel.cpp cueparser.cpp replaygainreader.cpp ) SET(libflac_HDRS decoder_flac.h cueparser.h replaygainreader.h ) SET(libflac_MOC_HDRS decoderflacfactory.h flacmetadatamodel.h ) SET(libflac_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libflac_RCC_SRCS ${libflac_RCCS}) QT4_WRAP_CPP(libflac_MOC_SRCS ${libflac_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(FLAC_FOUND) ADD_LIBRARY(flac MODULE ${libflac_SRCS} ${libflac_MOC_SRCS} ${libflac_RCC_SRCS} ${libflac_HDRS}) add_dependencies(flac qmmp) target_link_libraries(flac ${QT_LIBRARIES} -lqmmp ${FLAC_LDFLAGS} ${TAGLIB_LDFLAGS}) install(TARGETS flac DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(FLAC_FOUND) qmmp-0.7.4/src/plugins/Input/flac/decoderflacfactory.h0000664000175000017500000000441312256224735021476 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERFLACFACTORY_H #define DECODERFLACFACTORY_H #include #include #include #include #include #include #include class DecoderFLACFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/flac/translations/0000775000175000017500000000000012256224735020221 5ustar useruserqmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_uk_UA.ts0000664000175000017500000000520712256224735024144 0ustar useruser DecoderFLACFactory FLAC Plugin Модуль FLAC FLAC Files Файли FLAC About FLAC Audio Plugin Про аудіо-модуль FLAC Qmmp FLAC Audio Plugin Аудіо-модуль FLAC для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> FLACMetaDataModel Length Тривалість Sample rate Частота Hz Гц Channels Канали Bitrate Бітрейт kbps Кб/с File size Розмір файлу KB Кб qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_pl_PL.ts0000664000175000017500000000505312256224735024145 0ustar useruser DecoderFLACFactory FLAC Plugin Wtyczka FLAC FLAC Files Pliki FLAC About FLAC Audio Plugin O wtyczce FLAC Audio Qmmp FLAC Audio Plugin Wtyczka FLAC Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/flac/translations/translations.qrc0000664000175000017500000000142512256224735023453 0ustar useruser flac_plugin_ru.qm flac_plugin_uk_UA.qm flac_plugin_zh_CN.qm flac_plugin_zh_TW.qm flac_plugin_tr.qm flac_plugin_cs.qm flac_plugin_pt_BR.qm flac_plugin_de.qm flac_plugin_pl_PL.qm flac_plugin_fr.qm flac_plugin_it.qm flac_plugin_kk.qm flac_plugin_lt.qm flac_plugin_hu.qm flac_plugin_nl.qm flac_plugin_ja.qm flac_plugin_sk.qm flac_plugin_es.qm flac_plugin_he.qm flac_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_pt_BR.ts0000664000175000017500000000514212256224735024144 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Files About FLAC Audio Plugin Qmmp FLAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_de.ts0000664000175000017500000000503212256224735023524 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC-Modul FLAC Files FLAC-Dateien About FLAC Audio Plugin Über FLAC-Audio-Modul Qmmp FLAC Audio Plugin Qmmp FLAC-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Channels Kanäle Bitrate Bitrate kbps kbps File size Dateigröße KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_cs.ts0000664000175000017500000000505512256224735023546 0ustar useruser DecoderFLACFactory FLAC Plugin Modul FLAC FLAC Files Soubory FLAC About FLAC Audio Plugin O modulu FLAC Qmmp FLAC Audio Plugin Vstupní modul Qmmp FLAC Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů Bitrate Datový tok kbps kbps File size Velikost souboru KB KiB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_es.ts0000664000175000017500000000510312256224735023542 0ustar useruser DecoderFLACFactory FLAC Plugin Módulo FLAC FLAC Files Archivos FLAC About FLAC Audio Plugin Acerca del módulo de audio FLAC Qmmp FLAC Audio Plugin Módulo de audio FLAC para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Channels Canales Bitrate Tasa de bits kbps kbps File size Tamaño del archivo KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_fr.ts0000664000175000017500000000514212256224735023545 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Files About FLAC Audio Plugin Qmmp FLAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_he.ts0000664000175000017500000000516712256224735023541 0ustar useruser DecoderFLACFactory FLAC Plugin תוספת FLAC FLAC Files קבצי FLAC About FLAC Audio Plugin אודות תוספת שמע FLAC Qmmp FLAC Audio Plugin תוספת שמע FLAC ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> FLACMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Channels ערוצים Bitrate שיעור סיביות kbps File size גודל קובץ KB ק״ב qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_hu.ts0000664000175000017500000000514212256224735023552 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Files About FLAC Audio Plugin Qmmp FLAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_ja.ts0000664000175000017500000000522612256224735023533 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC プラグイン FLAC Files FLAC ファイル About FLAC Audio Plugin FLAC 音響プラグインについて Qmmp FLAC Audio Plugin QMMP FLAC 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> FLACMetaDataModel Length 長さ Sample rate サンプルレート Hz Hz Channels チャンネル Bitrate ビットレート kbps キロビット毎秒 File size ファイルの大きさ KB KiB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_it.ts0000664000175000017500000000505412256224735023554 0ustar useruser DecoderFLACFactory FLAC Plugin Modulo FLAC FLAC Files Brani FLAC About FLAC Audio Plugin Info sul modulo audio FLAC Qmmp FLAC Audio Plugin Modulo Audio FLAC per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Durata Sample rate Campionamento Hz Hz Channels Canali Bitrate bit al secondo kbps kbps File size Dimensione file KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_kk.ts0000664000175000017500000000514212256224735023543 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Files About FLAC Audio Plugin Qmmp FLAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_lt.ts0000664000175000017500000000504112256224735023553 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC įskiepis FLAC Files FLAC bylos About FLAC Audio Plugin Apie FLAC audio įskiepį Qmmp FLAC Audio Plugin Qmmp FLAC audio įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Channels Kanalai Bitrate Kokybė kbps kbps File size Bylos dydis KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_nl.ts0000664000175000017500000000505012256224735023545 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Module FLAC Files FLAC Bestanden About FLAC Audio Plugin Over de FLAC Audio Module Qmmp FLAC Audio Plugin FLAC Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Duur Sample rate Sample frequentie Hz Channels Kanalen Bitrate Bitsnelheid kbps File size Bestandsgrootte KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_pl.ts0000664000175000017500000000505312256224735023552 0ustar useruser DecoderFLACFactory FLAC Plugin Wtyczka FLAC FLAC Files Pliki FLAC About FLAC Audio Plugin O wtyczce FLAC Audio Qmmp FLAC Audio Plugin Wtyczka FLAC Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_ru.ts0000664000175000017500000000525212256224735023566 0ustar useruser DecoderFLACFactory FLAC Plugin Модуль FLAC FLAC Files Файлы FLAC About FLAC Audio Plugin Об аудио-модуле FLAC Qmmp FLAC Audio Plugin Аудио-модуль FLAC для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> FLACMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Channels Каналов Bitrate Битовая частота kbps Кб/с File size Размер файла KB КБ qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_sk.ts0000664000175000017500000000514212256224735023553 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Files About FLAC Audio Plugin Qmmp FLAC Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_tr.ts0000664000175000017500000000521712256224735023566 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC Eklentisi FLAC Files FLAC Dosyaları About FLAC Audio Plugin FLAC Ses Eklentisi Hakkında Qmmp FLAC Audio Plugin Qmmp FLAC Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Sample rate Hz Hz Channels Bitrate kbps kbps File size KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_zh_CN.ts0000664000175000017500000000512512256224735024140 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC 插件 FLAC Files FLAC 文件 About FLAC Audio Plugin 关于 FLAC 音频插件 Qmmp FLAC Audio Plugin Qmmp FLAC 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length 长度 Sample rate 取样率 Hz Hz Channels 声音通道 Bitrate 比特率 kbps File size 文件大小 KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_zh_TW.ts0000664000175000017500000000511112256224735024165 0ustar useruser DecoderFLACFactory FLAC Plugin FLAC 插件 FLAC Files FLAC 檔案 About FLAC Audio Plugin 關於 FLAC 聲訊插件 Qmmp FLAC Audio Plugin Qmmp FLAC 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Channels 聲音通道 Bitrate 比特率 kbps kbps File size 文件大小 KB KB qmmp-0.7.4/src/plugins/Input/flac/translations/flac_plugin_gl_ES.ts0000664000175000017500000000507412256224735024133 0ustar useruser DecoderFLACFactory FLAC Plugin Engadido FLAC FLAC Files Ficheiros FLAC About FLAC Audio Plugin Sobre o engadido FLAC Qmmp FLAC Audio Plugin Engadido FLAC de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> FLACMetaDataModel Length Lonxitude Sample rate Frecuencia de mostra Hz Hz Channels Canais Bitrate Taxa de bits kbps kbps File size Tamaño de ficheiro KB KB qmmp-0.7.4/src/plugins/Input/flac/flacmetadatamodel.h0000664000175000017500000000456012256224735021305 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FLACMETADATAMODEL_H #define FLACMETADATAMODEL_H #include #include #include #include class FLACMetaDataModel : public MetaDataModel { Q_OBJECT public: FLACMetaDataModel(const QString &path, QObject *parent); ~FLACMetaDataModel(); QHash audioProperties(); QList tags(); QPixmap cover(); QString coverPath(); private: QString m_path; QList m_tags; }; class VorbisCommentModel : public TagModel { public: VorbisCommentModel(const QString &path); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); void save(); private: TagLib::FLAC::File *m_file; TagLib::Ogg::FLAC::File *m_ogg_file; TagLib::Ogg::XiphComment *m_tag; }; #endif // FLACMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/flac/flac.pro0000664000175000017500000000261412256224735017132 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decoderflacfactory.h \ decoder_flac.h \ cueparser.h \ flacmetadatamodel.h \ replaygainreader.h SOURCES += decoder_flac.cpp \ decoderflacfactory.cpp \ cueparser.cpp \ flacmetadatamodel.cpp \ replaygainreader.cpp TARGET = $$PLUGINS_PREFIX/Input/flac INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/flac_plugin_ru.ts \ translations/flac_plugin_uk_UA.ts \ translations/flac_plugin_zh_CN.ts \ translations/flac_plugin_zh_TW.ts \ translations/flac_plugin_cs.ts \ translations/flac_plugin_pl.ts \ translations/flac_plugin_de.ts \ translations/flac_plugin_it.ts \ translations/flac_plugin_tr.ts \ translations/flac_plugin_lt.ts \ translations/flac_plugin_nl.ts \ translations/flac_plugin_ja.ts \ translations/flac_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target PKGCONFIG += taglib flac LIBS += -lqmmp QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libflac.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lflac -logg -ltag.dll -lm } qmmp-0.7.4/src/plugins/Input/flac/replaygainreader.h0000664000175000017500000000374212256224735021175 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAINREADER_H #define REPLAYGAINREADER_H #include #include #include #include /** @author Ilya Kotov */ class ReplayGainReader { public: ReplayGainReader(const QString &path); QMap replayGainInfo() const; private: void readVorbisComment(TagLib::Ogg::XiphComment *comment); void setValue(Qmmp::ReplayGainKey key, QString value); QMap m_values; }; #endif // REPLAYGAINREADER_H qmmp-0.7.4/src/plugins/Input/flac/replaygainreader.cpp0000664000175000017500000000621412256224735021525 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { if(path.endsWith(".flac"), Qt::CaseInsensitive) { TagLib::FLAC::File fileRef(path.toLocal8Bit ().constData()); if(fileRef.xiphComment()) readVorbisComment(fileRef.xiphComment()); } else if(path.endsWith(".oga"), Qt::CaseInsensitive) { TagLib::Ogg::FLAC::File fileRef(path.toLocal8Bit ().constData()); if(fileRef.tag()) readVorbisComment(fileRef.tag()); } } QMap ReplayGainReader::replayGainInfo() const { return m_values; } void ReplayGainReader::readVorbisComment(TagLib::Ogg::XiphComment *comment) { TagLib::Ogg::FieldListMap items = comment->fieldListMap(); if (items.contains("REPLAYGAIN_TRACK_GAIN")) setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].front())); if (items.contains("REPLAYGAIN_TRACK_PEAK")) setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].front())); if (items.contains("REPLAYGAIN_ALBUM_GAIN")) setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN,TStringToQString(items["REPLAYGAIN_ALBUM_GAIN"].front())); if (items.contains("REPLAYGAIN_ALBUM_PEAK")) setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK,TStringToQString(items["REPLAYGAIN_ALBUM_PEAK"].front())); } void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) { value.remove(" dB"); if(value.isEmpty()) return; bool ok; double v = value.toDouble(&ok); if(ok) m_values[key] = v; } qmmp-0.7.4/src/plugins/Input/flac/decoder_flac.h0000664000175000017500000000627312256224735020253 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_FLAC_H #define DECODER_FLAC_H #include #include #define MAX_SUPPORTED_CHANNELS 2 #define SAMPLES_PER_WRITE 512 #define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * MAX_SUPPORTED_CHANNELS * (32/8)) class CUEParser; struct flac_data { //FLAC__SeekableStreamDecoder *decoder; FLAC__StreamDecoder *decoder; struct io_stream *stream; int bitrate; int abort; /* abort playing (due to an error) */ qint64 length; qint64 total_samples; FLAC__byte sample_buffer[SAMPLE_BUFFER_SIZE]; unsigned sample_buffer_fill; /* sound parameters */ unsigned bits_per_sample; unsigned sample_rate; unsigned channels; FLAC__uint64 last_bytes; int ok; /* was this stream successfully opened? */ //struct decoder_error error; QIODevice *input; }; class DecoderFLAC : public Decoder { public: DecoderFLAC(const QString &path, QIODevice *i); virtual ~DecoderFLAC(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *data, qint64 maxSize); void seek(qint64 time); const QString nextURL(); void next(); struct flac_data *data() { return m_data; } private: // helper functions void deinit(); uint findID3v2(char *data, ulong size); //retuns ID3v2 tag size // FLAC Decoder FLAC__StreamDecoder *m_flacDecoder; struct flac_data *m_data; qint64 m_totalTime; qint64 length_in_bytes; qint64 m_totalBytes; qint64 m_offset; qint64 m_length; QString m_path; CUEParser *m_parser; int m_track; char *m_buf; //buffer for remainig data qint64 m_buf_size; qint64 m_sz; //sample size }; #endif // __decoder_flac_h qmmp-0.7.4/src/plugins/Input/flac/flacmetadatamodel.cpp0000664000175000017500000001643112256224735021640 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "flacmetadatamodel.h" #define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) #define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() FLACMetaDataModel::FLACMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { if(path.startsWith("flac://")) { QString p = path; p.remove("flac://"); p.remove(QRegExp("#\\d+$")); m_path = p; } else { m_path = path; m_tags << new VorbisCommentModel(path); } } FLACMetaDataModel::~FLACMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); } QHash FLACMetaDataModel::audioProperties() { QHash ap; TagLib::FLAC::File *flacFile = 0; TagLib::Ogg::FLAC::File *oggFlacFile = 0; TagLib::FLAC::Properties *taglib_ap = 0; qint64 size = 0; if(m_path.endsWith(".flac"), Qt::CaseInsensitive) { flacFile = new TagLib::FLAC::File(m_path.toLocal8Bit().constData()); taglib_ap = flacFile->audioProperties(); size = flacFile->length(); } else if(m_path.endsWith(".oga"), Qt::CaseInsensitive) { oggFlacFile = new TagLib::Ogg::FLAC::File(m_path.toLocal8Bit().constData()); taglib_ap = oggFlacFile->audioProperties(); size = oggFlacFile->length(); } else return ap; if(taglib_ap) { QString text = QString("%1").arg(taglib_ap->length()/60); text +=":"+QString("%1").arg(taglib_ap->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(taglib_ap->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(taglib_ap->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(taglib_ap->bitrate())); } ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(size/1024)); if(flacFile) delete flacFile; if(oggFlacFile) delete oggFlacFile; return ap; } QList FLACMetaDataModel::tags() { return m_tags; } QPixmap FLACMetaDataModel::cover() { //embedded cover FLAC__StreamMetadata *metadata; FLAC__metadata_get_picture (qPrintable(m_path), &metadata, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, 0,0, -1,-1,-1,-1); if(metadata) { FLAC__StreamMetadata_Picture *pict = &metadata->data.picture; QPixmap cover; cover.loadFromData(QByteArray((char *)pict->data, (int) pict->data_length)); FLAC__metadata_object_delete(metadata); return cover; } QString cPath = coverPath(); return cPath.isEmpty() ? QPixmap() : QPixmap(cPath); } QString FLACMetaDataModel::coverPath() { return MetaDataManager::instance()->getCoverPath(m_path); } VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) { m_file = 0; m_ogg_file = 0; m_tag = 0; if(path.endsWith(".flac")) { m_file = new TagLib::FLAC::File (path.toLocal8Bit().constData()); m_tag = m_file->xiphComment(); } else if (path.endsWith(".oga")) { m_ogg_file = new TagLib::Ogg::FLAC::File(path.toLocal8Bit().constData()); m_tag = m_ogg_file->tag(); } } VorbisCommentModel::~VorbisCommentModel() { if(m_file) delete m_file; if(m_ogg_file) delete m_ogg_file; } const QString VorbisCommentModel::name() { return "Vorbis Comment"; } const QString VorbisCommentModel::value(Qmmp::MetaData key) { if(!m_tag) return QString(); switch((int) key) { case Qmmp::TITLE: return TStringToQString_qt4(m_tag->title()); case Qmmp::ARTIST: return TStringToQString_qt4(m_tag->artist()); case Qmmp::ALBUM: return TStringToQString_qt4(m_tag->album()); case Qmmp::COMMENT: return TStringToQString_qt4(m_tag->comment()); case Qmmp::GENRE: return TStringToQString_qt4(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); case Qmmp::DISCNUMBER: if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String str = QStringToTString_qt4(value); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); return; case Qmmp::ARTIST: m_tag->setArtist(str); return; case Qmmp::ALBUM: m_tag->setAlbum(str); return; case Qmmp::COMMENT: m_tag->setComment(str); return; case Qmmp::GENRE: m_tag->setGenre(str); return; case Qmmp::COMPOSER: value.isEmpty() ? m_tag->removeField("COMPOSER"): m_tag->addField("COMPOSER", str, true); return; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); return; case Qmmp::YEAR: m_tag->setYear(value.toInt()); return; case Qmmp::DISCNUMBER: value == "0" ? m_tag->removeField("DISCNUMBER"): m_tag->addField("DISCNUMBER", str, true); } } void VorbisCommentModel::save() { if(m_file) m_file->save(); else if(m_ogg_file) m_ogg_file->save(); } qmmp-0.7.4/src/plugins/Input/opus/0000775000175000017500000000000012256224735015561 5ustar useruserqmmp-0.7.4/src/plugins/Input/opus/tdebug.h0000664000175000017500000000510612256224735017206 0ustar useruser/*************************************************************************** copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ #ifndef TAGLIB_DEBUG_H #define TAGLIB_DEBUG_H namespace TagLib { class String; class ByteVector; #ifndef DO_NOT_DOCUMENT #ifndef NDEBUG /*! * A simple function that prints debugging output to cerr if debugging is * not disabled. * * \warning Do not use this outside of TagLib, it could lead to undefined * symbols in your build if TagLib is built with NDEBUG defined and your * application is not. * * \internal */ void debug(const String &s); /*! * For debugging binary data. * * \warning Do not use this outside of TagLib, it could lead to undefined * symbols in your build if TagLib is built with NDEBUG defined and your * application is not. * * \internal */ void debugData(const ByteVector &v); #else // Define these to an empty statement if debugging is disabled. #define debug(x) #define debugData(x) #endif #endif } #endif qmmp-0.7.4/src/plugins/Input/opus/opusproperties.cpp0000664000175000017500000001144112256224735021371 0ustar useruser/*************************************************************************** copyright : (C) 2012 by Lukáš Lalinský email : lalinsky@gmail.com copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org (original Vorbis implementation) ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ #include #include "tdebug.h" #include #include "opusproperties.h" #include "opusfile.h" using namespace TagLib; using namespace TagLib::Ogg; class Opus::Properties::PropertiesPrivate { public: PropertiesPrivate(File *f, ReadStyle s) : file(f), style(s), length(0), inputSampleRate(0), channels(0), opusVersion(0) {} File *file; ReadStyle style; int length; int inputSampleRate; int channels; int opusVersion; }; //////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// Opus::Properties::Properties(File *file, ReadStyle style) : AudioProperties(style) { d = new PropertiesPrivate(file, style); read(); } Opus::Properties::~Properties() { delete d; } int Opus::Properties::length() const { return d->length; } int Opus::Properties::bitrate() const { return 0; } int Opus::Properties::sampleRate() const { // Opus can decode any stream at a sample rate of 8, 12, 16, 24, or 48 kHz, // so there is no single sample rate. Let's assume it's the highest // possible. return 48000; } int Opus::Properties::channels() const { return d->channels; } int Opus::Properties::inputSampleRate() const { return d->inputSampleRate; } int Opus::Properties::opusVersion() const { return d->opusVersion; } //////////////////////////////////////////////////////////////////////////////// // private members //////////////////////////////////////////////////////////////////////////////// void Opus::Properties::read() { // Get the identification header from the Ogg implementation. // http://tools.ietf.org/html/draft-terriberry-oggopus-01#section-5.1 ByteVector data = d->file->packet(0); // *Magic Signature* int pos = 8; // *Version* (8 bits, unsigned) d->opusVersion = uchar(data.at(pos)); pos += 1; // *Output Channel Count* 'C' (8 bits, unsigned) d->channels = uchar(data.at(pos)); pos += 1; // *Pre-skip* (16 bits, unsigned, little endian) ushort preSkip = data.mid(pos, 2).toUShort(false); pos += 2; // *Input Sample Rate* (32 bits, unsigned, little endian) d->inputSampleRate = data.mid(pos, 4).toUInt(false); pos += 4; // *Output Gain* (16 bits, signed, little endian) pos += 2; // *Channel Mapping Family* (8 bits, unsigned) pos += 1; const Ogg::PageHeader *first = d->file->firstPageHeader(); const Ogg::PageHeader *last = d->file->lastPageHeader(); if(first && last) { long long start = first->absoluteGranularPosition(); long long end = last->absoluteGranularPosition(); if(start >= 0 && end >= 0) d->length = (int) ((end - start - preSkip) / 48000); else { debug("Opus::Properties::read() -- The PCM values for the start or " "end of this file was incorrect."); } } else debug("Opus::Properties::read() -- Could not find valid first and last Ogg pages."); } qmmp-0.7.4/src/plugins/Input/opus/opusfile.h0000664000175000017500000001001412256224735017554 0ustar useruser/*************************************************************************** copyright : (C) 2012 by Lukáš Lalinský email : lalinsky@gmail.com copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org (original Vorbis implementation) ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ /* Changes against original code: - removed constructor File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle); - removed function PropertyMap File::properties() const; - removed function PropertyMap File::setProperties(const PropertyMap &properties). */ #ifndef TAGLIB_OPUSFILE_H #define TAGLIB_OPUSFILE_H #include #include #include "opusproperties.h" namespace TagLib { namespace Ogg { //! A namespace containing classes for Opus metadata namespace Opus { //! An implementation of Ogg::File with Opus specific methods /*! * This is the central class in the Ogg Opus metadata processing collection * of classes. It's built upon Ogg::File which handles processing of the Ogg * logical bitstream and breaking it down into pages which are handled by * the codec implementations, in this case Opus specifically. */ class File : public Ogg::File { public: /*! * Contructs a Opus file from \a file. If \a readProperties is true the * file's audio properties will also be read using \a propertiesStyle. If * false, \a propertiesStyle is ignored. */ File(FileName file, bool readProperties = true, Properties::ReadStyle propertiesStyle = Properties::Average); /*! * Destroys this instance of the File. */ virtual ~File(); /*! * Returns the XiphComment for this file. XiphComment implements the tag * interface, so this serves as the reimplementation of * TagLib::File::tag(). */ virtual Ogg::XiphComment *tag() const; /*! * Returns the Opus::Properties for this file. If no audio properties * were read then this will return a null pointer. */ virtual Properties *audioProperties() const; virtual bool save(); private: File(const File &); File &operator=(const File &); void read(bool readProperties, Properties::ReadStyle propertiesStyle); class FilePrivate; FilePrivate *d; }; } } } #endif qmmp-0.7.4/src/plugins/Input/opus/decoderopusfactory.h0000664000175000017500000000470012256224735021637 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODEROPUSFACTORY_H #define DECODEROPUSFACTORY_H #include #include #include #include #include #include #include #include #include /** @author Ilya Kotov */ class DecoderOpusFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory) public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *input); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); QList createPlayList(const QString &fileName, bool useMetaData); QObject* showDetails(QWidget *parent, const QString &path); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif //DECODEROPUSFACTORY_H qmmp-0.7.4/src/plugins/Input/opus/CMakeLists.txt0000664000175000017500000000343612256224735020327 0ustar useruserproject(libopus) cmake_minimum_required(VERSION 2.6.0) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libopus and libopusfile pkg_check_modules(OPUS opus>=1.0.2 opusfile>=0.2) include_directories(${OPUS_INCLUDE_DIRS} ${TAGLIB_INCLUDE_DIRS}) link_directories(${OPUS_LIBRARY_DIRS} ${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${OPUS_CFLAGS} ${TAGLIB_CFLAGS}) SET(libopus_SRCS decoder_opus.cpp decoderopusfactory.cpp opusmetadatamodel.cpp replaygainreader.cpp opusfile.cpp opusproperties.cpp tdebug.cpp ) SET(libopus_HDRS decoder_opus.h replaygainreader.h opusfile.h opusproperties.h tdebug.h ) SET(libopus_MOC_HDRS decoderopusfactory.h opusmetadatamodel.h ) SET(libopus_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libopus_RCC_SRCS ${libopus_RCCS}) QT4_WRAP_CPP(libopus_MOC_SRCS ${libopus_MOC_HDRS}) # user interface QT4_WRAP_UI(libopus_UIS_H ${libopus_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(OPUS_FOUND) ADD_LIBRARY(opus MODULE ${libopus_SRCS} ${libopus_MOC_SRCS} ${libopus_RCC_SRCS} ${libopus_HDRS}) add_dependencies(opus qmmp) target_link_libraries(opus ${QT_LIBRARIES} -lqmmp ${OPUS_LDFLAGS} ${TAGLIB_LDFLAGS}) install(TARGETS opus DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(OPUS_FOUND) qmmp-0.7.4/src/plugins/Input/opus/decoderopusfactory.cpp0000664000175000017500000001230312256224735022170 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "opusfile.h" #include "replaygainreader.h" #include "decoder_opus.h" #include "opusmetadatamodel.h" #include "decoderopusfactory.h" // DecoderOpusFactory bool DecoderOpusFactory::supports(const QString &source) const { return source.right(5).toLower() == ".opus"; } bool DecoderOpusFactory::canDecode(QIODevice *input) const { char buf[36]; if (input->peek(buf, 36) == 36 && !memcmp(buf, "OggS", 4) && !memcmp(buf + 28, "OpusHead", 8)) return true; return false; } const DecoderProperties DecoderOpusFactory::properties() const { DecoderProperties properties; properties.name = tr("Opus Plugin"); properties.shortName = "opus"; properties.filters << "*.opus"; properties.description = tr("Ogg Opus Files"); properties.contentTypes << "audio/opus"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = false; return properties; } Decoder *DecoderOpusFactory::create(const QString &url, QIODevice *input) { Decoder *d = new DecoderOpus(url, input); if(!url.contains("://")) //local file { ReplayGainReader rg(url); d->setReplayGainInfo(rg.replayGainInfo()); } return d; } MetaDataModel* DecoderOpusFactory::createMetaDataModel(const QString &path, QObject *parent) { return new OpusMetaDataModel(path, parent); } QList DecoderOpusFactory::createPlayList(const QString &fileName, bool useMetaData) { FileInfo *info = new FileInfo(fileName); TagLib::Ogg::Opus::File fileRef(fileName.toLocal8Bit().constData()); TagLib::Ogg::XiphComment *tag = useMetaData ? fileRef.tag() : 0; if (tag && !tag->isEmpty()) { info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(tag->album().toCString(true)).trimmed()); info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(tag->artist().toCString(true)).trimmed()); info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(tag->comment().toCString(true)).trimmed()); info->setMetaData(Qmmp::GENRE, QString::fromUtf8(tag->genre().toCString(true)).trimmed()); info->setMetaData(Qmmp::TITLE, QString::fromUtf8(tag->title().toCString(true)).trimmed()); info->setMetaData(Qmmp::YEAR, tag->year()); info->setMetaData(Qmmp::TRACK, tag->track()); } if (fileRef.audioProperties()) info->setLength(fileRef.audioProperties()->length()); //additional metadata if(tag) { TagLib::StringList fld; if(!(fld = tag->fieldListMap()["COMPOSER"]).isEmpty()) info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); if(!(fld = tag->fieldListMap()["DISCNUMBER"]).isEmpty()) info->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); } QList list; list << info; return list; } void DecoderOpusFactory::showSettings(QWidget *) {} void DecoderOpusFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Opus Audio Plugin"), tr("Qmmp Opus Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("This plugin includes code from TagLib library")); } QTranslator *DecoderOpusFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/opus_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(opus,DecoderOpusFactory) qmmp-0.7.4/src/plugins/Input/opus/decoder_opus.cpp0000664000175000017500000001026412256224735020743 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "decoder_opus.h" // ic functions for libopusfile static int opusread (void *src, unsigned char *buf,int size) { DecoderOpus *d = (DecoderOpus *) src; return d->input()->read((char *) buf, size); } static int opusseek(void *src, opus_int64 offset, int whence) { DecoderOpus *d = (DecoderOpus *) src; if (d->input()->isSequential()) return -1; long start = 0; switch (whence) { case SEEK_END: start = d->input()->size(); break; case SEEK_CUR: start = d->input()->pos(); break; case SEEK_SET: default: start = 0; } if (d->input()->seek(start + offset)) return 0; return -1; } static opus_int64 opustell(void *src) { DecoderOpus *dogg = (DecoderOpus *) src; return (long) dogg->input()->pos(); } // Decoder class DecoderOpus::DecoderOpus(const QString &url, QIODevice *i) : Decoder(i) { m_totalTime = 0; m_opusfile = 0; m_chan = 0; m_bitrate = 0; m_url = url; } DecoderOpus::~DecoderOpus() { if (m_opusfile) op_free(m_opusfile); m_opusfile = 0; } bool DecoderOpus::initialize() { qDebug("DecoderOpus: initialize"); m_chan = 0; m_totalTime = 0; if (!input()) { qDebug("DecoderOpus: cannot initialize. No input"); return false; } if (!input()->isOpen()) { if (!input()->open(QIODevice::ReadOnly)) { qWarning("DecoderOpus: unable to open input. Error: %s",qPrintable(input()->errorString())); return false; } } OpusFileCallbacks opuscb = { opusread, opusseek, opustell, 0, }; m_opusfile = op_open_callbacks(this, &opuscb, 0, 0, 0); if (!m_opusfile) { qWarning("DecoderOpus: cannot open stream"); return false; } m_bitrate = op_bitrate(m_opusfile, -1) / 1000; if((m_totalTime = op_pcm_total(m_opusfile, -1) / 48) < 0) m_totalTime = 0; const OpusHead *head = op_head(m_opusfile, -1); if (head) m_chan = head->channel_count; configure(48000, m_chan, Qmmp::PCM_S16LE); //opus codec supports 48 kHz only return true; } qint64 DecoderOpus::totalTime() { if (!m_opusfile) return 0; return m_totalTime; } int DecoderOpus::bitrate() { return m_bitrate; } void DecoderOpus::seek(qint64 time) { op_pcm_seek(m_opusfile, time*48); } qint64 DecoderOpus::read(char *data, qint64 maxSize) { int samples = maxSize / 2 / m_chan; samples = op_read(m_opusfile, (opus_int16 *)data, samples, 0); m_bitrate = op_bitrate_instant(m_opusfile) / 1000; return samples * m_chan * 2; } qmmp-0.7.4/src/plugins/Input/opus/opusmetadatamodel.h0000664000175000017500000000451212256224735021444 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OPUSMETADATAMODEL_H #define OPUSMETADATAMODEL_H #include "opusfile.h" #include #include class OpusMetaDataModel : public MetaDataModel { Q_OBJECT public: OpusMetaDataModel(const QString &path, QObject *parent); ~OpusMetaDataModel(); QHash audioProperties(); QList tags(); QPixmap cover(); private: QString m_path; QList m_tags; ulong readPictureBlockField(QByteArray data, int offset); }; class VorbisCommentModel : public TagModel { public: VorbisCommentModel(const QString &path); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); void save(); private: TagLib::Ogg::Opus::File *m_file; TagLib::Ogg::XiphComment *m_tag; }; #endif // OPUSMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/opus/opusmetadatamodel.cpp0000664000175000017500000001623712256224735022006 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "opusfile.h" #include #include #include "opusmetadatamodel.h" #define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) #define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() OpusMetaDataModel::OpusMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_path = path; m_tags << new VorbisCommentModel(path); } OpusMetaDataModel::~OpusMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); } QHash OpusMetaDataModel::audioProperties() { QHash ap; TagLib::Ogg::Opus::File f (m_path.toLocal8Bit().constData()); if(f.audioProperties()) { QString text = QString("%1").arg(f.audioProperties()->length()/60); text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); } return ap; } QList OpusMetaDataModel::tags() { return m_tags; } QPixmap OpusMetaDataModel::cover() { TagLib::Ogg::Opus::File file(m_path.toLocal8Bit().constData()); TagLib::Ogg::XiphComment *tag = file.tag(); if(!tag) return QPixmap(); TagLib::StringList list = tag->fieldListMap()["METADATA_BLOCK_PICTURE"]; if(list.isEmpty()) return QPixmap(); for(uint i = 0; i < list.size(); ++i) { TagLib::String value = list[i]; QByteArray block = QByteArray::fromBase64(TStringToQString_qt4(value).toAscii()); if(block.size() < 32) continue; qint64 pos = 0; if(readPictureBlockField(block, pos) != 3) //picture type, use front cover only continue; pos += 4; int mimeLength = readPictureBlockField(block, pos); //mime type length pos += 4; pos += mimeLength; //skip mime type int descLength = readPictureBlockField(block, pos); //description length pos += 4; pos += descLength; //skip description pos += 4; //width pos += 4; //height pos += 4; //color depth pos += 4; //the number of colors used int length = readPictureBlockField(block, pos); //picture size pos += 4; QPixmap cover; cover.loadFromData(block.mid(pos, length)); //read binary picture data return cover; } return QPixmap(); } ulong OpusMetaDataModel::readPictureBlockField(QByteArray data, int offset) { return (((uchar)data.data()[offset] & 0xff) << 24) | (((uchar)data.data()[offset+1] & 0xff) << 16) | (((uchar)data.data()[offset+2] & 0xff) << 16) | ((uchar)data.data()[offset+3] & 0xff); } VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) { m_file = new TagLib::Ogg::Opus::File (path.toLocal8Bit().constData()); m_tag = m_file->tag(); } VorbisCommentModel::~VorbisCommentModel() { delete m_file; } const QString VorbisCommentModel::name() { return "Vorbis Comment"; } const QString VorbisCommentModel::value(Qmmp::MetaData key) { if(!m_tag) return QString(); switch((int) key) { case Qmmp::TITLE: return TStringToQString_qt4(m_tag->title()); case Qmmp::ARTIST: return TStringToQString_qt4(m_tag->artist()); case Qmmp::ALBUM: return TStringToQString_qt4(m_tag->album()); case Qmmp::COMMENT: return TStringToQString_qt4(m_tag->comment()); case Qmmp::GENRE: return TStringToQString_qt4(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); case Qmmp::DISCNUMBER: if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String str = QStringToTString_qt4(value); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); return; case Qmmp::ARTIST: m_tag->setArtist(str); return; case Qmmp::ALBUM: m_tag->setAlbum(str); return; case Qmmp::COMMENT: m_tag->setComment(str); return; case Qmmp::GENRE: m_tag->setGenre(str); return; case Qmmp::COMPOSER: value.isEmpty() ? m_tag->removeField("COMPOSER"): m_tag->addField("COMPOSER", str, true); return; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); return; case Qmmp::YEAR: m_tag->setYear(value.toInt()); return; case Qmmp::DISCNUMBER: value == "0" ? m_tag->removeField("DISCNUMBER"): m_tag->addField("DISCNUMBER", str, true); } } void VorbisCommentModel::save() { if(m_tag) m_file->save(); //taglib bug workarround QString path = QString::fromLocal8Bit(m_file->name()); delete m_file; m_file = new TagLib::Ogg::Opus::File(path.toLocal8Bit().constData()); m_tag = m_file->tag(); } qmmp-0.7.4/src/plugins/Input/opus/translations/0000775000175000017500000000000012256224735020302 5ustar useruserqmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_zh_CN.ts0000664000175000017500000000564512256224735024311 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length 长度 Sample rate 取样率 Hz Channels 声音通道 Bitrate 比特率 kbps File size 文件大小 KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_zh_TW.ts0000664000175000017500000000565512256224735024344 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Channels 聲音通道 Bitrate 比特率 kbps kbps File size 文件大小 KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_gl_ES.ts0000664000175000017500000000547312256224735024300 0ustar useruser DecoderOpusFactory Opus Plugin Engadido Opus Ogg Opus Files Ficheiros Opus Ogg About Opus Audio Plugin Sobre o endagido Opus Qmmp Opus Audio Plugin Engadido Opus de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library Este engadido inclúe código da libraría TagLig OpusMetaDataModel Length Lonxitude Sample rate Taxa de mostra Hz Hz Channels Canais Bitrate Taxa de bits kbps kbps File size Tamaño de ficheiro KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_de.ts0000664000175000017500000000564512256224735023700 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Channels Kanäle Bitrate Bitrate kbps kbps File size Dateigröße KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_cs.ts0000664000175000017500000000544312256224735023711 0ustar useruser DecoderOpusFactory Opus Plugin Modul Opus Ogg Opus Files Soubory Ogg Opus About Opus Audio Plugin O modulu Opus Qmmp Opus Audio Plugin Modul Qmmp Opus Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library Tento modul zahrnuje kód z knihovny TagLib OpusMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů Bitrate Datový tok kbps kbps File size Velikost souboru KB KiB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_es.ts0000664000175000017500000000566712256224735023723 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Channels Canales Bitrate Tasa de bits kbps kbps File size Tamaño del archivo KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_fr.ts0000664000175000017500000000550412256224735023711 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_he.ts0000664000175000017500000000560612256224735023701 0ustar useruser DecoderOpusFactory Opus Plugin תוספת Opus Ogg Opus Files תוספת Ogg Opus About Opus Audio Plugin אודות תוספת שמע Opus Qmmp Opus Audio Plugin תוספת שמע Opus ‏Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> This plugin includes code from TagLib library תוספת זו כוללת קוד מהספרייה TagLib OpusMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Channels ערוצים Bitrate שיעור סיביות kbps File size גודל קובץ KB ק״ב qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_hu.ts0000664000175000017500000000550412256224735023716 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_ja.ts0000664000175000017500000000571112256224735023674 0ustar useruser DecoderOpusFactory Opus Plugin Opus プラグイン Ogg Opus Files Ogg Opus ファイル About Opus Audio Plugin Opus 音響プラグインについて Qmmp Opus Audio Plugin QMMP Opus 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> This plugin includes code from TagLib library このプラグインは TagLib ライブラリーのコードを流用しています。 OpusMetaDataModel Length 演奏時間 Sample rate サンプルレート Hz Hz Channels チャンネル Bitrate ビットレート kbps キロビット毎秒 File size ファイルの大きさ KB KiB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_it.ts0000664000175000017500000000565712256224735023727 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Durata Sample rate Campionamento Hz Hz Channels Canali Bitrate bit al secondo kbps kbps File size Dimensione file KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_kk.ts0000664000175000017500000000550412256224735023707 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_lt.ts0000664000175000017500000000564212256224735023724 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Channels Kanalai Bitrate Kokybė kbps kbps File size Bylos dydis KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_nl.ts0000664000175000017500000000564412256224735023720 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Duur Sample rate Sample frequentie Hz Channels Kanalen Bitrate Bitsnelheid kbps File size Bestandsnaam KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_pl.ts0000664000175000017500000000554012256224735023715 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Wtyczka Ogg Vorbis Ogg Vorbis Files Pliki Ogg Vorbis About Ogg Vorbis Audio Plugin O wtyczce Ogg Vorbis Audio Qmmp Ogg Vorbis Audio Plugin Wtyczka Ogg Vorbis dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Kod źródłowy oparty jest na projekcie mq3 VorbisMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_ru.ts0000664000175000017500000000572012256224735023730 0ustar useruser DecoderOpusFactory Opus Plugin Модуль Opus Ogg Opus Files Файлы Ogg Opus About Opus Audio Plugin Об аудио-модуле Opus Qmmp Opus Audio Plugin Модуль Opus для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> This plugin includes code from TagLib library В данном модуле задействован код из библиотеки TagLib OpusMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Channels Каналов Bitrate Битовая частота kbps Кб/с File size Размер файла KB КБ qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_sk.ts0000664000175000017500000000550412256224735023717 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_tr.ts0000664000175000017500000000557312256224735023735 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Hz Channels Bitrate kbps kbps File size KB KB qmmp-0.7.4/src/plugins/Input/opus/translations/translations.qrc0000664000175000017500000000142512256224735023534 0ustar useruser opus_plugin_ru.qm opus_plugin_uk_UA.qm opus_plugin_zh_CN.qm opus_plugin_zh_TW.qm opus_plugin_tr.qm opus_plugin_cs.qm opus_plugin_pt_BR.qm opus_plugin_de.qm opus_plugin_pl_PL.qm opus_plugin_fr.qm opus_plugin_it.qm opus_plugin_kk.qm opus_plugin_lt.qm opus_plugin_hu.qm opus_plugin_nl.qm opus_plugin_ja.qm opus_plugin_sk.qm opus_plugin_es.qm opus_plugin_he.qm opus_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_uk_UA.ts0000664000175000017500000000564112256224735024310 0ustar useruser DecoderOpusFactory Opus Plugin Модуль Opus Ogg Opus Files Файли Ogg Opus About Opus Audio Plugin Про модуль аудіо Opus Qmmp Opus Audio Plugin Модуль Opus для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> This plugin includes code from TagLib library В даному модулі задіяно код з бібліотеки TagLib OpusMetaDataModel Length Тривалість Sample rate Частота Hz Гц Channels Канали Bitrate Бітрейт kbps Кб/с File size Розмір файлу KB Кб qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_pl_PL.ts0000664000175000017500000000545312256224735024313 0ustar useruser DecoderOpusFactory Opus Plugin Wtyczka Opus Ogg Opus Files Pliki Ogg Opus About Opus Audio Plugin O wtyczce Opus Audio Qmmp Opus Audio Plugin Wtyczka Opus Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library Ta wtyczka używa kodu z biblioteki TagLib OpusMetaDataModel Length Długość Sample rate Próbkowanie Hz Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/opus/translations/opus_plugin_pt_BR.ts0000664000175000017500000000550412256224735024310 0ustar useruser DecoderOpusFactory Opus Plugin Ogg Opus Files About Opus Audio Plugin Qmmp Opus Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> This plugin includes code from TagLib library OpusMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/opus/replaygainreader.h0000664000175000017500000000374212256224735021256 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAINREADER_H #define REPLAYGAINREADER_H #include #include #include #include /** @author Ilya Kotov */ class ReplayGainReader { public: ReplayGainReader(const QString &path); QMap replayGainInfo() const; private: void readVorbisComment(TagLib::Ogg::XiphComment *comment); void setValue(Qmmp::ReplayGainKey key, QString value); QMap m_values; }; #endif // REPLAYGAINREADER_H qmmp-0.7.4/src/plugins/Input/opus/tdebug.cpp0000664000175000017500000000440012256224735017535 0ustar useruser/*************************************************************************** copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ #ifndef NDEBUG #include #include #include "tdebug.h" #include using namespace TagLib; void TagLib::debug(const String &s) { std::cerr << "TagLib: " << s << std::endl; } void TagLib::debugData(const ByteVector &v) { for(uint i = 0; i < v.size(); i++) { std::cout << "*** [" << i << "] - '" << char(v[i]) << "' - int " << int(v[i]) << std::endl; std::bitset<8> b(v[i]); for(int j = 0; j < 8; j++) std::cout << i << ":" << j << " " << b.test(j) << std::endl; std::cout << std::endl; } } #endif qmmp-0.7.4/src/plugins/Input/opus/replaygainreader.cpp0000664000175000017500000000546712256224735021617 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "opusfile.h" #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { TagLib::Ogg::Opus::File fileRef(path.toLocal8Bit ().constData()); if(fileRef.tag()) readVorbisComment(fileRef.tag()); } QMap ReplayGainReader::replayGainInfo() const { return m_values; } void ReplayGainReader::readVorbisComment(TagLib::Ogg::XiphComment *comment) { TagLib::Ogg::FieldListMap items = comment->fieldListMap(); if (items.contains("REPLAYGAIN_TRACK_GAIN")) setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].front())); if (items.contains("REPLAYGAIN_TRACK_PEAK")) setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].front())); if (items.contains("REPLAYGAIN_ALBUM_GAIN")) setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN,TStringToQString(items["REPLAYGAIN_ALBUM_GAIN"].front())); if (items.contains("REPLAYGAIN_ALBUM_PEAK")) setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK,TStringToQString(items["REPLAYGAIN_ALBUM_PEAK"].front())); } void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) { value.remove(" dB"); if(value.isEmpty()) return; bool ok; double v = value.toDouble(&ok); if(ok) m_values[key] = v; } qmmp-0.7.4/src/plugins/Input/opus/opus.pro0000664000175000017500000000275212256224735017277 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decoderopusfactory.h \ decoder_opus.h \ opusmetadatamodel.h \ replaygainreader.h \ opusproperties.h \ opusfile.h \ tdebug.h SOURCES += decoder_opus.cpp \ decoderopusfactory.cpp \ opusmetadatamodel.cpp \ replaygainreader.cpp \ opusproperties.cpp \ opusfile.cpp \ tdebug.cpp TARGET = $$PLUGINS_PREFIX/Input/opus INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/opus_plugin_ru.ts \ translations/opus_plugin_uk_UA.ts \ translations/opus_plugin_zh_CN.ts \ translations/opus_plugin_zh_TW.ts \ translations/opus_plugin_cs.ts \ translations/opus_plugin_pl.ts \ translations/opus_plugin_de.ts \ translations/opus_plugin_it.ts \ translations/opus_plugin_tr.ts \ translations/opus_plugin_lt.ts \ translations/opus_plugin_nl.ts \ translations/opus_plugin_ja.ts \ translations/opus_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty (LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target PKGCONFIG += taglib opus opusfile LIBS += -lqmmp QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libopus.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lopusfile -lopus -ltag.dll -lm } qmmp-0.7.4/src/plugins/Input/opus/opusfile.cpp0000664000175000017500000001001312256224735020106 0ustar useruser/*************************************************************************** copyright : (C) 2012 by Lukáš Lalinský email : lalinsky@gmail.com copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org (original Vorbis implementation) ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ /* Changes against original code: - removed constructor File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle); - removed function PropertyMap File::properties() const; - removed function PropertyMap File::setProperties(const PropertyMap &properties). */ #include #include #include "tdebug.h" #include "opusfile.h" using namespace TagLib; using namespace TagLib::Ogg; class Opus::File::FilePrivate { public: FilePrivate() : comment(0), properties(0) {} ~FilePrivate() { delete comment; delete properties; } Ogg::XiphComment *comment; Properties *properties; }; //////////////////////////////////////////////////////////////////////////////// // public members //////////////////////////////////////////////////////////////////////////////// Opus::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) : Ogg::File(file) { d = new FilePrivate; read(readProperties, propertiesStyle); } Opus::File::~File() { delete d; } Ogg::XiphComment *Opus::File::tag() const { return d->comment; } Opus::Properties *Opus::File::audioProperties() const { return d->properties; } bool Opus::File::save() { if(!d->comment) d->comment = new Ogg::XiphComment; setPacket(1, ByteVector("OpusTags", 8) + d->comment->render(false)); return Ogg::File::save(); } //////////////////////////////////////////////////////////////////////////////// // private members //////////////////////////////////////////////////////////////////////////////// void Opus::File::read(bool readProperties, Properties::ReadStyle propertiesStyle) { ByteVector opusHeaderData = packet(0); if(!opusHeaderData.startsWith("OpusHead")) { setValid(false); debug("Opus::File::read() -- invalid Opus identification header"); return; } ByteVector commentHeaderData = packet(1); if(!commentHeaderData.startsWith("OpusTags")) { setValid(false); debug("Opus::File::read() -- invalid Opus tags header"); return; } d->comment = new Ogg::XiphComment(commentHeaderData.mid(8)); if(readProperties) d->properties = new Properties(this, propertiesStyle); } qmmp-0.7.4/src/plugins/Input/opus/decoder_opus.h0000664000175000017500000000406412256224735020411 0ustar useruser/*************************************************************************** * Copyright (C) 2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_OPUS_H #define DECODER_OPUS_H #include #include /** @author Ilya Kotov */ class DecoderOpus : public Decoder { public: DecoderOpus(const QString &url, QIODevice *i); virtual ~DecoderOpus(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); private: virtual qint64 read(char *data, qint64 maxSize); virtual void seek(qint64 time); // helper functions OggOpusFile *m_opusfile; qint64 m_totalTime; int m_bitrate; int m_chan; QString m_url; }; #endif // DECODER_OPUS_H qmmp-0.7.4/src/plugins/Input/opus/opusproperties.h0000664000175000017500000000655112256224735021044 0ustar useruser/*************************************************************************** copyright : (C) 2012 by Lukáš Lalinský email : lalinsky@gmail.com copyright : (C) 2002 - 2008 by Scott Wheeler email : wheeler@kde.org (original Vorbis implementation) ***************************************************************************/ /*************************************************************************** * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License version * * 2.1 as published by the Free Software Foundation. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301 USA * * * * Alternatively, this file is available under the Mozilla Public * * License Version 1.1. You may obtain a copy of the License at * * http://www.mozilla.org/MPL/ * ***************************************************************************/ #ifndef TAGLIB_OPUSPROPERTIES_H #define TAGLIB_OPUSPROPERTIES_H #include namespace TagLib { namespace Ogg { namespace Opus { class File; //! An implementation of audio property reading for Ogg Opus /*! * This reads the data from an Ogg Opus stream found in the AudioProperties * API. */ class Properties : public AudioProperties { public: /*! * Create an instance of Opus::Properties with the data read from the * Opus::File \a file. */ Properties(File *file, ReadStyle style = Average); /*! * Destroys this Opus::Properties instance. */ virtual ~Properties(); // Reimplementations. virtual int length() const; virtual int bitrate() const; virtual int sampleRate() const; virtual int channels() const; /*! * The Opus codec supports decoding at multiple sample rates, there is no * single sample rate of the encoded stream. This returns the sample rate * of the original audio stream. */ int inputSampleRate() const; /*! * Returns the Opus version, currently "0" (as specified by the spec). */ int opusVersion() const; private: Properties(const Properties &); Properties &operator=(const Properties &); void read(); class PropertiesPrivate; PropertiesPrivate *d; }; } } } #endif qmmp-0.7.4/src/plugins/Input/Input.pro0000664000175000017500000000126112256224735016414 0ustar useruserinclude(../../../qmmp.pri) SUBDIRS += mad cue vorbis sndfile wavpack TEMPLATE = subdirs contains(CONFIG, FLAC_PLUGIN){ SUBDIRS += flac } contains(CONFIG, MUSEPACK_PLUGIN){ SUBDIRS += mpc } contains(CONFIG, MODPLUG_PLUGIN){ SUBDIRS += modplug } contains(CONFIG, FFMPEG_PLUGIN){ contains(CONFIG, FFMPEG_LEGACY){ SUBDIRS += ffmpeg_legacy }else{ SUBDIRS += ffmpeg } } contains(CONFIG, GME_PLUGIN){ SUBDIRS += gme } contains(CONFIG, OPUS_PLUGIN){ SUBDIRS += opus } contains(CONFIG, CDAUDIO_PLUGIN){ SUBDIRS += cdaudio } unix{ contains(CONFIG, AAC_PLUGIN){ SUBDIRS += aac } contains(CONFIG, WILDMIDI_PLUGIN){ SUBDIRS += wildmidi } } qmmp-0.7.4/src/plugins/Input/CMakeLists.txt0000664000175000017500000000411512256224735017334 0ustar useruserSET(USE_MAD TRUE CACHE BOOL "enable/disable mad plugin") SET(USE_FLAC TRUE CACHE BOOL "enable/disable flac plugin") SET(USE_VORBIS TRUE CACHE BOOL "enable/disable ogg vorbis plugin") SET(USE_FFMPEG TRUE CACHE BOOL "enable/disable ffmpeg plugin") SET(USE_FFMPEG_LEGACY TRUE CACHE BOOL "enable/disable ffmpeg_legacy plugin") SET(USE_MPC TRUE CACHE BOOL "enable/disable mpc plugin") SET(USE_SNDFILE TRUE CACHE BOOL "enable/disable sndfile plugin") SET(USE_WAVPACK TRUE CACHE BOOL "enable/disable wavpack plugin") SET(USE_MODPLUG TRUE CACHE BOOL "enable/disable modplug plugin") SET(USE_AAC TRUE CACHE BOOL "enable/disable aac plugin") SET(USE_CUE TRUE CACHE BOOL "enable/disable cue plugin") SET(USE_CDA TRUE CACHE BOOL "enable/disable cd audio support") SET(USE_MIDI TRUE CACHE BOOL "enable/disable midi support") SET(USE_GME TRUE CACHE BOOL "enable/disable game music plugin") SET(USE_OPUS TRUE CACHE BOOL "enable/disable opus plugin") IF(USE_MAD AND TAGLIB_FOUND) add_subdirectory(mad) ENDIF(USE_MAD AND TAGLIB_FOUND) IF(USE_FLAC AND TAGLIB_FOUND) add_subdirectory(flac) ENDIF(USE_FLAC AND TAGLIB_FOUND) IF(USE_VORBIS AND TAGLIB_FOUND) add_subdirectory(vorbis) ENDIF(USE_VORBIS AND TAGLIB_FOUND) IF(USE_FFMPEG) add_subdirectory(ffmpeg) ENDIF(USE_FFMPEG) IF(USE_FFMPEG_LEGACY) add_subdirectory(ffmpeg_legacy) ENDIF(USE_FFMPEG_LEGACY) IF(USE_MPC AND TAGLIB_FOUND) add_subdirectory(mpc) ENDIF(USE_MPC AND TAGLIB_FOUND) IF(USE_SNDFILE) add_subdirectory(sndfile) ENDIF(USE_SNDFILE) IF(USE_WAVPACK) add_subdirectory(wavpack) ENDIF(USE_WAVPACK) IF(USE_MODPLUG) add_subdirectory(modplug) ENDIF(USE_MODPLUG) IF(USE_AAC AND TAGLIB_FOUND) add_subdirectory(aac) ENDIF(USE_AAC AND TAGLIB_FOUND) IF(USE_CUE) add_subdirectory(cue) ENDIF(USE_CUE) IF(USE_CDA) add_subdirectory(cdaudio) ENDIF(USE_CDA) IF(USE_MIDI) add_subdirectory(wildmidi) ENDIF(USE_MIDI) IF(USE_GME) add_subdirectory(gme) ENDIF(USE_GME) IF(USE_OPUS AND TAGLIB_FOUND) add_subdirectory(opus) ENDIF(USE_OPUS AND TAGLIB_FOUND) qmmp-0.7.4/src/plugins/Input/sndfile/0000775000175000017500000000000012256224735016217 5ustar useruserqmmp-0.7.4/src/plugins/Input/sndfile/decodersndfilefactory.cpp0000664000175000017500000001204512256224735023267 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include extern "C" { #include } #include "decoder_sndfile.h" #include "decodersndfilefactory.h" // DecoderSndFileFactory bool DecoderSndFileFactory::supports(const QString &source) const { if (source.right(4).toLower() == ".wav") { //try top open the file SF_INFO snd_info; SNDFILE *sndfile = sf_open(source.toLocal8Bit(), SFM_READ, &snd_info); if (!sndfile) return false; sf_close (sndfile); sndfile = 0; return true; } foreach(QString filter, properties().filters) { QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if (regexp.exactMatch(source)) return true; } return false; } bool DecoderSndFileFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderSndFileFactory::properties() const { DecoderProperties properties; properties.name = tr("Sndfile Plugin"); properties.filters << "*.wav" << "*.au" << "*.snd" << "*.aif" << "*.aiff" << "*.8svx"; properties.filters << "*.sph" << "*.sf" << "*.voc" << "*.w64"; properties.description = tr("PCM Files"); //properties.contentType = ""; properties.shortName = "sndfile"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = true; properties.protocols << "file"; return properties; } Decoder *DecoderSndFileFactory::create(const QString &path, QIODevice *) { return new DecoderSndFile(path); } QList DecoderSndFileFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; SF_INFO snd_info; SNDFILE *sndfile = 0; memset (&snd_info, 0, sizeof(snd_info)); snd_info.format = 0; sndfile = sf_open(fileName.toLocal8Bit(), SFM_READ, &snd_info); if (!sndfile) return list; list << new FileInfo(fileName); if (useMetaData) { if (sf_get_string(sndfile, SF_STR_TITLE)) { char* title = strdup(sf_get_string(sndfile, SF_STR_TITLE)); list.at(0)->setMetaData(Qmmp::TITLE, QString::fromUtf8(title).trimmed()); } if (sf_get_string(sndfile, SF_STR_ARTIST)) { char* artist = strdup(sf_get_string(sndfile, SF_STR_ARTIST)); list.at(0)->setMetaData(Qmmp::ARTIST, QString::fromUtf8(artist).trimmed()); } if (sf_get_string(sndfile, SF_STR_COMMENT)) { char* comment = strdup(sf_get_string(sndfile, SF_STR_COMMENT)); list.at(0)->setMetaData(Qmmp::COMMENT, QString::fromUtf8(comment).trimmed()); } } list.at(0)->setLength(int(snd_info.frames / snd_info.samplerate)); sf_close(sndfile); return list; } MetaDataModel* DecoderSndFileFactory::createMetaDataModel(const QString&, QObject *) { return 0; } void DecoderSndFileFactory::showSettings(QWidget *) {} void DecoderSndFileFactory::showAbout(QWidget *parent) { char version [128] ; sf_command (NULL, SFC_GET_LIB_VERSION, version, sizeof (version)) ; QMessageBox::about (parent, tr("About Sndfile Audio Plugin"), tr("Qmmp Sndfile Audio Plugin")+"\n"+ tr("Compiled against")+" "+QString(version)+"\n" + tr("Written by: Ilya Kotov ")); } QTranslator *DecoderSndFileFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/sndfile_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(sndfile, DecoderSndFileFactory) qmmp-0.7.4/src/plugins/Input/sndfile/decoder_sndfile.cpp0000664000175000017500000000627512256224735022046 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "decoder_sndfile.h" // Decoder class DecoderSndFile::DecoderSndFile(const QString &path) : Decoder() { m_path = path; m_bitrate = 0; m_totalTime = 0; m_sndfile = 0; m_freq = 0; } DecoderSndFile::~DecoderSndFile() { deinit(); } bool DecoderSndFile::initialize() { m_bitrate = 0; m_totalTime = 0.0; SF_INFO snd_info; memset (&snd_info, 0, sizeof(snd_info)); snd_info.format=0; m_sndfile = sf_open(m_path.toLocal8Bit(), SFM_READ, &snd_info); if (!m_sndfile) { qWarning("DecoderSndFile: failed to open: %s", qPrintable(m_path)); return false; } m_freq = snd_info.samplerate; int chan = snd_info.channels; m_totalTime = snd_info.frames * 1000 / m_freq; m_bitrate = QFileInfo(m_path).size () * 8.0 / m_totalTime + 0.5; if((snd_info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT) sf_command (m_sndfile, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE); configure(m_freq, chan, Qmmp::PCM_S16LE); qDebug("DecoderSndFile: detected format: %08X", snd_info.format); qDebug("DecoderSndFile: initialize succes"); return true; } void DecoderSndFile::deinit() { m_totalTime = 0; m_bitrate = 0; m_freq = 0; if (m_sndfile) sf_close(m_sndfile); m_sndfile = 0; } qint64 DecoderSndFile::totalTime() { return m_totalTime; } int DecoderSndFile::bitrate() { return m_bitrate; } qint64 DecoderSndFile::read(char *audio, qint64 maxSize) { return sizeof(short)* sf_read_short (m_sndfile, (short *)audio, maxSize / sizeof(short)); } void DecoderSndFile::seek(qint64 pos) { sf_seek(m_sndfile, m_freq * pos/1000, SEEK_SET); } qmmp-0.7.4/src/plugins/Input/sndfile/CMakeLists.txt0000664000175000017500000000306712256224735020765 0ustar useruserproject(libsndfile) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libsndfile pkg_search_module(SNDFILE sndfile) include_directories(${SNDFILE_INCLUDE_DIRS}) link_directories(${SNDFILE_LIBRARY_DIRS}) ADD_DEFINITIONS(${SNDFILE_CFLAGS}) SET(libsndfile_SRCS decoder_sndfile.cpp decodersndfilefactory.cpp ) SET(libsndfile_HDRS decoder_sndfile.h ) SET(libsndfile_MOC_HDRS decodersndfilefactory.h ) SET(libsndfile_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libsndfile_RCC_SRCS ${libsndfile_RCCS}) QT4_WRAP_CPP(libsndfile_MOC_SRCS ${libsndfile_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(SNDFILE_FOUND) ADD_LIBRARY(sndfile MODULE ${libsndfile_SRCS} ${libsndfile_MOC_SRCS} ${libsndfile_UIS_H} ${libsndfile_RCC_SRCS} ${libsndfile_HDRS}) add_dependencies(sndfile qmmp) target_link_libraries(sndfile ${QT_LIBRARIES} -lqmmp ${SNDFILE_LDFLAGS}) install(TARGETS sndfile DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(SNDFILE_FOUND) qmmp-0.7.4/src/plugins/Input/sndfile/decodersndfilefactory.h0000664000175000017500000000446312256224735022741 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERSNDFILEFACTORY_H #define DECODERSNDFILEFACTORY_H #include #include #include #include #include #include #include #include class DecoderSndFileFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/sndfile/sndfile.pro0000664000175000017500000000274612256224735020376 0ustar useruserinclude(../../plugins.pri) HEADERS += decodersndfilefactory.h \ decoder_sndfile.h SOURCES += decoder_sndfile.cpp \ decodersndfilefactory.cpp TARGET=$$PLUGINS_PREFIX/Input/sndfile INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/sndfile_plugin_cs.ts \ translations/sndfile_plugin_de.ts \ translations/sndfile_plugin_zh_CN.ts \ translations/sndfile_plugin_zh_TW.ts \ translations/sndfile_plugin_ru.ts \ translations/sndfile_plugin_pl.ts \ translations/sndfile_plugin_uk_UA.ts \ translations/sndfile_plugin_it.ts \ translations/sndfile_plugin_tr.ts \ translations/sndfile_plugin_lt.ts \ translations/sndfile_plugin_nl.ts \ translations/sndfile_plugin_ja.ts \ translations/sndfile_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp PKGCONFIG += sndfile QMAKE_CLEAN =$$PLUGINS_PREFIX/Input/libsndfile.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lsndfile -lflac -lvorbisenc -lvorbis -logg } qmmp-0.7.4/src/plugins/Input/sndfile/decoder_sndfile.h0000664000175000017500000000402512256224735021502 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_AUDIOFILE_H #define DECODER_AUDIOFILE_H extern "C"{ #include } #include class DecoderSndFile : public Decoder { public: DecoderSndFile(const QString &path); virtual ~DecoderSndFile(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: // helper functions void deinit(); SNDFILE *m_sndfile; int m_bitrate; quint32 m_freq; qint64 m_totalTime; QString m_path; }; #endif // DECODER_SNDFILE_H qmmp-0.7.4/src/plugins/Input/sndfile/translations/0000775000175000017500000000000012256224735020740 5ustar useruserqmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_pl_PL.ts0000664000175000017500000000260512256224735025403 0ustar useruser DecoderSndFileFactory Sndfile Plugin Wtyczka Sndfile PCM Files Pliki PCM About Sndfile Audio Plugin O wtyczce Sndfile Audio Qmmp Sndfile Audio Plugin Wtyczka Sndfile Audio dla Qmmp Compiled against Skompilowano przy użyciu Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_pt_BR.ts0000664000175000017500000000253712256224735025407 0ustar useruser DecoderSndFileFactory Sndfile Plugin PCM Files About Sndfile Audio Plugin Qmmp Sndfile Audio Plugin Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_zh_CN.ts0000664000175000017500000000257412256224735025403 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile 插件 PCM Files PCM 文件 About Sndfile Audio Plugin 关于 Sndfile 音频插件 Qmmp Sndfile Audio Plugin Qmmp Sndfile 音频插件 Compiled against 编译依赖 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/translations.qrc0000664000175000017500000000152112256224735024167 0ustar useruser sndfile_plugin_ru.qm sndfile_plugin_uk_UA.qm sndfile_plugin_zh_CN.qm sndfile_plugin_zh_TW.qm sndfile_plugin_tr.qm sndfile_plugin_cs.qm sndfile_plugin_pt_BR.qm sndfile_plugin_de.qm sndfile_plugin_pl_PL.qm sndfile_plugin_fr.qm sndfile_plugin_it.qm sndfile_plugin_kk.qm sndfile_plugin_lt.qm sndfile_plugin_hu.qm sndfile_plugin_nl.qm sndfile_plugin_ja.qm sndfile_plugin_sk.qm sndfile_plugin_es.qm sndfile_plugin_he.qm sndfile_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_zh_TW.ts0000664000175000017500000000257712256224735025440 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile 插件 PCM Files PCM 檔案 About Sndfile Audio Plugin 關於 Sndfile 聲訊插件 Qmmp Sndfile Audio Plugin Qmmp Sndfile 聲訊插件 Compiled against 編譯依賴於 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_gl_ES.ts0000664000175000017500000000260212256224735025363 0ustar useruser DecoderSndFileFactory Sndfile Plugin Engadido Sndfile PCM Files Ficheiros PCM About Sndfile Audio Plugin Sobre o engadido Sndfile Qmmp Sndfile Audio Plugin Engadido Sndfile de Qmmp Compiled against Compilado con Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_uk_UA.ts0000664000175000017500000000267212256224735025405 0ustar useruser DecoderSndFileFactory Sndfile Plugin Модуль Sndfile PCM Files Файли PCM About Sndfile Audio Plugin Про аудіо-модуль Sndfile Qmmp Sndfile Audio Plugin Модуль SndFile для Qmmp Compiled against Зкомпільовано з Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_de.ts0000664000175000017500000000257312256224735024771 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile-Modul PCM Files PCM-Dateien About Sndfile Audio Plugin Über Sndfile-Audio-Modul Qmmp Sndfile Audio Plugin Qmmp Sndfile-Audio-Modul Compiled against Kompiliert gegen Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_cs.ts0000664000175000017500000000256112256224735025003 0ustar useruser DecoderSndFileFactory Sndfile Plugin Modul Sndfile PCM Files Soubory PCM About Sndfile Audio Plugin O modulu Sndfile Qmmp Sndfile Audio Plugin Vstupní modul Qmmp Sndfile Compiled against Zkompilováno s Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_es.ts0000664000175000017500000000262412256224735025005 0ustar useruser DecoderSndFileFactory Sndfile Plugin Módulo Sndfile PCM Files Archivos PCM About Sndfile Audio Plugin Acerca del módulo de sonido Sndfile Qmmp Sndfile Audio Plugin Módulo de sonido Sndfile para Qmmp Compiled against Compilado con Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_fr.ts0000664000175000017500000000253712256224735025010 0ustar useruser DecoderSndFileFactory Sndfile Plugin PCM Files About Sndfile Audio Plugin Qmmp Sndfile Audio Plugin Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_he.ts0000664000175000017500000000265412256224735024775 0ustar useruser DecoderSndFileFactory Sndfile Plugin תוספת Sndfile PCM Files קבצי PCM About Sndfile Audio Plugin אודות תוספת שמע Sndfile Qmmp Sndfile Audio Plugin תוספת שמע Sndfile ‫Qmmp Compiled against הודרה כנגד Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_hu.ts0000664000175000017500000000253712256224735025015 0ustar useruser DecoderSndFileFactory Sndfile Plugin PCM Files About Sndfile Audio Plugin Qmmp Sndfile Audio Plugin Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_ja.ts0000664000175000017500000000273012256224735024766 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile プラグイン PCM Files PCM ファイル About Sndfile Audio Plugin Sndfile 音響プラグインについて Qmmp Sndfile Audio Plugin QMMP Sndfile 音響プラグイン Compiled against コンパイルに使用したライブラリ Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_it.ts0000664000175000017500000000257512256224735025017 0ustar useruser DecoderSndFileFactory Sndfile Plugin Modulo Sndfile PCM Files Brani PCM About Sndfile Audio Plugin Info sul modulo audio Sndfile Qmmp Sndfile Audio Plugin Modulo audio Sndfile per Qmmp Compiled against Compilato su Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_kk.ts0000664000175000017500000000253712256224735025006 0ustar useruser DecoderSndFileFactory Sndfile Plugin PCM Files About Sndfile Audio Plugin Qmmp Sndfile Audio Plugin Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_lt.ts0000664000175000017500000000260412256224735025013 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile įskiepis PCM Files PCM bylos About Sndfile Audio Plugin Apie Sndfile Audio įskiepį Qmmp Sndfile Audio Plugin Qmmp Sndfile Audio įskiepis Compiled against Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_nl.ts0000664000175000017500000000260712256224735025010 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile Module PCM Files PCM Bestanden About Sndfile Audio Plugin Over de Sndfile Audio Module Qmmp Sndfile Audio Plugin Sndfile Audio Module voor Qmmp Compiled against Gecompileerd tegen Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_pl.ts0000664000175000017500000000260512256224735025010 0ustar useruser DecoderSndFileFactory Sndfile Plugin Wtyczka Sndfile PCM Files Pliki PCM About Sndfile Audio Plugin O wtyczce Sndfile Audio Qmmp Sndfile Audio Plugin Wtyczka Sndfile Audio dla Qmmp Compiled against Skompilowano przy użyciu Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_ru.ts0000664000175000017500000000266012256224735025024 0ustar useruser DecoderSndFileFactory Sndfile Plugin Модуль Sndfile PCM Files Файлы PCM About Sndfile Audio Plugin Об аудио-модуле Sndfile Qmmp Sndfile Audio Plugin Модуль SndFile для Qmmp Compiled against Собрано с Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_sk.ts0000664000175000017500000000253712256224735025016 0ustar useruser DecoderSndFileFactory Sndfile Plugin PCM Files About Sndfile Audio Plugin Qmmp Sndfile Audio Plugin Compiled against Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/sndfile/translations/sndfile_plugin_tr.ts0000664000175000017500000000260212256224735025017 0ustar useruser DecoderSndFileFactory Sndfile Plugin Sndfile Eklentisi PCM Files PCM Dosyaları About Sndfile Audio Plugin Sndfile Ses Eklentisi Hakkında Qmmp Sndfile Audio Plugin Qmmp Sndfile Ses Eklentisi Compiled against Derlendi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/0000775000175000017500000000000012256224735017363 5ustar useruserqmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/ffmpegmetadatamodel.h0000664000175000017500000000372612256224735023532 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FFMPEGMETADATAMODEL_H #define FFMPEGMETADATAMODEL_H extern "C"{ #include #include #if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0)) #include #endif } #include class FFmpegMetaDataModel : public MetaDataModel { Q_OBJECT public: FFmpegMetaDataModel(const QString &path, QObject *parent); ~FFmpegMetaDataModel(); QHash audioProperties(); private: AVFormatContext *m_in; }; #endif // FFMPEGMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/CMakeLists.txt0000664000175000017500000000444412256224735022131 0ustar useruserproject(libffmpeg_legacy) cmake_minimum_required(VERSION 2.6.0) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) # fixes ffmpeg defines ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # minimal supported versions # ffmpeg-0.6: libavcodec-52.72.2, libavformat-52.64.2, libavutil-50.15.1 pkg_check_modules(FFMPEG_MIN libavcodec>=52.72.2 libavformat>=52.64.2 libavutil>=50.15.1) # maximal supported versions # libav-0.8: libavcodec-53.34.0, libavformat-53.20.0, libavutil-51.21.0 # ffmpeg-0.9: libavcodec-53.42.0, libavformat-53.24.0, libavutil-51.32.0 IF(FFMPEG_MIN_FOUND) pkg_check_modules(FFMPEG_LEGACY libavcodec<=53.33.0 libavformat<=53.19.0 libavutil<=51.20.0) ENDIF(FFMPEG_MIN_FOUND) include_directories(${FFMPEG_LEGACY_INCLUDE_DIRS}) link_directories(${FFMPEG_LEGACY_LIBRARY_DIRS}) ADD_DEFINITIONS(${FFMPEG_LEGACY_CFLAGS}) SET(libffmpeg_SRCS decoder_ffmpeg.cpp decoderffmpegfactory.cpp ffmpegmetadatamodel.cpp settingsdialog.cpp ) SET(libffmpeg_HDRS decoder_ffmpeg.h ) SET(libffmpeg_MOC_HDRS decoderffmpegfactory.h ffmpegmetadatamodel.h settingsdialog.h ) SET(libffmpeg_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libffmpeg_RCC_SRCS ${libffmpeg_RCCS}) QT4_WRAP_CPP(libffmpeg_MOC_SRCS ${libffmpeg_MOC_HDRS}) # user interface SET(libffmpeg_UIS settingsdialog.ui ) QT4_WRAP_UI(libffmpeg_UIS_H ${libffmpeg_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(FFMPEG_LEGACY_FOUND) ADD_LIBRARY(ffmpeg_legacy MODULE ${libffmpeg_SRCS} ${libffmpeg_MOC_SRCS} ${libffmpeg_UIS_H} ${libffmpeg_RCC_SRCS} ${libffmpeg_HDRS}) add_dependencies(ffmpeg_legacy qmmp) target_link_libraries(ffmpeg_legacy ${QT_LIBRARIES} -lqmmp ${FFMPEG_LEGACY_LDFLAGS}) install(TARGETS ffmpeg_legacy DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(FFMPEG_LEGACY_FOUND) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/ffmpeg_legacy.pro0000664000175000017500000000312612256224735022677 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decoderffmpegfactory.h \ decoder_ffmpeg.h \ settingsdialog.h \ ffmpegmetadatamodel.h SOURCES += decoder_ffmpeg.cpp \ decoderffmpegfactory.cpp \ settingsdialog.cpp \ ffmpegmetadatamodel.cpp INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib TARGET = $$PLUGINS_PREFIX/Input/ffmpeg_legacy unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libffmpeg_legacy.so LIBS += -lqmmp QMAKE_LIBDIR += ../../../../lib PKGCONFIG += libavcodec libavformat libavutil } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lavcodec.dll -lavformat.dll -lavutil.dll } DEFINES += __STDC_CONSTANT_MACROS TRANSLATIONS = translations/ffmpeg_plugin_legacy_ru.ts \ translations/ffmpeg_plugin_legacy_uk_UA.ts \ translations/ffmpeg_plugin_legacy_zh_CN.ts \ translations/ffmpeg_plugin_legacy_zh_TW.ts \ translations/ffmpeg_plugin_legacy_cs.ts \ translations/ffmpeg_plugin_legacy_pl.ts \ translations/ffmpeg_plugin_legacy_de.ts \ translations/ffmpeg_plugin_legacy_it.ts \ translations/ffmpeg_plugin_legacy_tr.ts \ translations/ffmpeg_plugin_legacy_lt.ts \ translations/ffmpeg_plugin_legacy_nl.ts \ translations/ffmpeg_plugin_legacy_ja.ts \ translations/ffmpeg_plugin_legacy_es.ts RESOURCES = translations/translations.qrc qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/settingsdialog.cpp0000664000175000017500000001225512256224735023114 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C"{ #include #include #if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0)) #include #endif } #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QStringList filters; filters << "*.wma"; filters << "*.ape"; filters = settings.value("FFMPEG_legacy/filters", filters).toStringList(); avcodec_register_all(); av_register_all(); ui.wmaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_WMAV1)); ui.wmaCheckBox->setChecked(filters.contains("*.wma") && avcodec_find_decoder(CODEC_ID_WMAV1)); ui.apeCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_APE)); ui.apeCheckBox->setChecked(filters.contains("*.ape") && avcodec_find_decoder(CODEC_ID_APE)); ui.ttaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TTA)); ui.ttaCheckBox->setChecked(filters.contains("*.tta") && avcodec_find_decoder(CODEC_ID_TTA)); ui.aacCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_AAC)); ui.aacCheckBox->setChecked(filters.contains("*.aac") && avcodec_find_decoder(CODEC_ID_AAC)); ui.mp3CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_MP3)); ui.mp3CheckBox->setChecked(filters.contains("*.mp3") && avcodec_find_decoder(CODEC_ID_MP3)); ui.mp4CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_AAC)); ui.mp4CheckBox->setChecked(filters.contains("*.m4a") && (avcodec_find_decoder(CODEC_ID_AAC) || avcodec_find_decoder(CODEC_ID_ALAC))); ui.raCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_RA_288)); ui.raCheckBox->setChecked(filters.contains("*.ra") && avcodec_find_decoder(CODEC_ID_RA_288)); ui.shCheckBox->setChecked(filters.contains("*.shn") && avcodec_find_decoder(CODEC_ID_SHORTEN)); ui.ac3CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_EAC3)); ui.ac3CheckBox->setChecked(filters.contains("*.ac3") && avcodec_find_decoder(CODEC_ID_EAC3)); ui.dtsCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_DTS)); ui.dtsCheckBox->setChecked(filters.contains("*.dts") && avcodec_find_decoder(CODEC_ID_DTS)); ui.mkaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TRUEHD)); ui.mkaCheckBox->setChecked(filters.contains("*.mka") && avcodec_find_decoder(CODEC_ID_TRUEHD)); ui.vqfCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TWINVQ)); #if (LIBAVCODEC_VERSION_INT >= ((53<<16)+(42<<8)+4)) ui.vqfCheckBox->setChecked(filters.contains("*.vqf") && avcodec_find_decoder(CODEC_ID_TWINVQ)); #else ui.vqfCheckBox->hide(); #endif } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QStringList filters; if (ui.mp3CheckBox->isChecked()) filters << "*.mp3"; if (ui.wmaCheckBox->isChecked()) filters << "*.wma"; if (ui.apeCheckBox->isChecked()) filters << "*.ape"; if (ui.ttaCheckBox->isChecked()) filters << "*.tta"; if (ui.aacCheckBox->isChecked()) filters << "*.aac"; if (ui.mp4CheckBox->isChecked()) filters << "*.m4a"; if (ui.raCheckBox->isChecked()) filters << "*.ra"; if (ui.shCheckBox->isChecked()) filters << "*.shn"; if (ui.ac3CheckBox->isChecked()) filters << "*.ac3"; if (ui.dtsCheckBox->isChecked()) filters << "*.dts"; if (ui.mkaCheckBox->isChecked()) filters << "*.mka"; if (ui.vqfCheckBox->isChecked()) filters << "*.vqf"; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("FFMPEG_legacy/filters", filters); QDialog::accept(); } qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/ffmpegmetadatamodel.cpp0000664000175000017500000000560212256224735024060 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "ffmpegmetadatamodel.h" FFmpegMetaDataModel::FFmpegMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_in = 0; avcodec_init(); avcodec_register_all(); av_register_all(); if (av_open_input_file(&m_in, path.toLocal8Bit(), NULL,0, NULL) < 0) return; av_find_stream_info(m_in); av_read_play(m_in); } FFmpegMetaDataModel::~FFmpegMetaDataModel() { if(m_in) av_close_input_file(m_in); } QHash FFmpegMetaDataModel::audioProperties() { QHash ap; if(!m_in) return ap; QString text = QString("%1").arg(int(m_in->duration/AV_TIME_BASE)/60); text +=":"+QString("%1").arg(int(m_in->duration/AV_TIME_BASE)%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("File size"), QString("%1 ").arg(m_in->file_size/1024)+" "+tr("KB")); ap.insert(tr("Bitrate"), QString("%1 "+tr("kbps")).arg(m_in->bit_rate/1000)); AVCodecContext *c = 0; uint wma_idx; for (wma_idx = 0; wma_idx < m_in->nb_streams; wma_idx++) { c = m_in->streams[wma_idx]->codec; #if LIBAVCODEC_VERSION_MAJOR < 53 if (c->codec_type == CODEC_TYPE_AUDIO) #else if (c->codec_type == AVMEDIA_TYPE_AUDIO) #endif break; } if (c) { ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(c->sample_rate)); ap.insert(tr("Channels"), QString("%1").arg(c->channels)); } return ap; } qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/settingsdialog.ui0000664000175000017500000001104412256224735022742 0ustar useruser SettingsDialog 0 0 308 328 FFmpeg Plugin Settings 6 6 6 Qt::Horizontal 178 20 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF buttonBox accepted() SettingsDialog accept() 214 167 103 160 buttonBox rejected() SettingsDialog reject() 269 174 148 169 qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/0000775000175000017500000000000012256224735022104 5ustar useruserqmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_pl_PL.ts0000664000175000017500000001250412256224735027712 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Wtyczka FFMPEG FFmpeg Formats Formaty FFmpeg About FFmpeg Audio Plugin O wtyczce FFmpeg Audio Qmmp FFmpeg Audio Plugin Wtyczka FFmpeg Audio dla Qmmp Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Skompilowane przy użyciu libavformat-%1.%2.%3 i libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Długość File size Wielkość pliku KB Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Channels Kanały SettingsDialog FFmpeg Plugin Settings Ustawienia wtyczki FFMPEG Formats Formaty Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten Shorten (SHN) AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Bezstratny) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_de.ts0000664000175000017500000001276712256224735027307 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Über FFmpeg-Audio-Modul Qmmp FFmpeg Audio Plugin Qmmp FFmpeg-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg-Modul FFmpeg Formats FFmpeg-Formate Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Kompiliert gegen libavformat-%1.%2.%3 und libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Länge File size Dateigröße KB KB Bitrate Bitrate kbps kbps Sample rate Abtastrate Hz Hz Channels Kanäle SettingsDialog Formats Formate Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Name eines Dateiformats Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD, verlustfrei) VQF VQF FFmpeg Plugin Settings Einstellungen FFmpeg-Modul Monkey's Audio (APE) Monkey’s Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_cs.ts0000664000175000017500000001267512256224735027322 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin O modulu FFmpeg Qmmp FFmpeg Audio Plugin Vstupní modul Qmmp FFmpeg Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Modul FFmpeg FFmpeg Formats Formáty FFmpeg Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Přeloženo s libavformat-%1.%2.%3 a libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Délka File size Velikost souboru KB KiB Bitrate Datový tok kbps kbps Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů SettingsDialog Formats Formáty Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Lossless) VQF VQF FFmpeg Plugin Settings Nastavení modulu FFmpeg Monkey's Audio (APE) Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_es.ts0000664000175000017500000001274312256224735027320 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Acerca del módulo de audio FFmpeg Qmmp FFmpeg Audio Plugin Módulo de audio FFmpeg para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Módulo FFmpeg FFmpeg Formats Formatos FFmpeg Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Compilado con libavformat-%1.%2.%3 y libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Duración File size Tamaño del archivo KB KB Bitrate Tasa de bits kbps kbps Sample rate Frecuencia Hz Hz Channels Canales SettingsDialog Formats Formatos Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Configuración del módulo FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_fr.ts0000664000175000017500000001274612256224735027323 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_he.ts0000664000175000017500000001270312256224735027301 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin תוספת FFmpeg FFmpeg Formats פורמטים של FFmpeg About FFmpeg Audio Plugin אודות תוספת שמע FFmpeg Qmmp FFmpeg Audio Plugin תוספת שמע FFmpeg ‫Qmmp Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 הודרה כנגד libavformat-%1.%2.%3 וכנגד libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> FFmpegMetaDataModel Length אריכות File size גודל קובץ KB ק״ב Bitrate שיעור סיביות kbps Sample rate שיעור דגימה Hz הרץ Channels ערוצים SettingsDialog FFmpeg Plugin Settings הגדרות תוספת FFmpeg Formats פורמטים Windows Media Audio Monkey's Audio (APE) True Audio שמע אמיתי ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten מקוצר AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) שמע Matroska ‫(Dolby TrueHD נטול אובדן) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_hu.ts0000664000175000017500000001274612256224735027330 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_ja.ts0000664000175000017500000001313412256224735027276 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg プラグイン FFmpeg Formats FFmpeg 用の形式 About FFmpeg Audio Plugin FFmpeg 音響プラグインについて Qmmp FFmpeg Audio Plugin QMMP FFmpeg 音響プラグイン Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 libavformat-%1.%2.%3 と libavcodec-%4.%5.%6 対応でコンパイル Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> FFmpegMetaDataModel Length 長さ File size ファイルの大きさ KB KiB Bitrate ビットレート kbps キロビット毎秒 Sample rate サンプルレート Hz Hz Channels チャンネル SettingsDialog FFmpeg Plugin Settings FFmpeg プラグイン設定 Formats 形式 Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG オーディオ レイヤー3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten 短縮 AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_it.ts0000664000175000017500000001272112256224735027321 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Info sul modulo audi FFmpeg Qmmp FFmpeg Audio Plugin Modulo audio FFmpeg per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Modulo FFmpeg FFmpeg Formats Formati FFmpeg Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Compilato con libavformat-%1.%2.%3 e libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Durata File size Dimensione file KB KB Bitrate Bit/secondo kbps kbps Sample rate Campionamento Hz Hz Channels Canali SettingsDialog Formats Formati Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Impostazioni del modulo FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_kk.ts0000664000175000017500000001274612256224735027321 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_lt.ts0000664000175000017500000001266012256224735027326 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Apie FFmpeg įskiepį Qmmp FFmpeg Audio Plugin FFmpeg Qmmp audio įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg įskiepis FFmpeg Formats FFmpeg bylų tipai Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Surinkta iš libavformat-%1.%2.%3 ir libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Trukmė File size Bylos dydis KB КB Bitrate Kokybė kbps kbps Sample rate Dažnis Hz Hz Channels Kanalai SettingsDialog Formats Tipai Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Lossless) VQF VQF FFmpeg Plugin Settings FFmpeg įskiepio nustatymai Monkey's Audio (APE) Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_nl.ts0000664000175000017500000001240412256224735027314 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Over de FFmpeg Audio Module Qmmp FFmpeg Audio Plugin FFmpeg Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg Module FFmpeg Formats FFmpeg Formaat Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Gecompileerd tegen libavformat-%1.%2.%3 en libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Duur File size Bestandsgrootte KB Bitrate Bitsnelheid kbps Sample rate Sample frequentie Hz Channels Kanalen SettingsDialog Formats Formaten Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg Module Instellingen Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_pl.ts0000664000175000017500000001355212256224735027323 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Wtyczka FFMPEG FFmpeg Formats Formaty FFmpeg About FFmpeg Audio Plugin O wtyczce FFmpeg Audio Qmmp FFmpeg Audio Plugin Wtyczka FFmpeg Audio dla Qmmp Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Skompilowane przy użyciu libavformat-%1.%2.%3 i libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Długość File size Wielkość pliku KB Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Channels Kanały SettingsDialog FFmpeg Plugin Settings Ustawienia wtyczki FFMPEG Formats Formaty Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten Shorten (SHN) AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Bezstratny) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_ru.ts0000664000175000017500000001316512256224735027336 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Об аудио-модуле FFmpeg Qmmp FFmpeg Audio Plugin Аудио-модуль FFmpeg для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> FFmpeg Plugin Модуль FFmpeg FFmpeg Formats Форматы FFmpeg Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Собрано с libavformat-%1.%2.%3 и libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Длительность File size Размер файла KB КБ Bitrate Битовая частота kbps Кб/с Sample rate Дискретизация Hz Гц Channels Каналов SettingsDialog Formats Форматы Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Настройки модуля FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_sk.ts0000664000175000017500000001274612256224735027331 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_tr.ts0000664000175000017500000001306712256224735027336 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Eklentisi FFmpeg Formats FFmpeg Biçimleri About FFmpeg Audio Plugin FFmpeg Ses Eklentisi Hakkında Qmmp FFmpeg Audio Plugin Qmmp FFmpeg Ses Eklentisi Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 libavformat-%1.%2.%3 ve libavcodec-%4.%5.%6 ile derlenmiştir Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB KB Bitrate kbps kbps Sample rate Hz Hz Channels SettingsDialog FFmpeg Plugin Settings FFmpeg Eklenti Ayarları Formats Biçimler Windows Media Audio Windows Media Audio Monkey's Audio (APE) True Audio True Audio ADTS AAC ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_pt_BR.ts0000664000175000017500000001274612256224735027722 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/translations.qrc0000664000175000017500000000171112256224735025334 0ustar useruser ffmpeg_legacy_plugin_ru.qm ffmpeg_legacy_plugin_uk_UA.qm ffmpeg_legacy_plugin_zh_CN.qm ffmpeg_legacy_plugin_zh_TW.qm ffmpeg_legacy_plugin_tr.qm ffmpeg_legacy_plugin_cs.qm ffmpeg_legacy_plugin_pt_BR.qm ffmpeg_legacy_plugin_de.qm ffmpeg_legacy_plugin_pl_PL.qm ffmpeg_legacy_plugin_fr.qm ffmpeg_legacy_plugin_it.qm ffmpeg_legacy_plugin_kk.qm ffmpeg_legacy_plugin_lt.qm ffmpeg_legacy_plugin_hu.qm ffmpeg_legacy_plugin_nl.qm ffmpeg_legacy_plugin_ja.qm ffmpeg_legacy_plugin_sk.qm ffmpeg_legacy_plugin_es.qm ffmpeg_legacy_plugin_he.qm ffmpeg_legacy_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_zh_CN.ts0000664000175000017500000001277312256224735027715 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin 关于 FFmpeg 音频插件 Qmmp FFmpeg Audio Plugin Qmmp FFmpeg 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg 插件 FFmpeg Formats FFmpeg 格式 Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 编译依赖 libavformat-%1.%2.%3 和 libavcodec-%4.%5.%6 FFmpegMetaDataModel Length 长度 File size 文件大小 KB Bitrate 比特率 kbps Sample rate 取样率 Hz Channels 声音通道 SettingsDialog Formats 格式 Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg 插件设置 Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_zh_TW.ts0000664000175000017500000001271512256224735027743 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin 關於 FFmpeg 聲訊插件 Qmmp FFmpeg Audio Plugin Qmmp FFmpeg 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg 插件 FFmpeg Formats FFmpeg 格式 Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 編譯依賴 libavformat-%1.%2.%3 與 libavcodec-%4.%5.%6 FFmpegMetaDataModel Length 長度 File size 文件大小 KB KB Bitrate 比特率 kbps kbps Sample rate 取樣率 Hz Hz Channels 聲音通道 SettingsDialog Formats 格式 Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg 插件設置 Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_gl_ES.ts0000664000175000017500000001272112256224735027676 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Engadido ffmpeg FFmpeg Formats Formatos ffmpeg About FFmpeg Audio Plugin Sobre o engadido ffmpeg Qmmp FFmpeg Audio Plugin Engadido ffmpeg de Qmmp Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Compilado con libavformat-%1.%2.%3 e libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Lonxitude File size Tamaño de ficheiro KB KB Bitrate Taxa de bits kbps kbps Sample rate Frecuencia de mostra Hz Hz Channels Canais SettingsDialog FFmpeg Plugin Settings Preferencias do engadido ffmpeg Formats Formatos Windows Media Audio Windows Media Audio Monkey's Audio (APE) Monkey's Audio (APE) True Audio True Audio ADTS AAC ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Lossless) VQF VQF qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/translations/ffmpeg_legacy_plugin_uk_UA.ts0000664000175000017500000001260212256224735027707 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Про аудіо-модуль FFmpeg Qmmp FFmpeg Audio Plugin Аудіо-модуль FFmpeg для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> FFmpeg Plugin Модуль FFmpeg FFmpeg Formats Формати FFmpeg Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Зібрано з libavformat-%1.%2.%3 та libavcodec-%4.%5.%6 FFmpegMetaDataModel Length Тривалість File size Розмір файлу KB Кб Bitrate Бітрейт kbps Кб/с Sample rate Частота Hz Гц Channels Канали SettingsDialog Formats Формати Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Налаштування модуля FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/decoder_ffmpeg.h0000664000175000017500000000530512256224735022470 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef __decoder_ffmeg_h #define __decoder_ffmeg_h extern "C"{ #include #include #include #if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0)) #include #endif } #include #define PROBE_BUFFER_SIZE 8192 #define INPUT_BUFFER_SIZE 16384 class DecoderFFmpeg : public Decoder { public: DecoderFFmpeg(const QString &, QIODevice *i); virtual ~DecoderFFmpeg(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: //helper functions void fillBuffer(); AVFormatContext *ic; AVCodecContext *c; uint wma_st_buff, wma_idx2; int m_bitrate, wma_idx; QString m_path; qint64 m_totalTime; AVPacket m_pkt; AVPacket m_temp_pkt; qint64 m_output_at; uchar m_input_buf[INPUT_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; int64_t m_seekTime; qint64 m_skipBytes; qint64 ffmpeg_decode(uint8_t *audio); bool m_skip; #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(102<<8)+0)) AVIOContext *m_stream; #else ByteIOContext *m_stream; #endif uint8_t *m_output_buf; }; #endif // __decoder_ffmpeg_h qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/decoder_ffmpeg.cpp0000664000175000017500000003043712256224735023027 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "decoder_ffmpeg.h" // callbacks static int ffmpeg_read(void *data, uint8_t *buf, int size) { DecoderFFmpeg *d = (DecoderFFmpeg*)data; return (int)d->input()->read((char*)buf, size); } static int64_t ffmpeg_seek(void *data, int64_t offset, int whence) { DecoderFFmpeg *d = (DecoderFFmpeg*)data; int64_t absolute_pos = 0; /*if(d->input()->isSequential()) return -1;*/ switch( whence ) { case AVSEEK_SIZE: return d->input()->size(); case SEEK_SET: absolute_pos = offset; break; case SEEK_CUR: absolute_pos = d->input()->pos() + offset; break; case SEEK_END: absolute_pos = d->input()->size() - offset; default: return -1; } if(absolute_pos < 0 || absolute_pos > d->input()->size()) return -1; return d->input()->seek(absolute_pos); } // Decoder class //legacy ffmpeg support DecoderFFmpeg::DecoderFFmpeg(const QString &path, QIODevice *i) : Decoder(i) { m_bitrate = 0; m_skip = false; m_totalTime = 0; ic = 0; m_path = path; m_temp_pkt.size = 0; m_pkt.size = 0; m_pkt.data = 0; m_output_buf = 0; m_output_at = 0; m_skipBytes = 0; m_stream = 0; av_init_packet(&m_pkt); av_init_packet(&m_temp_pkt); } DecoderFFmpeg::~DecoderFFmpeg() { m_bitrate = 0; m_temp_pkt.size = 0; if (ic) av_close_input_stream(ic); if(m_pkt.data) av_free_packet(&m_pkt); if(m_output_buf) av_free(m_output_buf); if(m_stream) av_free(m_stream); } bool DecoderFFmpeg::initialize() { m_bitrate = 0; m_skip = false; m_totalTime = 0; m_seekTime = -1; av_register_all(); AVProbeData pd; uint8_t buf[PROBE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; pd.filename = m_path.toLocal8Bit().constData(); pd.buf_size = input()->peek((char*)buf, sizeof(buf) - AVPROBE_PADDING_SIZE); pd.buf = buf; if(pd.buf_size < PROBE_BUFFER_SIZE) { qWarning("DecoderFFmpeg: too small buffer size: %d bytes", pd.buf_size); return false; } AVInputFormat *fmt = av_probe_input_format(&pd, 1); if(!fmt) { qWarning("DecoderFFmpeg: usupported format"); return false; } qDebug("DecoderFFmpeg: detected format: %s", fmt->long_name); qDebug("=%s=", fmt->name); #if (LIBAVFORMAT_VERSION_INT >= ((52<<16)+(105<<8)+0)) m_stream = avio_alloc_context(m_input_buf, INPUT_BUFFER_SIZE, 0, this, ffmpeg_read, NULL, ffmpeg_seek); if(!m_stream) { qWarning("DecoderFFmpeg: unable to initialize I/O callbacks"); return false; } m_stream->seekable = !input()->isSequential(); #else m_stream = (ByteIOContext *)av_malloc(sizeof(ByteIOContext)); init_put_byte(m_stream, m_input_buf, INPUT_BUFFER_SIZE, 0, this, ffmpeg_read, NULL, ffmpeg_seek); m_stream->is_streamed = input()->isSequential(); #endif m_stream->max_packet_size = INPUT_BUFFER_SIZE; AVFormatParameters ap; memset(&ap, 0, sizeof(ap)); if(av_open_input_stream(&ic, m_stream, m_path.toLocal8Bit(), fmt, &ap) != 0) { qDebug("DecoderFFmpeg: av_open_input_stream() failed"); return false; } av_find_stream_info(ic); if(ic->pb) ic->pb->eof_reached = 0; if (input()->isSequential()) { QMap metaData; AVMetadataTag *album = av_metadata_get(ic->metadata,"album",0,0); if(!album) album = av_metadata_get(ic->metadata,"WM/AlbumTitle",0,0); AVMetadataTag *artist = av_metadata_get(ic->metadata,"artist",0,0); if(!artist) artist = av_metadata_get(ic->metadata,"author",0,0); AVMetadataTag *comment = av_metadata_get(ic->metadata,"comment",0,0); AVMetadataTag *genre = av_metadata_get(ic->metadata,"genre",0,0); AVMetadataTag *title = av_metadata_get(ic->metadata,"title",0,0); AVMetadataTag *year = av_metadata_get(ic->metadata,"WM/Year",0,0); if(!year) year = av_metadata_get(ic->metadata,"year",0,0); if(!year) year = av_metadata_get(ic->metadata,"date",0,0); AVMetadataTag *track = av_metadata_get(ic->metadata,"track",0,0); if(!track) track = av_metadata_get(ic->metadata,"WM/Track",0,0); if(!track) track = av_metadata_get(ic->metadata,"WM/TrackNumber",0,0); if(album) metaData.insert(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed()); if(artist) metaData.insert(Qmmp::ARTIST, QString::fromUtf8(artist->value).trimmed()); if(comment) metaData.insert(Qmmp::COMMENT, QString::fromUtf8(comment->value).trimmed()); if(genre) metaData.insert(Qmmp::GENRE, QString::fromUtf8(genre->value).trimmed()); if(title) metaData.insert(Qmmp::TITLE, QString::fromUtf8(title->value).trimmed()); if(year) metaData.insert(Qmmp::YEAR, year->value); if(track) metaData.insert(Qmmp::TRACK, track->value); metaData.insert(Qmmp::URL, m_path); addMetaData(metaData); } ic->flags |= AVFMT_FLAG_GENPTS; av_read_play(ic); for (wma_idx = 0; wma_idx < (int)ic->nb_streams; wma_idx++) { c = ic->streams[wma_idx]->codec; #if LIBAVCODEC_VERSION_MAJOR < 53 if (c->codec_type == CODEC_TYPE_AUDIO) #else if (c->codec_type == AVMEDIA_TYPE_AUDIO) #endif break; } if (c->channels > 0) c->request_channels = qMin(2, c->channels); else c->request_channels = 2; #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(101<<8)+0)) av_dump_format(ic,0,0,0); #else dump_format(ic,0,0,0); #endif AVCodec *codec = avcodec_find_decoder(c->codec_id); if (!codec) { qWarning("DecoderFFmpeg: unsupported codec for output stream"); return false; } if (avcodec_open(c, codec) < 0) { qWarning("DecoderFFmpeg: error while opening codec for output stream"); return false; } m_totalTime = input()->isSequential() ? 0 : ic->duration * 1000 / AV_TIME_BASE; m_output_buf = (uint8_t *)av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE*2); #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(20<<8)+0)) if(c->codec_id == CODEC_ID_SHORTEN) //ffmpeg bug workaround m_totalTime = 0; #endif #if (LIBAVUTIL_VERSION_INT >= ((50<<16)+(38<<8)+0)) if(c->sample_fmt == AV_SAMPLE_FMT_S32) configure(c->sample_rate, c->request_channels, Qmmp::PCM_S32LE); else configure(c->sample_rate, c->request_channels, Qmmp::PCM_S16LE); #else if(c->sample_fmt == SAMPLE_FMT_S32) configure(c->sample_rate, c->request_channels, Qmmp::PCM_S32LE); else configure(c->sample_rate, c->request_channels, Qmmp::PCM_S16LE); #endif if(ic->bit_rate) m_bitrate = ic->bit_rate/1000; if(c->bit_rate) m_bitrate = c->bit_rate/1000; qDebug("DecoderFFmpeg: initialize succes"); return true; } qint64 DecoderFFmpeg::totalTime() { return m_totalTime; } int DecoderFFmpeg::bitrate() { return m_bitrate; } qint64 DecoderFFmpeg::read(char *audio, qint64 maxSize) { m_skipBytes = 0; if (m_skip) { while(m_temp_pkt.size) ffmpeg_decode(m_output_buf); m_output_at = 0; m_skip = false; } if(!m_output_at) fillBuffer(); if(!m_output_at) return 0; qint64 len = qMin(m_output_at, maxSize); memcpy(audio, m_output_buf, len); m_output_at -= len; memmove(m_output_buf, m_output_buf + len, m_output_at); return len; } qint64 DecoderFFmpeg::ffmpeg_decode(uint8_t *audio) { int out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE * 2; if((m_pkt.stream_index == wma_idx)) { #if (LIBAVCODEC_VERSION_INT >= ((52<<16)+(23<<8)+0)) int l = avcodec_decode_audio3(c, (int16_t *)(audio), &out_size, &m_temp_pkt); #else int l = avcodec_decode_audio2(c, (int16_t *)(audio), &out_size, m_temp_pkt.data, m_temp_pkt.size); #endif if(c->bit_rate) m_bitrate = c->bit_rate/1000; if(l < 0) return l; m_temp_pkt.data += l; m_temp_pkt.size -= l; } if (!m_temp_pkt.size && m_pkt.data) av_free_packet(&m_pkt); return out_size; } void DecoderFFmpeg::seek(qint64 pos) { int64_t timestamp = int64_t(pos)*AV_TIME_BASE/1000; if (ic->start_time != (qint64)AV_NOPTS_VALUE) timestamp += ic->start_time; m_seekTime = timestamp; av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD); if(m_pkt.size) m_skip = true; } void DecoderFFmpeg::fillBuffer() { while(!m_output_at) { if(!m_temp_pkt.size) { if (av_read_frame(ic, &m_pkt) < 0) { m_temp_pkt.size = 0; break; } m_temp_pkt.size = m_pkt.size; m_temp_pkt.data = m_pkt.data; if(m_pkt.stream_index != wma_idx) { if(m_pkt.data) av_free_packet(&m_pkt); m_temp_pkt.size = 0; continue; } if(m_seekTime && c->codec_id == CODEC_ID_APE) { int64_t rescaledPts = av_rescale(m_pkt.pts, AV_TIME_BASE * (int64_t) ic->streams[m_pkt.stream_index]->time_base.num, ic->streams[m_pkt.stream_index]->time_base.den); m_skipBytes = (m_seekTime - rescaledPts) * c->sample_rate * 4 / AV_TIME_BASE; } else m_skipBytes = 0; m_seekTime = 0; } if(m_skipBytes > 0 && c->codec_id == CODEC_ID_APE) { while (m_skipBytes > 0) { m_output_at = ffmpeg_decode(m_output_buf); if(m_output_at < 0) break; m_skipBytes -= m_output_at; } if(m_skipBytes < 0) { qint64 size = m_output_at; m_output_at = - m_skipBytes; m_output_at = m_output_at/4*4; memmove(m_output_buf, (m_output_buf + size - m_output_at), m_output_at); m_skipBytes = 0; } } else m_output_at = ffmpeg_decode(m_output_buf); if(m_output_at < 0) { m_output_at = 0; m_temp_pkt.size = 0; if(c->codec_id == CODEC_ID_SHORTEN) { if(m_pkt.data) av_free_packet(&m_pkt); m_pkt.data = 0; break; } continue; } else if(m_output_at == 0) { if(c->codec_id == CODEC_ID_SHORTEN) continue; if(m_pkt.data) av_free_packet(&m_pkt); m_pkt.data = 0; break; } } } qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/settingsdialog.h0000664000175000017500000000345612256224735022564 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/decoderffmpegfactory.h0000664000175000017500000000445312256224735023724 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERFFMPEGFACTORY_H #define DECODERFFMPEGFACTORY_H #include #include #include #include #include #include #include #include class DecoderFFmpegFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory) public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/ffmpeg_legacy/decoderffmpegfactory.cpp0000664000175000017500000002100712256224735024251 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include extern "C"{ #include #include #if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0)) #include #endif } #include "ffmpegmetadatamodel.h" #include "settingsdialog.h" #include "decoder_ffmpeg.h" #include "decoderffmpegfactory.h" // DecoderFFmpegFactory bool DecoderFFmpegFactory::supports(const QString &source) const { foreach(QString filter, properties().filters) { QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if (regexp.exactMatch(source)) return true; } return false; } bool DecoderFFmpegFactory::canDecode(QIODevice *i) const { av_register_all(); QStringList filters = properties().filters; AVProbeData pd; uint8_t buf[PROBE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; pd.filename = 0; pd.buf_size = i->peek((char*)buf, sizeof(buf) - AVPROBE_PADDING_SIZE); pd.buf = buf; if(pd.buf_size < PROBE_BUFFER_SIZE) return false; AVInputFormat *fmt = av_probe_input_format(&pd, 1); if(!fmt) { return false; } if(filters.contains("*.wma") && !memcmp(fmt->name, "asf", 3)) return true; else if(filters.contains("*.mp3") && !memcmp(fmt->name, "mp3", 3)) return true; else if(filters.contains("*.aac") && !memcmp(fmt->name, "aac", 3)) return true; else if(filters.contains("*.ac3") && !memcmp(fmt->name, "eac3", 4)) return true; else if(filters.contains("*.dts") && !memcmp(fmt->name, "dts", 3)) return true; else if(filters.contains("*.mka") && !memcmp(fmt->name, "mka", 3)) return true; else if(filters.contains("*.vqf") && !memcmp(fmt->name, "vqf", 3)) return true; return false; } const DecoderProperties DecoderFFmpegFactory::properties() const { av_register_all(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QStringList filters; filters << "*.wma" << "*.ape"; filters = settings.value("FFMPEG_legacy/filters", filters).toStringList(); if(!avcodec_find_decoder(CODEC_ID_AAC)) { filters.removeAll("*.aac"); filters.removeAll("*.m4a"); } DecoderProperties properties; properties.name = tr("FFmpeg Plugin"); properties.filters = filters; properties.description = tr("FFmpeg Formats"); if(filters.contains("*.wma")) properties.contentTypes << "audio/x-ms-wma"; if(filters.contains("*.mp3")) properties.contentTypes << "audio/mpeg"; if(filters.contains("*.aac")) properties.contentTypes << "audio/aac" << "audio/aacp"; if(filters.contains("*.shn")) properties.contentTypes << "audio/x-ffmpeg-shorten"; if(filters.contains("*.m4a")) { properties.contentTypes << "audio/3gpp" << "audio/3gpp2" << "audio/mp4"; properties.contentTypes << "audio/MP4A-LATM" << "audio/mpeg4-generic"; properties.contentTypes << "audio/m4a"; } if(filters.contains("*.ac3")) properties.contentTypes << "audio/ac3" << "audio/eac3"; if(filters.contains("*.dts")) properties.contentTypes << "audio/dts"; if(filters.contains("*.mka")) properties.contentTypes << "audio/true-hd" << "audio/x-matroska"; properties.shortName = "ffmpeg_legacy"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = false; properties.priority = 10; return properties; } Decoder *DecoderFFmpegFactory::create(const QString &path, QIODevice *input) { return new DecoderFFmpeg(path, input); } QList DecoderFFmpegFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; avcodec_init(); avcodec_register_all(); av_register_all(); AVFormatContext *in = 0; if (av_open_input_file(&in, fileName.toLocal8Bit(), 0, 0, 0) < 0) { qDebug("DecoderFFmpegFactory: unable to open file"); return list; } FileInfo *info = new FileInfo(fileName); av_find_stream_info(in); if (useMetaData) { AVMetadataTag *album = av_metadata_get(in->metadata,"album",0,0); if(!album) album = av_metadata_get(in->metadata,"WM/AlbumTitle",0,0); AVMetadataTag *artist = av_metadata_get(in->metadata,"artist",0,0); if(!artist) artist = av_metadata_get(in->metadata,"author",0,0); AVMetadataTag *comment = av_metadata_get(in->metadata,"comment",0,0); AVMetadataTag *genre = av_metadata_get(in->metadata,"genre",0,0); AVMetadataTag *title = av_metadata_get(in->metadata,"title",0,0); AVMetadataTag *year = av_metadata_get(in->metadata,"WM/Year",0,0); if(!year) year = av_metadata_get(in->metadata,"year",0,0); if(!year) year = av_metadata_get(in->metadata,"date",0,0); AVMetadataTag *track = av_metadata_get(in->metadata,"track",0,0); if(!track) track = av_metadata_get(in->metadata,"WM/Track",0,0); if(!track) track = av_metadata_get(in->metadata,"WM/TrackNumber",0,0); if(album) info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed()); if(artist) info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(artist->value).trimmed()); if(comment) info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(comment->value).trimmed()); if(genre) info->setMetaData(Qmmp::GENRE, QString::fromUtf8(genre->value).trimmed()); if(title) info->setMetaData(Qmmp::TITLE, QString::fromUtf8(title->value).trimmed()); if(year) info->setMetaData(Qmmp::YEAR, year->value); if(track) info->setMetaData(Qmmp::TRACK, track->value); } info->setLength(in->duration/AV_TIME_BASE); av_close_input_file(in); list << info; return list; } MetaDataModel* DecoderFFmpegFactory::createMetaDataModel(const QString &path, QObject *parent) { return new FFmpegMetaDataModel(path,parent); } void DecoderFFmpegFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void DecoderFFmpegFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About FFmpeg Audio Plugin"), tr("Qmmp FFmpeg Audio Plugin")+"\n"+ QString(tr("Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6")) .arg(LIBAVFORMAT_VERSION_MAJOR) .arg(LIBAVFORMAT_VERSION_MINOR) .arg(LIBAVFORMAT_VERSION_MICRO) .arg(LIBAVCODEC_VERSION_MAJOR) .arg(LIBAVCODEC_VERSION_MINOR) .arg(LIBAVCODEC_VERSION_MICRO)+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderFFmpegFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/ffmpeg_legacy_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(ffmpeg_legacy,DecoderFFmpegFactory) qmmp-0.7.4/src/plugins/Input/modplug/0000775000175000017500000000000012256224735016242 5ustar useruserqmmp-0.7.4/src/plugins/Input/modplug/modplugmetadatamodel.cpp0000664000175000017500000001357312256224735023150 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "archivereader.h" #include "modplugmetadatamodel.h" #define MAX_MESSAGE_LENGTH 4000 ModPlugMetaDataModel::ModPlugMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_soundFile = 0; m_path = path; ArchiveReader reader(this); if(reader.isSupported(m_path)) { m_buffer = reader.unpack(m_path); } else { QFile file(m_path); if(!file.open(QIODevice::ReadOnly)) { qWarning("DetailsDialog: error: %s", qPrintable(file.errorString ())); return; } m_buffer = file.readAll(); file.close(); } m_soundFile = new CSoundFile(); m_soundFile->Create((uchar*) m_buffer.data(), m_buffer.size()); } ModPlugMetaDataModel::~ModPlugMetaDataModel() { if(m_soundFile) { m_soundFile->Destroy(); delete m_soundFile; } } QHash ModPlugMetaDataModel::audioProperties() { QHash ap; if(!m_soundFile) return ap; ap.insert(tr("File name"), m_path.section('/',-1)); QString text; switch(m_soundFile->GetType()) { case MOD_TYPE_MOD: text += "ProTracker"; break; case MOD_TYPE_S3M: text += "Scream Tracker 3"; break; case MOD_TYPE_XM: text += "Fast Tracker 2"; break; case MOD_TYPE_IT: text += "Impulse Tracker"; break; case MOD_TYPE_MED: text += "OctaMed"; break; case MOD_TYPE_MTM: text += "MTM"; break; case MOD_TYPE_669: text += "669 Composer / UNIS 669"; break; case MOD_TYPE_ULT: text += "ULT"; break; case MOD_TYPE_STM: text += "Scream Tracker"; break; case MOD_TYPE_FAR: text += "Farandole"; break; case MOD_TYPE_AMF: text += "ASYLUM Music Format"; break; case MOD_TYPE_AMS: text += "AMS module"; break; case MOD_TYPE_DSM: text += "DSIK Internal Format"; break; case MOD_TYPE_MDL: text += "DigiTracker"; break; case MOD_TYPE_OKT: text += "Oktalyzer"; break; case MOD_TYPE_DMF: text += "Delusion Digital Music Fileformat (X-Tracker)"; break; case MOD_TYPE_PTM: text += "PolyTracker"; break; case MOD_TYPE_DBM: text += "DigiBooster Pro"; break; case MOD_TYPE_MT2: text += "MT2"; break; case MOD_TYPE_AMF0: text += "AMF0"; break; case MOD_TYPE_PSM: text += "PSM"; break; default: text += "Unknown"; break; } ap.insert(tr("Type"), text); int lSongTime = m_soundFile->GetSongTime(); text = QString("%1").arg(lSongTime/60); text +=":"+QString("%1").arg(lSongTime%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Speed"), QString::number(m_soundFile->GetMusicSpeed())); ap.insert(tr("Tempo"), QString::number(m_soundFile->GetMusicTempo())); ap.insert(tr("Samples"), QString::number(m_soundFile->GetNumSamples())); ap.insert(tr("Instruments"), QString::number(m_soundFile->GetNumInstruments())); ap.insert(tr("Patterns"), QString::number(m_soundFile->GetNumPatterns())); ap.insert(tr("Channels"), QString::number(m_soundFile->GetNumChannels())); return ap; } QHash ModPlugMetaDataModel::descriptions() { QHash desc; if(!m_soundFile) return desc; char lBuffer[33]; QString text; for(uint i = 0; i < m_soundFile->GetNumSamples(); i++) { m_soundFile->GetSampleName(i, lBuffer); text += QString::fromUtf8(lBuffer) + '\n'; } text = text.trimmed(); if(!text.isEmpty()) desc.insert(tr("Samples"), text); text.clear(); for(uint i = 0; i < m_soundFile->GetNumInstruments(); i++) { m_soundFile->GetInstrumentName(i, lBuffer); text += QString::fromUtf8(lBuffer) + '\n'; } text = text.trimmed(); if(!text.isEmpty()) desc.insert(tr("Instruments"), text); text.clear(); char message[MAX_MESSAGE_LENGTH]; int length = m_soundFile->GetSongComments(message, MAX_MESSAGE_LENGTH, 80); if (length != 0) desc.insert(tr("Comment"), QString::fromUtf8(message).trimmed ()); return desc; } qmmp-0.7.4/src/plugins/Input/modplug/modplug.pro0000664000175000017500000000307112256224735020434 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decodermodplugfactory.h \ decoder_modplug.h \ settingsdialog.h \ archivereader.h \ modplugmetadatamodel.h SOURCES += decoder_modplug.cpp \ decodermodplugfactory.cpp \ settingsdialog.cpp \ archivereader.cpp \ modplugmetadatamodel.cpp TARGET = $$PLUGINS_PREFIX/Input/modplug DEFINES += HAVE_STDINT_H \ HAVE_INTTYPES_H INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/modplug_plugin_cs.ts \ translations/modplug_plugin_de.ts \ translations/modplug_plugin_zh_CN.ts \ translations/modplug_plugin_zh_TW.ts \ translations/modplug_plugin_ru.ts \ translations/modplug_plugin_pl.ts \ translations/modplug_plugin_uk_UA.ts \ translations/modplug_plugin_it.ts \ translations/modplug_plugin_tr.ts \ translations/modplug_plugin_lt.ts \ translations/modplug_plugin_nl.ts \ translations/modplug_plugin_ja.ts \ translations/modplug_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp PKGCONFIG += libmodplug QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libmodplug.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lmodplug DEFINES -= UNICODE } qmmp-0.7.4/src/plugins/Input/modplug/modplugmetadatamodel.h0000664000175000017500000000364312256224735022612 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef MODPLUGMETADATAMODEL_H #define MODPLUGMETADATAMODEL_H #include class CSoundFile; class ModPlugMetaDataModel : public MetaDataModel { Q_OBJECT public: ModPlugMetaDataModel(const QString &path, QObject *parent); ~ModPlugMetaDataModel(); QHash audioProperties(); QHash descriptions(); private: CSoundFile* m_soundFile; QByteArray m_buffer; QString m_path; }; #endif // MODPLUGMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/modplug/archivereader.h0000664000175000017500000000373112256224735021223 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ARCHIVEREADER_H #define ARCHIVEREADER_H #include #include class QProcess; /** @author Ilya Kotov */ class ArchiveReader : public QObject { Q_OBJECT public: ArchiveReader(QObject *parent = 0); ~ArchiveReader(); bool isSupported(const QString &path); QByteArray unpack(const QString &path); private: QProcess *m_process; QByteArray unzip(const QString &path); QByteArray gunzip(const QString &path); QByteArray bunzip2(const QString &path); }; #endif qmmp-0.7.4/src/plugins/Input/modplug/CMakeLists.txt0000664000175000017500000000407012256224735021003 0ustar useruserproject(libmodplug) INCLUDE(CheckIncludeFile) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # modplug pkg_search_module(MODPLUG libmodplug) # add modplug defines CHECK_INCLUDE_FILE(stdint.h STDINT_FOUND) IF(STDINT_FOUND) ADD_DEFINITIONS(-DHAVE_STDINT_H) ENDIF(STDINT_FOUND) CHECK_INCLUDE_FILE(inttypes.h INTTYPES_FOUND) IF(INTTYPES_FOUND) ADD_DEFINITIONS(-DHAVE_INTTYPES_H) ENDIF(INTTYPES_FOUND) include_directories(${MODPLUG_INCLUDE_DIRS}) link_directories(${MODPLUG_LIBRARY_DIRS}) ADD_DEFINITIONS(${MODPLUG_CFLAGS}) SET(libmodplug_SRCS decoder_modplug.cpp decodermodplugfactory.cpp modplugmetadatamodel.cpp settingsdialog.cpp archivereader.cpp ) SET(libmodplug_HDRS decoder_modplug.h ) SET(libmodplug_MOC_HDRS decodermodplugfactory.h modplugmetadatamodel.h settingsdialog.h archivereader.h ) SET(libmodplug_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libmodplug_RCC_SRCS ${libmodplug_RCCS}) QT4_WRAP_CPP(libmodplug_MOC_SRCS ${libmodplug_MOC_HDRS}) # user interface SET(libmodplug_UIS settingsdialog.ui ) QT4_WRAP_UI(libmodplug_UIS_H ${libmodplug_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(MODPLUG_FOUND) ADD_LIBRARY(modplug MODULE ${libmodplug_SRCS} ${libmodplug_MOC_SRCS} ${libmodplug_UIS_H} ${libmodplug_RCC_SRCS} ${libmodplug_HDRS}) add_dependencies(modplug qmmp) target_link_libraries(modplug ${QT_LIBRARIES} -lqmmp ${MODPLUG_LDFLAGS}) install(TARGETS modplug DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(MODPLUG_FOUND) qmmp-0.7.4/src/plugins/Input/modplug/decodermodplugfactory.h0000664000175000017500000000446412256224735023010 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERMODPLUGFACTORY_H #define DECODERMODPLUGFACTORY_H #include #include #include #include #include #include #include #include class DecoderModPlugFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/modplug/decodermodplugfactory.cpp0000664000175000017500000001301412256224735023332 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include "settingsdialog.h" #include "modplugmetadatamodel.h" #include "decoder_modplug.h" #include "archivereader.h" #include "decodermodplugfactory.h" // DecoderModPlugFactory bool DecoderModPlugFactory::supports(const QString &source) const { foreach(QString filter, properties().filters) { QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if (regexp.exactMatch(source)) return true; } return false; } bool DecoderModPlugFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderModPlugFactory::properties() const { DecoderProperties properties; properties.name = tr("ModPlug Plugin"); properties.filters << "*.amf" << "*.ams" << "*.dbm" << "*.dbf" << "*.dsm" << "*.far" << "*.mdl"; properties.filters << "*.stm" << "*.ult" << "*.j2b" << "*.mt2" << "*.mdz" << "*.mdr" << "*.mdgz"; properties.filters << "*.mdbz" << "*.mod" << "*.s3z" << "*.s3r" << "*.s3gz" << "*.s3m" << "*.xmz"; properties.filters << "*.xmr" << "*.xmgz" << "*.itz" << "*.itr" << "*.itgz" << "*.dmf" "*.umx"; properties.filters << "*.it" << "*.669" << "*.xm" << "*.mtm" << "*.psm" << "*.ft2"; properties.description = tr("ModPlug Files"); //properties.contentType = ; properties.shortName = "modplug"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = true; properties.protocols << "file"; return properties; } Decoder *DecoderModPlugFactory::create(const QString &path, QIODevice *input) { Q_UNUSED(input); return new DecoderModPlug(path); } QList DecoderModPlugFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); if (!useMetaData || settings.value("UseFileName", false).toBool()) { list << new FileInfo(fileName); list.at(0)->setMetaData(Qmmp::TITLE, fileName.section('/',-1)); return list; } ArchiveReader reader(0); QByteArray buffer; if (reader.isSupported(fileName)) { buffer = reader.unpack(fileName); } else { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { qWarning("DecoderModPlugFactory: error: %s", qPrintable(file.errorString ())); return list; } buffer = file.readAll(); file.close(); } CSoundFile* soundFile = new CSoundFile(); soundFile->Create((uchar*) buffer.data(), buffer.size()+1); list << new FileInfo(fileName); list.at(0)->setLength((int) soundFile->GetSongTime()); list.at(0)->setMetaData(Qmmp::TITLE, QString::fromUtf8(soundFile->GetTitle())); soundFile->Destroy(); delete soundFile; return list; } MetaDataModel* DecoderModPlugFactory::createMetaDataModel(const QString &path, QObject *parent) { return new ModPlugMetaDataModel(path, parent); } void DecoderModPlugFactory::showSettings(QWidget *parent) { SettingsDialog *d = new SettingsDialog(parent); d->show(); } void DecoderModPlugFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About ModPlug Audio Plugin"), tr("Qmmp ModPlug Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Based on the Modplug Plugin for Xmms")+"\n"+ tr("Modplug Plugin developers:")+"\n"+ tr("Olivier Lapicque ")+"\n"+ tr("Kenton Varda ")+"\n"+ tr("Konstanty Bialkowski ")); } QTranslator *DecoderModPlugFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/modplug_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(modplug,DecoderModPlugFactory) qmmp-0.7.4/src/plugins/Input/modplug/settingsdialog.cpp0000664000175000017500000002013112256224735021763 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "decoder_modplug.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ModPlug"); //general ui.noiseCheckBox->setChecked(settings.value("NoiseReduction", false).toBool()); ui.fileNameCheckBox->setChecked(settings.value("UseFileName", false).toBool()); ui.amigaCheckBox->setChecked(settings.value("GrabAmigaMOD", true).toBool()); //settings.value("Oversampling", true).toBool(); //settings.value("VolumeRamp", true).toBool(); //settings.value("FastInfo", true).toBool(); //channels number if (settings.value("Channels", 2).toInt() == 2) ui.stereoRadioButton->setChecked(true); else ui.monoRadioButton->setChecked(true); //bits number if (settings.value("Bits", 16).toInt() == 8) ui.bit8RadioButton->setChecked(true); else ui.bit16RadioButton->setChecked(true); //resampling frequency int freq = settings.value("Frequency", 44100).toInt(); if (freq == 48000) ui.khz48RadioButton->setChecked(true); else if (freq == 44100) ui.khz44RadioButton->setChecked(true); else if (freq == 22050) ui.khz22RadioButton->setChecked(true); else ui.khz11RadioButton->setChecked(true); //resampling mode int res = settings.value("ResamplineMode", SRCMODE_POLYPHASE).toInt(); if (res == SRCMODE_NEAREST) ui.resampNearestRadioButton->setChecked(true); else if (res == SRCMODE_LINEAR) ui.resampLinearRadioButton->setChecked(true); else if (res == SRCMODE_SPLINE) ui.resampSplineRadioButton->setChecked(true); else ui.resampPolyphaseRadioButton->setChecked(true); //reverberation ui.reverbGroupBox->setChecked(settings.value("Reverb", false).toBool()); ui.reverbDepthSlider->setValue(settings.value("ReverbDepth", 30).toInt()); ui.reverbDelaySlider->setValue(settings.value("ReverbDelay", 100).toInt()); //surround ui.surGroupBox->setChecked(settings.value("Surround", true).toBool()); ui.surDepthSlider->setValue(settings.value("SurroundDepth", 20).toInt()); ui.surDelaySlider->setValue(settings.value("SurroundDelay", 20).toInt()); //bass ui.bassGroupBox->setChecked(settings.value("Megabass", false).toBool()); ui.bassAmountSlider->setValue(settings.value("BassAmount", 40).toInt()); ui.bassRangeSlider->setValue(settings.value("BassRange", 30).toInt()); //preamp ui.preampGroupBox->setChecked(settings.value("PreAmp", false).toBool()); connect(ui.preampSlider, SIGNAL(valueChanged(int)), SLOT(setPreamp(int))); ui.preampSlider->setValue(int(settings.value("PreAmpLevel", 0.0f).toDouble()*10)); //looping int l = settings.value("LoopCount", 0).toInt(); if (l == 0) ui.dontLoopRadioButton->setChecked(true); else if (l < 0) ui.loopForeverRadioButton->setChecked(true); else { ui.loopRadioButton->setChecked(true); ui.loopSpinBox->setValue(l); } settings.endGroup(); connect(ui.buttonBox, SIGNAL(clicked (QAbstractButton *)), SLOT(exec(QAbstractButton *))); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::writeSettings() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ModPlug"); //general settings.setValue("NoiseReduction", ui.noiseCheckBox->isChecked()); settings.setValue("UseFileName", ui.fileNameCheckBox->isChecked()); settings.setValue("GrabAmigaMOD", ui.amigaCheckBox->isChecked()); //settings.value("Oversampling", true).toBool(); //settings.value("VolumeRamp", true).toBool(); //settings.value("FastInfo", true).toBool(); //channels number settings.setValue("Channels", ui.stereoRadioButton->isChecked() ? 2 : 1 ); //bits number settings.setValue("Bits", ui.bit8RadioButton->isChecked() ? 8 : 16 ); //resampling frequency if (ui.khz48RadioButton->isChecked()) settings.setValue("Frequency", 48000); else if (ui.khz44RadioButton->isChecked()) settings.setValue("Frequency", 44100); else if (ui.khz22RadioButton->isChecked()) settings.setValue("Frequency", 22050); else settings.setValue("Frequency", 11025); //resampling mode if (ui.resampNearestRadioButton->isChecked()) settings.setValue("ResamplineMode", SRCMODE_NEAREST); else if (ui.resampLinearRadioButton->isChecked()) settings.setValue("ResamplineMode", SRCMODE_LINEAR); else if (ui.resampSplineRadioButton->isChecked()) settings.setValue("ResamplineMode", SRCMODE_SPLINE); else settings.setValue("ResamplineMode", SRCMODE_POLYPHASE); //reverberation settings.setValue("Reverb", ui.reverbGroupBox->isChecked()); settings.setValue("ReverbDepth", ui.reverbDepthSlider->value()); settings.setValue("ReverbDelay", ui.reverbDelaySlider->value()); //surround settings.setValue("Surround", ui.surGroupBox->isChecked()); settings.setValue("SurroundDepth", ui.surDepthSlider->value()); settings.setValue("SurroundDelay", ui.surDelaySlider->value()); //bass settings.setValue("Megabass", ui.bassGroupBox->isChecked()); settings.setValue("BassAmount", ui.bassAmountSlider->value()); settings.setValue("BassRange", ui.bassRangeSlider->value()); //preamp settings.setValue("PreAmp", ui.preampGroupBox->isChecked()); connect(ui.preampSlider, SIGNAL(valueChanged(int)), SLOT(setPreamp(int))); settings.setValue("PreAmpLevel", (double) ui.preampSlider->value()/10); //looping if (ui.dontLoopRadioButton->isChecked()) settings.setValue("LoopCount", 0); else if (ui.loopForeverRadioButton->isChecked()) settings.setValue("LoopCount", -1); else settings.setValue("LoopCount", ui.loopSpinBox->value()); settings.endGroup(); //apply settings for the created decoder if (DecoderModPlug::instance()) { //DecoderModPlug::instance()->mutex()->lock(); DecoderModPlug::instance()->readSettings(); //DecoderModPlug::instance()->mutex()->unlock(); } } void SettingsDialog::setPreamp(int preamp) { ui.preampLabel->setText(QString("%1").arg((double) preamp/10)); } void SettingsDialog::exec(QAbstractButton *button) { switch ((int) ui.buttonBox->buttonRole(button)) { case QDialogButtonBox::AcceptRole: writeSettings(); accept(); break; case QDialogButtonBox::ApplyRole: writeSettings(); break; } } qmmp-0.7.4/src/plugins/Input/modplug/settingsdialog.ui0000664000175000017500000006713112256224735021631 0ustar useruser SettingsDialog 0 0 468 382 ModPlug Plugin Settings 6 6 6 0 Quality 0 0 Resolution 16 bit 8 bit 0 0 Channels Stereo Mono (downmix) 0 0 Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) 0 0 Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb true true Depth (%) Qt::Horizontal 10 20 40 0 QFrame::Panel QFrame::Sunken 0 Qt::AlignCenter false 2 100 Qt::Horizontal Delay (ms) Qt::Horizontal 10 20 35 0 QFrame::Panel QFrame::Sunken 40 Qt::AlignCenter false 2 40 200 Qt::Horizontal Bass Boost true true Amount (%) Qt::Horizontal 10 20 40 0 QFrame::Panel QFrame::Sunken 0 Qt::AlignCenter false 2 100 Qt::Horizontal Range (Hz) Qt::Horizontal 10 20 35 0 QFrame::Panel QFrame::Sunken 10 Qt::AlignCenter false 2 10 100 Qt::Horizontal Surround true Depth (%) Qt::Horizontal 10 20 35 0 QFrame::Panel QFrame::Sunken 0 Qt::AlignCenter 100 Qt::Horizontal Delay (ms) Qt::Horizontal 10 20 35 0 QFrame::Panel QFrame::Sunken 5 Qt::AlignCenter 5 40 Qt::Horizontal Preamp true Volume Qt::Horizontal 10 20 35 0 QFrame::Panel QFrame::Sunken 0 Qt::AlignCenter false 2 -30 30 0 Qt::Horizontal QSlider::TicksBelow 30 Note: Setting the preamp too high may cause clipping! Qt::AlignCenter Misc General Use filename as song title Noise reduction false Fast playlist info false Play Amiga MOD Looping Don't loop Loop 100 1 time(s) Qt::Horizontal 10 20 Loop forever Qt::Vertical 20 40 Qt::Horizontal QSizePolicy::Preferred 211 20 0 0 QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok reverbDepthSlider valueChanged(int) label_9 setNum(int) 219 118 199 85 reverbDelaySlider valueChanged(int) label_10 setNum(int) 191 172 219 150 surDepthSlider valueChanged(int) label_11 setNum(int) 200 253 199 231 surDelaySlider valueChanged(int) label_12 setNum(int) 193 316 187 276 bassAmountSlider valueChanged(int) label_13 setNum(int) 408 118 420 87 bassRangeSlider valueChanged(int) label_14 setNum(int) 392 159 397 137 buttonBox rejected() SettingsDialog reject() 294 362 170 371 qmmp-0.7.4/src/plugins/Input/modplug/translations/0000775000175000017500000000000012256224735020763 5ustar useruserqmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_pl_PL.ts0000664000175000017500000003023312256224735025447 0ustar useruser DecoderModPlugFactory ModPlug Plugin Wtyczka ModPlug ModPlug Files Pliki ModPlug About ModPlug Audio Plugin O wtyczce ModPlug Audio Qmmp ModPlug Audio Plugin Wtyczka ModPlug Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Oparty na wtyczce Modplug dla Xmms Modplug Plugin developers: Twórcy wtyczki Modplug: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Nazwa pliku Type Typ Length Długość Speed Prędkość Tempo Tempo Samples Sample Instruments Instrumenty Patterns Szablony Channels Kanały Comment Komentarz SettingsDialog ModPlug Plugin Settings Ustawienia wtyczki ModPlug Quality Jakość Resolution Rozdzielczość 16 bit 16-bitów 8 bit 8-bitów Channels Kanały Stereo Stereo Mono (downmix) Mono (downmix) Resampling Resamplowanie Nearest (fastest) Najbliższe (najszybsze) Linear (fast) Liniowe (szybkie) Spline (good quality) Spline (dobra jakość) 8-tap Fir (extremely high quality) 8-tap FIR (bardzo wysoka jakość) Sampling Rate Próbkowanie 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Efekty Reverb Reverb Depth (%) Głębia 0 Delay (ms) Opóźnienie (ms) 40 Bass Boost Wzmocnienie basu Amount (%) Poziom (%) Range (Hz) Zasięg (Hz) 10 Surround 5 Preamp Wzmocnienie sygnału Volume Głośność Note: Setting the preamp too high may cause clipping! Uwaga: Ustawienie preamp na zbyt wysokim poziomie może powodować zacinanie się utworu! Misc Inne General Ogólne Use filename as song title Użyj nazwy pliku jako tytułu utworu Noise reduction Redukcja szumów Fast playlist info Szybkie info playlisty Play Amiga MOD Odtwarzaj Amiga MOD Looping Zapętlanie Don't loop Nie zapętlaj Loop Pętla time(s) raz(y) Loop forever Zapętlaj w nieskończoność qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_pt_BR.ts0000664000175000017500000003071512256224735025454 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Files About ModPlug Audio Plugin Qmmp ModPlug Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Type Length Speed Tempo Samples Instruments Patterns Channels Comment SettingsDialog ModPlug Plugin Settings Quality Resolution 16 bit 8 bit Channels Stereo Mono (downmix) Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb Depth (%) 0 Delay (ms) 40 Bass Boost Amount (%) Range (Hz) 10 Surround 5 Preamp Volume Note: Setting the preamp too high may cause clipping! Misc General Use filename as song title Noise reduction Fast playlist info Play Amiga MOD Looping Don't loop Loop time(s) Loop forever qmmp-0.7.4/src/plugins/Input/modplug/translations/translations.qrc0000664000175000017500000000152112256224735024212 0ustar useruser modplug_plugin_ru.qm modplug_plugin_uk_UA.qm modplug_plugin_zh_CN.qm modplug_plugin_zh_TW.qm modplug_plugin_tr.qm modplug_plugin_cs.qm modplug_plugin_pt_BR.qm modplug_plugin_de.qm modplug_plugin_pl_PL.qm modplug_plugin_fr.qm modplug_plugin_it.qm modplug_plugin_kk.qm modplug_plugin_lt.qm modplug_plugin_hu.qm modplug_plugin_nl.qm modplug_plugin_ja.qm modplug_plugin_sk.qm modplug_plugin_es.qm modplug_plugin_he.qm modplug_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_zh_CN.ts0000664000175000017500000003030412256224735025441 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug 插件 ModPlug Files ModPlug 文件 About ModPlug Audio Plugin 关于 ModPlug 音频插件 Qmmp ModPlug Audio Plugin Qmmp ModPlug 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms 基于 Modplug 的 Xmms 插件 Modplug Plugin developers: ModPlug 插件开发者: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name 文件名 Type 类型 Length 长度 Speed 速度 Tempo 节拍 Samples 取样率 Instruments 乐器 Patterns 结构 Channels 声音通道 Comment 备注 SettingsDialog ModPlug Plugin Settings ModPlug 插件设置 Quality 品质 Resolution 分辨率 16 bit 16 位 8 bit 8 位 Channels 声音通道 Stereo 立体声 Mono (downmix) 单声道 Resampling 重取样 Nearest (fastest) 最近(最快) Linear (fast) 直线(快) Spline (good quality) 曲线(好品质) 8-tap Fir (extremely high quality) 8-Tap FIR (最高品质) Sampling Rate 取样率 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects 特效 Reverb 余响 0 0 40 40 Bass Boost 低音提升 10 10 Surround 环绕 5 5 Preamp 前置放大器 Volume 音量 Misc 杂项 General 常规 Use filename as song title 使用文件名为曲目标题 Noise reduction 噪声抑制 Fast playlist info 快速播放列表信息 Play Amiga MOD 播放 Amiga MOD Looping 循环 Don't loop 不循环 Loop 循环 time(s) (秒) 时间 Loop forever 永远循环 Depth (%) 深度 (%) Delay (ms) 延迟 (ms) Amount (%) 总计 (%) Range (Hz) 范围 (Hz) Note: Setting the preamp too high may cause clipping! 注释:设置前置放大器 太高可能会产生削波现象! qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_zh_TW.ts0000664000175000017500000003030412256224735025473 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug 插件 ModPlug Files ModPlug 檔案 About ModPlug Audio Plugin 關於 ModPlug 聲訊插件 Qmmp ModPlug Audio Plugin Qmmp ModPlug 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms 基於 Modplug 的 Xmms 插件 Modplug Plugin developers: ModPlug 插件開發: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name 文件名 Type 類別 Length 長度 Speed 速度 Tempo 節拍 Samples 取樣率 Instruments 樂器 Patterns 架構 Channels 聲音通道 Comment 備註 SettingsDialog ModPlug Plugin Settings ModPlug 插件設定 Quality 品質 Resolution 解析度 16 bit 16 位 8 bit 8 位 Channels 聲道 Stereo 立體聲 Mono (downmix) 單聲道 Resampling 重取樣 Nearest (fastest) 最近(最快) Linear (fast) 直線(快) Spline (good quality) 曲線(好品質) 8-tap Fir (extremely high quality) 8-Tap FIR (最高品質) Sampling Rate 取樣率 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects 特效 Reverb 餘響 0 0 40 40 Bass Boost 低音提升 10 10 Surround 自動換行 5 5 Preamp 前置放大器 Volume 音量 Misc 雜項 General 常規 Use filename as song title 使用檔名為曲目標題 Noise reduction 聲音雜訊抑制 Fast playlist info 快速播放清單資訊 Play Amiga MOD 播放 Amiga MOD Looping 循環 Don't loop 不循環 Loop 循環 time(s) (秒) 時間 Loop forever 永遠循環 Depth (%) 深度 (%) Delay (ms) 延遲 (ms) Amount (%) 總計 (%) Range (Hz) 範圍 (Hz) Note: Setting the preamp too high may cause clipping! 註釋:設定前置放大器 太高可能會產生削波現象! qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_gl_ES.ts0000664000175000017500000003057112256224735025437 0ustar useruser DecoderModPlugFactory ModPlug Plugin Engadido ModPlug ModPlug Files Ficheiros ModPlug About ModPlug Audio Plugin Sobre o engadido ModPlug Qmmp ModPlug Audio Plugin Engadido ModPlug de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Baseado no engadido ModPlug para Xmms Modplug Plugin developers: Desenvolvedores do engadido ModPlug: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Nome do ficheiro Type Tipo Length Lonxitude Speed Velocidade Tempo Tempo Samples Mostras Instruments Instrumentos Patterns Patróns Channels Canais Comment Comentarios SettingsDialog ModPlug Plugin Settings Preferencias do engadido ModPlug Quality Calidade Resolution Resolución 16 bit 16 bit 8 bit 8 bit Channels Canais Stereo Estéreo Mono (downmix) Mono (downmix) Resampling Remostrar Nearest (fastest) O máis próximo (o máis rápido) Linear (fast) Linear (rápido) Spline (good quality) Estriado (calidade boa) 8-tap Fir (extremely high quality) 8-tap-Fir (calidade moi boa) Sampling Rate Taxa de mostra 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Efectos Reverb Reverberación Depth (%) Profundidade (%) 0 0 Delay (ms) Duración (ms) 40 40 Bass Boost Bass Boost Amount (%) Cantidade (%) Range (Hz) Rango (HZ) 10 10 Surround Surround 5 5 Preamp Preamplificación Volume Volume Note: Setting the preamp too high may cause clipping! Nota: Establecer o preamplificador demasiado algo pode causar recorte do son! Misc Miscelánea General Xeral Use filename as song title Usar título da canción como nome do ficheiro Noise reduction Redución de ruído Fast playlist info Información rápida de pista de reprodución Play Amiga MOD MOD Play Amiga Looping Repetir Don't loop Non repetir Loop Repetición time(s) tempo(s) Loop forever Repetir indefinidamente qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_uk_UA.ts0000664000175000017500000003132212256224735025445 0ustar useruser DecoderModPlugFactory ModPlug Plugin Модуль ModPlug ModPlug Files Файли ModPlug About ModPlug Audio Plugin Про аудіо-модуль ModPlug Qmmp ModPlug Audio Plugin Аудіо-модуль для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms На базі модуля Modplug для Xmms Modplug Plugin developers: Розробники модуля ModPlug: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Ім'я файлу Type Тип Length Тривалість Speed Швидкість Tempo Темп Samples Семпли Instruments Інструменти Patterns Зразків Channels Канали Comment Коментар SettingsDialog ModPlug Plugin Settings Налаштування модуля ModPlug Quality Якість Resolution Роздільність 16 bit 16 біт 8 bit 8 біт Channels Канали Stereo Стерео Mono (downmix) Моно Resampling Передискретизація Nearest (fastest) Nearest (найшвидше) Linear (fast) Linear (швидко) Spline (good quality) Spline (висока якість) 8-tap Fir (extremely high quality) 8-tap Fir (найвища якість) Sampling Rate Дискретизація 48000 Hz 48000 Гц 44100 Hz 44100 Гц 22050 Hz 22050 Гц 11025 Hz 11025 Гц Effects Ефекти Reverb Реверберація Depth (%) Глибина (%) 0 Delay (ms) Затримка (мс) 40 Bass Boost Підсилення басів Amount (%) Об'єм (%) Range (Hz) Діапазон (Гц) 10 Surround Оточення 5 Preamp Підсилення Volume Гучність Note: Setting the preamp too high may cause clipping! Примітка: встановлення занадто високого підсилення може викликати зрізання! Misc Різне General Загальне Use filename as song title Використовувати і'мя файла як ім'я фрагменту Noise reduction Шумопридушення Fast playlist info Швидка інформація списку Play Amiga MOD Грати Amiga MOD Looping Зациклення Don't loop Не зациклювати Loop Цикл time(s) раз(ів) Loop forever Цикл назавжди qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_de.ts0000664000175000017500000003044312256224735025034 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug-Modul ModPlug Files ModPlug-Dateien About ModPlug Audio Plugin Über ModPlug-Audio-Modul Qmmp ModPlug Audio Plugin Qmmp ModPlug-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Basiert auf dem Modplug-Modul für Xmms Modplug Plugin developers: Entwickler des Modplug-Moduls: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Dateiname Type Typ Length Länge Speed Geschwindigkeit Tempo Tempo Samples Samples Instruments Instrumente Patterns Pattern Channels Kanäle Comment Kommentar SettingsDialog ModPlug Plugin Settings Einstellungen ModPlug-Modul Quality Qualität Resolution Auflösung 16 bit 16 Bit 8 bit 8 Bit Channels Kanäle Stereo Stereo Mono (downmix) Mono (Downmix) Resampling Resampling Nearest (fastest) Nearest (sehr schnell) Linear (fast) Linear (schnell) Spline (good quality) Spline (hohe Qualität) 8-tap Fir (extremely high quality) 8-tap FIR (sehr hohe Qualität) Sampling Rate Abtastrate 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Effekte Reverb Hall 0 0 40 40 Bass Boost Bass Boost 10 10 Surround Surround 5 5 Preamp Vorverstärkung Volume Pegel Misc Verschiedenes General Allgemein Use filename as song title Dateiname als Titel verwenden Noise reduction Rauschunterdrückung Fast playlist info Play Amiga MOD Amiga MOD abspielen Looping Wiederholung Don't loop Keine Loop Schleifen time(s) mal Loop forever Endlosschleife Depth (%) Intensität (%) Delay (ms) Verzögerung (ms) Amount (%) Pegel (%) Range (Hz) Bereich (Hz) Note: Setting the preamp too high may cause clipping! Hinweis: Ein zu hoch gewählter Vorverstärkungspegel kann Signalübersteuerungen verursachen. qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_cs.ts0000664000175000017500000003050512256224735025050 0ustar useruser DecoderModPlugFactory ModPlug Plugin Modul ModPlug ModPlug Files Soubory ModPlug About ModPlug Audio Plugin O modulu ModPlug Qmmp ModPlug Audio Plugin Vstupní modul Qmmp ModPlug Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Založeno na modulu Modplug pro XMMS Modplug Plugin developers: Vývojáři modulu ModPlug: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Název souboru Type Typ Length Délka Speed Rychlost Tempo Tempo Samples Vzorky Instruments Nástroje Patterns Patterny Channels Kanály Comment Poznámka SettingsDialog ModPlug Plugin Settings Nastavení modulu ModPlug Quality Kvalita Resolution Rozlišení 16 bit 16 bitů 8 bit 8 bitů Channels Kanály Stereo Stereo Mono (downmix) Mono (mix) Resampling Převzorkování Nearest (fastest) Nejbližší (nejrychlejší) Linear (fast) Lineární (rychlé) Spline (good quality) Kubické (spline) (kvalitní) 8-tap Fir (extremely high quality) FIR 8. řádu (extrémní kvalita) Sampling Rate Vzorkovací frekvence 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Efekty Reverb Dozvuk Depth (%) Hloubka (%) 0 0 Delay (ms) Zpoždění (ms) 40 40 Bass Boost Zdůraznění basů Amount (%) Síla (%) Range (Hz) Rozsah (Hz) 10 10 Surround Surround 5 5 Preamp Předzesílení Volume Hlasitost Note: Setting the preamp too high may cause clipping! Pozor: Nastavení příliš vysokého předzesílení může způsobit přebuzení! Misc Různé General Obecné Use filename as song title Použít název souboru jako název skladby Noise reduction Odstranění šumu Fast playlist info Rychlé informace o seznamu skladeb Play Amiga MOD Přehrát Amiga modul Looping Smyčky Don't loop Neopakovat Loop Opakovat time(s) krát Loop forever Donekonečna qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_es.ts0000664000175000017500000003053312256224735025053 0ustar useruser DecoderModPlugFactory ModPlug Plugin Módulo ModPlug ModPlug Files Archivos ModPlug About ModPlug Audio Plugin Acerca del módulo de audio ModPlug Qmmp ModPlug Audio Plugin Módulo de audio ModPlug para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Basado en el módulo Modplug para Xmms Modplug Plugin developers: Desarrolladores del módulo Modplug: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Nombre del archivo Type Tipo Length Duración Speed Velocidad Tempo Tempo Samples Muestreo Instruments Instrumentos Patterns Patrones Channels Canales Comment Comentario SettingsDialog ModPlug Plugin Settings Configuración del módulo ModPlug Quality Calidad Resolution Resolución 16 bit 16 bit 8 bit 8 bit Channels Canales Stereo Estéreo Mono (downmix) Mono (downmix) Resampling Rehacer muestreo Nearest (fastest) Próximo (muy rápido) Linear (fast) Linear (rápido) Spline (good quality) Spline (buena calidad) 8-tap Fir (extremely high quality) 8-tap FIR (calidad muy alta) Sampling Rate Tasa de muestreo 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Efectos Reverb Reverberación 0 0 40 40 Bass Boost Refuerzo de graves 10 10 Surround Envolvente 5 5 Preamp Preamplificar Volume Volumen Misc Varios General General Use filename as song title Usar el nombre de archivo como título Noise reduction Reducir ruido Fast playlist info Lista de reproducción rápida Play Amiga MOD Reproducir Amiga MOD Looping Repeticiones Don't loop No repetir Loop Repetir time(s) tiempo(s) Loop forever Repetir siempre Depth (%) Intensidad (%) Delay (ms) Retardo (ms) Amount (%) Cantidad (%) Range (Hz) Rango (Hz) Note: Setting the preamp too high may cause clipping! Nota: ¡Una preamplificación muy alta puede producir cortes! qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_fr.ts0000664000175000017500000003071512256224735025055 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Files About ModPlug Audio Plugin Qmmp ModPlug Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Type Length Speed Tempo Samples Instruments Patterns Channels Comment SettingsDialog ModPlug Plugin Settings Quality Resolution 16 bit 8 bit Channels Stereo Mono (downmix) Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb Depth (%) 0 Delay (ms) 40 Bass Boost Amount (%) Range (Hz) 10 Surround 5 Preamp Volume Note: Setting the preamp too high may cause clipping! Misc General Use filename as song title Noise reduction Fast playlist info Play Amiga MOD Looping Don't loop Loop time(s) Loop forever qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_he.ts0000664000175000017500000003146612256224735025046 0ustar useruser DecoderModPlugFactory ModPlug Plugin תוספת ModPlug ModPlug Files קבצי ModPlug About ModPlug Audio Plugin אודות תוספת שמע ModPlug Qmmp ModPlug Audio Plugin תוספת שמע ModPlug ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms מבוססת על התוספת Modplug עבור Xmms Modplug Plugin developers: מפתחי תוספת Modplug: Olivier Lapicque <olivierl@jps.net> ‭Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> ‭Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ‭Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name שם קובץ Type טיפוס Length אריכות Speed מהירות Tempo קצב Samples דוגמיות דגימות Instruments מכשירים Patterns דפוסים Channels ערוצים Comment הערה SettingsDialog ModPlug Plugin Settings הגדרות תוספת ModPlug Quality איכות Resolution רזולוציה 16 bit 16 סיביות 8 bit 8 סיביות Channels ערוצים Stereo סטריאו Mono (downmix) מונו (downmix) Resampling דגימה מחודשת Nearest (fastest) הכי קרובה (הכי מהירה) Linear (fast) לינארית (מהירה) Spline (good quality) משוננת (איכות טובה) 8-tap Fir (extremely high quality) 8-tap Fir (איכות גבוהה ביותר) Sampling Rate שיעור דגימה 48000 Hz 48000 הרץ 44100 Hz 44100 הרץ 22050 Hz 22050 הרץ 11025 Hz 11025 הרץ Effects אפקטים Reverb הדהוד Depth (%) עומק (%) 0 Delay (ms) שיהוי (מ״ש) 40 Bass Boost מינוף בס Amount (%) כמות (%) Range (Hz) מטווח (הרץ) 10 Surround מוקף סראונד 5 Preamp מגבר קדמי Volume עוצמת קול Note: Setting the preamp too high may cause clipping! לתשומת לבך: הגדרת מגבר קדמי בצורה גבוהה מדי עשויה לגרום לקיצוץ! Misc שונות General כללי Use filename as song title השתמש בשם קובץ ככותרת שיר Noise reduction הפחתת רעש Fast playlist info מידע רשימת השמעה מהיר Play Amiga MOD נגן Amiga MOD Looping לולאה Don't loop אל תקיים לולאה Loop לולאה time(s) פעמים Loop forever תמידית לולאה נצחית qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_hu.ts0000664000175000017500000003071512256224735025062 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Files About ModPlug Audio Plugin Qmmp ModPlug Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Type Length Speed Tempo Samples Instruments Patterns Channels Comment SettingsDialog ModPlug Plugin Settings Quality Resolution 16 bit 8 bit Channels Stereo Mono (downmix) Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb Depth (%) 0 Delay (ms) 40 Bass Boost Amount (%) Range (Hz) 10 Surround 5 Preamp Volume Note: Setting the preamp too high may cause clipping! Misc General Use filename as song title Noise reduction Fast playlist info Play Amiga MOD Looping Don't loop Loop time(s) Loop forever qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_ja.ts0000664000175000017500000003120012256224735025026 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug プラグイン ModPlug Files ModoPlug ファイル About ModPlug Audio Plugin ModoPlug 音響プラグインについて Qmmp ModPlug Audio Plugin QMMP ModoPlug 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms XMMS 用 ModPlug プラグインを基に作成 Modplug Plugin developers: ModPlug プラグインの開発者: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name ファイル名 Type Length 長さ Speed 速さ Tempo テンポ Samples サンプル Instruments 楽器 Patterns パターン Channels チャンネル Comment コメント SettingsDialog ModPlug Plugin Settings ModPlug プラグイン設定 Quality 品質 Resolution 解像度 16 bit 16ビット 8 bit 8ビット Channels チャンネル Stereo ステレオ Mono (downmix) モノラル (downmix) Resampling リサンプリング Nearest (fastest) 最近傍 (最速) Linear (fast) 線形 (高速) Spline (good quality) スプライン (高品質) 8-tap Fir (extremely high quality) 8-tap Fir (究極最高品質) Sampling Rate サンプリングレート 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects エフェクト Reverb リバーブ Depth (%) 深度 (%) 0 0 Delay (ms) 残響時間 (ミリ秒) 40 40 Bass Boost 低音ブースト Amount (%) 量 (%) Range (Hz) 帯域幅 (Hz) 10 10 Surround サラウンド 5 5 Preamp プリアンプ Volume 音量 Note: Setting the preamp too high may cause clipping! ご注意: プリアンプ値を高くし過ぎると クリッピング現象を起こすおそれがあります! Misc その他いろいろ General 一般 Use filename as song title ファイル名を曲名として使う Noise reduction ノイズ軽減 Fast playlist info 高速プレイリスト情報 Play Amiga MOD Amiga MOD で再生 Looping 繰り返し Don't loop 繰り返さない Loop 繰り返しを [n] 回行なう 繰り返しを time(s) 回行なう Loop forever 恒久的に繰り返す qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_it.ts0000664000175000017500000003042612256224735025061 0ustar useruser DecoderModPlugFactory ModPlug Plugin Modulo ModPlug ModPlug Files Brani ModPlug About ModPlug Audio Plugin Info sul modulo audio ModPlug Qmmp ModPlug Audio Plugin Modulo audio ModPlug per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Basato sul Modulo Modplug per Xmms Modplug Plugin developers: Sviluppatori del modulo Modplug: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Nome del brano Type Tipo Length Durata Speed Velocità Tempo Tempo Samples Campionamenti Instruments Strumenti Patterns Schemi Channels Canali Comment Commento SettingsDialog ModPlug Plugin Settings Impostazioni modulo ModPlug Quality Qualità Resolution Risoluzione 16 bit 16 bit 8 bit 8 bit Channels Canali Stereo Stereo Mono (downmix) Mono (downmix) Resampling Ricampionatura Nearest (fastest) Vicinissima (molto veloce) Linear (fast) Lineare (veloce) Spline (good quality) Spline (alta qualità) 8-tap Fir (extremely high quality) 8-tap FIR (altissima qualità) Sampling Rate Campionamento 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Effetti Reverb Riverbero 0 0 40 40 Bass Boost Potenzaiamento bassi 10 10 Surround Surround 5 5 Preamp Preamplificazione Volume Pegel Misc Varie General Generale Use filename as song title Nome brano come titolo Noise reduction Riduzione fastidio Fast playlist info informazione rapida sulla lista dei brani Play Amiga MOD Esegui Amiga MOD Looping Ripetizione Don't loop Nessuna Loop Ripetere time(s) volta/e Loop forever Sempre Depth (%) Intensità (%) Delay (ms) Ritardo (ms) Amount (%) Percentuale (%) Range (Hz) campo di variazione (Hz) Note: Setting the preamp too high may cause clipping! Nota: Impostare la preamplificazione troppo alta può causare dei tagli! qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_kk.ts0000664000175000017500000003071512256224735025053 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Files About ModPlug Audio Plugin Qmmp ModPlug Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Type Length Speed Tempo Samples Instruments Patterns Channels Comment SettingsDialog ModPlug Plugin Settings Quality Resolution 16 bit 8 bit Channels Stereo Mono (downmix) Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb Depth (%) 0 Delay (ms) 40 Bass Boost Amount (%) Range (Hz) 10 Surround 5 Preamp Volume Note: Setting the preamp too high may cause clipping! Misc General Use filename as song title Noise reduction Fast playlist info Play Amiga MOD Looping Don't loop Loop time(s) Loop forever qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_lt.ts0000664000175000017500000003051212256224735025060 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Įskiepis ModPlug Files ModPlug bylos About ModPlug Audio Plugin Apie ModPlug audio įskiepį Qmmp ModPlug Audio Plugin Qmmp ModPlug audio įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Sukurta Xmms Modplug įskiepio pagrindu Modplug Plugin developers: Modplug įskiepio kūrėjai: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Bylos pavadinimas Type Tipas Length Trukmė Speed Greitis Tempo Tempas Samples Pavyzdžiai Instruments Instrumentai Patterns Pavyzdžiai Channels Kanalai Comment Komentaras SettingsDialog ModPlug Plugin Settings ModPlug įskiepio nustatymai Quality Kokybė Resolution Kokybė 16 bit 16 bit 8 bit 8 bit Channels Kanalai Stereo Stereo Mono (downmix) Mono Resampling Diskretizavimas Nearest (fastest) Arčiausias (greičiausias) Linear (fast) Linijinis (greitas) Spline (good quality) Spline (gera kokybė) 8-tap Fir (extremely high quality) 8-tap Fir (aukščiausia kokybė) Sampling Rate Dažnio keitimas 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Efektai Reverb Aidas Depth (%) Gilumas (%) 0 0 Delay (ms) Užlaikymas (ms) 40 40 Bass Boost Žemų dažnių stiprinimas Amount (%) Kiekis (%) Range (Hz) Diapazonas (Hz) 10 10 Surround Surround 5 5 Preamp Stiprinimas Volume Garsumas Note: Setting the preamp too high may cause clipping! Priminimas: Per didelis garso triprinimas gali sukelti garso trūkinėjimą! Misc Papildomi General Bendri Use filename as song title Naudoti bylos pavadinimą dainos pavadinimui Noise reduction Sumažinti triukšmą Fast playlist info Greita grojaraščio informacija Play Amiga MOD Groti Amiga MOD Looping Kartoti Don't loop Nekartoti Loop Kartoti time(s) kartą Loop forever Amžinai qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_nl.ts0000664000175000017500000003034512256224735025056 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Module ModPlug Files ModPlug Bestanden About ModPlug Audio Plugin Over de ModPlug Audio Module Qmmp ModPlug Audio Plugin Modplug Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Gebasseerd op de Modplug Module voor Xmms Modplug Plugin developers: Modplug Module ontwikkelaars: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Bestandsnaam Type Soort Length Duur Speed Snelheid Tempo Samples Samples Instruments Instrumenten Patterns Patronen Channels Kanalen Comment Commentaar SettingsDialog ModPlug Plugin Settings ModPlug Module Instellingen Quality Kwaliteit Resolution Resolutie 16 bit 8 bit Channels Kanalen Stereo Mono (downmix) Mono (downmix) Resampling Nearest (fastest) Dichstbij (snelst) Linear (fast) Lineair (snel) Spline (good quality) Cubisch (goede kwaliteit) 8-tap Fir (extremely high quality) 8-tap 'Fir' (erg goede kwaliteit) Sampling Rate Sampling frequentie 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Effecten Reverb Galm Depth (%) Diepte (%) 0 Delay (ms) Vertraging (ms) 40 Bass Boost Amount (%) Hoeveelheid (%) Range (Hz) Bereik (Hz) 10 Surround 5 Preamp Voorversterking Volume Note: Setting the preamp too high may cause clipping! Notitie: Het te hoog instellen van de voorverstelling kan veel stotteringen veroorzaken! Misc Overige General Algemeen Use filename as song title Gebruik bestandsnaam als nummertitel Noise reduction Noise verlaging Fast playlist info Snelle afspeellijst informatie Play Amiga MOD Speel Amiga MOD af Looping Herhalen Don't loop Niet herhalen Loop Herhaal time(s) aantal Loop forever Altijd herhalen qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_pl.ts0000664000175000017500000003023312256224735025054 0ustar useruser DecoderModPlugFactory ModPlug Plugin Wtyczka ModPlug ModPlug Files Pliki ModPlug About ModPlug Audio Plugin O wtyczce ModPlug Audio Qmmp ModPlug Audio Plugin Wtyczka ModPlug Audio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Oparty na wtyczce Modplug dla Xmms Modplug Plugin developers: Twórcy wtyczki Modplug: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Nazwa pliku Type Typ Length Długość Speed Prędkość Tempo Tempo Samples Sample Instruments Instrumenty Patterns Szablony Channels Kanały Comment Komentarz SettingsDialog ModPlug Plugin Settings Ustawienia wtyczki ModPlug Quality Jakość Resolution Rozdzielczość 16 bit 16-bitów 8 bit 8-bitów Channels Kanały Stereo Stereo Mono (downmix) Mono (downmix) Resampling Resamplowanie Nearest (fastest) Najbliższe (najszybsze) Linear (fast) Liniowe (szybkie) Spline (good quality) Spline (dobra jakość) 8-tap Fir (extremely high quality) 8-tap FIR (bardzo wysoka jakość) Sampling Rate Próbkowanie 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Efekty Reverb Reverb Depth (%) Głębia 0 Delay (ms) Opóźnienie (ms) 40 Bass Boost Wzmocnienie basu Amount (%) Poziom (%) Range (Hz) Zasięg (Hz) 10 Surround 5 Preamp Wzmocnienie sygnału Volume Głośność Note: Setting the preamp too high may cause clipping! Uwaga: Ustawienie preamp na zbyt wysokim poziomie może powodować zacinanie się utworu! Misc Inne General Ogólne Use filename as song title Użyj nazwy pliku jako tytułu utworu Noise reduction Redukcja szumów Fast playlist info Szybkie info playlisty Play Amiga MOD Odtwarzaj Amiga MOD Looping Zapętlanie Don't loop Nie zapętlaj Loop Pętla time(s) raz(y) Loop forever Zapętlaj w nieskończoność qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_ru.ts0000664000175000017500000003172512256224735025076 0ustar useruser DecoderModPlugFactory ModPlug Plugin Модуль ModPlug ModPlug Files Файлы ModPlug About ModPlug Audio Plugin Об аудио-модуле ModPlug Qmmp ModPlug Audio Plugin Аудио-модуль ModPlug для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Основан на базе модуля Modplug для Xmms Modplug Plugin developers: Разработчики модуля Modplug: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Имя файла Type Тип Length Длительность Speed Скорость Tempo Темп Samples Сэмплы Instruments Инструменты Patterns Образцов Channels Каналы Comment Комментарий SettingsDialog ModPlug Plugin Settings Настройки модуля ModPlug Quality Качество Resolution Разрешение 16 bit 16 бит 8 bit 8 бит Channels Каналы Stereo Стерео Mono (downmix) Моно Resampling Передискретизация Nearest (fastest) Nearest (самый быстрый) Linear (fast) Linear (быстрый) Spline (good quality) Spline (хорошее качество) 8-tap Fir (extremely high quality) 8-tap Fir (самое выскокое качество) Sampling Rate Дискретизация 48000 Hz 48000 Гц 44100 Hz 44100 Гц 22050 Hz 22050 Гц 11025 Hz 11025 Гц Effects Эффекты Reverb Затухание Depth (%) Интенсивность (%) 0 0 Delay (ms) Задержка (мс) 40 40 Bass Boost Усиление басов Amount (%) Уровень (%) Range (Hz) Диапазон (Гц) 10 10 Surround Эффект Surround (объёмное звучание) 5 5 Preamp Усиление Volume Громкость Note: Setting the preamp too high may cause clipping! Замечание: установка слишком высокого усиления может вызвать срезание! Misc Дополнительно General Общие Use filename as song title Использовать имя файла в качестве имени фрагмента Noise reduction Шумоподавление Fast playlist info Быстрое чтение информации Play Amiga MOD Воспроизводить Amiga MOD Looping Повтор Don't loop Не повторять Loop Повторять time(s) раз Loop forever Повторять всегда qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_sk.ts0000664000175000017500000003071512256224735025063 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Files About ModPlug Audio Plugin Qmmp ModPlug Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Type Length Speed Tempo Samples Instruments Patterns Channels Comment SettingsDialog ModPlug Plugin Settings Quality Resolution 16 bit 8 bit Channels Stereo Mono (downmix) Resampling Nearest (fastest) Linear (fast) Spline (good quality) 8-tap Fir (extremely high quality) Sampling Rate 48000 Hz 44100 Hz 22050 Hz 11025 Hz Effects Reverb Depth (%) 0 Delay (ms) 40 Bass Boost Amount (%) Range (Hz) 10 Surround 5 Preamp Volume Note: Setting the preamp too high may cause clipping! Misc General Use filename as song title Noise reduction Fast playlist info Play Amiga MOD Looping Don't loop Loop time(s) Loop forever qmmp-0.7.4/src/plugins/Input/modplug/translations/modplug_plugin_tr.ts0000664000175000017500000003064612256224735025076 0ustar useruser DecoderModPlugFactory ModPlug Plugin ModPlug Eklentisi ModPlug Files ModPlug Dosyaları About ModPlug Audio Plugin ModPlug Ses Eklentisi Hakkında Qmmp ModPlug Audio Plugin Qmmp ModPlug Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on the Modplug Plugin for Xmms Xmms için yazılan Modplug eklentisi temellidir Modplug Plugin developers: Olivier Lapicque <olivierl@jps.net> Olivier Lapicque <olivierl@jps.net> Kenton Varda <temporal@gauge3d.org> Kenton Varda <temporal@gauge3d.org> Konstanty Bialkowski <konstanty@ieee.org> Konstanty Bialkowski <konstanty@ieee.org> ModPlugMetaDataModel File name Dosya adı Type Tip Length Uzunluk Speed Hız Tempo Tempo Samples Örnekler Instruments Enstrümanlar Patterns Desenler Channels Kanallar Comment SettingsDialog ModPlug Plugin Settings ModPlug Eklenti Ayarları Quality Kalite Resolution Çözünürlük 16 bit 16 bit 8 bit 8 bit Channels Kanallar Stereo Stereo Mono (downmix) Mono (downmix) Resampling Yeniden örnekleme Nearest (fastest) En yakın (en hızlısı) Linear (fast) Doğrusal (hızlı) Spline (good quality) Çubuk (iyi kalitede) 8-tap Fir (extremely high quality) 8-tap Fir (en yüksek kalitede) Sampling Rate Örnekleme Oranı 48000 Hz 48000 Hz 44100 Hz 44100 Hz 22050 Hz 22050 Hz 11025 Hz 11025 Hz Effects Efektler Reverb Depth (%) Derinlik (%) 0 0 Delay (ms) Gecikme (ms) 40 40 Bass Boost Amount (%) Miktar (%) Range (Hz) Aralık (Hz) 10 10 Surround 5 5 Preamp Volume Ses Note: Setting the preamp too high may cause clipping! Misc Çeşitli General Genel Use filename as song title Şarkı başlığı için dosya adını kullan Noise reduction Gürültü azaltma Fast playlist info Play Amiga MOD Amiga MOD Oynat Looping Döngü Don't loop Döngü kurma Loop Döngü time(s) süre(s) Loop forever Sonsuz döngü qmmp-0.7.4/src/plugins/Input/modplug/decoder_modplug.h0000664000175000017500000000437512256224735021560 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_MODPLUG_H #define DECODER_MODPLUG_H #include class CSoundFile; class DecoderModPlug : public Decoder { public: DecoderModPlug(const QString &path); virtual ~DecoderModPlug(); void readSettings(); static DecoderModPlug* instance(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: //helper function void deinit(); CSoundFile *m_soundFile; int m_bps; //bits per sample QByteArray m_input_buf; //input buffer quint32 m_freq; int m_chan, m_sampleSize, m_bitrate; qint64 m_totalTime; double m_preampFactor; bool m_usePreamp; QString m_path; static DecoderModPlug* m_instance; }; #endif // DECODER_MODPLUG_H qmmp-0.7.4/src/plugins/Input/modplug/archivereader.cpp0000664000175000017500000000655512256224735021565 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "archivereader.h" ArchiveReader::ArchiveReader(QObject *parent) : QObject(parent) { m_process = new QProcess(this); } ArchiveReader::~ArchiveReader() {} bool ArchiveReader::isSupported(const QString &path) { QString lPath = path.toLower(); return lPath.endsWith(".mdz") || lPath.endsWith(".s3z") || lPath.endsWith(".xmz") || lPath.endsWith(".itz") || lPath.endsWith(".mdgz") || lPath.endsWith(".s3gz") || lPath.endsWith(".xmgz") || lPath.endsWith(".itgz") || lPath.endsWith(".mdbz") || lPath.endsWith(".s3bz") || lPath.endsWith(".xmbz") || lPath.endsWith(".itbz"); } QByteArray ArchiveReader::unpack(const QString &path) { QString lPath = path.toLower(); if (path.endsWith(".mdz") || lPath.endsWith(".s3z") || lPath.endsWith(".xmz") || lPath.endsWith(".itz")) return unzip(path); else if (lPath.endsWith(".mdgz") || lPath.endsWith(".s3gz") || lPath.endsWith(".xmgz") || lPath.endsWith(".itgz")) return gunzip(path); else if (lPath.endsWith(".mdbz")) return bunzip2(path); return QByteArray(); } QByteArray ArchiveReader::unzip(const QString &path) { QStringList args; args << "-p" << path; m_process->start("unzip", args); m_process->waitForFinished(); return m_process->readAllStandardOutput (); } QByteArray ArchiveReader::gunzip(const QString &path) { QStringList args; args << "-c" << path; m_process->start("gunzip", args); m_process->waitForFinished(); return m_process->readAllStandardOutput (); } QByteArray ArchiveReader::bunzip2(const QString &path) { QStringList args; args << "-c" << path; m_process->start("bunzip2", args); m_process->waitForFinished(); return m_process->readAllStandardOutput (); } qmmp-0.7.4/src/plugins/Input/modplug/decoder_modplug.cpp0000664000175000017500000001547112256224735022112 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ /* Based on Modplug XMMS Plugin * Authors: Kenton Varda */ #include #include #include #include #include #include #include #include #include #include #include #include #include "archivereader.h" #include "decoder_modplug.h" // Decoder class DecoderModPlug* DecoderModPlug::m_instance = 0; DecoderModPlug::DecoderModPlug(const QString &path) : Decoder(0) { m_path = path; m_freq = 0; m_bitrate = 0; m_totalTime = 0; m_chan = 0; m_soundFile = 0; m_sampleSize = 0; m_instance = this; } DecoderModPlug::~DecoderModPlug() { deinit(); m_instance = 0; } bool DecoderModPlug::initialize() { m_freq = m_bitrate = 0; m_chan = 0; m_totalTime = 0; ArchiveReader reader; if (reader.isSupported(m_path)) m_input_buf = reader.unpack(m_path); else { QFile file(m_path); if (!file.open(QIODevice::ReadOnly)) { qWarning("DecoderModPlug: error: %s", qPrintable(file.errorString ())); return false; } m_input_buf = file.readAll(); file.close(); } if (m_input_buf.isEmpty()) { qWarning("DecoderModPlug: error reading moplug file"); return false; } m_soundFile = new CSoundFile(); readSettings(); m_sampleSize = m_bps / 8 * m_chan; m_soundFile->Create((uchar*) m_input_buf.data(), m_input_buf.size()); m_bitrate = m_soundFile->GetNumChannels(); m_totalTime = (qint64) m_soundFile->GetSongTime() * 1000; configure(m_freq, m_chan, (m_bps == 8 ? Qmmp::PCM_S8 : Qmmp::PCM_S16LE)); return true; } qint64 DecoderModPlug::totalTime() { return m_totalTime; } int DecoderModPlug::bitrate() { return m_bitrate; } qint64 DecoderModPlug::read(char *audio, qint64 maxSize) { long len = m_soundFile->Read (audio, maxSize) * m_sampleSize; if (m_usePreamp) { { //apply preamp if (m_bps == 16) { long n = len >> 1; for (long i = 0; i < n; i++) { short old = ((short*)audio)[i]; ((short*)audio)[i] *= m_preampFactor; // detect overflow and clip! if ((old & 0x8000) != (((short*)audio)[i] & 0x8000)) ((short*)audio)[i] = old | 0x7FFF; } } else { for (long i = 0; i < len; i++) { uchar old = ((uchar*)audio)[i]; ((uchar*)audio)[i] *= m_preampFactor; // detect overflow and clip! if ((old & 0x80) != (((uchar*)audio)[i] & 0x80)) ((uchar*)audio)[i] = old | 0x7F; } } } } return len; } void DecoderModPlug::seek(qint64 pos) { quint32 lMax; quint32 lMaxtime; double lPostime; if (pos > (lMaxtime = m_soundFile->GetSongTime()) * 1000) pos = lMaxtime * 1000; lMax = m_soundFile->GetMaxPosition(); lPostime = float(lMax) / lMaxtime; m_soundFile->SetCurrentPos(int(pos * lPostime / 1000)); } void DecoderModPlug::deinit() { m_freq = m_bitrate = 0; m_chan = 0; if (m_soundFile) { m_soundFile->Destroy(); delete m_soundFile; m_soundFile = 0; } m_input_buf.clear(); } void DecoderModPlug::readSettings() { if (!m_soundFile) return; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ModPlug"); CSoundFile::SetWaveConfig ( m_freq = settings.value("Frequency", 44100).toInt(), m_bps = settings.value("Bits", 16).toInt(), m_chan = settings.value("Channels", 2).toInt() ); CSoundFile::SetWaveConfigEx ( settings.value("Surround", true).toBool(), true, settings.value("Reverb", false).toBool(), true, settings.value("Megabass", false).toBool(), settings.value("NoiseReduction", false).toBool(), false ); if (settings.value("Reverb", false).toBool()) { CSoundFile::SetReverbParameters ( settings.value("ReverbDepth", 30).toInt(), settings.value("ReverbDelay", 100).toInt() ); } if (settings.value("Megabass", false).toBool()) { CSoundFile::SetXBassParameters ( settings.value("BassAmount", 40).toInt(), settings.value("BassRange", 30).toInt() ); } if (settings.value("Surround", true).toBool()) { CSoundFile::SetSurroundParameters ( settings.value("SurroundDepth", 20).toInt(), settings.value("SurroundDelay", 20).toInt() ); } CSoundFile::SetResamplingMode(settings.value("ResamplineMode", SRCMODE_POLYPHASE).toInt()); m_soundFile->SetRepeatCount(settings.value("LoopCount", 0).toInt()); //general /* settings.value("GrabAmigaMOD", true).toBool());*/ //preamp m_usePreamp = settings.value("PreAmp", false).toBool(); m_preampFactor = exp(settings.value("PreAmpLevel", 0.0f).toDouble()); settings.endGroup(); } DecoderModPlug* DecoderModPlug::instance() { return m_instance; } qmmp-0.7.4/src/plugins/Input/modplug/settingsdialog.h0000664000175000017500000000354512256224735021442 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); private slots: void writeSettings(); void setPreamp(int); void exec(QAbstractButton *); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Input/ffmpeg/0000775000175000017500000000000012256224735016037 5ustar useruserqmmp-0.7.4/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.h0000664000175000017500000000372612256224735022206 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef FFMPEGMETADATAMODEL_H #define FFMPEGMETADATAMODEL_H extern "C"{ #include #include #if (LIBAVUTIL_VERSION_INT >= ((51<<16)+(32<<8)+0)) #include #endif } #include class FFmpegMetaDataModel : public MetaDataModel { Q_OBJECT public: FFmpegMetaDataModel(const QString &path, QObject *parent); ~FFmpegMetaDataModel(); QHash audioProperties(); private: AVFormatContext *m_in; }; #endif // FFMPEGMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/ffmpeg/CMakeLists.txt0000664000175000017500000000374212256224735020605 0ustar useruserproject(libffmpeg) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) # fixes ffmpeg defines ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # minimal supported versions # libav-0.8: libavcodec-53.34.0, libavformat-53.20.0, libavutil-51.21.0 # ffmpeg-0.9: libavcodec-53.42.0, libavformat-53.24.0, libavutil-51.32.0 pkg_check_modules(FFMPEG libavcodec>=53.34.0 libavformat>=53.20.0 libavutil>=51.21.0) include_directories(${FFMPEG_INCLUDE_DIRS}) link_directories(${FFMPEG_LIBRARY_DIRS}) ADD_DEFINITIONS(${FFMPEG_CFLAGS}) SET(libffmpeg_SRCS decoder_ffmpeg.cpp decoderffmpegfactory.cpp ffmpegmetadatamodel.cpp settingsdialog.cpp ) SET(libffmpeg_HDRS decoder_ffmpeg.h ) SET(libffmpeg_MOC_HDRS decoderffmpegfactory.h ffmpegmetadatamodel.h settingsdialog.h ) SET(libffmpeg_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libffmpeg_RCC_SRCS ${libffmpeg_RCCS}) QT4_WRAP_CPP(libffmpeg_MOC_SRCS ${libffmpeg_MOC_HDRS}) # user interface SET(libffmpeg_UIS settingsdialog.ui ) QT4_WRAP_UI(libffmpeg_UIS_H ${libffmpeg_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(FFMPEG_FOUND) ADD_LIBRARY(ffmpeg MODULE ${libffmpeg_SRCS} ${libffmpeg_MOC_SRCS} ${libffmpeg_UIS_H} ${libffmpeg_RCC_SRCS} ${libffmpeg_HDRS}) add_dependencies(ffmpeg qmmp) target_link_libraries(ffmpeg ${QT_LIBRARIES} -lqmmp ${FFMPEG_LDFLAGS}) install(TARGETS ffmpeg DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(FFMPEG_FOUND) qmmp-0.7.4/src/plugins/Input/ffmpeg/settingsdialog.cpp0000664000175000017500000001200612256224735021562 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C"{ #include #include #include } #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QStringList filters; filters << "*.wma" << "*.ape" << "*.tta" << "*.m4a" << "*.ra" << "*.shn" << "*.vqf" << "*.ac3"; filters = settings.value("FFMPEG/filters", filters).toStringList(); ui.wmaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_WMAV1)); ui.wmaCheckBox->setChecked(filters.contains("*.wma") && avcodec_find_decoder(CODEC_ID_WMAV1)); ui.apeCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_APE)); ui.apeCheckBox->setChecked(filters.contains("*.ape") && avcodec_find_decoder(CODEC_ID_APE)); ui.ttaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TTA)); ui.ttaCheckBox->setChecked(filters.contains("*.tta") && avcodec_find_decoder(CODEC_ID_TTA)); ui.aacCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_AAC)); ui.aacCheckBox->setChecked(filters.contains("*.aac") && avcodec_find_decoder(CODEC_ID_AAC)); ui.mp3CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_MP3)); ui.mp3CheckBox->setChecked(filters.contains("*.mp3") && avcodec_find_decoder(CODEC_ID_MP3)); ui.mp4CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_AAC)); ui.mp4CheckBox->setChecked(filters.contains("*.m4a") && (avcodec_find_decoder(CODEC_ID_AAC) || avcodec_find_decoder(CODEC_ID_ALAC))); ui.raCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_RA_288)); ui.raCheckBox->setChecked(filters.contains("*.ra") && avcodec_find_decoder(CODEC_ID_RA_288)); ui.shCheckBox->setChecked(filters.contains("*.shn") && avcodec_find_decoder(CODEC_ID_SHORTEN)); ui.ac3CheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_EAC3)); ui.ac3CheckBox->setChecked(filters.contains("*.ac3") && avcodec_find_decoder(CODEC_ID_EAC3)); ui.dtsCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_DTS)); ui.dtsCheckBox->setChecked(filters.contains("*.dts") && avcodec_find_decoder(CODEC_ID_DTS)); ui.mkaCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TRUEHD)); ui.mkaCheckBox->setChecked(filters.contains("*.mka") && avcodec_find_decoder(CODEC_ID_TRUEHD)); ui.vqfCheckBox->setEnabled(avcodec_find_decoder(CODEC_ID_TWINVQ)); ui.vqfCheckBox->setChecked(filters.contains("*.vqf") && avcodec_find_decoder(CODEC_ID_TWINVQ)); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QStringList filters; if (ui.mp3CheckBox->isChecked()) filters << "*.mp3"; if (ui.wmaCheckBox->isChecked()) filters << "*.wma"; if (ui.apeCheckBox->isChecked()) filters << "*.ape"; if (ui.ttaCheckBox->isChecked()) filters << "*.tta"; if (ui.aacCheckBox->isChecked()) filters << "*.aac"; if (ui.mp4CheckBox->isChecked()) filters << "*.m4a"; if (ui.raCheckBox->isChecked()) filters << "*.ra"; if (ui.shCheckBox->isChecked()) filters << "*.shn"; if (ui.ac3CheckBox->isChecked()) filters << "*.ac3"; if (ui.dtsCheckBox->isChecked()) filters << "*.dts"; if (ui.mkaCheckBox->isChecked()) filters << "*.mka"; if (ui.vqfCheckBox->isChecked()) filters << "*.vqf"; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("FFMPEG/filters", filters); QDialog::accept(); } qmmp-0.7.4/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp0000664000175000017500000000536012256224735022535 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "ffmpegmetadatamodel.h" FFmpegMetaDataModel::FFmpegMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_in = 0; if (avformat_open_input(&m_in, path.toLocal8Bit().constData(), 0, 0) < 0) return; avformat_find_stream_info(m_in, 0); av_read_play(m_in); } FFmpegMetaDataModel::~FFmpegMetaDataModel() { if(m_in) avformat_close_input(&m_in); } QHash FFmpegMetaDataModel::audioProperties() { QHash ap; if(!m_in) return ap; QString text = QString("%1").arg(int(m_in->duration/AV_TIME_BASE)/60); text +=":"+QString("%1").arg(int(m_in->duration/AV_TIME_BASE)%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("File size"), QString("%1 ").arg(avio_size(m_in->pb)) + " " + tr("KB")); ap.insert(tr("Bitrate"), QString("%1 "+tr("kbps")).arg(m_in->bit_rate/1000)); AVCodecContext *c = 0; uint wma_idx; for (wma_idx = 0; wma_idx < m_in->nb_streams; wma_idx++) { c = m_in->streams[wma_idx]->codec; if (c->codec_type == AVMEDIA_TYPE_AUDIO) break; } if (c) { ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(c->sample_rate)); ap.insert(tr("Channels"), QString("%1").arg(c->channels)); } return ap; } qmmp-0.7.4/src/plugins/Input/ffmpeg/settingsdialog.ui0000664000175000017500000001104412256224735021416 0ustar useruser SettingsDialog 0 0 308 328 FFmpeg Plugin Settings 6 6 6 Qt::Horizontal 178 20 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF buttonBox accepted() SettingsDialog accept() 214 167 103 160 buttonBox rejected() SettingsDialog reject() 269 174 148 169 qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/0000775000175000017500000000000012256224735020560 5ustar useruserqmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_gl_ES.ts0000664000175000017500000001261212256224735025025 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Engadido FFmpeg FFmpeg Formats Formatos ffmpeg About FFmpeg Audio Plugin Sobre o engadido ffmpeg Qmmp FFmpeg Audio Plugin Engadido de audio ffmpeg de Qmmp Compiled against: Compilado usando: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Lonxitude File size Tamaño de ficheiro KB KB Bitrate Taxa de bits kbps kbps Sample rate Frecuencia de mostra Hz Hz Channels Canais SettingsDialog FFmpeg Plugin Settings Preferencias do engadido ffmpeg Formats Formatos Windows Media Audio Windows Media Audio Monkey's Audio (APE) Monkey's Audio (APE) True Audio True Audio ADTS AAC ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD sen perdas) VQF VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/translations.qrc0000664000175000017500000000147512256224735024017 0ustar useruser ffmpeg_plugin_ru.qm ffmpeg_plugin_uk_UA.qm ffmpeg_plugin_zh_CN.qm ffmpeg_plugin_zh_TW.qm ffmpeg_plugin_tr.qm ffmpeg_plugin_cs.qm ffmpeg_plugin_pt_BR.qm ffmpeg_plugin_de.qm ffmpeg_plugin_pl_PL.qm ffmpeg_plugin_fr.qm ffmpeg_plugin_it.qm ffmpeg_plugin_kk.qm ffmpeg_plugin_lt.qm ffmpeg_plugin_hu.qm ffmpeg_plugin_nl.qm ffmpeg_plugin_ja.qm ffmpeg_plugin_sk.qm ffmpeg_plugin_es.qm ffmpeg_plugin_he.qm ffmpeg_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_uk_UA.ts0000664000175000017500000001250312256224735025037 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Про аудіо-модуль FFmpeg Qmmp FFmpeg Audio Plugin Аудіо-модуль FFmpeg для Qmmp Compiled against: Зібрано з бібліотеками: Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> FFmpeg Plugin Модуль FFmpeg FFmpeg Formats Формати FFmpeg FFmpegMetaDataModel Length Тривалість File size Розмір файлу KB Кб Bitrate Бітрейт kbps Кб/с Sample rate Частота Hz Гц Channels Канали SettingsDialog Formats Формати Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Налаштування модуля FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_pl_PL.ts0000664000175000017500000001236012256224735025042 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Wtyczka FFMPEG FFmpeg Formats Formaty FFmpeg About FFmpeg Audio Plugin O wtyczce FFmpeg Audio Qmmp FFmpeg Audio Plugin Wtyczka FFmpeg Audio dla Qmmp Compiled against: Skompilowana z biblioteką: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Długość File size Wielkość pliku KB Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Channels Kanały SettingsDialog FFmpeg Plugin Settings Ustawienia wtyczki FFMPEG Formats Formaty Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten Shorten (SHN) AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Bezstratny) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_de.ts0000664000175000017500000001264112256224735024426 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Über FFmpeg-Audio-Modul Qmmp FFmpeg Audio Plugin Qmmp FFmpeg-Audio-Modul Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg-Modul FFmpeg Formats FFmpeg-Formate FFmpegMetaDataModel Length Länge File size Dateigröße KB KB Bitrate Bitrate kbps kbps Sample rate Abtastrate Hz Hz Channels Kanäle SettingsDialog Formats Formate Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Name eines Dateiformats Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD, verlustfrei) VQF VQF FFmpeg Plugin Settings Einstellungen FFmpeg-Modul Monkey's Audio (APE) Monkey’s Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_cs.ts0000664000175000017500000001267512256224735024452 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin O modulu FFmpeg Qmmp FFmpeg Audio Plugin Vstupní modul Qmmp FFmpeg Compiled against: Kompilováno s: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Modul FFmpeg FFmpeg Formats Formáty FFmpeg FFmpegMetaDataModel Length Délka File size Velikost souboru KB KiB Bitrate Datový tok kbps kbps Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů SettingsDialog Formats Formáty Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) název formátu se nepřekládá ... Matroska Audio (Dolby TrueHD Lossless) VQF VQF FFmpeg Plugin Settings Nastavení modulu FFmpeg Monkey's Audio (APE) Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_es.ts0000664000175000017500000001262212256224735024444 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Acerca del módulo de audio FFmpeg Qmmp FFmpeg Audio Plugin Módulo de audio FFmpeg para Qmmp Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Módulo FFmpeg FFmpeg Formats Formatos FFmpeg FFmpegMetaDataModel Length Duración File size Tamaño del archivo KB KB Bitrate Tasa de bits kbps kbps Sample rate Frecuencia Hz Hz Channels Canales SettingsDialog Formats Formatos Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Configuración del módulo FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_fr.ts0000664000175000017500000001267312256224735024452 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_he.ts0000664000175000017500000001254512256224735024435 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin תוספת FFmpeg FFmpeg Formats פורמטים של FFmpeg About FFmpeg Audio Plugin אודות תוספת שמע FFmpeg Qmmp FFmpeg Audio Plugin תוספת שמע FFmpeg ‫Qmmp Compiled against: הודרה כנגד: Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> FFmpegMetaDataModel Length אריכות File size גודל קובץ KB ק״ב Bitrate שיעור סיביות kbps Sample rate שיעור דגימה Hz הרץ Channels ערוצים SettingsDialog FFmpeg Plugin Settings הגדרות תוספת FFmpeg Formats פורמטים Windows Media Audio Monkey's Audio (APE) True Audio שמע אמיתי ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten מקוצר AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) שמע Matroska ‫(Dolby TrueHD נטול אובדן) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_hu.ts0000664000175000017500000001267312256224735024457 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_ja.ts0000664000175000017500000001303212256224735024423 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg プラグイン FFmpeg Formats FFmpeg 用の形式 About FFmpeg Audio Plugin FFmpeg 音響プラグインについて Qmmp FFmpeg Audio Plugin QMMP FFmpeg 音響プラグイン Compiled against: コンパイルに使用したライブラリ: Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> FFmpegMetaDataModel Length 長さ File size ファイルの大きさ KB KiB Bitrate ビットレート kbps キロビット毎秒 Sample rate サンプルレート Hz Hz Channels チャンネル SettingsDialog FFmpeg Plugin Settings FFmpeg プラグイン設定 Formats 形式 Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG オーディオ レイヤー3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten 短縮 AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_it.ts0000664000175000017500000001260012256224735024445 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Info sul modulo audi FFmpeg Qmmp FFmpeg Audio Plugin Modulo audio FFmpeg per Qmmp Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin Modulo FFmpeg FFmpeg Formats Formati FFmpeg FFmpegMetaDataModel Length Durata File size Dimensione file KB KB Bitrate Bit/secondo kbps kbps Sample rate Campionamento Hz Hz Channels Canali SettingsDialog Formats Formati Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Impostazioni del modulo FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG Audio Layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_kk.ts0000664000175000017500000001267312256224735024450 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_lt.ts0000664000175000017500000001253712256224735024461 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Apie FFmpeg įskiepį Qmmp FFmpeg Audio Plugin FFmpeg Qmmp audio įskiepis Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg įskiepis FFmpeg Formats FFmpeg bylų tipai FFmpegMetaDataModel Length Trukmė File size Bylos dydis KB КB Bitrate Kokybė kbps kbps Sample rate Dažnis Hz Hz Channels Kanalai SettingsDialog Formats Tipai Windows Media Audio Windows Media Audio True Audio True Audio ADTS AAC ADTS AAC MPEG-4 AAC/ALAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten Shorten AC3/EAC AC3/EAC DTS/DTS-Core DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Lossless) VQF VQF FFmpeg Plugin Settings FFmpeg įskiepio nustatymai Monkey's Audio (APE) Monkey's Audio (APE) MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_nl.ts0000664000175000017500000001225512256224735024450 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Over de FFmpeg Audio Module Qmmp FFmpeg Audio Plugin FFmpeg Audio Module voor Qmmp Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg Module FFmpeg Formats FFmpeg Formaat FFmpegMetaDataModel Length Duur File size Bestandsgrootte KB Bitrate Bitsnelheid kbps Sample rate Sample frequentie Hz Channels Kanalen SettingsDialog Formats Formaten Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg Module Instellingen Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_pl.ts0000664000175000017500000001355212256224735024453 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin Wtyczka FFMPEG FFmpeg Formats Formaty FFmpeg About FFmpeg Audio Plugin O wtyczce FFmpeg Audio Qmmp FFmpeg Audio Plugin Wtyczka FFmpeg Audio dla Qmmp Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6 Skompilowane przy użyciu libavformat-%1.%2.%3 i libavcodec-%4.%5.%6 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length Długość File size Wielkość pliku KB Bitrate Szybkość transmisji kbps Sample rate Próbkowanie Hz Channels Kanały SettingsDialog FFmpeg Plugin Settings Ustawienia wtyczki FFMPEG Formats Formaty Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten Shorten (SHN) AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) Matroska Audio (Dolby TrueHD Bezstratny) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_ru.ts0000664000175000017500000001307012256224735024461 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin Об аудио-модуле FFmpeg Qmmp FFmpeg Audio Plugin Аудио-модуль FFmpeg для Qmmp Compiled against: Собрано с библиотеками: Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> FFmpeg Plugin Модуль FFmpeg FFmpeg Formats Форматы FFmpeg FFmpegMetaDataModel Length Длительность File size Размер файла KB КБ Bitrate Битовая частота kbps Кб/с Sample rate Дискретизация Hz Гц Channels Каналов SettingsDialog Formats Форматы Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings Настройки модуля FFmpeg Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_sk.ts0000664000175000017500000001267312256224735024460 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_tr.ts0000664000175000017500000001274112256224735024464 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Eklentisi FFmpeg Formats FFmpeg Biçimleri About FFmpeg Audio Plugin FFmpeg Ses Eklentisi Hakkında Qmmp FFmpeg Audio Plugin Qmmp FFmpeg Ses Eklentisi Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB KB Bitrate kbps kbps Sample rate Hz Hz Channels SettingsDialog FFmpeg Plugin Settings FFmpeg Eklenti Ayarları Formats Biçimler Windows Media Audio Windows Media Audio Monkey's Audio (APE) True Audio True Audio ADTS AAC ADTS AAC MP3 (MPEG audio layer 3) MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_pt_BR.ts0000664000175000017500000001267312256224735025051 0ustar useruser DecoderFFmpegFactory FFmpeg Plugin FFmpeg Formats About FFmpeg Audio Plugin Qmmp FFmpeg Audio Plugin Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> FFmpegMetaDataModel Length File size KB Bitrate kbps Sample rate Hz Channels SettingsDialog FFmpeg Plugin Settings Formats Windows Media Audio Monkey's Audio (APE) True Audio ADTS AAC MP3 (MPEG audio layer 3) MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_zh_CN.ts0000664000175000017500000001265112256224735025040 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin 关于 FFmpeg 音频插件 Qmmp FFmpeg Audio Plugin Qmmp FFmpeg 音频插件 Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg 插件 FFmpeg Formats FFmpeg 格式 FFmpegMetaDataModel Length 长度 File size 文件大小 KB Bitrate 比特率 kbps Sample rate 取样率 Hz Channels 声音通道 SettingsDialog Formats 格式 Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg 插件设置 Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/translations/ffmpeg_plugin_zh_TW.ts0000664000175000017500000001257312256224735025075 0ustar useruser DecoderFFmpegFactory About FFmpeg Audio Plugin 關於 FFmpeg 聲訊插件 Qmmp FFmpeg Audio Plugin Qmmp FFmpeg 聲訊插件 Compiled against: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> FFmpeg Plugin FFmpeg 插件 FFmpeg Formats FFmpeg 格式 FFmpegMetaDataModel Length 長度 File size 文件大小 KB KB Bitrate 比特率 kbps kbps Sample rate 取樣率 Hz Hz Channels 聲音通道 SettingsDialog Formats 格式 Windows Media Audio True Audio ADTS AAC MPEG-4 AAC/ALAC RealAudio 1.0/2.0 Shorten AC3/EAC DTS/DTS-Core Matroska Audio (Dolby TrueHD Lossless) VQF FFmpeg Plugin Settings FFmpeg 插件設置 Monkey's Audio (APE) MP3 (MPEG audio layer 3) qmmp-0.7.4/src/plugins/Input/ffmpeg/decoder_ffmpeg.h0000664000175000017500000000503412256224735021143 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_FFMPEG_H #define DECODER_FFMPEG_H extern "C"{ #include #include #include #include } #include #define PROBE_BUFFER_SIZE 8192 #define INPUT_BUFFER_SIZE 16384 class DecoderFFmpeg : public Decoder { public: DecoderFFmpeg(const QString &, QIODevice *i); virtual ~DecoderFFmpeg(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: //helper functions void fillBuffer(); AVFormatContext *ic; AVCodecContext *c; uint wma_st_buff, wma_idx2; int m_bitrate, wma_idx; QString m_path; qint64 m_totalTime; AVPacket m_pkt; AVPacket m_temp_pkt; qint64 m_output_at; uchar m_input_buf[INPUT_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; int64_t m_seekTime; qint64 m_skipBytes; int m_channels; qint64 ffmpeg_decode(); AVIOContext *m_stream; AVFrame *m_decoded_frame; }; #endif // DECODER_FFMPEG_H qmmp-0.7.4/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp0000664000175000017500000003365312256224735021506 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "decoder_ffmpeg.h" // callbacks static int ffmpeg_read(void *data, uint8_t *buf, int size) { DecoderFFmpeg *d = (DecoderFFmpeg*)data; return (int)d->input()->read((char*)buf, size); } static int64_t ffmpeg_seek(void *data, int64_t offset, int whence) { DecoderFFmpeg *d = (DecoderFFmpeg*)data; int64_t absolute_pos = 0; /*if(d->input()->isSequential()) return -1;*/ switch( whence ) { case AVSEEK_SIZE: return d->input()->size(); case SEEK_SET: absolute_pos = offset; break; case SEEK_CUR: absolute_pos = d->input()->pos() + offset; break; case SEEK_END: absolute_pos = d->input()->size() - offset; default: return -1; } if(absolute_pos < 0 || absolute_pos > d->input()->size()) return -1; return d->input()->seek(absolute_pos); } // Decoder class DecoderFFmpeg::DecoderFFmpeg(const QString &path, QIODevice *i) : Decoder(i) { m_bitrate = 0; m_totalTime = 0; ic = 0; m_path = path; m_temp_pkt.size = 0; m_pkt.size = 0; m_pkt.data = 0; m_output_at = 0; m_skipBytes = 0; m_stream = 0; m_decoded_frame = 0; m_channels = 0; av_init_packet(&m_pkt); av_init_packet(&m_temp_pkt); } DecoderFFmpeg::~DecoderFFmpeg() { m_bitrate = 0; m_temp_pkt.size = 0; if (ic) avformat_free_context(ic); if(m_pkt.data) av_free_packet(&m_pkt); if(m_stream) av_free(m_stream); if(m_decoded_frame) av_free(m_decoded_frame); } bool DecoderFFmpeg::initialize() { m_bitrate = 0; m_totalTime = 0; m_seekTime = -1; ic = avformat_alloc_context(); AVProbeData pd; uint8_t buf[PROBE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; pd.filename = m_path.toLocal8Bit().constData(); pd.buf_size = input()->peek((char*)buf, sizeof(buf) - AVPROBE_PADDING_SIZE); pd.buf = buf; if(pd.buf_size < PROBE_BUFFER_SIZE) { qWarning("DecoderFFmpeg: too small buffer size: %d bytes", pd.buf_size); return false; } AVInputFormat *fmt = av_probe_input_format(&pd, 1); if(!fmt) { qWarning("DecoderFFmpeg: usupported format"); return false; } qDebug("DecoderFFmpeg: detected format: %s", fmt->long_name); qDebug("=%s=", fmt->name); m_stream = avio_alloc_context(m_input_buf, INPUT_BUFFER_SIZE, 0, this, ffmpeg_read, NULL, ffmpeg_seek); if(!m_stream) { qWarning("DecoderFFmpeg: unable to initialize I/O callbacks"); return false; } m_stream->seekable = !input()->isSequential(); m_stream->max_packet_size = INPUT_BUFFER_SIZE; ic->pb = m_stream; if(avformat_open_input(&ic, 0, fmt, 0) != 0) { qDebug("DecoderFFmpeg: avformat_open_input() failed"); return false; } avformat_find_stream_info(ic, 0); if(ic->pb) ic->pb->eof_reached = 0; if (input()->isSequential()) { QMap metaData; AVDictionaryEntry *album = av_dict_get(ic->metadata,"album",0,0); if(!album) album = av_dict_get(ic->metadata,"WM/AlbumTitle",0,0); AVDictionaryEntry *artist = av_dict_get(ic->metadata,"artist",0,0); if(!artist) artist = av_dict_get(ic->metadata,"author",0,0); AVDictionaryEntry *comment = av_dict_get(ic->metadata,"comment",0,0); AVDictionaryEntry *genre = av_dict_get(ic->metadata,"genre",0,0); AVDictionaryEntry *title = av_dict_get(ic->metadata,"title",0,0); AVDictionaryEntry *year = av_dict_get(ic->metadata,"WM/Year",0,0); if(!year) year = av_dict_get(ic->metadata,"year",0,0); if(!year) year = av_dict_get(ic->metadata,"date",0,0); AVDictionaryEntry *track = av_dict_get(ic->metadata,"track",0,0); if(!track) track = av_dict_get(ic->metadata,"WM/Track",0,0); if(!track) track = av_dict_get(ic->metadata,"WM/TrackNumber",0,0); if(album) metaData.insert(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed()); if(artist) metaData.insert(Qmmp::ARTIST, QString::fromUtf8(artist->value).trimmed()); if(comment) metaData.insert(Qmmp::COMMENT, QString::fromUtf8(comment->value).trimmed()); if(genre) metaData.insert(Qmmp::GENRE, QString::fromUtf8(genre->value).trimmed()); if(title) metaData.insert(Qmmp::TITLE, QString::fromUtf8(title->value).trimmed()); if(year) metaData.insert(Qmmp::YEAR, year->value); if(track) metaData.insert(Qmmp::TRACK, track->value); metaData.insert(Qmmp::URL, m_path); addMetaData(metaData); } ic->flags |= AVFMT_FLAG_GENPTS; av_read_play(ic); for (wma_idx = 0; wma_idx < (int)ic->nb_streams; wma_idx++) { c = ic->streams[wma_idx]->codec; if (c->codec_type == AVMEDIA_TYPE_AUDIO) break; } #if (LIBAVCODEC_VERSION_INT >= ((55<<16)+(39<<8)+100)) //ffmpeg 2.1 if (c->channels == 1) { c->request_channel_layout = AV_CH_LAYOUT_MONO; m_channels = c->channels; } else { c->request_channel_layout = AV_CH_LAYOUT_STEREO; m_channels = 2; } #else if (c->channels > 0) c->request_channels = qMin(2, c->channels); else c->request_channels = 2; m_channels = c->request_channels; #endif av_dump_format(ic,0,0,0); AVCodec *codec = avcodec_find_decoder(c->codec_id); if (!codec) { qWarning("DecoderFFmpeg: unsupported codec for output stream"); return false; } if (avcodec_open2(c, codec, 0) < 0) { qWarning("DecoderFFmpeg: error while opening codec for output stream"); return false; } m_decoded_frame = avcodec_alloc_frame(); m_totalTime = input()->isSequential() ? 0 : ic->duration * 1000 / AV_TIME_BASE; if(c->codec_id == CODEC_ID_SHORTEN) //ffmpeg bug workaround m_totalTime = 0; Qmmp::AudioFormat format = Qmmp::PCM_UNKNOWM; switch(c->sample_fmt) { case AV_SAMPLE_FMT_U8: case AV_SAMPLE_FMT_U8P: format = Qmmp::PCM_S8; break; case AV_SAMPLE_FMT_S16: case AV_SAMPLE_FMT_S16P: format = Qmmp::PCM_S16LE; break; case AV_SAMPLE_FMT_S32: case AV_SAMPLE_FMT_S32P: case AV_SAMPLE_FMT_FLT: case AV_SAMPLE_FMT_FLTP: format = Qmmp::PCM_S32LE; break; default: qWarning("DecoderFFmpeg: unsupported audio format"); return false; } configure(c->sample_rate, m_channels, format); if(ic->bit_rate) m_bitrate = ic->bit_rate/1000; if(c->bit_rate) m_bitrate = c->bit_rate/1000; qDebug("DecoderFFmpeg: initialize succes"); #ifdef Q_OS_WIN qDebug("total time = %I64d", m_totalTime); #else qDebug("total time = %lld ", m_totalTime); #endif return true; } qint64 DecoderFFmpeg::totalTime() { return m_totalTime; } int DecoderFFmpeg::bitrate() { return m_bitrate; } qint64 DecoderFFmpeg::read(char *audio, qint64 maxSize) { m_skipBytes = 0; if(!m_output_at) fillBuffer(); if(!m_output_at) return 0; qint64 len = qMin(m_output_at, maxSize); if(av_sample_fmt_is_planar(c->sample_fmt) && m_channels > 1) { int bps = av_get_bytes_per_sample(c->sample_fmt); for(int i = 0; i < (len >> 1); i+=bps) { memcpy(audio + 2*i, m_decoded_frame->extended_data[0] + i, bps); memcpy(audio + 2*i + bps, m_decoded_frame->extended_data[1] + i, bps); } m_output_at -= len; memmove(m_decoded_frame->extended_data[0], m_decoded_frame->extended_data[0] + len/2, m_output_at/2); memmove(m_decoded_frame->extended_data[1], m_decoded_frame->extended_data[1] + len/2, m_output_at/2); } else { memcpy(audio, m_decoded_frame->extended_data[0], len); m_output_at -= len; memmove(m_decoded_frame->extended_data[0], m_decoded_frame->extended_data[0] + len, m_output_at); } if(c->sample_fmt == AV_SAMPLE_FMT_FLTP || c->sample_fmt == AV_SAMPLE_FMT_FLT) { //convert float to signed 32 bit LE for(int i = 0; i < (len >> 2); i++) { int32_t *out = (int32_t *)audio; float *in = (float *) audio; out[i] = qBound(-1.0f, in[i], +1.0f) * (double) 0x7fffffff; } } return len; } qint64 DecoderFFmpeg::ffmpeg_decode() { int out_size = 0; int got_frame = 0; if((m_pkt.stream_index == wma_idx)) { avcodec_get_frame_defaults(m_decoded_frame); int l = avcodec_decode_audio4(c, m_decoded_frame, &got_frame, &m_temp_pkt); if(got_frame) out_size = av_samples_get_buffer_size(0, c->channels, m_decoded_frame->nb_samples, c->sample_fmt, 1); else out_size = 0; if(c->bit_rate) m_bitrate = c->bit_rate/1000; if(l < 0) { return l; } m_temp_pkt.data += l; m_temp_pkt.size -= l; } if (!m_temp_pkt.size && m_pkt.data) av_free_packet(&m_pkt); return out_size; } void DecoderFFmpeg::seek(qint64 pos) { int64_t timestamp = int64_t(pos)*AV_TIME_BASE/1000; if (ic->start_time != (qint64)AV_NOPTS_VALUE) timestamp += ic->start_time; m_seekTime = timestamp; av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD); avcodec_flush_buffers(c); av_free_packet(&m_pkt); m_temp_pkt.size = 0; } void DecoderFFmpeg::fillBuffer() { while(!m_output_at) { if(!m_temp_pkt.size) { if (av_read_frame(ic, &m_pkt) < 0) { m_temp_pkt.size = 0; break; } m_temp_pkt.size = m_pkt.size; m_temp_pkt.data = m_pkt.data; if(m_pkt.stream_index != wma_idx) { if(m_pkt.data) av_free_packet(&m_pkt); m_temp_pkt.size = 0; continue; } if(m_seekTime && c->codec_id == CODEC_ID_APE) { int64_t rescaledPts = av_rescale(m_pkt.pts, AV_TIME_BASE * (int64_t) ic->streams[m_pkt.stream_index]->time_base.num, ic->streams[m_pkt.stream_index]->time_base.den); m_skipBytes = (m_seekTime - rescaledPts) * c->sample_rate * 4 / AV_TIME_BASE; } else m_skipBytes = 0; m_seekTime = 0; } if(m_skipBytes > 0 && c->codec_id == CODEC_ID_APE) { while (m_skipBytes > 0) { m_output_at = ffmpeg_decode(); if(m_output_at < 0) break; m_skipBytes -= m_output_at; } if(m_skipBytes < 0) { qint64 size = m_output_at; m_output_at = - m_skipBytes; m_output_at = m_output_at/4*4; if(av_sample_fmt_is_planar(c->sample_fmt) && m_channels > 1) { memmove(m_decoded_frame->extended_data[0], m_decoded_frame->extended_data[0] + (size - m_output_at)/2, m_output_at/2); memmove(m_decoded_frame->extended_data[1], m_decoded_frame->extended_data[1] + (size - m_output_at)/2, m_output_at/2); } else { memmove(m_decoded_frame->extended_data[0], m_decoded_frame->extended_data[0] + size - m_output_at, m_output_at); } m_skipBytes = 0; } } else m_output_at = ffmpeg_decode(); if(m_output_at < 0) { m_output_at = 0; m_temp_pkt.size = 0; if(c->codec_id == CODEC_ID_SHORTEN || c->codec_id == CODEC_ID_TWINVQ) { if(m_pkt.data) av_free_packet(&m_pkt); m_pkt.data = 0; break; } continue; } else if(m_output_at == 0) { if(c->codec_id == CODEC_ID_SHORTEN || c->codec_id == CODEC_ID_TWINVQ) continue; if(m_pkt.data) av_free_packet(&m_pkt); m_pkt.data = 0; break; } } } qmmp-0.7.4/src/plugins/Input/ffmpeg/ffmpeg.pro0000664000175000017500000000275512256224735020036 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decoderffmpegfactory.h \ decoder_ffmpeg.h \ settingsdialog.h \ ffmpegmetadatamodel.h SOURCES += decoder_ffmpeg.cpp \ decoderffmpegfactory.cpp \ settingsdialog.cpp \ ffmpegmetadatamodel.cpp INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib TARGET = $$PLUGINS_PREFIX/Input/ffmpeg unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libffmpeg.so LIBS += -lqmmp QMAKE_LIBDIR += ../../../../lib PKGCONFIG += libavcodec libavformat libavutil } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lavcodec.dll -lavformat.dll -lavutil.dll } DEFINES += __STDC_CONSTANT_MACROS TRANSLATIONS = translations/ffmpeg_plugin_ru.ts \ translations/ffmpeg_plugin_uk_UA.ts \ translations/ffmpeg_plugin_zh_CN.ts \ translations/ffmpeg_plugin_zh_TW.ts \ translations/ffmpeg_plugin_cs.ts \ translations/ffmpeg_plugin_pl.ts \ translations/ffmpeg_plugin_de.ts \ translations/ffmpeg_plugin_it.ts \ translations/ffmpeg_plugin_tr.ts \ translations/ffmpeg_plugin_lt.ts \ translations/ffmpeg_plugin_nl.ts \ translations/ffmpeg_plugin_ja.ts \ translations/ffmpeg_plugin_es.ts RESOURCES = translations/translations.qrc qmmp-0.7.4/src/plugins/Input/ffmpeg/settingsdialog.h0000664000175000017500000000345612256224735021240 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Input/ffmpeg/decoderffmpegfactory.h0000664000175000017500000000450712256224735022400 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERFFMPEGFACTORY_H #define DECODERFFMPEGFACTORY_H #include #include #include #include #include #include #include #include class DecoderFFmpegFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory) public: DecoderFFmpegFactory(); bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp0000664000175000017500000002331612256224735022732 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include extern "C"{ #include #include #include #include } #include "ffmpegmetadatamodel.h" #include "settingsdialog.h" #include "decoder_ffmpeg.h" #include "decoderffmpegfactory.h" // DecoderFFmpegFactory DecoderFFmpegFactory::DecoderFFmpegFactory() { avcodec_register_all(); avformat_network_init(); av_register_all(); } bool DecoderFFmpegFactory::supports(const QString &source) const { foreach(QString filter, properties().filters) { QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); if (regexp.exactMatch(source)) return true; } return false; } bool DecoderFFmpegFactory::canDecode(QIODevice *i) const { QStringList filters = properties().filters; AVProbeData pd; uint8_t buf[PROBE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; pd.filename = 0; pd.buf_size = i->peek((char*)buf, sizeof(buf) - AVPROBE_PADDING_SIZE); pd.buf = buf; if(pd.buf_size < PROBE_BUFFER_SIZE) return false; AVInputFormat *fmt = av_probe_input_format(&pd, 1); if(!fmt) { return false; } if(filters.contains("*.wma") && !memcmp(fmt->name, "asf", 3)) return true; else if(filters.contains("*.mp3") && !memcmp(fmt->name, "mp3", 3)) return true; else if(filters.contains("*.aac") && !memcmp(fmt->name, "aac", 3)) return true; else if(filters.contains("*.ac3") && !memcmp(fmt->name, "eac3", 4)) return true; else if(filters.contains("*.dts") && !memcmp(fmt->name, "dts", 3)) return true; else if(filters.contains("*.mka") && !memcmp(fmt->name, "mka", 3)) return true; else if(filters.contains("*.vqf") && !memcmp(fmt->name, "vqf", 3)) return true; return false; } const DecoderProperties DecoderFFmpegFactory::properties() const { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QStringList filters; filters << "*.wma" << "*.ape" << "*.tta" << "*.m4a" << "*.ra" << "*.shn" << "*.vqf" << "*.ac3"; filters = settings.value("FFMPEG/filters", filters).toStringList(); //removed unsupported filters if(!avcodec_find_decoder(CODEC_ID_WMAV1)) filters.removeAll("*.wma"); if(!avcodec_find_decoder(CODEC_ID_APE)) filters.removeAll("*.ape"); if(!avcodec_find_decoder(CODEC_ID_TTA)) filters.removeAll("*.tta"); if(!avcodec_find_decoder(CODEC_ID_AAC)) filters.removeAll("*.aac"); if(!avcodec_find_decoder(CODEC_ID_MP3)) filters.removeAll("*.mp3"); if(!avcodec_find_decoder(CODEC_ID_AAC) && !avcodec_find_decoder(CODEC_ID_ALAC)) filters.removeAll("*.m4a"); if(!avcodec_find_decoder(CODEC_ID_RA_288)) filters.removeAll("*.ra"); if(!avcodec_find_decoder(CODEC_ID_SHORTEN)) filters.removeAll("*.shn"); if(!avcodec_find_decoder(CODEC_ID_EAC3)) filters.removeAll("*.ac3"); if(!avcodec_find_decoder(CODEC_ID_DTS)) filters.removeAll("*.dts"); if(!avcodec_find_decoder(CODEC_ID_TRUEHD)) filters.removeAll("*.mka"); if(!avcodec_find_decoder(CODEC_ID_TWINVQ)) filters.removeAll("*.vqf"); DecoderProperties properties; properties.name = tr("FFmpeg Plugin"); properties.filters = filters; properties.description = tr("FFmpeg Formats"); if(filters.contains("*.wma")) properties.contentTypes << "audio/x-ms-wma"; if(filters.contains("*.mp3")) properties.contentTypes << "audio/mpeg"; if(filters.contains("*.aac")) properties.contentTypes << "audio/aac" << "audio/aacp"; if(filters.contains("*.shn")) properties.contentTypes << "audio/x-ffmpeg-shorten"; if(filters.contains("*.m4a")) { properties.contentTypes << "audio/3gpp" << "audio/3gpp2" << "audio/mp4"; properties.contentTypes << "audio/MP4A-LATM" << "audio/mpeg4-generic"; properties.contentTypes << "audio/m4a"; } if(filters.contains("*.ac3")) properties.contentTypes << "audio/ac3" << "audio/eac3"; if(filters.contains("*.dts")) properties.contentTypes << "audio/dts"; if(filters.contains("*.mka")) properties.contentTypes << "audio/true-hd" << "audio/x-matroska"; properties.shortName = "ffmpeg"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = false; properties.priority = 10; return properties; } Decoder *DecoderFFmpegFactory::create(const QString &path, QIODevice *input) { return new DecoderFFmpeg(path, input); } QList DecoderFFmpegFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; AVFormatContext *in = 0; if (avformat_open_input(&in,fileName.toLocal8Bit().constData(), 0, 0) < 0) { qDebug("DecoderFFmpegFactory: unable to open file"); return list; } FileInfo *info = new FileInfo(fileName); avformat_find_stream_info(in, 0); if (useMetaData) { AVDictionaryEntry *album = av_dict_get(in->metadata,"album",0,0); if(!album) album = av_dict_get(in->metadata,"WM/AlbumTitle",0,0); AVDictionaryEntry *artist = av_dict_get(in->metadata,"artist",0,0); if(!artist) artist = av_dict_get(in->metadata,"author",0,0); AVDictionaryEntry *comment = av_dict_get(in->metadata,"comment",0,0); AVDictionaryEntry *genre = av_dict_get(in->metadata,"genre",0,0); AVDictionaryEntry *title = av_dict_get(in->metadata,"title",0,0); AVDictionaryEntry *year = av_dict_get(in->metadata,"WM/Year",0,0); if(!year) year = av_dict_get(in->metadata,"year",0,0); if(!year) year = av_dict_get(in->metadata,"date",0,0); AVDictionaryEntry *track = av_dict_get(in->metadata,"track",0,0); if(!track) track = av_dict_get(in->metadata,"WM/Track",0,0); if(!track) track = av_dict_get(in->metadata,"WM/TrackNumber",0,0); if(album) info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed()); if(artist) info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(artist->value).trimmed()); if(comment) info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(comment->value).trimmed()); if(genre) info->setMetaData(Qmmp::GENRE, QString::fromUtf8(genre->value).trimmed()); if(title) info->setMetaData(Qmmp::TITLE, QString::fromUtf8(title->value).trimmed()); if(year) info->setMetaData(Qmmp::YEAR, year->value); if(track) info->setMetaData(Qmmp::TRACK, track->value); } info->setLength(in->duration/AV_TIME_BASE); avformat_close_input(&in); list << info; return list; } MetaDataModel* DecoderFFmpegFactory::createMetaDataModel(const QString &path, QObject *parent) { return new FFmpegMetaDataModel(path,parent); } void DecoderFFmpegFactory::showSettings(QWidget *parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void DecoderFFmpegFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About FFmpeg Audio Plugin"), tr("Qmmp FFmpeg Audio Plugin")+"\n"+ tr("Compiled against:") + "\n"+ QString("libavformat-%1.%2.%3\n" "libavcodec-%4.%5.%6\n" "libavutil-%7.%8.%9") .arg(LIBAVFORMAT_VERSION_MAJOR) .arg(LIBAVFORMAT_VERSION_MINOR) .arg(LIBAVFORMAT_VERSION_MICRO) .arg(LIBAVCODEC_VERSION_MAJOR) .arg(LIBAVCODEC_VERSION_MINOR) .arg(LIBAVCODEC_VERSION_MICRO) .arg(LIBAVUTIL_VERSION_MAJOR) .arg(LIBAVUTIL_VERSION_MINOR) .arg(LIBAVUTIL_VERSION_MICRO) +"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderFFmpegFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/ffmpeg_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(ffmpeg,DecoderFFmpegFactory) qmmp-0.7.4/src/plugins/Input/wildmidi/0000775000175000017500000000000012256224735016375 5ustar useruserqmmp-0.7.4/src/plugins/Input/wildmidi/wildmidihelper.h0000664000175000017500000000404312256224735021551 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef WILDMIDIHELPER_H #define WILDMIDIHELPER_H #include #include #include class WildMidiHelper : public QObject { Q_OBJECT public: explicit WildMidiHelper(QObject *parent = 0); ~WildMidiHelper(); bool initialize(); void readSettings(); quint32 sampleRate(); void addPtr(void *); void removePtr(void *); QStringList configFiles() const; static WildMidiHelper *instance(); private: static WildMidiHelper *m_instance; bool m_inited; QMutex m_mutex; QList m_ptrs; quint32 m_sample_rate; }; #endif // WILDMIDIHELPER_H qmmp-0.7.4/src/plugins/Input/wildmidi/decoder_wildmidi.cpp0000664000175000017500000000570112256224735022373 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "wildmidihelper.h" #include "decoder_wildmidi.h" // Decoder class DecoderWildMidi::DecoderWildMidi(const QString &path) : Decoder() { m_path = path; midi_ptr = 0; m_sample_rate = 0; } DecoderWildMidi::~DecoderWildMidi() { if(midi_ptr) { WildMidiHelper::instance()->removePtr(midi_ptr); WildMidi_Close(midi_ptr); } } bool DecoderWildMidi::initialize() { m_totalTime = 0; if(!WildMidiHelper::instance()->initialize()) { qWarning("DecoderWildMidi: initialization failed"); return false; } WildMidiHelper::instance()->readSettings(); midi_ptr = WildMidi_Open (m_path.toLocal8Bit()); if(!midi_ptr) { qWarning("DecoderWildMidi: unable to open file"); return false; } WildMidiHelper::instance()->addPtr(midi_ptr); m_sample_rate = WildMidiHelper::instance()->sampleRate(); _WM_Info *wm_info = WildMidi_GetInfo(midi_ptr); m_totalTime = (qint64)wm_info->approx_total_samples * 1000 / WildMidiHelper::instance()->sampleRate(); configure(m_sample_rate, 2, Qmmp::PCM_S16LE); qDebug("DecoderWildMidi: initialize succes"); return true; } qint64 DecoderWildMidi::totalTime() { return m_totalTime; } void DecoderWildMidi::seek(qint64 pos) { ulong sample = (ulong)m_sample_rate * pos / 1000; WildMidi_FastSeek(midi_ptr, &sample); } int DecoderWildMidi::bitrate() { return 8; } qint64 DecoderWildMidi::read(char *data, qint64 size) { return WildMidi_GetOutput (midi_ptr, data, size); } qmmp-0.7.4/src/plugins/Input/wildmidi/CMakeLists.txt0000664000175000017500000000426412256224735021143 0ustar useruserproject(libwildmidi) cmake_minimum_required(VERSION 2.6.0) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 NEW) endif(COMMAND cmake_policy) INCLUDE(CheckIncludeFile) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libwildmidi_SRCS decoder_wildmidi.cpp decoderwildmidifactory.cpp settingsdialog.cpp wildmidihelper.cpp ) SET(libwildmidi_HDRS decoder_wildmidi.h ) SET(libwildmidi_MOC_HDRS decoderwildmidifactory.h settingsdialog.h wildmidihelper.h ) # libwildmidi CHECK_INCLUDE_FILE(wildmidi_lib.h WILDMIDI_HEADER_FOUND) FIND_LIBRARY(WILDMIDI_LIB NAME WildMidi PATHS /usr/lib /usr/lib32 /usr/local/lib /usr/local/lib32) IF(WILDMIDI_HEADER_FOUND AND (NOT WILDMIDI_LIB MATCHES "^.*-NOTFOUND")) SET(WILDMIDI_FOUND TRUE CACHE INTERNAL "wildmidi") MESSAGE(STATUS "Found WildMidi: ${WILDMIDI_LIB}") ELSE(WILDMIDI_HEADER_FOUND AND (NOT WILDMIDI_LIB MATCHES "^.*-NOTFOUND")) MESSAGE(STATUS "Could not find WildMidi library") ENDIF(WILDMIDI_HEADER_FOUND AND (NOT WILDMIDI_LIB MATCHES "^.*-NOTFOUND")) SET(libwildmidi_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libwildmidi_RCC_SRCS ${libwildmidi_RCCS}) QT4_WRAP_CPP(libwildmidi_MOC_SRCS ${libwildmidi_MOC_HDRS}) # user interface SET(libwildmidi_UIS settingsdialog.ui ) QT4_WRAP_UI(libwildmidi_UIS_H ${libwildmidi_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(WILDMIDI_FOUND) ADD_LIBRARY(wildmidi MODULE ${libwildmidi_SRCS} ${libwildmidi_MOC_SRCS} ${libwildmidi_UIS_H} ${libwildmidi_RCC_SRCS} ${libwildmidi_HDRS}) add_dependencies(wildmidi qmmp) target_link_libraries(wildmidi ${QT_LIBRARIES} -lqmmp ${WILDMIDI_LIB}) install(TARGETS wildmidi DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(WILDMIDI_FOUND) qmmp-0.7.4/src/plugins/Input/wildmidi/wildmidi.pro0000664000175000017500000000244512256224735020726 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += decoderwildmidifactory.h \ decoder_wildmidi.h \ wildmidihelper.h \ settingsdialog.h SOURCES += decoder_wildmidi.cpp \ decoderwildmidifactory.cpp \ wildmidihelper.cpp \ settingsdialog.cpp TARGET = $$PLUGINS_PREFIX/Input/wildmidi QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libwildmidi.so INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp \ -L/usr/lib \ -I/usr/include \ -lWildMidi TRANSLATIONS = translations/wildmidi_plugin_it.ts \ translations/wildmidi_plugin_ru.ts \ translations/wildmidi_plugin_cs.ts \ translations/wildmidi_plugin_de.ts \ translations/wildmidi_plugin_zh_CN.ts \ translations/wildmidi_plugin_zh_TW.ts \ translations/wildmidi_plugin_uk_UA.ts \ translations/wildmidi_plugin_pl.ts \ translations/wildmidi_plugin_tr.ts \ translations/wildmidi_plugin_lt.ts \ translations/wildmidi_plugin_nl.ts \ translations/wildmidi_plugin_ja.ts RESOURCES = translations/translations.qrc isEmpty (LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target qmmp-0.7.4/src/plugins/Input/wildmidi/settingsdialog.cpp0000664000175000017500000000623212256224735022124 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "wildmidihelper.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Midi"); QStringList files = WildMidiHelper::instance()->configFiles(); QString conf_path = files.isEmpty() ? QString() : files.first(); m_ui.confPathComboBox->addItems(files); m_ui.confPathComboBox->setEditText(settings.value("conf_path", conf_path).toString()); m_ui.sampleRateComboBox->addItem(tr("44100 Hz"), 44100); m_ui.sampleRateComboBox->addItem(tr("48000 Hz"), 48000); int i = m_ui.sampleRateComboBox->findData(settings.value("sample_rate", 44100).toInt()); m_ui.sampleRateComboBox->setCurrentIndex(i); m_ui.enhancedResamplingCheckBox->setChecked(settings.value("enhanced_resampling", false).toBool()); m_ui.reverbCheckBox->setChecked(settings.value("reverberation", false).toBool()); settings.endGroup(); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Midi"); settings.setValue("conf_path", m_ui.confPathComboBox->currentText()); settings.setValue("sample_rate", m_ui.sampleRateComboBox->itemData(m_ui.sampleRateComboBox->currentIndex())); settings.setValue("enhanced_resampling", m_ui.enhancedResamplingCheckBox->isChecked()); settings.setValue("reverberation", m_ui.reverbCheckBox->isChecked()); settings.endGroup(); WildMidiHelper::instance()->readSettings(); QDialog::accept(); } qmmp-0.7.4/src/plugins/Input/wildmidi/wildmidihelper.cpp0000664000175000017500000001015612256224735022106 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C"{ #include } #include #include "wildmidihelper.h" WildMidiHelper *WildMidiHelper::m_instance = 0; WildMidiHelper::WildMidiHelper(QObject *parent) : QObject(parent) { m_inited = false; m_sample_rate = 0; } WildMidiHelper::~WildMidiHelper() { if(m_inited) WildMidi_Shutdown(); m_instance = 0; } bool WildMidiHelper::initialize() { m_mutex.lock(); if(m_inited) { m_mutex.unlock(); return true; } QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("Midi"); unsigned short int mixer_options = 0; QString conf_path = configFiles().isEmpty() ? QString() : configFiles().first(); conf_path = settings.value("conf_path", conf_path).toString(); if(conf_path.isEmpty() || !QFile::exists(conf_path)) { qWarning("WildMidiHelper: invalid config path: %s", qPrintable(conf_path)); m_mutex.unlock(); return false; } unsigned short int sample_rate = settings.value("sample_rate", 44100).toInt(); if(settings.value("enhanced_resampling", false).toBool()) mixer_options |= WM_MO_ENHANCED_RESAMPLING; if(settings.value("reverberation", false).toBool()) mixer_options |= WM_MO_REVERB; settings.endGroup(); m_sample_rate = sample_rate; if (WildMidi_Init (qPrintable(conf_path), sample_rate, mixer_options) < 0) { qWarning("WildMidiHelper: unable to initialize WildMidi library"); m_mutex.unlock(); return false; } m_inited = true; m_mutex.unlock(); return true; } void WildMidiHelper::readSettings() { m_mutex.lock(); if(!m_ptrs.isEmpty()) { m_mutex.unlock(); return; } if(m_inited) WildMidi_Shutdown(); m_inited = false; m_mutex.unlock(); initialize(); } void WildMidiHelper::addPtr(void *t) { m_mutex.lock(); m_ptrs.append(t); m_mutex.unlock(); } void WildMidiHelper::removePtr(void *t) { m_mutex.lock(); m_ptrs.removeAll(t); m_mutex.unlock(); } QStringList WildMidiHelper::configFiles() const { QStringList files = QStringList() << "/etc/timidity.cfg" << "/etc/timidity/timidity.cfg" << "/etc/wildmidi/wildmidi.cfg"; foreach(QString path, files) { if(!QFile::exists(path)) files.removeAll(path); } return files; } quint32 WildMidiHelper::sampleRate() { return m_sample_rate; } WildMidiHelper *WildMidiHelper::instance() { if(!m_instance) m_instance = new WildMidiHelper(qApp); return m_instance; } qmmp-0.7.4/src/plugins/Input/wildmidi/decoder_wildmidi.h0000664000175000017500000000372412256224735022043 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_WILDMIDI_H #define DECODER_WILDMIDI_H extern "C"{ #include } #include class DecoderWildMidi : public Decoder { public: DecoderWildMidi(const QString &path); virtual ~DecoderWildMidi(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *data, qint64 size); void seek(qint64); private: void *midi_ptr; qint64 m_totalTime; quint32 m_sample_rate; QString m_path; }; #endif // DECODER_WILDMIDI_H qmmp-0.7.4/src/plugins/Input/wildmidi/settingsdialog.ui0000664000175000017500000000552012256224735021756 0ustar useruser SettingsDialog 0 0 339 169 WildMidi Plugin Settings 6 6 6 Instrument configuration: true Sample rate: Enhanced resampling Reverberation 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 214 167 103 160 buttonBox rejected() SettingsDialog reject() 269 174 148 169 qmmp-0.7.4/src/plugins/Input/wildmidi/translations/0000775000175000017500000000000012256224735021116 5ustar useruserqmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_zh_TW.ts0000664000175000017500000000540212256224735025762 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi 插件 Midi Files Midi 文件 About WildMidi Audio Plugin 關於 WildMidi 插件 Qmmp WildMidi Audio Plugin Qmmp WildMidi 插件 This plugin uses WildMidi library to play midi files 此插件使用 WildMidi 庫來播放 Midi 文件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings WildMidi 插件設定 Instrument configuration: 樂器配置: Sample rate: 取樣率 Enhanced resampling 提高再取樣 Reverberation 混響 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_gl_ES.ts0000664000175000017500000000550412256224735025723 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Engadido WildMidi Midi Files Ficheiros Midi About WildMidi Audio Plugin Sobre o engadido WildMidi Qmmp WildMidi Audio Plugin Engadido WildMidi do Qmmp This plugin uses WildMidi library to play midi files Este engadido usa a libraría WildMidi para reproducir ficheiros midi Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Preferencias do engadido WildMidi Instrument configuration: Configuración dos instrumentos: Sample rate: Taxa de mostra: Enhanced resampling Remostraxe mellorada Reverberation Reverberación 44100 Hz 44100 Hz 48000 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/translations.qrc0000664000175000017500000000154512256224735024353 0ustar useruser wildmidi_plugin_ru.qm wildmidi_plugin_uk_UA.qm wildmidi_plugin_zh_CN.qm wildmidi_plugin_zh_TW.qm wildmidi_plugin_tr.qm wildmidi_plugin_cs.qm wildmidi_plugin_pt_BR.qm wildmidi_plugin_de.qm wildmidi_plugin_pl_PL.qm wildmidi_plugin_fr.qm wildmidi_plugin_it.qm wildmidi_plugin_kk.qm wildmidi_plugin_lt.qm wildmidi_plugin_hu.qm wildmidi_plugin_nl.qm wildmidi_plugin_ja.qm wildmidi_plugin_sk.qm wildmidi_plugin_es.qm wildmidi_plugin_he.qm wildmidi_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_uk_UA.ts0000664000175000017500000000577012256224735025743 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Модуль WildMidi Midi Files Файли Midi About WildMidi Audio Plugin Про аудіо модуль WildMidi Qmmp WildMidi Audio Plugin Аудіо-модуль WildMidi для Qmmp This plugin uses WildMidi library to play midi files Цей модуль використовує бібліотеку WildMidi для програвання файлів midi Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Налаштування модуля WildMidi Instrument configuration: Конфігурація інструменту: Sample rate: Частота: Enhanced resampling Покращена передискретизація Reverberation Реверберація 44100 Hz 44100 Гц 48000 Hz 48000 Гц qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_pl_PL.ts0000664000175000017500000000540212256224735025735 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Wtyczka WildMidi Midi Files Pliki Midi About WildMidi Audio Plugin O wtyczce WildMidi Qmmp WildMidi Audio Plugin Wtyczka WildMidi dla Qmmp This plugin uses WildMidi library to play midi files Ta wtyczka używa biblioteki WildMidi do odtwarzania plików midi Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Ustawienia wtyczki WildMidi Instrument configuration: Konfiguracja instrumentów: Sample rate: Próbkowanie: Enhanced resampling Rozszerzony resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_pt_BR.ts0000664000175000017500000000534012256224735025736 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_de.ts0000664000175000017500000000544712256224735025330 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi-Modul Midi Files Midi-Dateien About WildMidi Audio Plugin Über WildMidi-Audio-Modul Qmmp WildMidi Audio Plugin Qmmp WildMidi-Audio-Modul This plugin uses WildMidi library to play midi files Dieses Modul nutzt die WildMidi-Bibliothek, um Midi-Dateien abzuspielen Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Einstellungen WildMidi-Modul Instrument configuration: Instrumenteneinrichtung: Sample rate: Abtastrate: Enhanced resampling Verbessertes Resampling Reverberation Nachhall 44100 Hz 44100 Hz 48000 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_cs.ts0000664000175000017500000000544112256224735025337 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Modul WildMidi Midi Files Soubory Midi About WildMidi Audio Plugin O modulu WildMidi Qmmp WildMidi Audio Plugin Modul Qmmp WildMidi This plugin uses WildMidi library to play midi files Tento modul využívá knihovnu WildMidi pro přehrávání Midi souborů Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Nastavení modulu WildMidi Instrument configuration: Nastavení nástrojů: Sample rate: Vzorkovací kmitočet: Enhanced resampling Vylepšené převzorkování Reverberation Dozvuk 44100 Hz 44100 Hz 48000 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_es.ts0000664000175000017500000000534012256224735025337 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_fr.ts0000664000175000017500000000534012256224735025337 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_he.ts0000664000175000017500000000561212256224735025326 0ustar useruser DecoderWildMidiFactory WildMidi Plugin תוספת WildMidi Midi Files קבצי Midi About WildMidi Audio Plugin אודות תוספת שמע WildMidi Qmmp WildMidi Audio Plugin תוספת שמע WildMidi ‫Qmmp This plugin uses WildMidi library to play midi files תוספת זו עושה שימוש בספריית WildMidi לניגון של קבצי midi Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings הגדרות תוספת WildMidi Instrument configuration: תצורת מכשיר: Sample rate: שיעור דגימה: Enhanced resampling דגימה מחדש משופרת Reverberation הדהוד 44100 Hz 44100 הרץ 48000 Hz 48000 הרץ qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_hu.ts0000664000175000017500000000534012256224735025344 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_ja.ts0000664000175000017500000000563212256224735025326 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi プラグイン Midi Files MIDI ファイル About WildMidi Audio Plugin WildMidi 音響プラグインについて Qmmp WildMidi Audio Plugin QMMP WildMidi 音響プラグイン This plugin uses WildMidi library to play midi files このプラグインは MIDI ファイルの再生に WildMidi ライブラリを利用します Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings WildMidi プラグイン設定 Instrument configuration: 楽器編成: Sample rate: サンプルレート: Enhanced resampling 拡張リサンプリング Reverberation 反響効果 (リバーブ) 44100 Hz 44100 Hz 48000 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_it.ts0000664000175000017500000000541512256224735025347 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_kk.ts0000664000175000017500000000534012256224735025335 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_lt.ts0000664000175000017500000000546512256224735025357 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi įskiepis Midi Files Midi bylos About WildMidi Audio Plugin Apie WildMidi Audio įskiepį Qmmp WildMidi Audio Plugin Qmmp WildMidi Audio įskiepis This plugin uses WildMidi library to play midi files Šis įskiepis naudoja WildMidi biblioteką midi bylų grojimui Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings WildMidi įskiepio nustatymai Instrument configuration: Instrumentų nustatymai: Sample rate: Enhanced resampling Reverberation 44100 Hz 44100 Hz 48000 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_nl.ts0000664000175000017500000000550012256224735025337 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi Module Midi Files Midi Bestanden About WildMidi Audio Plugin Over de WildMidi Audio Module Qmmp WildMidi Audio Plugin WildMidi Audio Module voor Qmmp This plugin uses WildMidi library to play midi files Deze plugin faciliteert in het afspelen van midi bestanden, gebruikmakend van de WildMidi bibliotheek Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings WildMidi Module Instellingen Instrument configuration: Instrument instellingen: Sample rate: Sample frequentie: Enhanced resampling Verbeterde resampling Reverberation Galm 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_pl.ts0000664000175000017500000000540212256224735025342 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Wtyczka WildMidi Midi Files Pliki Midi About WildMidi Audio Plugin O wtyczce WildMidi Qmmp WildMidi Audio Plugin Wtyczka WildMidi dla Qmmp This plugin uses WildMidi library to play midi files Ta wtyczka używa biblioteki WildMidi do odtwarzania plików midi Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Ustawienia wtyczki WildMidi Instrument configuration: Konfiguracja instrumentów: Sample rate: Próbkowanie: Enhanced resampling Rozszerzony resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_ru.ts0000664000175000017500000000576412256224735025370 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Модуль WildMidi Midi Files Файлы midi About WildMidi Audio Plugin Об аудио-модуле WildMdi Qmmp WildMidi Audio Plugin Модуль WildMidi для Qmmp This plugin uses WildMidi library to play midi files Для воспроизведения midi-файлов используется библиотека WildMidi Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Настройка модуля WildMidi Instrument configuration: Настройки инструментов: Sample rate: Частота дискретизации: Enhanced resampling Улучшенная передискретизация Reverberation Реверберация 44100 Hz 44100 Гц 48000 Hz 48000 Гц qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_sk.ts0000664000175000017500000000534012256224735025345 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_tr.ts0000664000175000017500000000541712256224735025362 0ustar useruser DecoderWildMidiFactory WildMidi Plugin Midi Files About WildMidi Audio Plugin Qmmp WildMidi Audio Plugin This plugin uses WildMidi library to play midi files Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings Instrument configuration: Sample rate: Enhanced resampling Reverberation 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/translations/wildmidi_plugin_zh_CN.ts0000664000175000017500000000542412256224735025734 0ustar useruser DecoderWildMidiFactory WildMidi Plugin WildMidi 插件 Midi Files Midi 文件 About WildMidi Audio Plugin 关于 WildMidi 音频插件 Qmmp WildMidi Audio Plugin Qmmp WildMidi 音频插件 This plugin uses WildMidi library to play midi files 此插件使用 WildMidi 库来播放 midi 文件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog WildMidi Plugin Settings WildMidi 插件设置 Instrument configuration: 乐器配置 Sample rate: 取样率: Enhanced resampling 提高再取样 Reverberation 混响效果 44100 Hz 48000 Hz qmmp-0.7.4/src/plugins/Input/wildmidi/decoderwildmidifactory.cpp0000664000175000017500000001023712256224735023624 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "wildmidihelper.h" #include "decoder_wildmidi.h" #include "settingsdialog.h" #include "decoderwildmidifactory.h" // DecoderWildMidiFactory bool DecoderWildMidiFactory::supports(const QString &source) const { return (source.right(4).toLower() == ".mid"); } bool DecoderWildMidiFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderWildMidiFactory::properties() const { DecoderProperties properties; properties.name = tr("WildMidi Plugin"); properties.filters << "*.mid"; properties.description = tr("Midi Files"); //properties.contentType = ; properties.shortName = "wildmidi"; properties.hasAbout = true; properties.hasSettings = true; properties.noInput = true; properties.protocols << "file"; WildMidiHelper::instance()->initialize(); return properties; } Decoder *DecoderWildMidiFactory::create(const QString &path, QIODevice *input) { Q_UNUSED(input); return new DecoderWildMidi(path); } QList DecoderWildMidiFactory::createPlayList(const QString &fileName, bool useMetaData) { Q_UNUSED(useMetaData); QList list; FileInfo *info = new FileInfo(fileName); if(WildMidiHelper::instance()->initialize() && WildMidiHelper::instance()->sampleRate()) { void *midi_ptr = WildMidi_Open (fileName.toLocal8Bit()); if(midi_ptr) { WildMidiHelper::instance()->addPtr(midi_ptr); _WM_Info *wm_info = WildMidi_GetInfo(midi_ptr); info->setLength((qint64)wm_info->approx_total_samples / WildMidiHelper::instance()->sampleRate()); WildMidi_Close(midi_ptr); WildMidiHelper::instance()->removePtr(midi_ptr); } } list << info; return list; } MetaDataModel* DecoderWildMidiFactory::createMetaDataModel(const QString &path, QObject *parent) { Q_UNUSED(path); Q_UNUSED(parent); return 0; } void DecoderWildMidiFactory::showSettings(QWidget *parent) { SettingsDialog *d = new SettingsDialog(parent); d->show(); } void DecoderWildMidiFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About WildMidi Audio Plugin"), tr("Qmmp WildMidi Audio Plugin")+"\n"+ tr("This plugin uses WildMidi library to play midi files")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderWildMidiFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/wildmidi_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(wildmidi,DecoderWildMidiFactory) qmmp-0.7.4/src/plugins/Input/wildmidi/settingsdialog.h0000664000175000017500000000346012256224735021571 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog m_ui; }; #endif qmmp-0.7.4/src/plugins/Input/wildmidi/decoderwildmidifactory.h0000664000175000017500000000445212256224735023273 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERWILDMIDIFACTORY_H #define DECODERWILDMIDIFACTORY_H #include #include #include #include #include #include #include #include class DecoderWildMidiFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *input); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/vorbis/0000775000175000017500000000000012256224735016077 5ustar useruserqmmp-0.7.4/src/plugins/Input/vorbis/decodervorbisfactory.h0000664000175000017500000000471312256224735022477 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERVORBISFACTORY_H #define DECODERVORBISFACTORY_H #include #include #include #include #include #include #include #include #include /** @author Ilya Kotov */ class DecoderVorbisFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &path, QIODevice *input); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); QList createPlayList(const QString &fileName, bool useMetaData); QObject* showDetails(QWidget *parent, const QString &path); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/vorbis/decoder_vorbis.cpp0000664000175000017500000001454312256224735021603 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #include #include #include #include #include #include "decoder_vorbis.h" // ic functions for OggVorbis static size_t oggread (void *buf, size_t size, size_t nmemb, void *src) { if (! src) return 0; DecoderVorbis *dogg = (DecoderVorbis *) src; int len = dogg->input()->read((char *) buf, (size * nmemb)); return len / size; } static int oggseek(void *src, ogg_int64_t offset, int whence) { DecoderVorbis *dogg = (DecoderVorbis *) src; if ( dogg->input()->isSequential ()) return -1; long start = 0; switch (whence) { case SEEK_END: start = dogg->input()->size(); break; case SEEK_CUR: start = dogg->input()->pos(); break; case SEEK_SET: default: start = 0; } if (dogg->input()->seek(start + offset)) return 0; return -1; } static int oggclose(void *) { return 0; } static long oggtell(void *src) { DecoderVorbis *dogg = (DecoderVorbis *) src; long t = dogg->input()->pos(); return t; } // Decoder class DecoderVorbis::DecoderVorbis(const QString &url, QIODevice *i) : Decoder(i) { inited = false; m_totalTime = 0; m_section = 0; m_last_section = -1; m_bitrate = 0; m_url = url; } DecoderVorbis::~DecoderVorbis() { deinit(); } bool DecoderVorbis::initialize() { qDebug("DecoderVorbis: initialize"); inited = false; m_totalTime = 0; if (!input()) { qDebug("DecoderVorbis: cannot initialize. No input"); return false; } if (!input()->isOpen()) { if (!input()->open(QIODevice::ReadOnly)) { qWarning("%s",qPrintable("DecoderVorbis: failed to open input. " + input()->errorString () + ".")); return false; } } ov_callbacks oggcb = { oggread, oggseek, oggclose, oggtell }; if (ov_open_callbacks(this, &oggfile, NULL, 0, oggcb) < 0) { qWarning("DecoderVorbis: cannot open stream"); return false; } quint32 freq = 0; m_bitrate = ov_bitrate(&oggfile, -1) / 1000; int chan = 0; if((m_totalTime = ov_time_total(&oggfile, -1) * 1000) < 0) m_totalTime = 0; vorbis_info *ogginfo = ov_info(&oggfile, -1); if (ogginfo) { freq = ogginfo->rate; chan = ogginfo->channels; } configure(freq, chan, Qmmp::PCM_S16LE); inited = true; return true; } qint64 DecoderVorbis::totalTime() { if (!inited) return 0; return m_totalTime; } int DecoderVorbis::bitrate() { return m_bitrate; } void DecoderVorbis::deinit() { if (inited) ov_clear(&oggfile); len = 0; } void DecoderVorbis::updateTags() { int i; vorbis_comment *comments; QMap metaData; comments = ov_comment (&oggfile, -1); for (i = 0; i < comments->comments; i++) { if (!strncasecmp(comments->user_comments[i], "title=", strlen ("title="))) metaData.insert(Qmmp::TITLE, QString::fromUtf8(comments->user_comments[i] + strlen ("title="))); else if (!strncasecmp(comments->user_comments[i], "artist=", strlen ("artist="))) metaData.insert(Qmmp::ARTIST, QString::fromUtf8(comments->user_comments[i] + strlen ("artist="))); else if (!strncasecmp(comments->user_comments[i], "album=", strlen ("album="))) metaData.insert(Qmmp::ALBUM, QString::fromUtf8(comments->user_comments[i] + strlen ("album="))); else if (!strncasecmp(comments->user_comments[i], "comment=", strlen ("comment="))) metaData.insert(Qmmp::COMMENT, QString::fromUtf8(comments->user_comments[i] + strlen ("comment="))); else if (!strncasecmp(comments->user_comments[i], "genre=", strlen ("genre="))) metaData.insert(Qmmp::GENRE, QString::fromUtf8 (comments->user_comments[i] + strlen ("genre="))); else if (!strncasecmp(comments->user_comments[i], "tracknumber=", strlen ("tracknumber="))) metaData.insert(Qmmp::TRACK, QString::number(atoi(comments->user_comments[i] + strlen ("tracknumber=")))); else if (!strncasecmp(comments->user_comments[i], "track=", strlen ("track="))) metaData.insert(Qmmp::TRACK, QString::number(atoi(comments->user_comments[i] + strlen ("track=")))); else if (!strncasecmp(comments->user_comments[i], "date=", strlen ("date="))) metaData.insert(Qmmp::YEAR, QString::number(atoi(comments->user_comments[i] + strlen ("date=")))); else if (!strncasecmp(comments->user_comments[i], "composer=", strlen ("composer="))) metaData.insert(Qmmp::COMPOSER, QString::fromUtf8 (comments->user_comments[i] + strlen ("composer="))); else if (!strncasecmp(comments->user_comments[i], "discnumber=", strlen ("discnumber="))) metaData.insert(Qmmp::DISCNUMBER, QString::number(atoi(comments->user_comments[i] + strlen ("discnumber=")))); } metaData.insert(Qmmp::URL, m_url); addMetaData(metaData); } void DecoderVorbis::seek(qint64 time) { ov_time_seek(&oggfile, (double) time/1000); } qint64 DecoderVorbis::read(char *data, qint64 maxSize) { len = -1; while (len < 0) len = ov_read(&oggfile, data, maxSize, 0, 2, 1, &m_section); if (m_section != m_last_section) updateTags(); m_last_section = m_section; if(len > 0) m_bitrate = ov_bitrate_instant(&oggfile) / 1000; return len; } qmmp-0.7.4/src/plugins/Input/vorbis/vorbis.pro0000664000175000017500000000272012256224735020126 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decodervorbisfactory.h \ decoder_vorbis.h \ vorbismetadatamodel.h \ replaygainreader.h SOURCES += decoder_vorbis.cpp \ decodervorbisfactory.cpp \ vorbismetadatamodel.cpp \ replaygainreader.cpp TARGET = $$PLUGINS_PREFIX/Input/vorbis INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/vorbis_plugin_ru.ts \ translations/vorbis_plugin_uk_UA.ts \ translations/vorbis_plugin_zh_CN.ts \ translations/vorbis_plugin_zh_TW.ts \ translations/vorbis_plugin_cs.ts \ translations/vorbis_plugin_pl.ts \ translations/vorbis_plugin_de.ts \ translations/vorbis_plugin_it.ts \ translations/vorbis_plugin_tr.ts \ translations/vorbis_plugin_lt.ts \ translations/vorbis_plugin_nl.ts \ translations/vorbis_plugin_ja.ts \ translations/vorbis_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty (LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target PKGCONFIG += taglib ogg vorbisfile vorbis LIBS += -lqmmp QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libvorbis.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lvorbisfile -lvorbis -logg -ltag.dll -lm LD_FLAGS += -no-undefined } qmmp-0.7.4/src/plugins/Input/vorbis/CMakeLists.txt0000664000175000017500000000341112256224735020636 0ustar useruserproject(libvorbis) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libvorbis and taglib pkg_check_modules(VORBIS ogg vorbis vorbisfile) include_directories(${VORBIS_INCLUDE_DIRS} ${TAGLIB_INCLUDE_DIRS}) link_directories(${VORBIS_LIBRARY_DIRS} ${TAGLIB_LIBRARY_DIRS}) ADD_DEFINITIONS(${VORBIS_CFLAGS} ${TAGLIB_CFLAGS}) SET(libvorbis_SRCS decoder_vorbis.cpp decodervorbisfactory.cpp vorbismetadatamodel.cpp replaygainreader.cpp ) SET(libvorbis_HDRS decoder_vorbis.h replaygainreader.h ) SET(libvorbis_MOC_HDRS decodervorbisfactory.h vorbismetadatamodel.h ) SET(libvorbis_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libvorbis_RCC_SRCS ${libvorbis_RCCS}) QT4_WRAP_CPP(libvorbis_MOC_SRCS ${libvorbis_MOC_HDRS}) # user interface QT4_WRAP_UI(libvorbis_UIS_H ${libvorbis_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(VORBIS_FOUND) ADD_LIBRARY(vorbis MODULE ${libvorbis_SRCS} ${libvorbis_MOC_SRCS} ${libvorbis_RCC_SRCS} ${libvorbis_HDRS}) add_dependencies(vorbis qmmp) target_link_libraries(vorbis ${QT_LIBRARIES} -lqmmp ${VORBIS_LDFLAGS} ${TAGLIB_LDFLAGS}) install(TARGETS vorbis DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(VORBIS_FOUND) qmmp-0.7.4/src/plugins/Input/vorbis/translations/0000775000175000017500000000000012256224735020620 5ustar useruserqmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_uk_UA.ts0000664000175000017500000000573012256224735025143 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Модуль Ogg Vorbis Ogg Vorbis Files Файли Ogg Vorbis About Ogg Vorbis Audio Plugin Про аудіо-модуль Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin Аудіо-модуль Ogg Vorbis для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Source code based on mq3 project Вихідний код базується на проекті mq3 VorbisMetaDataModel Length Тривалість Sample rate Частота Hz Гц Channels Канали Bitrate Бітрейт kbps Кб/с File size Розмір файлу KB Кб qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_pl_PL.ts0000664000175000017500000000554012256224735025144 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Wtyczka Ogg Vorbis Ogg Vorbis Files Pliki Ogg Vorbis About Ogg Vorbis Audio Plugin O wtyczce Ogg Vorbis Audio Qmmp Ogg Vorbis Audio Plugin Wtyczka Ogg Vorbis dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Kod źródłowy oparty jest na projekcie mq3 VorbisMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_pt_BR.ts0000664000175000017500000000555312256224735025150 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Files About Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project VorbisMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/translations.qrc0000664000175000017500000000147512256224735024057 0ustar useruser vorbis_plugin_ru.qm vorbis_plugin_uk_UA.qm vorbis_plugin_zh_CN.qm vorbis_plugin_zh_TW.qm vorbis_plugin_tr.qm vorbis_plugin_cs.qm vorbis_plugin_pt_BR.qm vorbis_plugin_de.qm vorbis_plugin_pl_PL.qm vorbis_plugin_fr.qm vorbis_plugin_it.qm vorbis_plugin_kk.qm vorbis_plugin_lt.qm vorbis_plugin_hu.qm vorbis_plugin_nl.qm vorbis_plugin_ja.qm vorbis_plugin_sk.qm vorbis_plugin_es.qm vorbis_plugin_he.qm vorbis_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_de.ts0000664000175000017500000000551612256224735024531 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg-Vorbis-Modul Ogg Vorbis Files Ogg-Vorbis-Dateien About Ogg Vorbis Audio Plugin Über Ogg-Vorbis-Audio-Modul Qmmp Ogg Vorbis Audio Plugin Qmmp Ogg-Vorbis-Audio-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Quellcode basiert auf dem mq3-Projekt VorbisMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Channels Kanäle Bitrate Bitrate kbps kbps File size Dateigröße KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_cs.ts0000664000175000017500000000554612256224735024551 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Modul Ogg-Vorbis Ogg Vorbis Files Soubory Ogg-Vorbis About Ogg Vorbis Audio Plugin O modulu Ogg-Vorbis Qmmp Ogg Vorbis Audio Plugin Vstupní modul Qmmp Ogg-Vorbis Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Zdrojový kód je založen na projektu mq3 VorbisMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů Bitrate Datový tok kbps kbps File size Velikost souboru KB KiB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_es.ts0000664000175000017500000000556512256224735024554 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Módulo Ogg Vorbis Ogg Vorbis Files Archivos Ogg Vorbis About Ogg Vorbis Audio Plugin Acerca del módulo de sonido Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin Módulo de sonido Ogg Vorbis para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Código basado en el proyecto mq3 VorbisMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Channels Canales Bitrate Tasa de bits kbps kbps File size Tamaño del archivo KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_fr.ts0000664000175000017500000000555312256224735024551 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Files About Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project VorbisMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_he.ts0000664000175000017500000000566612256224735024543 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin תוספת Ogg Vorbis Ogg Vorbis Files קבצי Ogg Vorbis About Ogg Vorbis Audio Plugin אודות תוספת שמע Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin תוספת שמע Ogg Vorbis ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Source code based on mq3 project קוד מקוד מבוסס על פרויקט mq3 VorbisMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Channels ערוצים Bitrate שיעור סיביות kbps File size גודל קובץ KB ק״ב qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_hu.ts0000664000175000017500000000555312256224735024556 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Files About Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project VorbisMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_ja.ts0000664000175000017500000000573512256224735024536 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis プラグイン Ogg Vorbis Files Ogg Vorbis ファイル About Ogg Vorbis Audio Plugin Ogg Vorbis 音響プラグインについて Qmmp Ogg Vorbis Audio Plugin QMMP Ogg Vorbis 音響プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Source code based on mq3 project ソースコードは mq3 プロジェクトから流用 VorbisMetaDataModel Length 長さ Sample rate サンプルレート Hz Hz Channels チャンネル Bitrate ビットレート kbps キロビット毎秒 File size ファイルの大きさ KB KiB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_it.ts0000664000175000017500000000554212256224735024554 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Modulo Ogg Vorbis Ogg Vorbis Files Brani Ogg Vorbis About Ogg Vorbis Audio Plugin Info sul modulo audio Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin Modulo audio Ogg Vorbis per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Codice sorgente basato sul Progetto mq3 VorbisMetaDataModel Length Durata Sample rate Campionamento Hz Hz Channels Canali Bitrate bit al secondo kbps kbps File size Dimensione file KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_kk.ts0000664000175000017500000000555312256224735024547 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Files About Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project VorbisMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_lt.ts0000664000175000017500000000552512256224735024560 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis įskiepis Ogg Vorbis Files Ogg Vorbis bylos About Ogg Vorbis Audio Plugin Apie Ogg Vorbis audio įskiepį Qmmp Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis audio įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Išvesties kodas sukurtas mq3 pagrindu VorbisMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Channels Kanalai Bitrate Kokybė kbps kbps File size Bylos dydis KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_nl.ts0000664000175000017500000000554612256224735024555 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Module Ogg Vorbis Files Ogg Vorbis Bestanden About Ogg Vorbis Audio Plugin Over de Ogg Vorbis Audio Module Qmmp Ogg Vorbis Audio Plugin Ogg Vorbis Audio Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Broncode gebasseerd op het 'mq3 project' VorbisMetaDataModel Length Duur Sample rate Sample frequentie Hz Channels Kanalen Bitrate Bitsnelheid kbps File size Bestandsnaam KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_pl.ts0000664000175000017500000000554012256224735024551 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Wtyczka Ogg Vorbis Ogg Vorbis Files Pliki Ogg Vorbis About Ogg Vorbis Audio Plugin O wtyczce Ogg Vorbis Audio Qmmp Ogg Vorbis Audio Plugin Wtyczka Ogg Vorbis dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Kod źródłowy oparty jest na projekcie mq3 VorbisMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_ru.ts0000664000175000017500000000576712256224735024577 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Модуль Ogg Vorbis Ogg Vorbis Files Файлы Ogg Vorbis About Ogg Vorbis Audio Plugin Об аудио-модуле Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin Аудио-модуль Ogg Vorbis для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Source code based on mq3 project Исходный код основан на проекте mq3 VorbisMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Channels Каналов Bitrate Битовая частота kbps Кб/с File size Размер файла KB КБ qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_sk.ts0000664000175000017500000000555312256224735024557 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Files About Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Audio Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project VorbisMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_tr.ts0000664000175000017500000000570012256224735024561 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis Eklentisi Ogg Vorbis Files Ogg Vorbis Dosyaları About Ogg Vorbis Audio Plugin Ogg Vorbis Ses Eklentisi Hakkında Qmmp Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis Ses Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Kaynak kodu mq3 projesi temellidir VorbisMetaDataModel Length Sample rate Hz Hz Channels Bitrate kbps kbps File size KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_CN.ts0000664000175000017500000000557412256224735025146 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis 插件 Ogg Vorbis Files Ogg Vorbis 文件 About Ogg Vorbis Audio Plugin 关于 Ogg Vorbis 音频插件 Qmmp Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis 音频插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project 源代码基于 mq3 项目 VorbisMetaDataModel Length 长度 Sample rate 取样率 Hz Channels 声音通道 Bitrate 比特率 kbps File size 文件大小 KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_TW.ts0000664000175000017500000000560112256224735025167 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Ogg Vorbis 插件 Ogg Vorbis Files Ogg Vorbis 檔案 About Ogg Vorbis Audio Plugin 關於 Ogg Vorbis 聲訊插件 Qmmp Ogg Vorbis Audio Plugin Qmmp Ogg Vorbis 聲訊插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project 源碼基於 mq3 項目 VorbisMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Channels 聲音通道 Bitrate 比特率 kbps kbps File size 文件大小 KB KB qmmp-0.7.4/src/plugins/Input/vorbis/translations/vorbis_plugin_gl_ES.ts0000664000175000017500000000555212256224735025132 0ustar useruser DecoderVorbisFactory Ogg Vorbis Plugin Engadido Ogg Vorbis Ogg Vorbis Files Ficheiros Ogg Vorbis About Ogg Vorbis Audio Plugin Sobre o engadido Ogg Vorbis Qmmp Ogg Vorbis Audio Plugin Engadido Ogg Vorbis de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Source code based on mq3 project Código fonte baseado no proxecto mq3 VorbisMetaDataModel Length Lonxitude Sample rate Taxa de mostra Hz Hz Channels Canais Bitrate Taxa de bits kbps kbps File size Tamaño do ficheiro KB KB qmmp-0.7.4/src/plugins/Input/vorbis/decoder_vorbis.h0000664000175000017500000000160012256224735021236 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef DECODER_VORBIS_H #define DECODER_VORBIS_H #include #include class DecoderVorbis : public Decoder { public: DecoderVorbis(const QString &url, QIODevice *i); virtual ~DecoderVorbis(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); private: virtual qint64 read(char *data, qint64 maxSize); virtual void seek(qint64 time); // helper functions void deinit(); void updateTags(); // OggVorbis Decoder OggVorbis_File oggfile; qint64 m_totalTime; long len; int m_section, m_last_section; int m_bitrate; bool inited; QString m_url; }; #endif // __decoder_vorbis_h qmmp-0.7.4/src/plugins/Input/vorbis/vorbismetadatamodel.cpp0000664000175000017500000001630212256224735022633 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "vorbismetadatamodel.h" #define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) #define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() VorbisMetaDataModel::VorbisMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_path = path; m_tags << new VorbisCommentModel(path); } VorbisMetaDataModel::~VorbisMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); } QHash VorbisMetaDataModel::audioProperties() { QHash ap; TagLib::Ogg::Vorbis::File f (m_path.toLocal8Bit().constData()); if(f.audioProperties()) { QString text = QString("%1").arg(f.audioProperties()->length()/60); text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); } return ap; } QList VorbisMetaDataModel::tags() { return m_tags; } QPixmap VorbisMetaDataModel::cover() { TagLib::Ogg::Vorbis::File file(m_path.toLocal8Bit().constData()); TagLib::Ogg::XiphComment *tag = file.tag(); if(!tag) return QPixmap(); TagLib::StringList list = tag->fieldListMap()["METADATA_BLOCK_PICTURE"]; if(list.isEmpty()) return QPixmap(); for(uint i = 0; i < list.size(); ++i) { TagLib::String value = list[i]; QByteArray block = QByteArray::fromBase64(TStringToQString_qt4(value).toAscii()); if(block.size() < 32) continue; qint64 pos = 0; if(readPictureBlockField(block, pos) != 3) //picture type, use front cover only continue; pos += 4; int mimeLength = readPictureBlockField(block, pos); //mime type length pos += 4; pos += mimeLength; //skip mime type int descLength = readPictureBlockField(block, pos); //description length pos += 4; pos += descLength; //skip description pos += 4; //width pos += 4; //height pos += 4; //color depth pos += 4; //the number of colors used int length = readPictureBlockField(block, pos); //picture size pos += 4; QPixmap cover; cover.loadFromData(block.mid(pos, length)); //read binary picture data return cover; } return QPixmap(); } ulong VorbisMetaDataModel::readPictureBlockField(QByteArray data, int offset) { return (((uchar)data.data()[offset] & 0xff) << 24) | (((uchar)data.data()[offset+1] & 0xff) << 16) | (((uchar)data.data()[offset+2] & 0xff) << 16) | ((uchar)data.data()[offset+3] & 0xff); } VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) { m_file = new TagLib::Ogg::Vorbis::File (path.toLocal8Bit().constData()); m_tag = m_file->tag(); } VorbisCommentModel::~VorbisCommentModel() { delete m_file; } const QString VorbisCommentModel::name() { return "Vorbis Comment"; } const QString VorbisCommentModel::value(Qmmp::MetaData key) { if(!m_tag) return QString(); switch((int) key) { case Qmmp::TITLE: return TStringToQString_qt4(m_tag->title()); case Qmmp::ARTIST: return TStringToQString_qt4(m_tag->artist()); case Qmmp::ALBUM: return TStringToQString_qt4(m_tag->album()); case Qmmp::COMMENT: return TStringToQString_qt4(m_tag->comment()); case Qmmp::GENRE: return TStringToQString_qt4(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: return QString::number(m_tag->track()); case Qmmp::DISCNUMBER: if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) { if(!m_tag) return; TagLib::String str = QStringToTString_qt4(value); switch((int) key) { case Qmmp::TITLE: m_tag->setTitle(str); return; case Qmmp::ARTIST: m_tag->setArtist(str); return; case Qmmp::ALBUM: m_tag->setAlbum(str); return; case Qmmp::COMMENT: m_tag->setComment(str); return; case Qmmp::GENRE: m_tag->setGenre(str); return; case Qmmp::COMPOSER: value.isEmpty() ? m_tag->removeField("COMPOSER"): m_tag->addField("COMPOSER", str, true); return; case Qmmp::TRACK: m_tag->setTrack(value.toInt()); return; case Qmmp::YEAR: m_tag->setYear(value.toInt()); return; case Qmmp::DISCNUMBER: value == "0" ? m_tag->removeField("DISCNUMBER"): m_tag->addField("DISCNUMBER", str, true); } } void VorbisCommentModel::save() { if(m_tag) m_file->save(); //taglib bug workarround QString path = QString::fromLocal8Bit(m_file->name()); delete m_file; m_file = new TagLib::Ogg::Vorbis::File(path.toLocal8Bit().constData()); m_tag = m_file->tag(); } qmmp-0.7.4/src/plugins/Input/vorbis/replaygainreader.h0000664000175000017500000000374212256224735021574 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAINREADER_H #define REPLAYGAINREADER_H #include #include #include #include /** @author Ilya Kotov */ class ReplayGainReader { public: ReplayGainReader(const QString &path); QMap replayGainInfo() const; private: void readVorbisComment(TagLib::Ogg::XiphComment *comment); void setValue(Qmmp::ReplayGainKey key, QString value); QMap m_values; }; #endif // REPLAYGAINREADER_H qmmp-0.7.4/src/plugins/Input/vorbis/replaygainreader.cpp0000664000175000017500000000550312256224735022124 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { TagLib::Ogg::Vorbis::File fileRef(path.toLocal8Bit ().constData()); if(fileRef.tag()) readVorbisComment(fileRef.tag()); } QMap ReplayGainReader::replayGainInfo() const { return m_values; } void ReplayGainReader::readVorbisComment(TagLib::Ogg::XiphComment *comment) { TagLib::Ogg::FieldListMap items = comment->fieldListMap(); if (items.contains("REPLAYGAIN_TRACK_GAIN")) setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].front())); if (items.contains("REPLAYGAIN_TRACK_PEAK")) setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].front())); if (items.contains("REPLAYGAIN_ALBUM_GAIN")) setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN,TStringToQString(items["REPLAYGAIN_ALBUM_GAIN"].front())); if (items.contains("REPLAYGAIN_ALBUM_PEAK")) setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK,TStringToQString(items["REPLAYGAIN_ALBUM_PEAK"].front())); } void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) { value.remove(" dB"); if(value.isEmpty()) return; bool ok; double v = value.toDouble(&ok); if(ok) m_values[key] = v; } qmmp-0.7.4/src/plugins/Input/vorbis/decodervorbisfactory.cpp0000664000175000017500000001245312256224735023032 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "replaygainreader.h" #include "decoder_vorbis.h" #include "vorbismetadatamodel.h" #include "decodervorbisfactory.h" // DecoderOggFactory bool DecoderVorbisFactory::supports(const QString &source) const { return source.right(4).toLower() == ".ogg"; } bool DecoderVorbisFactory::canDecode(QIODevice *input) const { char buf[36]; if (input->peek(buf, 36) == 36 && !memcmp(buf, "OggS", 4) && !memcmp(buf + 29, "vorbis", 6)) return true; return false; } const DecoderProperties DecoderVorbisFactory::properties() const { DecoderProperties properties; properties.name = tr("Ogg Vorbis Plugin"); properties.shortName = "vorbis"; properties.filters << "*.ogg"; properties.description = tr("Ogg Vorbis Files"); properties.contentTypes << "application/ogg" << "audio/x-vorbis+ogg"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = false; return properties; } Decoder *DecoderVorbisFactory::create(const QString &url, QIODevice *input) { Decoder *d = new DecoderVorbis(url, input); if(!url.contains("://")) //local file { ReplayGainReader rg(url); d->setReplayGainInfo(rg.replayGainInfo()); } return d; } MetaDataModel* DecoderVorbisFactory::createMetaDataModel(const QString &path, QObject *parent) { return new VorbisMetaDataModel(path, parent); } QList DecoderVorbisFactory::createPlayList(const QString &fileName, bool useMetaData) { FileInfo *info = new FileInfo(fileName); TagLib::Ogg::Vorbis::File fileRef(fileName.toLocal8Bit().constData()); TagLib::Ogg::XiphComment *tag = useMetaData ? fileRef.tag() : 0; if (tag && !tag->isEmpty()) { info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(tag->album().toCString(true)).trimmed()); info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(tag->artist().toCString(true)).trimmed()); info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(tag->comment().toCString(true)).trimmed()); info->setMetaData(Qmmp::GENRE, QString::fromUtf8(tag->genre().toCString(true)).trimmed()); info->setMetaData(Qmmp::TITLE, QString::fromUtf8(tag->title().toCString(true)).trimmed()); info->setMetaData(Qmmp::YEAR, tag->year()); info->setMetaData(Qmmp::TRACK, tag->track()); } if (fileRef.audioProperties()) info->setLength(fileRef.audioProperties()->length()); //additional metadata if(tag) { TagLib::StringList fld; if(!(fld = tag->fieldListMap()["COMPOSER"]).isEmpty()) info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); if(!(fld = tag->fieldListMap()["DISCNUMBER"]).isEmpty()) info->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(fld.toString().toCString(true)).trimmed()); } QList list; list << info; return list; } void DecoderVorbisFactory::showSettings(QWidget *) {} void DecoderVorbisFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Ogg Vorbis Audio Plugin"), tr("Qmmp Ogg Vorbis Audio Plugin")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Source code based on mq3 project") ); } QTranslator *DecoderVorbisFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/vorbis_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(vorbis,DecoderVorbisFactory) qmmp-0.7.4/src/plugins/Input/vorbis/vorbismetadatamodel.h0000664000175000017500000000454112256224735022302 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VORBISMETADATAMODEL_H #define VORBISMETADATAMODEL_H #include #include #include class VorbisMetaDataModel : public MetaDataModel { Q_OBJECT public: VorbisMetaDataModel(const QString &path, QObject *parent); ~VorbisMetaDataModel(); QHash audioProperties(); QList tags(); QPixmap cover(); private: QString m_path; QList m_tags; ulong readPictureBlockField(QByteArray data, int offset); }; class VorbisCommentModel : public TagModel { public: VorbisCommentModel(const QString &path); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); void save(); private: TagLib::Ogg::Vorbis::File *m_file; TagLib::Ogg::XiphComment *m_tag; }; #endif // VORBISMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/wavpack/0000775000175000017500000000000012256224735016227 5ustar useruserqmmp-0.7.4/src/plugins/Input/wavpack/wavpackmetadatamodel.h0000664000175000017500000000446212256224735022564 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef WAVPACKMETADATAMODEL_H #define WAVPACKMETADATAMODEL_H extern "C"{ #include } #include class WavPackMetaDataModel : public MetaDataModel { Q_OBJECT public: WavPackMetaDataModel(const QString &path, QObject *parent); ~WavPackMetaDataModel(); QHash audioProperties(); QList tags(); QPixmap cover(); QString coverPath(); private: WavpackContext *m_ctx; QList m_tags; QString m_path; }; class WavPackFileTagModel : public TagModel { public: WavPackFileTagModel(WavpackContext *ctx); ~WavPackFileTagModel(); const QString name(); const QString value(Qmmp::MetaData key); void setValue(Qmmp::MetaData key, const QString &value); void save(); private: WavpackContext *m_ctx; QString m_path; }; #endif // WAVPACKMETADATAMODEL_H qmmp-0.7.4/src/plugins/Input/wavpack/decoder_wavpack.cpp0000664000175000017500000002036212256224735022057 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "decoder_wavpack.h" #include "cueparser.h" // Decoder class DecoderWavPack::DecoderWavPack(const QString &path) : Decoder() { m_path = path; m_totalTime = 0.0; m_chan = 0; m_context = 0; m_freq = 0; m_parser = 0; m_output_buf = 0; m_parser = 0; length_in_bytes = 0; m_totalBytes = 0; m_sz = 0; m_buf = 0; m_offset = 0; m_bps = 0; } DecoderWavPack::~DecoderWavPack() { deinit(); if (m_output_buf) delete [] m_output_buf; m_output_buf = 0; } bool DecoderWavPack::initialize() { m_chan = 0; m_totalTime = 0; char err [80]; if (m_path.startsWith("wvpack://")) //embeded cue track { QString p = m_path; p.remove("wvpack://"); p.remove(QRegExp("#\\d+$")); m_context = WavpackOpenFileInput (p.toLocal8Bit().constData(), err, OPEN_WVC | OPEN_TAGS, 0); if (!m_context) { qWarning("DecoderWavPack: error: %s", err); return false; } int cue_len = WavpackGetTagItem (m_context, "cuesheet", NULL, 0); char *value; if (cue_len) { value = (char*)malloc (cue_len * 2 + 1); WavpackGetTagItem (m_context, "cuesheet", value, cue_len + 1); m_parser = new CUEParser(value, p); m_track = m_path.section("#", -1).toInt(); if(m_track > m_parser->count()) { qWarning("DecoderWavPack: invalid cuesheet comment"); return false; } m_path = p; //send metadata QMap metaData = m_parser->info(m_track)->metaData(); addMetaData(metaData); } } else m_context = WavpackOpenFileInput (m_path.toLocal8Bit(), err, OPEN_WVC | OPEN_TAGS, 0); if (!m_context) { qWarning("DecoderWavPack: error: %s", err); return false; } m_chan = WavpackGetNumChannels(m_context); m_freq = WavpackGetSampleRate (m_context); m_bps = WavpackGetBitsPerSample (m_context); if (!m_output_buf) m_output_buf = new int32_t[QMMP_BLOCK_FRAMES * m_chan]; switch(m_bps) { case 8: configure(m_freq, m_chan, Qmmp::PCM_S8); break; case 16: configure(m_freq, m_chan, Qmmp::PCM_S16LE); break; case 24: case 32: configure(m_freq, m_chan, Qmmp::PCM_S32LE); } if(!m_parser) m_totalTime = (qint64) WavpackGetNumSamples(m_context) * 1000 / m_freq; else { m_length = m_parser->length(m_track); m_offset = m_parser->offset(m_track); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; setReplayGainInfo(m_parser->replayGain(m_track)); seek(0); } m_totalBytes = 0; m_sz = audioParameters().sampleSize() * audioParameters().channels(); qDebug("DecoderWavPack: initialize succes"); return true; } int DecoderWavPack::bitrate() { if(m_context) return int(WavpackGetInstantBitrate(m_context)/1000); return 0; } qint64 DecoderWavPack::totalTime() { if(m_parser) return m_length; return m_totalTime; } void DecoderWavPack::deinit() { m_chan = 0; m_freq = 0; if (m_context) WavpackCloseFile (m_context); m_context = 0; if(m_parser) delete m_parser; m_parser = 0; if(m_buf) delete m_buf; m_buf = 0; } void DecoderWavPack::seek(qint64 time) { m_totalBytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * time/1000; if(m_parser) time += m_offset; WavpackSeekSample (m_context, time * m_freq / 1000); } qint64 DecoderWavPack::read(char *data, qint64 size) { if(m_parser) { if(length_in_bytes - m_totalBytes < m_sz) //end of cue track return 0; qint64 len = 0; if(m_buf) //read remaining data first { len = qMin(m_buf_size, size); memmove(data, m_buf, len); if(size >= m_buf_size) { delete[] m_buf; m_buf = 0; m_buf_size = 0; } else memmove(m_buf, m_buf + len, size - len); } else len = wavpack_decode (data, size); if(len <= 0) //end of file return 0; if(len + m_totalBytes <= length_in_bytes) { m_totalBytes += len; return len; } qint64 len2 = qMax(qint64(0), length_in_bytes - m_totalBytes); len2 = (len2 / m_sz) * m_sz; //returned size must contain integer number of samples m_totalBytes += len2; //save data of the next track if(m_buf) delete[] m_buf; m_buf_size = len - len2; m_buf = new char[m_buf_size]; memmove(m_buf, data + len2, m_buf_size); return len2; } return wavpack_decode(data, size); } const QString DecoderWavPack::nextURL() { if(m_parser && m_track +1 <= m_parser->count()) return m_parser->trackURL(m_track + 1); else return QString(); } void DecoderWavPack::next() { if(m_parser && m_track +1 <= m_parser->count()) { m_track++; m_offset = m_parser->length(m_track); m_length = m_parser->length(m_track); length_in_bytes = audioParameters().sampleRate() * audioParameters().channels() * audioParameters().sampleSize() * m_length/1000; addMetaData(m_parser->info(m_track)->metaData()); setReplayGainInfo(m_parser->replayGain(m_track)); m_totalBytes = 0; } } qint64 DecoderWavPack::wavpack_decode(char *data, qint64 size) { ulong len = qMin(QMMP_BLOCK_FRAMES, (int)size / m_chan / 4); len = WavpackUnpackSamples (m_context, m_output_buf, len); //convert 32 to 16 qint8 *data8 = (qint8 *)data; qint16 *data16 = (qint16 *)data; qint32 *data32 = (qint32 *)data; uint i = 0; switch (m_bps) { case 8: for (i = 0; i < len * m_chan; ++i) data8[i] = m_output_buf[i]; return len * m_chan; case 16: for (i = 0; i < len * m_chan; ++i) data16[i] = m_output_buf[i]; return len * m_chan * 2; case 24: for (i = 0; i < len * m_chan; ++i) data32[i] = m_output_buf[i] << 8; return len * m_chan * 4; case 32: for (i = 0; i < len * m_chan; ++i) data32[i] = m_output_buf[i]; return len * m_chan * 4; } return 0; } qmmp-0.7.4/src/plugins/Input/wavpack/wavpackmetadatamodel.cpp0000664000175000017500000001361012256224735023112 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "wavpackmetadatamodel.h" WavPackMetaDataModel::WavPackMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { if(path.contains("://")) { QString p = path; p.remove("wvpack://"); p.remove(QRegExp("#\\d+$")); m_path = p; } else m_path = path; char err[80]; m_ctx = WavpackOpenFileInput (m_path.toLocal8Bit().constData(), err, OPEN_WVC | OPEN_EDIT_TAGS, 0); if (!m_ctx) { qWarning("WavPackMetaDataModel: error: %s", err); return; } if(!path.contains("://")) m_tags << new WavPackFileTagModel(m_ctx); } WavPackMetaDataModel::~WavPackMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); if(m_ctx) WavpackCloseFile (m_ctx); } QHash WavPackMetaDataModel::audioProperties() { QHash ap; if(!m_ctx) return ap; int length = (int) WavpackGetNumSamples(m_ctx)/WavpackGetSampleRate(m_ctx); QString text = QString("%1").arg(length/60); text +=":"+QString("%1").arg(length % 60, 2, 10, QChar('0')); ap.insert(tr("Length"), text); ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg((int) WavpackGetSampleRate(m_ctx))); ap.insert(tr("Channels"), QString("%1").arg((int) WavpackGetNumChannels(m_ctx))); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")) .arg((int) WavpackGetAverageBitrate(m_ctx, WavpackGetNumChannels(m_ctx))/1000)); ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(WavpackGetFileSize(m_ctx)/1024)); ap.insert(tr("Ratio"), QString("%1").arg(WavpackGetRatio(m_ctx))); ap.insert(tr("Version"), QString("%1").arg(WavpackGetVersion(m_ctx))); return ap; } QList WavPackMetaDataModel::tags() { return m_tags; } QPixmap WavPackMetaDataModel::cover() { QString cPath = coverPath(); return cPath.isEmpty() ? QPixmap() : QPixmap(cPath); } QString WavPackMetaDataModel::coverPath() { return MetaDataManager::instance()->getCoverPath(m_path); } WavPackFileTagModel::WavPackFileTagModel(WavpackContext *ctx) : TagModel(TagModel::Save) { m_ctx = ctx; } WavPackFileTagModel::~WavPackFileTagModel() {} const QString WavPackFileTagModel::name() { return "ID3v1/APEv2"; } const QString WavPackFileTagModel::value(Qmmp::MetaData key) { char value[200]; switch((int) key) { case Qmmp::TITLE: WavpackGetTagItem (m_ctx, "Title", value, sizeof(value)); break; case Qmmp::ARTIST: WavpackGetTagItem (m_ctx, "Artist", value, sizeof(value)); break; case Qmmp::ALBUM: WavpackGetTagItem (m_ctx, "Album", value, sizeof(value)); break; case Qmmp::COMMENT: WavpackGetTagItem (m_ctx, "Comment", value, sizeof(value)); break; case Qmmp::YEAR: WavpackGetTagItem (m_ctx, "Year", value, sizeof(value)); break; case Qmmp::TRACK: WavpackGetTagItem (m_ctx, "Track", value, sizeof(value)); break; case Qmmp::DISCNUMBER: WavpackGetTagItem (m_ctx, "Disc", value, sizeof(value)); break; case Qmmp::GENRE: WavpackGetTagItem (m_ctx, "Genre", value, sizeof(value)); break; case Qmmp::COMPOSER: WavpackGetTagItem (m_ctx, "Composer", value, sizeof(value)); } return QString::fromUtf8(value); } void WavPackFileTagModel::setValue(Qmmp::MetaData key, const QString &value) { int size = value.toUtf8().size(); char *v = value.toUtf8().data(); switch((int) key) { case Qmmp::TITLE: WavpackAppendTagItem (m_ctx, "Title", v, size); break; case Qmmp::ARTIST: WavpackAppendTagItem (m_ctx, "Artist", v, size); break; case Qmmp::ALBUM: WavpackAppendTagItem (m_ctx, "Album", v, size); break; case Qmmp::COMMENT: WavpackAppendTagItem (m_ctx, "Comment", v, size); break; case Qmmp::YEAR: WavpackAppendTagItem (m_ctx, "Year", v, size); break; case Qmmp::TRACK: WavpackAppendTagItem (m_ctx, "Track", v, size); break; case Qmmp::DISCNUMBER: WavpackAppendTagItem (m_ctx, "Disc", v, size); break; case Qmmp::GENRE: WavpackAppendTagItem (m_ctx, "Genre", v, size); break; case Qmmp::COMPOSER: WavpackAppendTagItem (m_ctx, "Composer", v, size); } } void WavPackFileTagModel::save() { WavpackWriteTag (m_ctx); } qmmp-0.7.4/src/plugins/Input/wavpack/cueparser.h0000664000175000017500000000472712256224735020403 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CUEPARSER_H #define CUEPARSER_H #include #include #include #include #include #include #include /** @author Ilya Kotov */ class CUEParser { public: CUEParser(const QByteArray &array, const QString &fileName); ~CUEParser(); QList createPlayList(); const QString filePath() const; qint64 offset(int track) const; qint64 length(int track) const; int count() const; FileInfo *info(int track); const QString trackURL(int track) const; const QMap replayGain(int track) const; private: struct CUETrack { FileInfo info; qint64 offset; QMap replayGain; }; QList m_tracks; bool m_dirty; QStringList splitLine(const QString &line); qint64 getLength(const QString &str); QString getDirtyPath(const QString &cue, const QString &path); QString m_filePath; }; #endif qmmp-0.7.4/src/plugins/Input/wavpack/cueparser.cpp0000664000175000017500000002047512256224735020734 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include "cueparser.h" CUEParser::CUEParser(const QByteArray &array, const QString &fileName) { QString album, genre, date, comment; QTextStream textStream (array); textStream.setCodec("UTF-8"); m_filePath = fileName; QString artist; double album_peak = 0.0, album_gain = 0.0; while (!textStream.atEnd()) { QString line = textStream.readLine().trimmed(); QStringList words = splitLine(line); if (words.size() < 2) continue; if (words[0] == "PERFORMER") { if(m_tracks.isEmpty()) artist = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::ARTIST, words[1]); } else if (words[0] == "TITLE") { if(m_tracks.isEmpty()) album = words[1]; else m_tracks.last()->info.setMetaData(Qmmp::TITLE, words[1]); } else if (words[0] == "TRACK") { FileInfo info("wvpack://" + fileName + QString("#%1").arg(words[1].toInt())); info.setMetaData(Qmmp::TRACK, words[1].toInt()); info.setMetaData(Qmmp::ALBUM, album); info.setMetaData(Qmmp::GENRE, genre); info.setMetaData(Qmmp::YEAR, date); info.setMetaData(Qmmp::COMMENT, comment); info.setMetaData(Qmmp::ARTIST, artist); m_tracks << new CUETrack; m_tracks.last()->info = info; m_tracks.last()->offset = 0; m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_GAIN, album_gain); m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_PEAK, album_peak); } else if (words[0] == "INDEX" && words[1] == "01") { if (m_tracks.isEmpty()) continue; m_tracks.last()->offset = getLength(words[2]); int c = m_tracks.count(); if(c > 1) m_tracks[c - 2]->info.setLength(m_tracks[c - 1]->offset - m_tracks[c - 2]->offset); } else if (words[0] == "REM") { if (words.size() < 3) continue; if (words[1] == "GENRE") genre = words[2]; else if (words[1] == "DATE") date = words[2]; else if (words[1] == "COMMENT") comment = words[2]; else if (words[1] == "REPLAYGAIN_ALBUM_GAIN") album_gain = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_ALBUM_PEAK") album_peak = words[2].toDouble(); else if (words[1] == "REPLAYGAIN_TRACK_GAIN" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_GAIN, words[2].toDouble()); else if (words[1] == "REPLAYGAIN_TRACK_PEAK" && !m_tracks.isEmpty()) m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_PEAK, words[2].toDouble()); } } if(m_tracks.isEmpty()) { qWarning("CUEParser: invalid cue file"); return; } //calculate last item length QList f_list = MetaDataManager::instance()->createPlayList(m_filePath, false); qint64 l = f_list.isEmpty() ? 0 : f_list.at(0)->length() * 1000; if (l > m_tracks.last()->offset) m_tracks.last()->info.setLength(l - m_tracks.last()->offset); else m_tracks.last()->info.setLength(0); } CUEParser::~CUEParser() { qDeleteAll(m_tracks); m_tracks.clear(); } QList CUEParser::createPlayList() { QList list; foreach(CUETrack *track, m_tracks) { list << new FileInfo(track->info); list.last()->setLength(track->info.length()/1000); } return list; } const QString CUEParser::filePath() const { return m_filePath; } qint64 CUEParser::offset(int track) const { return m_tracks.at(track - 1)->offset; } qint64 CUEParser::length(int track) const { return m_tracks.at(track - 1)->info.length(); } int CUEParser::count() const { return m_tracks.count(); } FileInfo *CUEParser::info(int track) { return &m_tracks.at(track - 1)->info; } const QString CUEParser::trackURL(int track) const { return m_tracks.at(track - 1)->info.path(); } const QMap CUEParser::replayGain(int track) const { return m_tracks.at(track - 1)->replayGain; } QStringList CUEParser::splitLine(const QString &line) { //qDebug("raw string = %s",qPrintable(line)); QStringList list; QString buf = line.trimmed(); if (buf.isEmpty()) return list; while (!buf.isEmpty()) { //qDebug(qPrintable(buf)); if (buf.startsWith('"')) { int end = buf.indexOf('"',1); if(end == -1) //ignore invalid line { list.clear(); qWarning("CUEParser: unable to parse line: %s",qPrintable(line)); return list; } list << buf.mid (1, end - 1); buf.remove (0, end+1); } else { int end = buf.indexOf(' ', 0); if (end < 0) end = buf.size(); list << buf.mid (0, end); buf.remove (0, end); } buf = buf.trimmed(); } return list; } qint64 CUEParser::getLength(const QString &str) { QStringList list = str.split(":"); if (list.size() == 2) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000; else if (list.size() == 3) return (qint64)list.at(0).toInt()*60000 + list.at(1).toInt()*1000 + list.at(2).toInt()*1000/75; return 0; } QString CUEParser::getDirtyPath(const QString &cue, const QString &path) { if (Decoder::findByPath(path) || ! m_dirty) return path; QStringList candidates; QDirIterator it(QFileInfo(path).dir().path(), QDir::Files); while (it.hasNext()) { it.next(); QString f = it.filePath(); if ((f != cue) && Decoder::findByPath(f)) candidates.push_back(f); } if (candidates.empty()) return path; else if (candidates.count() == 1) return candidates.first(); int dot = cue.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(cue.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } dot = path.lastIndexOf('.'); if (dot != -1) { QRegExp r(QRegExp::escape(path.left(dot)) + "\\.[^\\.]+$"); int index = candidates.indexOf(r); int rindex = candidates.lastIndexOf(r); if ((index != -1) && (index == rindex)) return candidates[index]; } return path; } qmmp-0.7.4/src/plugins/Input/wavpack/wavpack.pro0000664000175000017500000000273312256224735020412 0ustar useruserinclude(../../plugins.pri) FORMS += HEADERS += decoderwavpackfactory.h \ decoder_wavpack.h \ cueparser.h \ wavpackmetadatamodel.h \ replaygainreader.h SOURCES += decoder_wavpack.cpp \ decoderwavpackfactory.cpp \ cueparser.cpp \ wavpackmetadatamodel.cpp \ replaygainreader.cpp TARGET = $$PLUGINS_PREFIX/Input/wavpack INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/wavpack_plugin_cs.ts \ translations/wavpack_plugin_de.ts \ translations/wavpack_plugin_zh_CN.ts \ translations/wavpack_plugin_zh_TW.ts \ translations/wavpack_plugin_ru.ts \ translations/wavpack_plugin_pl.ts \ translations/wavpack_plugin_uk_UA.ts \ translations/wavpack_plugin_it.ts \ translations/wavpack_plugin_tr.ts \ translations/wavpack_plugin_lt.ts \ translations/wavpack_plugin_nl.ts \ translations/wavpack_plugin_ja.ts \ translations/wavpack_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty(LIB_DIR):LIB_DIR = /lib target.path = $$LIB_DIR/qmmp/Input INSTALLS += target QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp PKGCONFIG += wavpack QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libwavpack.so } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lwavpack } qmmp-0.7.4/src/plugins/Input/wavpack/CMakeLists.txt0000664000175000017500000000310312256224735020764 0ustar useruserproject(libwavpack) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # wavpack pkg_search_module(WAVPACK wavpack) include_directories(${WAVPACK_INCLUDE_DIRS}) link_directories(${WAVPACK_LIBRARY_DIRS}) ADD_DEFINITIONS(${WAVPACK_CLAGS}) SET(libwavpack_SRCS decoder_wavpack.cpp decoderwavpackfactory.cpp wavpackmetadatamodel.cpp cueparser.cpp replaygainreader.cpp ) SET(libwavpack_HDRS decoder_wavpack.h cueparser.h replaygainreader.h ) SET(libwavpack_MOC_HDRS decoderwavpackfactory.h wavpackmetadatamodel.h ) SET(libwavpack_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libwavpack_RCC_SRCS ${libwavpack_RCCS}) QT4_WRAP_CPP(libwavpack_MOC_SRCS ${libwavpack_MOC_HDRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(WAVPACK_FOUND) ADD_LIBRARY(wavpack MODULE ${libwavpack_SRCS} ${libwavpack_MOC_SRCS} ${libwavpack_RCC_SRCS} ${libwavpack_HDRS}) add_dependencies(wavpack qmmp) target_link_libraries(wavpack ${QT_LIBRARIES} -lqmmp ${WAVPACK_LDFLAGS}) install(TARGETS wavpack DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(WAVPACK_FOUND) qmmp-0.7.4/src/plugins/Input/wavpack/decoderwavpackfactory.cpp0000664000175000017500000001451112256224735023307 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "wavpackmetadatamodel.h" #include "decoder_wavpack.h" #include "decoderwavpackfactory.h" #include "cueparser.h" // DecoderWavPackFactory bool DecoderWavPackFactory::supports(const QString &source) const { return (source.right(3).toLower() == ".wv"); } bool DecoderWavPackFactory::canDecode(QIODevice *input) const { char buf[4]; return (input->peek(buf, 4) == 4 && !memcmp(buf, "wvpk", 4)); } const DecoderProperties DecoderWavPackFactory::properties() const { DecoderProperties properties; properties.name = tr("WavPack Plugin"); properties.filters << "*.wv"; properties.description = tr("WavPack Files"); //properties.contentType = ; properties.shortName = "wavpack"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = true; properties.protocols << "file" << "wvpack"; return properties; } Decoder *DecoderWavPackFactory::create(const QString &p, QIODevice *) { return new DecoderWavPack(p); } QList DecoderWavPackFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; char err[80]; int cue_len=0; FileInfo *info; //extract metadata of one cue track if(fileName.contains("://")) { QString path = fileName; path.remove("wvpack://"); path.remove(QRegExp("#\\d+$")); int track = fileName.section("#", -1).toInt(); list = createPlayList(path, true); if (list.isEmpty() || track <= 0 || track > list.count()) { qDeleteAll(list); list.clear(); return list; } FileInfo *info = list.takeAt(track - 1); qDeleteAll(list); return QList() << info; } WavpackContext *ctx = WavpackOpenFileInput (fileName.toLocal8Bit().constData(), err, OPEN_WVC | OPEN_TAGS, 0); if (!ctx) { qWarning("DecoderWavPackFactory: error: %s", err); return list; } info = new FileInfo(fileName); if (useMetaData) { cue_len = WavpackGetTagItem (ctx, "cuesheet", NULL, 0); char *value; if (cue_len) { value = (char*)malloc (cue_len * 2 + 1); WavpackGetTagItem (ctx, "cuesheet", value, cue_len + 1); CUEParser parser(value, fileName); list = parser.createPlayList(); } else { char value[200]; WavpackGetTagItem (ctx, "Album", value, sizeof(value)); info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Artist", value, sizeof(value)); info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Comment", value, sizeof(value)); info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Genre", value, sizeof(value)); info->setMetaData(Qmmp::GENRE, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Title", value, sizeof(value)); info->setMetaData(Qmmp::TITLE, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Composer", value, sizeof(value)); info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(value)); WavpackGetTagItem (ctx, "Year", value, sizeof(value)); info->setMetaData(Qmmp::YEAR, QString::fromUtf8(value).toInt()); WavpackGetTagItem (ctx, "Track", value, sizeof(value)); info->setMetaData(Qmmp::TRACK, QString::fromUtf8(value).toInt()); WavpackGetTagItem (ctx, "Disc", value, sizeof(value)); info->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(value).toInt()); } } if (cue_len==0) { info->setLength((int) WavpackGetNumSamples(ctx)/WavpackGetSampleRate(ctx)); list << info; } WavpackCloseFile (ctx); return list; } MetaDataModel* DecoderWavPackFactory::createMetaDataModel(const QString &path, QObject *parent) { if (!path.contains("://") || path.startsWith("wvpack://")) return new WavPackMetaDataModel(path, parent); else return 0; } void DecoderWavPackFactory::showSettings(QWidget *) {} void DecoderWavPackFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About WavPack Audio Plugin"), tr("Qmmp WavPack Audio Plugin")+"\n"+ tr("WavPack library version:") + QString(" %1").arg(WavpackGetLibraryVersionString ())+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *DecoderWavPackFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/wavpack_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(wavpack,DecoderWavPackFactory) qmmp-0.7.4/src/plugins/Input/wavpack/translations/0000775000175000017500000000000012256224735020750 5ustar useruserqmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_pt_BR.ts0000664000175000017500000000632712256224735025430 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Files About WavPack Audio Plugin Qmmp WavPack Audio Plugin WavPack library version: Written by: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts0000664000175000017500000000621312256224735025004 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack-Modul About WavPack Audio Plugin Über WavPack-Audio-Modul Qmmp WavPack Audio Plugin Qmmp WavPack-Audio-Modul WavPack library version: WavPack-Bibliotheksversion: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> WavPack Files WavPack-Dateien WavPackMetaDataModel Length Länge Sample rate Abtastrate Hz Hz Channels Kanäle Bitrate Bitrate kbps kbps File size Dategröße KB KB Ratio Ratio Version Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts0000664000175000017500000000623212256224735025022 0ustar useruser DecoderWavPackFactory WavPack Plugin Modul WavPack About WavPack Audio Plugin O modulu WavPack Qmmp WavPack Audio Plugin Vstupní modul Qmmp WavPack WavPack library version: Verze knihovny WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> WavPack Files Soubory WavPack WavPackMetaDataModel Length Délka Sample rate Vzorkovací frekvence Hz Hz Channels Počet kanálů Bitrate Datový tok kbps kbps File size Velikost souboru KB KiB Ratio Poměr Version Verze qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_es.ts0000664000175000017500000000627612256224735025034 0ustar useruser DecoderWavPackFactory WavPack Plugin Módulo WavPack About WavPack Audio Plugin Acerca del módulo de sonido WavPack Qmmp WavPack Audio Plugin Módulo de sonido WavPack para Qmmp WavPack library version: Versión de la librería WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> WavPack Files Archivos WavPack WavPackMetaDataModel Length Duración Sample rate Frecuencia Hz Hz Channels Canales Bitrate Tasa de bits kbps kbps File size Tamaño del archivo KB KB Ratio Ratio Version Versión qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_fr.ts0000664000175000017500000000632712256224735025031 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Files About WavPack Audio Plugin Qmmp WavPack Audio Plugin WavPack library version: Written by: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_he.ts0000664000175000017500000000636212256224735025015 0ustar useruser DecoderWavPackFactory WavPack Plugin תוספת WavPack WavPack Files קבצי WavPack About WavPack Audio Plugin אודות תוספת שמע WavPack Qmmp WavPack Audio Plugin תוספת שמע WavPack ‫Qmmp WavPack library version: גירסת ספריית WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> WavPackMetaDataModel Length אריכות Sample rate שיעור דגימה Hz הרץ Channels ערוצים Bitrate שיעור סיביות kbps File size גודל קובץ KB ק״ב Ratio יחס Version גירסה qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_hu.ts0000664000175000017500000000632712256224735025036 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Files About WavPack Audio Plugin Qmmp WavPack Audio Plugin WavPack library version: Written by: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_ja.ts0000664000175000017500000000642112256224735025007 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack プラグイン WavPack Files WavPack ファイル About WavPack Audio Plugin WavPack 音響プラグインについて Qmmp WavPack Audio Plugin QMMP WavPack 音響プラグイン WavPack library version: WavPack ライブラリのバージョン: Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> WavPackMetaDataModel Length 長さ Sample rate サンプルレート Hz Hz Channels チャンネル Bitrate ビットレート kbps キロビット毎秒 File size ファイルの大きさ KB KiB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts0000664000175000017500000000624512256224735025035 0ustar useruser DecoderWavPackFactory WavPack Plugin Modulo WavPack About WavPack Audio Plugin Info sul modulo audio WavPack Qmmp WavPack Audio Plugin Modulo audio WavPack per Qmmp WavPack library version: Versione libreria per WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> WavPack Files Brani WavPack WavPackMetaDataModel Length Durata Sample rate Campionamento Hz Hz Channels Canali Bitrate bit al secondo kbps kbps File size Dimensione file KB KB Ratio Rapporto Version Versione qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_kk.ts0000664000175000017500000000632712256224735025027 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Files About WavPack Audio Plugin Qmmp WavPack Audio Plugin WavPack library version: Written by: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_lt.ts0000664000175000017500000000623112256224735025033 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack įskiepis WavPack Files WavPack bylos About WavPack Audio Plugin Apie WavPack audio įskiepį Qmmp WavPack Audio Plugin Qmmp WavPack audio įskiepis WavPack library version: WavPack bibliotekos versija: Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukurta: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Trukmė Sample rate Dažnis Hz Hz Channels Kanalai Bitrate Kokybė kbps kbps File size Bylos dydis KB KB Ratio Koeficientas Version Versija qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_nl.ts0000664000175000017500000000623612256224735025032 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Module About WavPack Audio Plugin Over de WavPack Audio Module Qmmp WavPack Audio Plugin WavPack Audio Module voor Qmmp WavPack library version: WavPack bibliotheek versie: Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> WavPack Files WavPack Bestanden WavPackMetaDataModel Length Duur Sample rate Sample frequentie Hz Channels Kanalen Bitrate Bitsnelheid kbps File size Bestandsgrootte KB Ratio Verhouding Version Versie qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_pl.ts0000664000175000017500000000623612256224735025034 0ustar useruser DecoderWavPackFactory WavPack Plugin Wtyczka WavPack WavPack Files Pliki WavPack About WavPack Audio Plugin O wtyczce WavPack Audio Qmmp WavPack Audio Plugin Wtyczka WavPack dla Qmmp WavPack library version: Wersja biblioteki WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB Ratio Współczynnik Version Wersja qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts0000664000175000017500000000646712256224735025055 0ustar useruser DecoderWavPackFactory WavPack Plugin Модуль WavPack WavPack Files Файлы WavPack About WavPack Audio Plugin Об аудио-модуле WavPack Qmmp WavPack Audio Plugin Аудио-модуль WavPack для Qmmp WavPack library version: Версия библиотеки WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> WavPackMetaDataModel Length Длительность Sample rate Дискретизация Hz Гц Channels Каналов Bitrate Битовая частота kbps Кб/с File size Размер файла KB КБ Ratio Сжатие Version Версия qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_sk.ts0000664000175000017500000000632712256224735025037 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Files About WavPack Audio Plugin Qmmp WavPack Audio Plugin WavPack library version: Written by: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Channels Bitrate kbps File size KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_tr.ts0000664000175000017500000000643212256224735025044 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack Eklentisi WavPack Files WavPack Dosyaları About WavPack Audio Plugin WavPack Ses Eklentisi Hakkında Qmmp WavPack Audio Plugin Qmmp WavPack Ses Eklentisi WavPack library version: WavPack kitaplık sürümü: Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Sample rate Hz Hz Channels Bitrate kbps kbps File size KB KB Ratio Version qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts0000664000175000017500000000627612256224735025426 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack 插件 About WavPack Audio Plugin 关于 WavPack 音频插件 Qmmp WavPack Audio Plugin Qmmp WavPack 音频插件 WavPack library version: WavPack 库版本: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> WavPack Files WavPack 文件 WavPackMetaDataModel Length 长度 Sample rate 取样率 Hz Channels 声音通道 Bitrate 比特率 kbps File size 文件大小 KB Ratio 比值 Version 版本 qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts0000664000175000017500000000631412256224735025451 0ustar useruser DecoderWavPackFactory WavPack Plugin WavPack 插件 About WavPack Audio Plugin 關於 WavPack 聲訊插件 Qmmp WavPack Audio Plugin Qmmp WavPack 聲訊插件 WavPack library version: WavPack 程式庫版本: Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> WavPack Files WavPack 檔案 WavPackMetaDataModel Length 長度 Sample rate 取樣率 Hz Hz Channels 聲音通道 Bitrate 比特率 kbps kbps File size 文件大小 KB KB Ratio 比值 Version 版本 qmmp-0.7.4/src/plugins/Input/wavpack/translations/translations.qrc0000664000175000017500000000152112256224735024177 0ustar useruser wavpack_plugin_ru.qm wavpack_plugin_uk_UA.qm wavpack_plugin_zh_CN.qm wavpack_plugin_zh_TW.qm wavpack_plugin_tr.qm wavpack_plugin_cs.qm wavpack_plugin_pt_BR.qm wavpack_plugin_de.qm wavpack_plugin_pl_PL.qm wavpack_plugin_fr.qm wavpack_plugin_it.qm wavpack_plugin_kk.qm wavpack_plugin_lt.qm wavpack_plugin_hu.qm wavpack_plugin_nl.qm wavpack_plugin_ja.qm wavpack_plugin_sk.qm wavpack_plugin_es.qm wavpack_plugin_he.qm wavpack_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_gl_ES.ts0000664000175000017500000000626012256224735025407 0ustar useruser DecoderWavPackFactory WavPack Plugin Engadido WavPack WavPack Files Ficheiros WavPack About WavPack Audio Plugin Sobre o engadido WavPack Qmmp WavPack Audio Plugin Engadido WavPack do Qmmp WavPack library version: Versión da libraría WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Lonxitude Sample rate Taxa de mostra Hz Hz Channels Canais Bitrate Taxa de bits kbps kbps File size Tamaño do ficheiro KB KB Ratio Relación Version Versión qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts0000664000175000017500000000643212256224735025423 0ustar useruser DecoderWavPackFactory WavPack Plugin Модуль WavPack WavPack Files Файли WavPack About WavPack Audio Plugin Про аудіо-модуль WavPack Qmmp WavPack Audio Plugin Аудіо-модуль WavPack для Qmmp WavPack library version: Версія бібліотеки WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> WavPackMetaDataModel Length Тривалість Sample rate Частота Hz Гц Channels Канали Bitrate Бітрейт kbps кБ/с File size Розмір файлу KB кБ Ratio Стиснення Version Версія qmmp-0.7.4/src/plugins/Input/wavpack/translations/wavpack_plugin_pl_PL.ts0000664000175000017500000000623612256224735025427 0ustar useruser DecoderWavPackFactory WavPack Plugin Wtyczka WavPack WavPack Files Pliki WavPack About WavPack Audio Plugin O wtyczce WavPack Audio Qmmp WavPack Audio Plugin Wtyczka WavPack dla Qmmp WavPack library version: Wersja biblioteki WavPack: Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> WavPackMetaDataModel Length Długość Sample rate Próbkowanie Hz Channels Kanały Bitrate Szybkość transmisji kbps File size Wielkość pliku KB Ratio Współczynnik Version Wersja qmmp-0.7.4/src/plugins/Input/wavpack/replaygainreader.h0000664000175000017500000000377412256224735021731 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef REPLAYGAINREADER_H #define REPLAYGAINREADER_H #include #include #include #include /** @author Ilya Kotov */ class ReplayGainReader { public: ReplayGainReader(const QString &path); ~ReplayGainReader(); QMap replayGainInfo() const; private: void readAPE(); void setValue(Qmmp::ReplayGainKey key, QString value); QMap m_values; WavpackContext *m_ctx; QString m_path; }; #endif // REPLAYGAINREADER_H qmmp-0.7.4/src/plugins/Input/wavpack/replaygainreader.cpp0000664000175000017500000000577112256224735022263 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { if(path.contains("://")) { QString p = m_path; p.remove("wvpack://"); p.remove(QRegExp("#\\d+$")); m_path = p; } else m_path = path; char err[80]; m_ctx = WavpackOpenFileInput (m_path.toLocal8Bit(), err, OPEN_WVC | OPEN_EDIT_TAGS, 0); if (!m_ctx) { qWarning("ReplayGainReader: error: %s", err); return; } readAPE(); } ReplayGainReader::~ReplayGainReader() { if(m_ctx) WavpackCloseFile (m_ctx); } QMap ReplayGainReader::replayGainInfo() const { return m_values; } void ReplayGainReader::readAPE() { char value[200]; WavpackGetTagItem (m_ctx, "REPLAYGAIN_TRACK_GAIN", value, sizeof(value)); setValue(Qmmp::REPLAYGAIN_TRACK_GAIN, value); WavpackGetTagItem (m_ctx, "REPLAYGAIN_TRACK_PEAK", value, sizeof(value)); setValue(Qmmp::REPLAYGAIN_TRACK_PEAK, value); WavpackGetTagItem (m_ctx, "REPLAYGAIN_ALBUM_GAIN", value, sizeof(value)); setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN, value); WavpackGetTagItem (m_ctx, "REPLAYGAIN_ALBUM_PEAK", value, sizeof(value)); setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK, value); } void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) { value.remove(" dB"); value = value.trimmed(); if(value.isEmpty()) return; bool ok; double v = value.toDouble(&ok); if(ok) m_values[key] = v; } qmmp-0.7.4/src/plugins/Input/wavpack/decoder_wavpack.h0000664000175000017500000000466312256224735021532 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_WAVPACK_H #define DECODER_WAVPACK_H extern "C"{ #include } #include class CUEParser; class DecoderWavPack : public Decoder { public: DecoderWavPack(const QString &); virtual ~DecoderWavPack(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *data, qint64 maxSize); void seek(qint64 time); const QString nextURL(); void next(); private: // helper functions void deinit(); qint64 wavpack_decode(char *data, qint64 size); WavpackContext *m_context; int32_t *m_output_buf; // output buffer int m_chan; quint32 m_freq; qint64 m_totalTime; qint64 length_in_bytes; qint64 m_totalBytes; qint64 m_offset; qint64 m_length; QString m_path; CUEParser *m_parser; int m_track; int m_bps; char *m_buf; //buffer for remainig data qint64 m_buf_size; qint64 m_sz; //sample size }; #endif // DECODER_WAVPACK_H qmmp-0.7.4/src/plugins/Input/wavpack/decoderwavpackfactory.h0000664000175000017500000000445412256224735022761 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERWAVPACKFACTORY_H #define DECODERWAVPACKFACTORY_H #include #include #include #include #include #include #include #include class DecoderWavPackFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory); public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &p, QIODevice *i); QList createPlayList(const QString &fileName, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/cdaudio/0000775000175000017500000000000012256224735016203 5ustar useruserqmmp-0.7.4/src/plugins/Input/cdaudio/decoder_cdaudio.h0000664000175000017500000000532312256224735021454 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODER_CDAUIDO_H #define DECODER_CDAUIDO_H #include #include #include #include class CDATrack { public: CDATrack() { first_sector = 0; last_sector = 0; } FileInfo info; lsn_t first_sector; lsn_t last_sector; }; class DecoderCDAudio : public Decoder { public: DecoderCDAudio(const QString &url); virtual ~DecoderCDAudio(); static QList generateTrackList(const QString &device); static qint64 calculateTrackLength(lsn_t startlsn, lsn_t endlsn); static void clearTrackCache(); // Standard Decoder API bool initialize(); qint64 totalTime(); int bitrate(); qint64 read(char *audio, qint64 maxSize); void seek(qint64 time); private: //helper functions static void saveToCache(QList tracks, uint disc_id); static bool readFromCache(QList *tracks, uint disc_id); // libcdio variables lsn_t m_first_sector; lsn_t m_last_sector; lsn_t m_current_sector; CdIo_t *m_cdio; //other variables QString m_url; int m_bitrate; qint64 m_totalTime; char *m_buffer; qint64 m_buffer_at; //tracks cache static QList m_track_cache; }; #endif // DECODER_CDAUIDO_H qmmp-0.7.4/src/plugins/Input/cdaudio/CMakeLists.txt0000664000175000017500000000324512256224735020747 0ustar useruserproject(libcdaudio) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libcdaudio pkg_check_modules(CDIO libcdio libcdio_cdda libcdio_paranoia libcddb) include_directories(${CDIO_INCLUDE_DIRS}) link_directories(${CDIO_LIBRARY_DIRS}) ADD_DEFINITIONS(${CDIO_CFLAGS}) SET(libcdaudio_SRCS decoder_cdaudio.cpp decodercdaudiofactory.cpp settingsdialog.cpp ) SET(libcdaudio_HDRS decoder_cdaudio.h ) SET(libcdaudio_MOC_HDRS settingsdialog.h decodercdaudiofactory.h ) SET(libcdaudio_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libcdaudio_RCC_SRCS ${libcdaudio_RCCS}) QT4_WRAP_CPP(libcdaudio_MOC_SRCS ${libcdaudio_MOC_HDRS}) # user interface SET(libcdaudio_UIS settingsdialog.ui ) QT4_WRAP_UI(libcdaudio_UIS_H ${libcdaudio_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(CDIO_FOUND) ADD_LIBRARY(cdaudio MODULE ${libcdaudio_SRCS} ${libcdaudio_MOC_SRCS} ${libcdaudio_UIS_H} ${libcdaudio_RCC_SRCS} ${libcdaudio_HDRS}) add_dependencies(cdaudio qmmp) target_link_libraries(cdaudio ${QT_LIBRARIES} -lqmmp ${CDIO_LDFLAGS}) install(TARGETS cdaudio DESTINATION ${LIB_DIR}/qmmp/Input) ENDIF(CDIO_FOUND) qmmp-0.7.4/src/plugins/Input/cdaudio/settingsdialog.cpp0000664000175000017500000000762512256224735021741 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "decoder_cdaudio.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("cdaudio"); m_ui.deviceLineEdit->setText(settings.value("device").toString()); m_ui.deviceCheckBox->setChecked(!m_ui.deviceLineEdit->text().isEmpty()); int speed = settings.value("speed", 0).toInt(); m_ui.speedCheckBox->setChecked(speed > 0); m_ui.speedSpinBox->setValue(speed); m_ui.cdtextCheckBox->setChecked(settings.value("cdtext", true).toBool()); m_ui.cddbGroupBox->setChecked(settings.value("use_cddb", false).toBool()); m_ui.httpCheckBox->setChecked(settings.value("cddb_http", false).toBool()); m_ui.serverLineEdit->setText(settings.value("cddb_server", "freedb.org").toString()); m_ui.pathLineEdit->setText(settings.value("cddb_path").toString()); m_ui.portLineEdit->setText(settings.value("cddb_port", 8880).toString()); settings.endGroup(); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("cdaudio"); if(m_ui.deviceCheckBox->isChecked()) settings.setValue("device", m_ui.deviceLineEdit->text()); else settings.remove("device"); if(m_ui.speedCheckBox->isChecked()) settings.setValue("speed", m_ui.speedSpinBox->value()); else settings.setValue("speed", 0); settings.setValue("cdtext", m_ui.cdtextCheckBox->isChecked()); settings.setValue("cdtext", m_ui.cdtextCheckBox->isChecked()); settings.setValue("use_cddb", m_ui.cddbGroupBox->isChecked()); settings.setValue("cddb_http", m_ui.httpCheckBox->isChecked()); settings.setValue("cddb_server", m_ui.serverLineEdit->text()); settings.setValue("cddb_path", m_ui.pathLineEdit->text()); settings.setValue("cddb_port", m_ui.portLineEdit->text()); settings.endGroup(); settings.sync(); DecoderCDAudio::clearTrackCache(); QDialog::accept(); } void SettingsDialog::on_clearCacheButton_clicked() { QString path = QFileInfo(Qmmp::configFile()).absoluteDir().path(); QDir dir(path); dir.cd("cddbcache"); QStringList list = dir.entryList(QStringList() << "*", QDir::Files); foreach(QString name, list) dir.remove(name); } qmmp-0.7.4/src/plugins/Input/cdaudio/decodercdaudiofactory.h0000664000175000017500000000442512256224735022707 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef DECODERCDAUDIOFACTORY_H #define DECODERCDAUDIOFACTORY_H #include #include #include #include #include #include #include #include class DecoderCDAudioFactory : public QObject, DecoderFactory { Q_OBJECT Q_INTERFACES(DecoderFactory) public: bool supports(const QString &source) const; bool canDecode(QIODevice *input) const; const DecoderProperties properties() const; Decoder *create(const QString &, QIODevice *); QList createPlayList(const QString &url, bool useMetaData); MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0); void showSettings(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Input/cdaudio/decodercdaudiofactory.cpp0000664000175000017500000000747712256224735023254 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "settingsdialog.h" #include "decoder_cdaudio.h" #include "decodercdaudiofactory.h" // DecoderCDAudioFactory bool DecoderCDAudioFactory::supports(const QString &source) const { return source == "/" || source.startsWith("/dev"); } bool DecoderCDAudioFactory::canDecode(QIODevice *) const { return false; } const DecoderProperties DecoderCDAudioFactory::properties() const { DecoderProperties properties; properties.name = tr("CD Audio Plugin"); properties.shortName = "cdaudio"; properties.protocols << "cdda"; properties.hasAbout = true; properties.noInput = true; properties.hasSettings = true; return properties; } Decoder *DecoderCDAudioFactory::create(const QString &url, QIODevice *input) { Q_UNUSED(input); return new DecoderCDAudio(url); } QList DecoderCDAudioFactory::createPlayList(const QString &url, bool useMetaData) { Q_UNUSED(useMetaData); QList list; QString device_path = url; device_path.remove("cdda://"); device_path.remove(QRegExp("#\\d+$")); QList tracks = DecoderCDAudio::generateTrackList(device_path); foreach(CDATrack t, tracks) { list << new FileInfo(t.info); } return list; } MetaDataModel* DecoderCDAudioFactory::createMetaDataModel(const QString &path, QObject *parent) { Q_UNUSED(parent); Q_UNUSED(path); return 0; } void DecoderCDAudioFactory::showSettings(QWidget *parent) { SettingsDialog *d = new SettingsDialog(parent); d->show(); } void DecoderCDAudioFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About CD Audio Plugin"), tr("Qmmp CD Audio Plugin")+"\n"+ QString(tr("Compiled against libcdio-%1 and libcddb-%2")).arg(CDIO_VERSION) .arg(CDDB_VERSION) + "\n" + tr("Written by: Ilya Kotov ")+"\n"+ tr("Usage: open cdda:/// using Add URL dialog or command line")); } QTranslator *DecoderCDAudioFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/cdaudio_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(cdaudio, DecoderCDAudioFactory) qmmp-0.7.4/src/plugins/Input/cdaudio/settingsdialog.ui0000664000175000017500000001263212256224735021566 0ustar useruser SettingsDialog 0 0 261 280 CD Audio Plugin Settings 6 6 6 Override device: true Limit cd speed: true 1 48 Use cd-text CDDB true Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache Qt::Horizontal 40 20 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 253 118 95 53 buttonBox rejected() SettingsDialog reject() 253 118 130 63 deviceCheckBox toggled(bool) deviceLineEdit setEnabled(bool) 84 17 151 17 speedCheckBox toggled(bool) speedSpinBox setEnabled(bool) 99 42 134 45 qmmp-0.7.4/src/plugins/Input/cdaudio/translations/0000775000175000017500000000000012256224735020724 5ustar useruserqmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_de.ts0000664000175000017500000000660512256224735024741 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD-Audio-Modul About CD Audio Plugin Über CD-Audio-Modul Qmmp CD Audio Plugin Qmmp CD-Audio-Modul Compiled against libcdio-%1 and libcddb-%2 Kompiliert mit libcdio-%1 und libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Verwendung: Geben Sie cdda:/// in den „URL hinzufügen“-Dialog oder in die Befehlszeile ein SettingsDialog CD Audio Plugin Settings Einstellungen CD-Audio-Modul Override device: Einhängepunkt des CD-Laufwerks: Limit cd speed: CD-Geschwindigkeit begrenzen: Use cd-text CD-Text verwenden CDDB CDDB Use HTTP instead of CDDBP HTTP anstatt CDDBP verwenden Server: Server: Path: Pfad: Port: Port: Clear CDDB cache CDDB-Zwischenspeicher löschen qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_cs.ts0000664000175000017500000000654212256224735024756 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Modul pro zvuková CD About CD Audio Plugin O modulu pro zvuková CD Qmmp CD Audio Plugin Modul Qmmp pro zvuková CD Compiled against libcdio-%1 and libcddb-%2 Zkompilováno s libcdio-%1 a libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Použití: otevřete cdda:/// v dialogu Přidat URL nebo z příkazové řádky SettingsDialog CD Audio Plugin Settings Nastavení modulu pro zvuková CD Override device: Zařízení: Limit cd speed: Omezit rychlost CD: Use cd-text Použít CD-TEXT CDDB CDDB Use HTTP instead of CDDBP Použít HTTP namísto CDDBP Server: Server: Path: Cesta: Port: Port: Clear CDDB cache Vyprázdnit cache CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_es.ts0000664000175000017500000000657512256224735024766 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Módulo de audio CD About CD Audio Plugin Acerca del módulo de audio CD Qmmp CD Audio Plugin Módulo de audio CD para Qmmp Compiled against libcdio-%1 and libcddb-%2 Compilado con libcdio-%1 y libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Uso: abrir cdda:// con el diálogo Añadir URL o la línea de comandos SettingsDialog CD Audio Plugin Settings Configuración del módulo de audio CD Override device: Sobreescribir dispositivo: Limit cd speed: Límite de velocidad del CD: Use cd-text Usar CD-Text CDDB CDDB Use HTTP instead of CDDBP Usar HTTP en lugar de CDDBP Server: Servidor: Path: Ruta: Port: Puerto: Clear CDDB cache Limpiar la cache CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_fr.ts0000664000175000017500000000640112256224735024752 0ustar useruser DecoderCDAudioFactory CD Audio Plugin About CD Audio Plugin Qmmp CD Audio Plugin Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line SettingsDialog CD Audio Plugin Settings Override device: Limit cd speed: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_he.ts0000664000175000017500000000677012256224735024750 0ustar useruser DecoderCDAudioFactory CD Audio Plugin תוספת CD שמע About CD Audio Plugin אודות תוספת CD שמע Qmmp CD Audio Plugin תוספת CD שמע ‫Qmmp Compiled against libcdio-%1 and libcddb-%2 הודרה כנגד libcdio-%1 ונגד libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line שימוש: פתח cdda‪:///‬ באמצעות דו שיח הוסף URL או שורת פקודה SettingsDialog CD Audio Plugin Settings הגדרות תוספת CD שמע Override device: עקוף התקן: Limit cd speed: מהירות cd מותחמת תחום מהירות cd: Use cd-text נצל cd-text CDDB Use HTTP instead of CDDBP נצל HTTP במקום CDDBP Server: שרת: Path: נתיב: Port: פורט: Clear CDDB cache טהר מטמון CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_hu.ts0000664000175000017500000000640112256224735024757 0ustar useruser DecoderCDAudioFactory CD Audio Plugin About CD Audio Plugin Qmmp CD Audio Plugin Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line SettingsDialog CD Audio Plugin Settings Override device: Limit cd speed: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_ja.ts0000664000175000017500000000677012256224735024746 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD 音響プラグイン About CD Audio Plugin CD 音響プラグインについて Qmmp CD Audio Plugin QMMP CD 音響プラグイン Compiled against libcdio-%1 and libcddb-%2 libcdio-%1 と libcddb-%2 対応でコンパイル Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line 使い方: コマンド入力行もしくは「URL を追加」ダイアログで cdda:/// を開く SettingsDialog CD Audio Plugin Settings CD 音響プラグイン設定 Override device: オーバーライドするデバイス: Limit cd speed: CD 回転速度の限度: Use cd-text CD-text を利用する CDDB CDDB Use HTTP instead of CDDBP CDDBP ではなく HTTP を利用する Server: サーバー: Path: パス: Port: ポート番号: Clear CDDB cache CDDB キャッシュを消去 qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_it.ts0000664000175000017500000000655712256224735024773 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Modulo CD-Audio About CD Audio Plugin Informazioni sul modulo CD-Audio Qmmp CD Audio Plugin Modulo CD-Audio per Qmmp Compiled against libcdio-%1 and libcddb-%2 Compilazione basata su libcdio-%1 e libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Uso: aprire cdda:// nella finestra di dialgo degli URL, o via linea di comando SettingsDialog CD Audio Plugin Settings Impostazioni del modulo CD-Audio Override device: Sovrascrivi dispositivo Limit cd speed: Limita la velocità del CD: Use cd-text Usa CD-Text CDDB CDDB Use HTTP instead of CDDBP usa HTTP invece di CDDBP Server: Server: Path: Percorso: Port: Clear CDDB cache Pulisci la cache CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_kk.ts0000664000175000017500000000640112256224735024750 0ustar useruser DecoderCDAudioFactory CD Audio Plugin About CD Audio Plugin Qmmp CD Audio Plugin Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line SettingsDialog CD Audio Plugin Settings Override device: Limit cd speed: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_lt.ts0000664000175000017500000000660112256224735024764 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD Audio Įskiepis About CD Audio Plugin Apie CD Audio įskiepį Qmmp CD Audio Plugin Apie CD Audio Qmmp įskiepį Compiled against libcdio-%1 and libcddb-%2 Sukompiliuota su libcdio-%1 ir libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Naudojimas: atverti cdda:/// naudojant Prideti interneto adresą arba komandinė eilutę SettingsDialog CD Audio Plugin Settings CD Audio įskiepio nustatymai Override device: Nepaisyti įrangos: Limit cd speed: Riboti cd apsisukimų greitį: Use cd-text cd-text naudojimas CDDB CDDB Use HTTP instead of CDDBP Naudoti HTTP, o ne CDDBP Server: Serveris: Path: Kelias: Port: Portas: Clear CDDB cache Išvalyti CDDB talpyklą qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_nl.ts0000664000175000017500000000653512256224735024764 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Audio CD Module About CD Audio Plugin Over de Audio CD Module Qmmp CD Audio Plugin Audio CD Module voor Qmmp Compiled against libcdio-%1 and libcddb-%2 Gecompileerd tegen libcdio-%1 en libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Gebruik: Voeg cdda:/// in het "Voeg URL toe" dialoog of als argument op de command prompt SettingsDialog CD Audio Plugin Settings Audio CD Module Instellingen Override device: Gebruikt apparaat: Limit cd speed: Beperk CD snelheid: Use cd-text Gebruik cd-text CDDB Use HTTP instead of CDDBP Gebruik HTTP i.p.v. CDDBP Server: Path: Pad: Port: Poort: Clear CDDB cache Leeg CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_pl.ts0000664000175000017500000000651712256224735024766 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Wtyczka CD Audio About CD Audio Plugin O wtyczce CD Audio Qmmp CD Audio Plugin Wtyczka CD Audio dla Qmmp Compiled against libcdio-%1 and libcddb-%2 Skompilowane przy użyciu libcdio-%1 oraz libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Instrukcja: otwórz cdda:/// używając Dodaj URL lib z linii poleceń SettingsDialog CD Audio Plugin Settings Ustawienia wtyczki CD Audio Override device: Wymuś urządzenie: Limit cd speed: Limit prędkości cd: Use cd-text Użyj cd-text CDDB Use HTTP instead of CDDBP Użyj HTTP zamiast CDDBP Server: Serwer: Path: Ścieżka: Port: Clear CDDB cache Wyczyść bufor CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_ru.ts0000664000175000017500000000710712256224735024775 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Модуль CD Audio About CD Audio Plugin О Модуле CD Audio Qmmp CD Audio Plugin Модуль CD Audio для Qmmp Compiled against libcdio-%1 and libcddb-%2 Собрано с libcdio-%1 и libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Использование: откройте cdda:/// с помощью диалога добавления URL или командной строки SettingsDialog CD Audio Plugin Settings Настройки модуля CD Audio Override device: Переопределить устройство: Limit cd speed: Ограничить скорость cd: Use cd-text Использовать cd-text CDDB CDDB Use HTTP instead of CDDBP Использовать HTTP вместо CDDBP Server: Сервер: Path: Путь: Port: Порт: Clear CDDB cache Очистить кэш CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_sk.ts0000664000175000017500000000640112256224735024760 0ustar useruser DecoderCDAudioFactory CD Audio Plugin About CD Audio Plugin Qmmp CD Audio Plugin Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line SettingsDialog CD Audio Plugin Settings Override device: Limit cd speed: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_tr.ts0000664000175000017500000000657012256224735024777 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD Ses Eklentisi About CD Audio Plugin CD Ses Eklentisi Hakkında Qmmp CD Audio Plugin Qmmp CD Ses Eklentisi Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Kullanımı: komut satırından veya URL Ekle diyaloğundan open cdda:/// şeklindedir SettingsDialog CD Audio Plugin Settings CD Ses Eklentisi Ayarları Override device: Limit cd speed: CD hızını sınırla: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_zh_CN.ts0000664000175000017500000000651212256224735025347 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD 音频插件 About CD Audio Plugin 关于 CD 音频插件 Qmmp CD Audio Plugin Qmmp CD 音频插件 Compiled against libcdio-%1 and libcddb-%2 编译依赖 libcdio-%1 和 libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line 用法:open cdda:/// 使用添加 URL 对话或命令行 SettingsDialog CD Audio Plugin Settings CD 音频插件设置 Override device: 跳过设备: Limit cd speed: 限制 CD 速度: Use cd-text 使用 cd-text CDDB Use HTTP instead of CDDBP 使用 HTTP 而非 CDDBP Server: 服务器: Path: 路径: Port: 端口: Clear CDDB cache 清除 CDDB 缓存 qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_zh_TW.ts0000664000175000017500000000651112256224735025400 0ustar useruser DecoderCDAudioFactory CD Audio Plugin CD 聲訊插件 About CD Audio Plugin 關於 CD 聲訊插件 Qmmp CD Audio Plugin Qmmp CD 聲訊插件 Compiled against libcdio-%1 and libcddb-%2 編譯依賴 libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line 用法:open cdda:/// 使用添加 URL會話或命令行 SettingsDialog CD Audio Plugin Settings CD 聲訊插件設置 Override device: 忽略設備: Limit cd speed: 限制 CD 速度: Use cd-text 使用 cd-text CDDB Use HTTP instead of CDDBP 使用 HTTP 而非 CDDBP Server: 服務器: Path: 路徑: Port: 端口: Clear CDDB cache 清除 CDDB 緩存 qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_gl_ES.ts0000664000175000017500000000657612256224735025351 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Engadido de CD de audio About CD Audio Plugin Sobre o engadido de CD de audio Qmmp CD Audio Plugin Engadido de CD de audio de Qmmp Compiled against libcdio-%1 and libcddb-%2 Compilado usando libcdio-%1 e libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Uso: open cdda:/// usando diálogo de engadir URL ou liña de comandos SettingsDialog CD Audio Plugin Settings Preferencias do engadido cd CD de audio Override device: Limit cd speed: Limitar a velocidade de cd: Use cd-text Usar cd-text CDDB CDDB Use HTTP instead of CDDBP Usar HTTP en lugar de CDDBP Server: Servidor: Path: Ruta: Port: Porto: Clear CDDB cache Limpar caché CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/translations.qrc0000664000175000017500000000152112256224735024153 0ustar useruser cdaudio_plugin_ru.qm cdaudio_plugin_uk_UA.qm cdaudio_plugin_zh_CN.qm cdaudio_plugin_zh_TW.qm cdaudio_plugin_tr.qm cdaudio_plugin_cs.qm cdaudio_plugin_pt_BR.qm cdaudio_plugin_de.qm cdaudio_plugin_pl_PL.qm cdaudio_plugin_fr.qm cdaudio_plugin_it.qm cdaudio_plugin_kk.qm cdaudio_plugin_lt.qm cdaudio_plugin_hu.qm cdaudio_plugin_nl.qm cdaudio_plugin_ja.qm cdaudio_plugin_sk.qm cdaudio_plugin_es.qm cdaudio_plugin_he.qm cdaudio_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_uk_UA.ts0000664000175000017500000000713712256224735025356 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Модуль AudioCD About CD Audio Plugin Про модуль AudioCD Qmmp CD Audio Plugin Модуль AudioCD для Qmmp Compiled against libcdio-%1 and libcddb-%2 Зібрано з libcdio-%1 та libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Використання: відкрийте cdda:/// використовуючи діалог "Додати адресу" чи командний рядок SettingsDialog CD Audio Plugin Settings Налаштування модуля AudioCD Override device: Перевизначити пристрій: Limit cd speed: Обмежити швидкість CD: Use cd-text Використовувати cd-text CDDB Use HTTP instead of CDDBP Використовувати HTTP замість CDDBP Server: Сервер: Path: Шлях: Port: Порт: Clear CDDB cache Очистити кеш CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_pl_PL.ts0000664000175000017500000000652612256224735025361 0ustar useruser DecoderCDAudioFactory CD Audio Plugin Wtyczka CD Audio About CD Audio Plugin O wtyczce CD Audio Qmmp CD Audio Plugin Wtyczka CD Audio dla Qmmp Compiled against libcdio-%1 and libcddb-%2 Skompilowane przy użyciu libcdio-%1 oraz libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line Instrukcja: otwórz cdda:/// używając Dodaj URL lib z linii poleceń SettingsDialog CD Audio Plugin Settings Ustawienia wtyczki CD Audio Override device: Wymuś urządzenie: Limit cd speed: Limit prędkości cd: Use cd-text Użyj cd-text CDDB CDDB Use HTTP instead of CDDBP Użyj HTTP zamiast CDDBP Server: Serwer: Path: Ścieżka: Port: Clear CDDB cache Wyczyść bufor CDDB qmmp-0.7.4/src/plugins/Input/cdaudio/translations/cdaudio_plugin_pt_BR.ts0000664000175000017500000000640112256224735025351 0ustar useruser DecoderCDAudioFactory CD Audio Plugin About CD Audio Plugin Qmmp CD Audio Plugin Compiled against libcdio-%1 and libcddb-%2 Written by: Ilya Kotov <forkotov02@hotmail.ru> Usage: open cdda:/// using Add URL dialog or command line SettingsDialog CD Audio Plugin Settings Override device: Limit cd speed: Use cd-text CDDB Use HTTP instead of CDDBP Server: Path: Port: Clear CDDB cache qmmp-0.7.4/src/plugins/Input/cdaudio/decoder_cdaudio.cpp0000664000175000017500000004444612256224735022020 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #if LIBCDIO_VERSION_NUM <= 83 #include #else #include #endif #include #include #include #include #include #include #include #define CDDA_SECTORS 4 #define CDDA_BUFFER_SIZE (CDDA_SECTORS*CDIO_CD_FRAMESIZE_RAW) #include "decoder_cdaudio.h" QList DecoderCDAudio::m_track_cache; static void log_handler (cdio_log_level_t level, const char *message) { QString str = QString::fromLocal8Bit(message).trimmed(); switch (level) { case CDIO_LOG_DEBUG: qDebug("DecoderCDAudio: cdio message: %s (level=debug)", qPrintable(str)); return; case CDIO_LOG_INFO: qDebug("DecoderCDAudio: cdio message: %s (level=info)", qPrintable(str)); return; default: qWarning("DecoderCDAudio: cdio message: %s (level=error)", qPrintable(str)); } } static void cddb_log_handler(cddb_log_level_t level, const char *message) { QString str = QString::fromLocal8Bit(message).trimmed(); switch (level) { case CDDB_LOG_DEBUG: qDebug("DecoderCDAudio: cddb message: %s (level=debug)", qPrintable(str)); return; case CDDB_LOG_INFO: qDebug("DecoderCDAudio: cddb message: %s (level=info)", qPrintable(str)); return; default: qWarning("DecoderCDAudio: cddb message: %s (level=error)", qPrintable(str)); } } // Decoder class DecoderCDAudio::DecoderCDAudio(const QString &url) : Decoder() { m_bitrate = 0; m_totalTime = 0; m_first_sector = -1; m_last_sector = -1; m_current_sector = -1; m_url = url; m_cdio = 0; m_buffer_at = 0; m_buffer = new char[CDDA_BUFFER_SIZE]; } DecoderCDAudio::~DecoderCDAudio() { m_bitrate = 0; if (m_cdio) { cdio_destroy(m_cdio); m_cdio = 0; } delete [] m_buffer; } QList DecoderCDAudio::generateTrackList(const QString &device) { //read settings QSettings settings(Qmmp::configFile(), QSettings::IniFormat); int cd_speed = settings.value("cdaudio/speed", 0).toInt(); bool use_cd_text = settings.value("cdaudio/cdtext", true).toBool(); QList tracks; cdio_log_set_handler(log_handler); //setup cdio log handler CdIo_t *cdio = 0; QString device_path = device; if (device_path.isEmpty() || device_path == "/") device_path = settings.value("cdaudio/device").toString(); if (device_path.isEmpty() || device_path == "/") { char **cd_drives = cdio_get_devices_with_cap(0, CDIO_FS_AUDIO, true); //get drive list with CDA disks // open first audio capable cd drive if (cd_drives && *cd_drives) { cdio = cdio_open_cd(*cd_drives); if (!cdio) { qWarning("DecoderCDAudio: failed to open CD."); cdio_free_device_list(cd_drives); return tracks; } qDebug("DecoderCDAudio: found cd audio capable drive \"%s\"", *cd_drives); } else { qWarning("DecoderCDAudio: unable to find cd audio drive."); cdio_free_device_list(cd_drives); return tracks; } device_path = QString(*cd_drives); if (cd_drives && *cd_drives) //free device list cdio_free_device_list(cd_drives); } else { cdio = cdio_open_cd(device_path.toAscii().constData()); if (!cdio) { qWarning("DecoderCDAudio: failed to open CD."); return tracks; } qDebug("DecoderCDAudio: using cd audio capable drive \"%s\"", qPrintable(device_path)); } if(!m_track_cache.isEmpty() && !cdio_get_media_changed(cdio)) { qDebug("DecoderCDAudio: using track cache..."); cdio_destroy(cdio); return m_track_cache; } if (cd_speed) { qDebug("DecoderCDAudio: setting drive speed to %dX.", cd_speed); if (cdio_set_speed(cdio, 1) != DRIVER_OP_SUCCESS) qWarning("DecoderCDAudio: unable to set drive speed to %dX.", cd_speed); } cdrom_drive_t *pcdrom_drive = cdio_cddap_identify_cdio(cdio, 1, 0); //create paranoya CD-ROM object //get first and last track numbers int first_track_number = cdio_get_first_track_num(pcdrom_drive->p_cdio); int last_track_number = cdio_get_last_track_num(pcdrom_drive->p_cdio); if ((first_track_number == CDIO_INVALID_TRACK) || (last_track_number == CDIO_INVALID_TRACK)) { qWarning("DecoderCDAudio: invalid first (last) track number."); cdio_destroy(cdio); cdio = 0; return tracks; } bool use_cddb = true; //fill track list for (int i = first_track_number; i <= last_track_number; ++i) { CDATrack t; t.first_sector = cdio_get_track_lsn(pcdrom_drive->p_cdio, i); t.last_sector = cdio_get_track_last_lsn(pcdrom_drive->p_cdio, i); t.info.setLength((t.last_sector - t.first_sector +1) / 75); t.info.setMetaData(Qmmp::TRACK, i); t.info.setPath(QString("cdda://%1#%2").arg(device_path).arg(i)); if ((t.first_sector == CDIO_INVALID_LSN) || (t.last_sector== CDIO_INVALID_LSN)) { qWarning("DecoderCDAudio: invalid stard(end) lsn for the track %d.", i); tracks.clear(); cdio_destroy(cdio); cdio = 0; return tracks; } //cd text #if LIBCDIO_VERSION_NUM <= 83 cdtext_t *cdtext = use_cd_text ? cdio_get_cdtext(pcdrom_drive->p_cdio, i) : 0; if (cdtext && cdtext->field[CDTEXT_TITLE]) { t.info.setMetaData(Qmmp::TITLE, QString::fromLocal8Bit(cdtext->field[CDTEXT_TITLE])); t.info.setMetaData(Qmmp::ARTIST, QString::fromLocal8Bit(cdtext->field[CDTEXT_PERFORMER])); t.info.setMetaData(Qmmp::GENRE, QString::fromLocal8Bit(cdtext->field[CDTEXT_GENRE])); use_cddb = false; } #else cdtext_t *cdtext = use_cd_text ? cdio_get_cdtext(pcdrom_drive->p_cdio) : 0; if (cdtext) { t.info.setMetaData(Qmmp::TITLE, QString::fromUtf8(cdtext_get_const(cdtext,CDTEXT_FIELD_TITLE,i))); t.info.setMetaData(Qmmp::ARTIST, QString::fromUtf8(cdtext_get_const(cdtext,CDTEXT_FIELD_PERFORMER,i))); t.info.setMetaData(Qmmp::GENRE, QString::fromUtf8(cdtext_get_const(cdtext,CDTEXT_FIELD_GENRE,i))); use_cddb = false; } #endif else t.info.setMetaData(Qmmp::TITLE, QString("CDA Track %1").arg(i, 2, 10, QChar('0'))); tracks << t; } qDebug("DecoderCDAudio: found %d audio tracks", tracks.size()); use_cddb = use_cddb && settings.value("cdaudio/use_cddb", false).toBool(); if(use_cddb) { qDebug("DecoderCDAudio: reading CDDB..."); cddb_log_set_handler(cddb_log_handler); cddb_conn_t *cddb_conn = cddb_new (); cddb_disc_t *cddb_disc = NULL; cddb_track_t *cddb_track = NULL; lba_t lba; if (!cddb_conn) qWarning ("DecoderCDAudio: unable to create cddb connection"); else { cddb_cache_disable (cddb_conn); //disable libcddb cache, use own cache implementation instead settings.beginGroup("cdaudio"); cddb_set_server_name (cddb_conn, settings.value("cddb_server", "freedb.org").toByteArray().constData()); cddb_set_server_port (cddb_conn, settings.value("cddb_port", 8880).toInt()); if (settings.value("cddb_http", false).toBool()) { cddb_http_enable (cddb_conn); cddb_set_http_path_query (cddb_conn, settings.value("cddb_path").toByteArray()); if (QmmpSettings::instance()->isProxyEnabled()) { QUrl proxy = QmmpSettings::instance()->proxy(); cddb_http_proxy_enable (cddb_conn); cddb_set_http_proxy_server_name (cddb_conn, proxy.host().toAscii ()); cddb_set_http_proxy_server_port (cddb_conn, proxy.port()); if(QmmpSettings::instance()->useProxyAuth()) { cddb_set_http_proxy_username (cddb_conn, proxy.userName().toAscii()); cddb_set_http_proxy_password (cddb_conn, proxy.password().toAscii()); } } } settings.endGroup(); cddb_disc = cddb_disc_new (); lba = cdio_get_track_lba (cdio, CDIO_CDROM_LEADOUT_TRACK); cddb_disc_set_length (cddb_disc, FRAMES_TO_SECONDS (lba)); for (int i = first_track_number; i <= last_track_number; ++i) { cddb_track = cddb_track_new (); cddb_track_set_frame_offset (cddb_track, cdio_get_track_lba (cdio, i)); cddb_disc_add_track (cddb_disc, cddb_track); } cddb_disc_calc_discid (cddb_disc); uint id = cddb_disc_get_discid (cddb_disc); qDebug ("DecoderCDAudio: disc id = %x", id); if(readFromCache(&tracks, id)) qDebug("DecoderCDAudio: using local cddb cache"); else { int matches = cddb_query (cddb_conn, cddb_disc); if(matches == -1) { qWarning ("DecoderCDAudio: unable to query the CDDB server, error: %s", cddb_error_str (cddb_errno(cddb_conn))); } else if(matches == 0) { qDebug ("DecoderCDAudio: no CDDB info found"); } else if(cddb_read(cddb_conn, cddb_disc)) { for (int i = first_track_number; i <= last_track_number; ++i) { cddb_track_t *cddb_track = cddb_disc_get_track (cddb_disc, i - 1); int t = i - first_track_number; tracks[t].info.setMetaData(Qmmp::ARTIST, QString::fromUtf8(cddb_track_get_artist(cddb_track))); tracks[t].info.setMetaData(Qmmp::TITLE, QString::fromUtf8(cddb_track_get_title(cddb_track))); tracks[t].info.setMetaData(Qmmp::GENRE, QString::fromUtf8(cddb_disc_get_genre(cddb_disc))); tracks[t].info.setMetaData(Qmmp::ALBUM, QString::fromUtf8(cddb_disc_get_title(cddb_disc))); } saveToCache(tracks, id); } else { qWarning ("DecoderCDAudio: unable to read the CDDB info: %s", cddb_error_str (cddb_errno(cddb_conn))); } } } if (cddb_disc) cddb_disc_destroy (cddb_disc); if (cddb_conn) cddb_destroy (cddb_conn); } cdio_destroy(cdio); cdio = 0; m_track_cache = tracks; return tracks; } void DecoderCDAudio::saveToCache(QList tracks, uint disc_id) { QString path = QFileInfo(Qmmp::configFile()).absoluteDir().path(); QDir dir(path); if(!dir.exists("cddbcache")) dir.mkdir("cddbcache"); dir.cd("cddbcache"); path = dir.absolutePath() + QString("/%1").arg(disc_id, 0, 16); QSettings settings(path, QSettings::IniFormat); settings.clear(); settings.setValue("count", tracks.size()); for(int i = 0; i < tracks.size(); ++i) { CDATrack track = tracks[i]; QMap meta = track.info.metaData(); settings.setValue(QString("artist%1").arg(i), meta[Qmmp::ARTIST]); settings.setValue(QString("title%1").arg(i), meta[Qmmp::TITLE]); settings.setValue(QString("genre%1").arg(i), meta[Qmmp::GENRE]); settings.setValue(QString("album%1").arg(i), meta[Qmmp::ALBUM]); } } bool DecoderCDAudio::readFromCache(QList *tracks, uint disc_id) { QString path = QFileInfo(Qmmp::configFile()).absoluteDir().path(); path += QString("/cddbcache/%1").arg(disc_id, 0, 16); if(!QFile::exists(path)) return false; QSettings settings(path, QSettings::IniFormat); int count = settings.value("count").toInt(); if(count != tracks->count()) return false; for(int i = 0; i < count; ++i) { (*tracks)[i].info.setMetaData(Qmmp::ARTIST, settings.value(QString("artist%1").arg(i)).toString()); (*tracks)[i].info.setMetaData(Qmmp::TITLE, settings.value(QString("title%1").arg(i)).toString()); (*tracks)[i].info.setMetaData(Qmmp::GENRE, settings.value(QString("genre%1").arg(i)).toString()); (*tracks)[i].info.setMetaData(Qmmp::ALBUM, settings.value(QString("album%1").arg(i)).toString()); } return true; } qint64 DecoderCDAudio::calculateTrackLength(lsn_t startlsn, lsn_t endlsn) { return ((endlsn - startlsn + 1) * 1000) / 75; } void DecoderCDAudio::clearTrackCache() { m_track_cache.clear(); } bool DecoderCDAudio::initialize() { m_bitrate = 0; m_totalTime = 0; //extract track from url int track_number = m_url.section("#", -1).toInt(); QString device_path = m_url; device_path.remove("cdda://"); device_path.remove(QRegExp("#\\d+$")); track_number = qMax(track_number, 1); QList tracks = DecoderCDAudio::generateTrackList(device_path); //generate track list if (tracks.isEmpty()) { qWarning("DecoderCDAudio: initialize failed"); return false; } //find track by number int track_at = -1; for (int i = 0; i < tracks.size(); ++i) if (tracks[i].info.metaData(Qmmp::TRACK).toInt() == track_number) { track_at = i; break; } if (track_at < 0) { qWarning("DecoderCDAudio: invalid track number"); return false; } if (device_path.isEmpty() || device_path == "/") //try default path from config { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); device_path = settings.value("cdaudio/device").toString(); m_url = QString("cdda://%1#%2").arg(device_path).arg(track_number); } if (device_path.isEmpty() || device_path == "/") { char **cd_drives = cdio_get_devices_with_cap(0, CDIO_FS_AUDIO, true); //get drive list with CDA disks // open first audio capable cd drive if (cd_drives && *cd_drives) { m_cdio = cdio_open_cd(*cd_drives); if (!m_cdio) { qWarning("DecoderCDAudio: failed to open CD."); cdio_free_device_list(cd_drives); return false; } qDebug("DecoderCDAudio: found cd audio capable drive \"%s\"", *cd_drives); } else { qWarning("DecoderCDAudio: unable to find cd audio drive."); return false; } if (cd_drives && *cd_drives) //free device list cdio_free_device_list(cd_drives); } else { m_cdio = cdio_open_cd(device_path.toAscii().constData()); if (!m_cdio) { qWarning("DecoderCDAudio: failed to open CD."); return false; } qDebug("DecoderCDAudio: using cd audio capable drive \"%s\"", qPrintable(device_path)); } configure(44100, 2, Qmmp::PCM_S16LE); m_bitrate = 1411; m_totalTime = tracks[track_at].info.length() * 1000; m_first_sector = tracks[track_at].first_sector; m_current_sector = tracks[track_at].first_sector; m_last_sector = tracks[track_at].last_sector; addMetaData(tracks[track_at].info.metaData()); //send metadata qDebug("DecoderCDAudio: initialize succes"); return true; } qint64 DecoderCDAudio::totalTime() { return m_totalTime; } int DecoderCDAudio::bitrate() { return m_bitrate; } qint64 DecoderCDAudio::read(char *audio, qint64 maxSize) { if(!m_buffer_at) { lsn_t secorts_to_read = qMin(CDDA_SECTORS, (m_last_sector - m_current_sector + 1)); if (secorts_to_read <= 0) return 0; if (cdio_read_audio_sectors(m_cdio, m_buffer, m_current_sector, secorts_to_read) != DRIVER_OP_SUCCESS) { m_buffer_at = 0; return -1; } else { m_buffer_at = secorts_to_read * CDIO_CD_FRAMESIZE_RAW; m_current_sector += secorts_to_read; } } if(m_buffer_at > 0) { long len = qMin(maxSize, m_buffer_at); memcpy(audio, m_buffer, len); m_buffer_at -= len; memmove(m_buffer, m_buffer + len, m_buffer_at); return len; } return 0; } void DecoderCDAudio::seek(qint64 pos) { m_current_sector = m_first_sector + pos * 75 / 1000; m_buffer_at = 0; } qmmp-0.7.4/src/plugins/Input/cdaudio/settingsdialog.h0000664000175000017500000000352112256224735021375 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); void on_clearCacheButton_clicked(); private: Ui::SettingsDialog m_ui; }; #endif qmmp-0.7.4/src/plugins/Input/cdaudio/cdaudio.pro0000664000175000017500000000316412256224735020341 0ustar useruserinclude(../../plugins.pri) HEADERS += decodercdaudiofactory.h \ decoder_cdaudio.h \ settingsdialog.h SOURCES += decoder_cdaudio.cpp \ decodercdaudiofactory.cpp \ settingsdialog.cpp INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin \ link_pkgconfig TEMPLATE = lib TARGET =$$PLUGINS_PREFIX/Input/cdaudio TRANSLATIONS = translations/cdaudio_plugin_ru.ts \ translations/cdaudio_plugin_uk_UA.ts \ translations/cdaudio_plugin_zh_CN.ts \ translations/cdaudio_plugin_zh_TW.ts \ translations/cdaudio_plugin_cs.ts \ translations/cdaudio_plugin_pl.ts \ translations/cdaudio_plugin_de.ts \ translations/cdaudio_plugin_it.ts \ translations/cdaudio_plugin_tr.ts \ translations/cdaudio_plugin_lt.ts \ translations/cdaudio_plugin_nl.ts \ translations/cdaudio_plugin_ja.ts \ translations/cdaudio_plugin_es.ts RESOURCES = translations/translations.qrc FORMS += settingsdialog.ui unix { QMAKE_LIBDIR += ../../../../lib LIBS += -lqmmp -L/usr/lib -I/usr/include PKGCONFIG += libcdio libcdio_cdda libcdio_paranoia libcddb isEmpty(LIB_DIR) { LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Input QMAKE_CLEAN =$$PLUGINS_PREFIX/Input/libcdaudio.so INSTALLS += target } win32 { HEADERS += ../../../../src/qmmp/metadatamodel.h \ ../../../../src/qmmp/decoderfactory.h QMAKE_LIBDIR += ../../../../bin LIBS += -lqmmp0 -lcdio -lcdio_paranoia -lcdio_cdda -lm -lwinmm -mwindows -liconv -lcddb } qmmp-0.7.4/src/plugins/plugins.pri0000664000175000017500000000021612256224735015670 0ustar useruserinclude(../../qmmp.pri) unix:PLUGINS_PREFIX=../../../../lib/qmmp win32:PLUGINS_PREFIX=../../../../../bin/plugins INCLUDEPATH += ../../../qmmp qmmp-0.7.4/src/plugins/plugins.pro0000664000175000017500000000042212256224735015675 0ustar useruserSUBDIRS += Input \ Output \ General \ Visual \ Transports \ Effect \ PlayListFormats \ FileDialogs \ Ui unix:SUBDIRS += CommandLineOptions \ Engines TEMPLATE = subdirs qmmp-0.7.4/src/plugins/Output/0000775000175000017500000000000012256224735014774 5ustar useruserqmmp-0.7.4/src/plugins/Output/oss/0000775000175000017500000000000012256224735015600 5ustar useruserqmmp-0.7.4/src/plugins/Output/oss/outputossfactory.cpp0000664000175000017500000000527612256224735021773 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "outputoss.h" #include "outputossfactory.h" Output* OutputOSSFactory::create() { return new OutputOSS(); } const OutputProperties OutputOSSFactory::properties() const { OutputProperties properties; properties.name = tr("OSS Plugin"); properties.shortName = "oss"; properties.hasAbout = true; properties.hasSettings = true; return properties; } Volume *OutputOSSFactory::createVolume() { return new VolumeOSS; } void OutputOSSFactory::showSettings(QWidget* parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void OutputOSSFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About OSS Output Plugin"), tr("Qmmp OSS Output Plugin")+"\n"+ tr("Written by: Yuriy Zhuravlev ")+"\n"+ tr("Based on code by: Brad Hughes ")); } QTranslator *OutputOSSFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/oss_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(oss,OutputOSSFactory) qmmp-0.7.4/src/plugins/Output/oss/CMakeLists.txt0000664000175000017500000000261612256224735020345 0ustar useruserproject(liboss) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) INCLUDE(CheckIncludeFile) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) #OSS CHECK_INCLUDE_FILE(sys/soundcard.h SYS_SOUNDCARD_H_FOUND) IF(SYS_SOUNDCARD_H_FOUND) ADD_DEFINITIONS(-DHAVE_SYS_SOUNDCARD_H) ENDIF(SYS_SOUNDCARD_H_FOUND) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(liboss_SRCS outputossfactory.cpp outputoss.cpp settingsdialog.cpp ) SET(liboss_MOC_HDRS outputossfactory.h settingsdialog.h ) SET(liboss_HDRS outputoss.h ) SET(liboss_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(liboss_RCC_SRCS ${liboss_RCCS}) QT4_WRAP_CPP(liboss_MOC_SRCS ${liboss_MOC_HDRS}) SET(liboss_UIS settingsdialog.ui ) QT4_WRAP_UI(liboss_UIS_H ${liboss_UIS}) ADD_LIBRARY(oss MODULE ${liboss_SRCS} ${liboss_MOC_SRCS} ${liboss_UIS_H} ${liboss_RCC_SRCS} ${liboss_HDRS}) add_dependencies(oss qmmp) target_link_libraries(oss ${QT_LIBRARIES} -lqmmp) install(TARGETS oss DESTINATION ${LIB_DIR}/qmmp/Output) qmmp-0.7.4/src/plugins/Output/oss/outputoss.cpp0000664000175000017500000001336012256224735020374 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Uriy Zhuravlev stalkerg@gmail.com * * * * Copyright (c) 2000-2001 Brad Hughes bhughes@trolltech.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C" { #ifdef HAVE_SYS_SOUNDCARD_H #include #else #include #endif } #include #include #include #include #include #include #include #include #include #include #include "outputoss.h" OutputOSS::OutputOSS() : Output(), m_audio_fd(-1) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_audio_device = settings.value("OSS/device","/dev/dsp").toString(); } OutputOSS::~OutputOSS() { if (m_audio_fd >= 0) { ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); close(m_audio_fd); m_audio_fd = -1; } } void OutputOSS::post() { ioctl(m_audio_fd, SNDCTL_DSP_POST, 0); } void OutputOSS::sync() { ioctl(m_audio_fd, SNDCTL_DSP_SYNC, 0); } bool OutputOSS::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { m_audio_fd = open(m_audio_device.toAscii(), O_WRONLY); if (m_audio_fd < 0) { qWarning("OSSOutput: failed to open output device '%s'", qPrintable(m_audio_device)); return false; } ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); int p; switch (format) { case Qmmp::PCM_S16LE: #ifdef AFMT_S16_NE p = AFMT_S16_NE; #else p = AFMT_S16_LE; #endif break; case Qmmp::PCM_S8: p = AFMT_S8; break; default: qWarning("OutputOSS: unsupported audio format"); return false; } if (ioctl(m_audio_fd, SNDCTL_DSP_SETFMT, &p) == -1) qWarning("OutputOSS: ioctl SNDCTL_DSP_SETFMT failed: %s",strerror(errno)); if(ioctl(m_audio_fd, SNDCTL_DSP_CHANNELS, &chan) == -1) qWarning("OutputOSS: ioctl SNDCTL_DSP_CHANNELS failed: %s", strerror(errno)); if(chan <= 2) { int param = chan - 1; if(ioctl(m_audio_fd, SNDCTL_DSP_STEREO, ¶m) == -1) qWarning("OutputOSS: ioctl SNDCTL_DSP_STEREO failed: %s", strerror(errno)); chan = param + 1; } if (ioctl(m_audio_fd, SNDCTL_DSP_SPEED, &freq) < 0) qWarning("OutputOSS: ioctl SNDCTL_DSP_SPEED failed: %s", strerror(errno)); ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); configure(freq, chan, format); return true; } qint64 OutputOSS::latency() { return 0; } qint64 OutputOSS::writeAudio(unsigned char *data, qint64 maxSize) { qint64 m = write(m_audio_fd, data, maxSize); post(); return m; } void OutputOSS::drain() { ioctl(m_audio_fd, SNDCTL_DSP_SYNC, 0); } void OutputOSS::reset() { ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); } /***** MIXER *****/ VolumeOSS::VolumeOSS() { m_master = true; m_mixer_fd = -1; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_mixer_device = settings.value("OSS/mixer_device","/dev/mixer").toString(); openMixer(); } VolumeOSS::~VolumeOSS() { if (m_mixer_fd >= 0) { close(m_mixer_fd); m_mixer_fd = -1; } } void VolumeOSS::setVolume(const VolumeSettings &vol) { if (m_mixer_fd < 0) return; long cmd; int devs = 0; ioctl(m_mixer_fd, SOUND_MIXER_READ_DEVMASK, &devs); if ((devs & SOUND_MASK_PCM) && !m_master) cmd = SOUND_MIXER_WRITE_PCM; else if ((devs & SOUND_MASK_VOLUME) && m_master) cmd = SOUND_MIXER_WRITE_VOLUME; else { //close(mifd); return; } int v = (vol.right << 8) | vol.left; ioctl(m_mixer_fd, cmd, &v); } VolumeSettings VolumeOSS::volume() const { VolumeSettings vol; if(m_mixer_fd < 0) return vol; int cmd; int v, devs = 0; ioctl(m_mixer_fd, SOUND_MIXER_READ_DEVMASK, &devs); if ((devs & SOUND_MASK_PCM) && !m_master) cmd = SOUND_MIXER_READ_PCM; else if ((devs & SOUND_MASK_VOLUME) && m_master) cmd = SOUND_MIXER_READ_VOLUME; else return vol; ioctl(m_mixer_fd, cmd, &v); vol.left = (v & 0xFF00) >> 8; vol.right = (v & 0x00FF); return vol; } void VolumeOSS::openMixer() { if (m_mixer_fd >= 0) return; m_mixer_fd = open(m_mixer_device.toAscii(), O_RDWR); if (m_mixer_fd < 0) { qWarning("VolumeControlOSS: unable to open mixer device '%s'", qPrintable(m_mixer_device)); return; } } qmmp-0.7.4/src/plugins/Output/oss/outputossfactory.h0000664000175000017500000000371612256224735021435 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTOSSFACTORY_H #define OUTPUTOSSFACTORY_H #include #include #include #include #include #include class OutputOSSFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/oss/settingsdialog.cpp0000664000175000017500000000524312256224735021330 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "settingsdialog.h" SettingsDialog::SettingsDialog ( QWidget *parent ) : QDialog ( parent ) { ui.setupUi ( this ); setAttribute ( Qt::WA_DeleteOnClose ); connect(ui.okButton, SIGNAL(clicked()), SLOT(writeSettings())); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("OSS"); ui.lineEdit->insert(settings.value("device","/dev/dsp").toString()); ui.lineEdit_2->insert(settings.value("mixer_device","/dev/mixer").toString()); ui.bufferSpinBox->setValue(settings.value("buffer_time",500).toInt()); ui.periodSpinBox->setValue(settings.value("period_time",100).toInt()); settings.endGroup(); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::writeSettings() { qDebug("SettingsDialog (OSS):: writeSettings()"); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("OSS"); settings.setValue("device", ui.lineEdit->text()); settings.setValue("buffer_time",ui.bufferSpinBox->value()); settings.setValue("period_time",ui.periodSpinBox->value()); settings.setValue("mixer_device", ui.lineEdit_2->text()); settings.endGroup(); accept(); } qmmp-0.7.4/src/plugins/Output/oss/outputoss.h0000664000175000017500000000446412256224735020046 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Uriy Zhuravlev stalkerg@gmail.com * * * * Copyright (c) 2000-2001 Brad Hughes bhughes@trolltech.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTOSS_H #define OUTPUTOSS_H #include #include class OutputOSS : public Output { public: OutputOSS(); virtual ~OutputOSS(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(); void reset(); private: //oss void post(); void sync(); QString m_audio_device; int m_audio_fd; long bl, br; }; class VolumeOSS : public Volume { public: VolumeOSS(); ~VolumeOSS(); void setVolume(const VolumeSettings &vol); VolumeSettings volume() const; private: //oss mixer QString m_audio_device; void openMixer(); int m_mixer_fd; QString m_mixer_device; bool m_master; }; #endif qmmp-0.7.4/src/plugins/Output/oss/settingsdialog.ui0000664000175000017500000001576312256224735021173 0ustar useruser SettingsDialog 0 0 422 223 OSS Plugin Settings 9 6 0 Device Settings 6 9 Audio device Mixer device 9 6 Advanced Settings 6 9 Soundcard 9 6 Qt::Vertical 20 111 Qt::Horizontal 188 20 20 5000 100 200 10000 500 Buffer time (ms): Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Period time (ms): Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 188 20 PCM over Master Qt::Horizontal 191 20 Cancel OK cancelButton clicked() SettingsDialog reject() 338 283 164 294 qmmp-0.7.4/src/plugins/Output/oss/translations/0000775000175000017500000000000012256224735020321 5ustar useruserqmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_uk_UA.ts0000664000175000017500000000673212256224735024147 0ustar useruser OutputOSSFactory OSS Plugin Модуль OSS About OSS Output Plugin Про модуль виведення OSS Qmmp OSS Output Plugin Модуль виведення OSS для Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Розробник: Юрій Журавльов <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> На базі коду: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Налаштування модуля OSS Device Settings Налаштування пристрою Audio device Пристрій звуку Mixer device Пристрій мікшеру Advanced Settings Додаткові налаштування Soundcard Звукова карта Buffer time (ms): Час буферу (мс): Period time (ms): Час периоду (мс): PCM over Master PCM замість Master Cancel Відміна OK Застосувати qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_pl_PL.ts0000664000175000017500000000643312256224735024147 0ustar useruser OutputOSSFactory OSS Plugin Wtyczka OSS About OSS Output Plugin O wtyczce dźwiękowej OSS Qmmp OSS Output Plugin Wtyczka OSS dla Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Oparty na kodzie stworzonym przez Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Ustawienia wtyczki OSS Device Settings Ustawienia urządzenia Audio device Urządzenie dźwiękowe Mixer device Urządzenie miksujące Advanced Settings Zaawansowane ustawienia Soundcard Karta dźwiękowa Buffer time (ms): Czas bufora (ms): Period time (ms): Długość cyklu (ms): PCM over Master Użyj PCM nad Master Cancel Anuluj OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_pt_BR.ts0000664000175000017500000000630412256224735024144 0ustar useruser OutputOSSFactory OSS Plugin About OSS Output Plugin Qmmp OSS Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Device Settings Audio device Mixer device Advanced Settings Soundcard Buffer time (ms): Period time (ms): PCM over Master Cancel OK qmmp-0.7.4/src/plugins/Output/oss/translations/translations.qrc0000664000175000017500000000140112256224735023545 0ustar useruser oss_plugin_ru.qm oss_plugin_uk_UA.qm oss_plugin_zh_CN.qm oss_plugin_zh_TW.qm oss_plugin_tr.qm oss_plugin_cs.qm oss_plugin_pt_BR.qm oss_plugin_de.qm oss_plugin_pl_PL.qm oss_plugin_fr.qm oss_plugin_it.qm oss_plugin_kk.qm oss_plugin_lt.qm oss_plugin_hu.qm oss_plugin_nl.qm oss_plugin_ja.qm oss_plugin_sk.qm oss_plugin_es.qm oss_plugin_he.qm oss_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_zh_CN.ts0000664000175000017500000000632212256224735024137 0ustar useruser OutputOSSFactory OSS Plugin OSS 插件 About OSS Output Plugin 关于 OSS 输出插件 Qmmp OSS Output Plugin Qmmp OSS 输出插件 Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 作者:Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> 源代码基于:Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings OSS 插件设置 Device Settings 设备设置 Audio device 音频设备 Mixer device 混频设备 Advanced Settings 高级设置 Soundcard 声卡 Buffer time (ms): 缓冲时间(ms): Period time (ms): 周期时间(ms): PCM over Master Cancel 取消 OK 确定 qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_zh_TW.ts0000664000175000017500000000632212256224735024171 0ustar useruser OutputOSSFactory OSS Plugin OSS 插件 About OSS Output Plugin 關於 OSS 匯出插件 Qmmp OSS Output Plugin Qmmp OSS 匯出插件 Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 作者:Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> 源碼基於:Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings OSS 插件設定 Device Settings 裝置設定 Audio device 聲訊裝置 Mixer device 混頻裝置 Advanced Settings 進階設定 Soundcard 音效卡 Buffer time (ms): 緩衝時間(ms): Period time (ms): 周期時間(ms): PCM over Master Cancel 取消 OK 確定 qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_gl_ES.ts0000664000175000017500000000643112256224735024130 0ustar useruser OutputOSSFactory OSS Plugin Engadido OSS About OSS Output Plugin Sobre o engadido OSS Qmmp OSS Output Plugin Engadido OSS de Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Escrito por: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Baseado no código por: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Preferencias do engadido OSS Device Settings Preferencias de dispositivo Audio device Dispositivo de audio Mixer device Dispositivo mesturador Advanced Settings Opcións avanzadas Soundcard Tarxeta de son Buffer time (ms): Tempo de búfer (ms): Period time (ms): Tempo de periodo (ms): PCM over Master PCM sobre Master Cancel Cancelar OK Feito qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_de.ts0000664000175000017500000000635512256224735023534 0ustar useruser OutputOSSFactory OSS Plugin OSS-Modul About OSS Output Plugin Über OSS-Ausgabe-Modul Qmmp OSS Output Plugin Qmmp OSS-Ausgabe-Modul Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Basiert auf Quellcode von: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Einstellungen OSS-Modul Device Settings Geräte-Einstellungen Audio device Audiogerät Mixer device Mixergerät Advanced Settings Erweiterte Einstellungen Soundcard Soundkarte Buffer time (ms): Pufferzeit (ms): Period time (ms): Zeitraster (ms): PCM over Master PCM over Master Cancel Abbrechen OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_cs.ts0000664000175000017500000000637412256224735023552 0ustar useruser OutputOSSFactory OSS Plugin Modul OSS About OSS Output Plugin O modulu OSS Qmmp OSS Output Plugin Výstupní modul Qmmp OSS Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Založeno na kódu Brada Hughese <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Nastavení pluginu OSS Device Settings Nastavení zařízení Audio device Zvukové zařízení Mixer device Ovládání hlasitosti Advanced Settings Pokročilá nastavení Soundcard Zvuková karta Buffer time (ms): Velikost bufferu (ms): Period time (ms): Délka periody (ms): PCM over Master PCM přes Master Cancel Zrušit OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_es.ts0000664000175000017500000000646012256224735023550 0ustar useruser OutputOSSFactory OSS Plugin Módulo OSS About OSS Output Plugin Acerca del módulo de salida OSS Qmmp OSS Output Plugin Módulo de salida OSS para Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Escrito por: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Basado en el código de: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Configuración del módulo OSS Device Settings Configuración del dispositivo Audio device Dispositivo de sonido Mixer device Dispositivo mezclador Advanced Settings Configuración avanzada Soundcard Tarjeta de sonido Buffer time (ms): Tiempo de buffer (ms): Period time (ms): Periodo (ms): PCM over Master PCM sobre maestro Cancel Cancelar OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_fr.ts0000664000175000017500000000630412256224735023545 0ustar useruser OutputOSSFactory OSS Plugin About OSS Output Plugin Qmmp OSS Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Device Settings Audio device Mixer device Advanced Settings Soundcard Buffer time (ms): Period time (ms): PCM over Master Cancel OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_he.ts0000664000175000017500000000652712256224735023541 0ustar useruser OutputOSSFactory OSS Plugin תוספת OSS About OSS Output Plugin אודות תוספת פלט OSS Qmmp OSS Output Plugin תוספת פלט OSS ‫Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> חוברה על ידי: Yuriy Zhuravlev ‫<slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> מבוססת על קוד מאת: Brad Hughes ‫<bhughes@trolltech.com> SettingsDialog OSS Plugin Settings הגדרות תוספת OSS Device Settings הגדרות התקן Audio device התקן שמע Mixer device התקן מערבל Advanced Settings הגדרות מתקדמות Soundcard כרטיס קול Buffer time (ms): זמן אגירה (מ״ש): Period time (ms): זמן משך (מ״ש): PCM over Master Cancel ביטול OK אישור qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_hu.ts0000664000175000017500000000630412256224735023552 0ustar useruser OutputOSSFactory OSS Plugin About OSS Output Plugin Qmmp OSS Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Device Settings Audio device Mixer device Advanced Settings Soundcard Buffer time (ms): Period time (ms): PCM over Master Cancel OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_ja.ts0000664000175000017500000000655212256224735023535 0ustar useruser OutputOSSFactory OSS Plugin OSS プラグイン About OSS Output Plugin OSS 出力プラグインについて Qmmp OSS Output Plugin QMMP OSS 出力プラグイン Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 制作: Юрий Журавлёв (Yuriy Zhuravlev) <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Brad Hughes <bhughes@trolltech.com> 氏のコードを基に作成 SettingsDialog OSS Plugin Settings OSS プラグイン設定 Device Settings デバイス設定 Audio device 音響デバイス Mixer device ミキサーデバイス Advanced Settings 上級設定 Soundcard サウンドカード Buffer time (ms): バッファー時間 (ミリ秒): Period time (ms): 割り込み間隔 (ミリ秒): PCM over Master Cancel キャンセル OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_it.ts0000664000175000017500000000642412256224735023555 0ustar useruser OutputOSSFactory OSS Plugin Modulo OSS About OSS Output Plugin Informazioni sul modulo d'uscita OSS Qmmp OSS Output Plugin Modulo d'uscita OSS per Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autore: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Basato sul codice scritto da: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Impostazioni del modulo OSS Device Settings Impostazioni del device Audio device Device audio Mixer device Device Mixer Advanced Settings Impostazioni avanzate Soundcard Scheda audio Buffer time (ms): Tempo di buffering (ms): Period time (ms): Periodo (ms): PCM over Master PCM su Master Cancel Annulla OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_kk.ts0000664000175000017500000000630412256224735023543 0ustar useruser OutputOSSFactory OSS Plugin About OSS Output Plugin Qmmp OSS Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Device Settings Audio device Mixer device Advanced Settings Soundcard Buffer time (ms): Period time (ms): PCM over Master Cancel OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_lt.ts0000664000175000017500000000642312256224735023557 0ustar useruser OutputOSSFactory OSS Plugin OSS įskiepis About OSS Output Plugin Apie OSS išvesties įrenginį Qmmp OSS Output Plugin Apie Qmmp OSS išvesties įrenginį Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Sukūrė: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Sukurta Brad Hughes <bhughes@trolltech.com> kodo pagrindu SettingsDialog OSS Plugin Settings OSS įskiepio nustatymai Device Settings Įrangos nustatymai Audio device Audio įranga Mixer device Glotintuvo įranga Advanced Settings Papildomi nustatymai Soundcard Garso plokštė Buffer time (ms): Buferio laikas (ms): Period time (ms): Periodo laikas (ms): PCM over Master PCM per Master Cancel Atšaukti OK Gerai qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_nl.ts0000664000175000017500000000641112256224735023546 0ustar useruser OutputOSSFactory OSS Plugin OSS Module About OSS Output Plugin Over de OSS Uitvoer Module Qmmp OSS Output Plugin OSS Uitvoer Module voor Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Auteur: Yuriy Žuravljov <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Gebasseerd op code van: Brada Hughese <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings OSS Module Instellingen Device Settings Apparaat Instellingen Audio device Audio apparaat Mixer device Mixer apparaat Advanced Settings Geavanceerde Instellingen Soundcard Geluidskaart Buffer time (ms): Buffertijd (ms): Period time (ms): Tijdsperiode (ms): PCM over Master PCM preferen over Master Cancel Annuleren OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_pl.ts0000664000175000017500000000643312256224735023554 0ustar useruser OutputOSSFactory OSS Plugin Wtyczka OSS About OSS Output Plugin O wtyczce dźwiękowej OSS Qmmp OSS Output Plugin Wtyczka OSS dla Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Oparty na kodzie stworzonym przez Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Ustawienia wtyczki OSS Device Settings Ustawienia urządzenia Audio device Urządzenie dźwiękowe Mixer device Urządzenie miksujące Advanced Settings Zaawansowane ustawienia Soundcard Karta dźwiękowa Buffer time (ms): Czas bufora (ms): Period time (ms): Długość cyklu (ms): PCM over Master Użyj PCM nad Master Cancel Anuluj OK OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_ru.ts0000664000175000017500000000664212256224735023571 0ustar useruser OutputOSSFactory OSS Plugin Модуль OSS About OSS Output Plugin О модуле вывода OSS Qmmp OSS Output Plugin Модуль вывода OSS для Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Разработчик: Юрий Журавлёв <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Настройки модуля OSS Device Settings Настройки устройства Audio device Аудиоустройство Mixer device Устройство микшера Advanced Settings Дополнительные настройки Soundcard Звуковая карта Buffer time (ms): Время буфера (мс): Period time (ms): Время периода (мс): PCM over Master PCM вместо Master Cancel Отмена OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_sk.ts0000664000175000017500000000630412256224735023553 0ustar useruser OutputOSSFactory OSS Plugin About OSS Output Plugin Qmmp OSS Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> SettingsDialog OSS Plugin Settings Device Settings Audio device Mixer device Advanced Settings Soundcard Buffer time (ms): Period time (ms): PCM over Master Cancel OK qmmp-0.7.4/src/plugins/Output/oss/translations/oss_plugin_tr.ts0000664000175000017500000000643012256224735023563 0ustar useruser OutputOSSFactory OSS Plugin OSS Eklentisi About OSS Output Plugin OSS Çıktı Eklentisi Hakkında Qmmp OSS Output Plugin Qmmp OSS Çıktı Eklentisi Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Yazan: Yuriy Zhuravlev <slalkerg@gmail.com> Based on code by: Brad Hughes <bhughes@trolltech.com> Brad Hughes <bhughes@trolltech.com> tarafından yazılan kod temellidir SettingsDialog OSS Plugin Settings OSS Eklenti Ayarları Device Settings Aygıt Ayarları Audio device Ses aygıtı Mixer device Karıştırıcı aygıtı Advanced Settings Gelişmiş Ayarlar Soundcard Ses kartı Buffer time (ms): Arabellek süresi (ms): Period time (ms): Periyot süresi (ms): PCM over Master Master üzeri PCM Cancel İptal OK Tamam qmmp-0.7.4/src/plugins/Output/oss/oss.pro0000664000175000017500000000233212256224735017126 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += outputossfactory.h \ outputoss.h \ settingsdialog.h SOURCES += outputossfactory.cpp \ outputoss.cpp \ settingsdialog.cpp TARGET=$$PLUGINS_PREFIX/Output/oss QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/liboss.so INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin DEFINES += HAVE_SYS_SOUNDCARD_H TEMPLATE = lib LIBS += -lqmmp TRANSLATIONS = translations/oss_plugin_cs.ts \ translations/oss_plugin_de.ts \ translations/oss_plugin_zh_CN.ts \ translations/oss_plugin_zh_TW.ts \ translations/oss_plugin_ru.ts \ translations/oss_plugin_pl.ts \ translations/oss_plugin_uk_UA.ts \ translations/oss_plugin_it.ts \ translations/oss_plugin_tr.ts \ translations/oss_plugin_lt.ts \ translations/oss_plugin_nl.ts \ translations/oss_plugin_ja.ts \ translations/oss_plugin_es.ts \ RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/oss/settingsdialog.h0000664000175000017500000000345212256224735020775 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Yuriy Zhuravlev */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); private slots: void writeSettings(); private: Ui::SettingsDialog ui; }; #endif qmmp-0.7.4/src/plugins/Output/alsa/0000775000175000017500000000000012256224735015714 5ustar useruserqmmp-0.7.4/src/plugins/Output/alsa/outputalsafactory.h0000664000175000017500000000375412256224735021667 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTALSAFACTORY_H #define OUTPUTALSAFACTORY_H #include #include #include #include #include #include class OutputALSAFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/alsa/outputalsa.h0000664000175000017500000000551012256224735020267 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTALSA_H #define OUTPUTALSA_H class OutputALSA; extern "C" { #include } #include #include class OutputALSA : public Output { public: OutputALSA(); ~OutputALSA(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(); void reset(); void suspend(); void resume(); private: // helper functions long alsa_write(unsigned char *data, long size); void uninitialize(); bool m_inited; bool m_use_mmap; //alsa snd_pcm_t *pcm_handle; char *pcm_name; snd_pcm_uframes_t m_chunk_size; size_t m_bits_per_frame; //prebuffer uchar *m_prebuf; qint64 m_prebuf_size; qint64 m_prebuf_fill; bool m_can_pause; }; class VolumeALSA : public Volume { public: VolumeALSA(); virtual ~VolumeALSA(); void setVolume(const VolumeSettings &vol); VolumeSettings volume() const; private: //alsa mixer int setupMixer(QString card, QString device); void parseMixerName(char *str, char **name, int *index); int getMixer(snd_mixer_t **m_mixer, QString card); snd_mixer_elem_t* getMixerElem(snd_mixer_t *m_mixer, char *name, int index); snd_mixer_t *m_mixer; snd_mixer_elem_t *pcm_element; bool m_use_mmap; }; #endif // OUTPUTALSA_H qmmp-0.7.4/src/plugins/Output/alsa/CMakeLists.txt0000664000175000017500000000311612256224735020455 0ustar useruserproject(libalsa) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # alsa pkg_search_module(ALSA alsa) include_directories(${ALSA_INCLUDE_DIRS}) link_directories(${ALSA_LIBRARY_DIRS}) ADD_DEFINITIONS(${ALSA_CFLAGS}) SET(libalsa_SRCS outputalsa.cpp outputalsafactory.cpp settingsdialog.cpp ) SET(libalsa_MOC_HDRS outputalsafactory.h settingsdialog.h ) SET(libalsa_HDRS outputalsa.h ) SET(libalsa_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libalsa_RCC_SRCS ${libalsa_RCCS}) QT4_WRAP_CPP(libalsa_MOC_SRCS ${libalsa_MOC_HDRS}) # user interface SET(libalsa_UIS settingsdialog.ui ) QT4_WRAP_UI(libalsa_UIS_H ${libalsa_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(ALSA_FOUND) ADD_LIBRARY(alsa MODULE ${libalsa_SRCS} ${libalsa_MOC_SRCS} ${libalsa_UIS_H} ${libalsa_RCC_SRCS} ${libalsa_HDRS}) add_dependencies(alsa qmmp) target_link_libraries(alsa ${QT_LIBRARIES} -lqmmp ${ALSA_LDFLAGS}) install(TARGETS alsa DESTINATION ${LIB_DIR}/qmmp/Output) ENDIF(ALSA_FOUND) qmmp-0.7.4/src/plugins/Output/alsa/settingsdialog.cpp0000664000175000017500000002170112256224735021441 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include extern "C" { #include } #include "settingsdialog.h" SettingsDialog::SettingsDialog ( QWidget *parent ) : QDialog ( parent ) { ui.setupUi (this); setAttribute (Qt::WA_DeleteOnClose); ui.deviceComboBox->setEditable (true); getCards(); getSoftDevices(); connect (ui.deviceComboBox, SIGNAL(activated(int)),SLOT(setText(int))); connect(ui.mixerCardComboBox, SIGNAL(activated(int)), SLOT(showMixerDevices(int))); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ALSA"); ui.deviceComboBox->setEditText(settings.value("device","default").toString()); ui.bufferSpinBox->setValue(settings.value("buffer_time",500).toInt()); ui.periodSpinBox->setValue(settings.value("period_time",100).toInt()); int d = m_cards.indexOf(settings.value("mixer_card","hw:0").toString()); if (d >= 0) ui.mixerCardComboBox->setCurrentIndex(d); showMixerDevices(ui.mixerCardComboBox->currentIndex ()); d = ui.mixerDeviceComboBox->findText(settings.value("mixer_device", "PCM").toString()); if (d >= 0) ui.mixerDeviceComboBox->setCurrentIndex(d); ui.mmapCheckBox->setChecked(settings.value("use_mmap", false).toBool()); ui.pauseCheckBox->setChecked(settings.value("use_snd_pcm_pause", false).toBool()); settings.endGroup(); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::getCards() { int card = -1, err; m_devices.clear(); m_devices << "default"; ui.deviceComboBox->addItem("Default PCM device (default)"); if ((err = snd_card_next(&card)) !=0) qWarning("SettingsDialog (ALSA): snd_next_card() failed: %s", snd_strerror(-err)); while (card > -1) { getCardDevices(card); m_cards << QString("hw:%1").arg(card); if ((err = snd_card_next(&card)) !=0) { qWarning("SettingsDialog (ALSA): snd_next_card() failed: %s", snd_strerror(-err)); break; } } } void SettingsDialog::getSoftDevices() { #if SND_LIB_VERSION >= 0x010016 //1.0.22 void **hints = 0; int i = 0; if(snd_device_name_hint(-1, "pcm", &hints) < 0) return; while(hints[i]) { char *type = snd_device_name_get_hint (hints[i], "IOID"); if (!type || !strcmp (type, "Output")) { char *device_name = snd_device_name_get_hint (hints[i], "NAME"); char *device_desc = snd_device_name_get_hint (hints[i], "DESC"); m_devices << QString(device_name); QString str = QString("%1 (%2)").arg(device_desc).arg(device_name); qDebug("%s", qPrintable(str)); ui.deviceComboBox->addItem(str); free (device_name); free (device_desc); } if(type) free (type); ++i; } if (hints) snd_device_name_free_hint (hints); #endif } void SettingsDialog::getCardDevices(int card) { int pcm_device = -1, err; snd_pcm_info_t *pcm_info; snd_ctl_t *ctl; char dev[64], *card_name; sprintf(dev, "hw:%i", card); if ((err = snd_ctl_open(&ctl, dev, 0)) < 0) { qWarning("SettingsDialog (ALSA): snd_ctl_open() failed: %s", snd_strerror(-err)); return; } if ((err = snd_card_get_name(card, &card_name)) != 0) { qWarning("SettingsDialog (ALSA): snd_card_get_name() failed: %s", snd_strerror(-err)); card_name = strdup("Unknown soundcard"); } ui.mixerCardComboBox->addItem(QString(card_name)); snd_pcm_info_alloca(&pcm_info); qDebug("SettingsDialog (ALSA): detected sound cards:"); for (;;) { QString device; if ((err = snd_ctl_pcm_next_device(ctl, &pcm_device)) < 0) { qWarning("SettingsDialog (ALSA): snd_ctl_pcm_next_device() failed: %s", snd_strerror(-err)); pcm_device = -1; } if (pcm_device < 0) break; snd_pcm_info_set_device(pcm_info, pcm_device); snd_pcm_info_set_subdevice(pcm_info, 0); snd_pcm_info_set_stream(pcm_info, SND_PCM_STREAM_PLAYBACK); if ((err = snd_ctl_pcm_info(ctl, pcm_info)) < 0) { if (err != -ENOENT) qWarning("SettingsDialog (ALSA): get_devices_for_card(): " "snd_ctl_pcm_info() " "failed (%d:%d): %s.", card, pcm_device, snd_strerror(-err)); } device = QString("hw:%1,%2").arg(card).arg(pcm_device); m_devices << device; QString str; str = QString(card_name) + ": "+ snd_pcm_info_get_name(pcm_info)+" ("+device+")"; qDebug("%s",qPrintable(str)); ui.deviceComboBox->addItem(str); } snd_ctl_close(ctl); } void SettingsDialog::getMixerDevices(QString card) { ui.mixerDeviceComboBox->clear(); int err; snd_mixer_t *mixer; snd_mixer_elem_t *current; if ((err = getMixer(&mixer, card)) < 0) return; current = snd_mixer_first_elem(mixer); while (current) { const char *sname = snd_mixer_selem_get_name(current); if (snd_mixer_selem_is_active(current) && snd_mixer_selem_has_playback_volume(current)) ui.mixerDeviceComboBox->addItem(QString(sname)); current = snd_mixer_elem_next(current); } } void SettingsDialog::setText(int n) { ui.deviceComboBox->setEditText(m_devices.at(n)); } void SettingsDialog::accept() { qDebug("SettingsDialog (ALSA):: writeSettings()"); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ALSA"); settings.setValue("device", ui.deviceComboBox->currentText ()); settings.setValue("buffer_time",ui.bufferSpinBox->value()); settings.setValue("period_time",ui.periodSpinBox->value()); if(ui.mixerCardComboBox->currentIndex() >= 0) { QString card = m_cards.at(ui.mixerCardComboBox->currentIndex()); settings.setValue("mixer_card", card); } settings.setValue("mixer_device", ui.mixerDeviceComboBox->currentText ()); settings.setValue("use_mmap", ui.mmapCheckBox->isChecked()); settings.setValue("use_snd_pcm_pause", ui.pauseCheckBox->isChecked()); settings.endGroup(); QDialog::accept(); } int SettingsDialog::getMixer(snd_mixer_t **mixer, QString card) { char *dev; int err; dev = strdup(QString(card).toAscii().data()); if ((err = snd_mixer_open(mixer, 0)) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): " "Failed to open empty mixer: %s", snd_strerror(-err)); mixer = NULL; return -1; } if ((err = snd_mixer_attach(*mixer, dev)) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): " "Attaching to mixer %s failed: %s", dev, snd_strerror(-err)); return -1; } if ((err = snd_mixer_selem_register(*mixer, NULL, NULL)) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): " "Failed to register mixer: %s", snd_strerror(-err)); return -1; } if ((err = snd_mixer_load(*mixer)) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): Failed to load mixer: %s", snd_strerror(-err)); return -1; } free (dev); return (*mixer != NULL); } void SettingsDialog::showMixerDevices(int d) { if (0<=d && d //#include //#include #include #include #include #include #include #include #include #include #include #include #include #include "outputalsa.h" OutputALSA::OutputALSA() : m_inited(false) { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QString dev_name = settings.value("ALSA/device","default").toString(); m_use_mmap = settings.value("ALSA/use_mmap", false).toBool(); pcm_name = strdup(dev_name.toAscii().data()); pcm_handle = 0; m_prebuf = 0; m_prebuf_size = 0; m_prebuf_fill = 0; m_can_pause = false; } OutputALSA::~OutputALSA() { uninitialize(); free (pcm_name); } bool OutputALSA::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { m_inited = false; if (pcm_handle) return false; if (snd_pcm_open(&pcm_handle, pcm_name, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) { qWarning ("OutputALSA: Error opening PCM device %s", pcm_name); return false; } // we need to configure uint rate = freq; /* Sample rate */ uint exact_rate = freq; /* Sample rate returned by */ /* load settings from config */ QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.beginGroup("ALSA"); uint buffer_time = settings.value("buffer_time",500).toUInt()*1000; uint period_time = settings.value("period_time",100).toUInt()*1000; bool use_pause = settings.value("use_snd_pcm_pause", false).toBool(); settings.endGroup(); snd_pcm_hw_params_t *hwparams = 0; snd_pcm_sw_params_t *swparams = 0; int err; //alsa error code //hw params snd_pcm_hw_params_alloca(&hwparams); if ((err = snd_pcm_hw_params_any(pcm_handle, hwparams)) < 0) { qWarning("OutputALSA: Can not read configuration for PCM device: %s", snd_strerror(err)); return false; } if (m_use_mmap) { if ((err = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) { qWarning("OutputALSA: Error setting mmap access: %s", snd_strerror(err)); m_use_mmap = false; } } if (!m_use_mmap) { if ((err = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { qWarning("OutputALSA: Error setting access: %s", snd_strerror(err)); return false; } } snd_pcm_format_t alsa_format = SND_PCM_FORMAT_UNKNOWN; switch (format) { case Qmmp::PCM_S8: alsa_format = SND_PCM_FORMAT_S8; break; case Qmmp::PCM_S16LE: alsa_format = SND_PCM_FORMAT_S16_LE; break; case Qmmp::PCM_S24LE: alsa_format = SND_PCM_FORMAT_S24_LE; break; case Qmmp::PCM_S32LE: alsa_format = SND_PCM_FORMAT_S32_LE; break; default: qWarning("OutputALSA: unsupported format detected"); return false; } if ((err = snd_pcm_hw_params_set_format(pcm_handle, hwparams, alsa_format)) < 0) { qDebug("OutputALSA: Error setting format: %s", snd_strerror(err)); return false; } exact_rate = rate; if ((err = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &exact_rate, 0)) < 0) { qWarning("OutputALSA: Error setting rate: %s", snd_strerror(err)); return false; } if (rate != exact_rate) { qWarning("OutputALSA: The rate %d Hz is not supported by your hardware.\n==> Using %d Hz instead.", rate, exact_rate); } uint c = chan; if ((err = snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &c)) < 0) { qWarning("OutputALSA: Error setting channels: %s", snd_strerror(err)); return false; } if ((err = snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &period_time ,0)) < 0) { qWarning("OutputALSA: Error setting period time: %s", snd_strerror(err)); return false; } if ((err = snd_pcm_hw_params_set_buffer_time_near(pcm_handle, hwparams, &buffer_time ,0)) < 0) { qWarning("OutputALSA: Error setting buffer time: %s", snd_strerror(err)); return false; } if ((err = snd_pcm_hw_params(pcm_handle, hwparams)) < 0) { qWarning("OutputALSA: Error setting HW params: %s", snd_strerror(err)); return false; } //read some alsa parameters snd_pcm_uframes_t buffer_size = 0; snd_pcm_uframes_t period_size = 0; if ((err = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size)) < 0) { qWarning("OutputALSA: Error reading buffer size: %s", snd_strerror(err)); return false; } if ((err = snd_pcm_hw_params_get_period_size(hwparams, &period_size, 0)) < 0) { qWarning("OutputALSA: Error reading period size: %s", snd_strerror(err)); return false; } //swparams snd_pcm_sw_params_alloca(&swparams); snd_pcm_sw_params_current(pcm_handle, swparams); if ((err = snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, buffer_size - period_size)) < 0) qWarning("OutputALSA: Error setting threshold: %s", snd_strerror(err)); if ((err = snd_pcm_sw_params(pcm_handle, swparams)) < 0) { qWarning("OutputALSA: Error setting SW params: %s", snd_strerror(err)); return false; } //setup needed values m_bits_per_frame = snd_pcm_format_physical_width(alsa_format) * chan; m_chunk_size = period_size; m_can_pause = snd_pcm_hw_params_can_pause(hwparams) && use_pause; qDebug("OutputALSA: can pause: %d", m_can_pause); configure(freq, chan, format); //apply configuration //create alsa prebuffer; m_prebuf_size = /*QMMP_BUFFER_SIZE + */m_bits_per_frame * m_chunk_size / 8; m_prebuf = (uchar *)malloc(m_prebuf_size); m_inited = true; return true; } qint64 OutputALSA::latency() { return m_prebuf_fill * 1000 / sampleRate() / channels() / sampleSize(); } void OutputALSA::drain() { long m = 0; snd_pcm_uframes_t l = snd_pcm_bytes_to_frames(pcm_handle, m_prebuf_fill); while (l > 0) { if ((m = alsa_write(m_prebuf, l)) >= 0) { l -= m; m = snd_pcm_frames_to_bytes(pcm_handle, m); // convert frames to bytes m_prebuf_fill -= m; memmove(m_prebuf, m_prebuf + m, m_prebuf_fill); } else break; } snd_pcm_nonblock(pcm_handle, 0); snd_pcm_drain(pcm_handle); snd_pcm_nonblock(pcm_handle, 1); } void OutputALSA::reset() { m_prebuf_fill = 0; snd_pcm_drop(pcm_handle); snd_pcm_prepare(pcm_handle); } void OutputALSA::suspend() { if (m_can_pause) snd_pcm_pause(pcm_handle, 1); snd_pcm_prepare(pcm_handle); } void OutputALSA::resume() { if (m_can_pause) snd_pcm_pause(pcm_handle, 0); snd_pcm_prepare(pcm_handle); } qint64 OutputALSA::writeAudio(unsigned char *data, qint64 maxSize) { if((maxSize = qMin(maxSize, m_prebuf_size - m_prebuf_fill)) > 0) { memmove(m_prebuf + m_prebuf_fill, data, maxSize); m_prebuf_fill += maxSize; } snd_pcm_uframes_t l = snd_pcm_bytes_to_frames(pcm_handle, m_prebuf_fill); while (l >= m_chunk_size) { snd_pcm_wait(pcm_handle, 10); long m; if ((m = alsa_write(m_prebuf, m_chunk_size)) >= 0) { l -= m; m = snd_pcm_frames_to_bytes(pcm_handle, m); // convert frames to bytes m_prebuf_fill -= m; memmove(m_prebuf, m_prebuf + m, m_prebuf_fill); //move data to begin } else return -1; } return maxSize; } long OutputALSA::alsa_write(unsigned char *data, long size) { long m = snd_pcm_avail_update(pcm_handle); if(m >= 0 && m < size) { snd_pcm_wait(pcm_handle, 500); return 0; } if (m_use_mmap) m = snd_pcm_mmap_writei (pcm_handle, data, size); else m = snd_pcm_writei (pcm_handle, data, size); if (m == -EAGAIN) { snd_pcm_wait(pcm_handle, 500); return 0; } else if (m >= 0) { if (m < size) { snd_pcm_wait(pcm_handle, 500); } return m; } else if (m == -EPIPE) { qDebug ("OutputALSA: buffer underrun!"); if ((m = snd_pcm_prepare(pcm_handle)) < 0) { qDebug ("OutputALSA: Can't recover after underrun: %s", snd_strerror(m)); /* TODO: reopen the device */ return -1; } return 0; } #ifdef ESTRPIPE else if (m == -ESTRPIPE) { qDebug ("OutputALSA: Suspend, trying to resume"); while ((m = snd_pcm_resume(pcm_handle)) == -EAGAIN) sleep (1); if (m < 0) { qDebug ("OutputALSA: Failed, restarting"); if ((m = snd_pcm_prepare(pcm_handle)) < 0) { qDebug ("OutputALSA: Failed to restart device: %s.", snd_strerror(m)); return -1; } } return 0; } #endif qDebug ("OutputALSA: error: %s", snd_strerror(m)); return snd_pcm_prepare (pcm_handle); } void OutputALSA::uninitialize() { if (!m_inited) return; m_inited = false; if (pcm_handle) { snd_pcm_drop(pcm_handle); qDebug("OutputALSA: closing pcm_handle"); snd_pcm_close(pcm_handle); pcm_handle = 0; } if (m_prebuf) free(m_prebuf); m_prebuf = 0; } /* ****** MIXER ******* */ VolumeALSA::VolumeALSA() { //alsa mixer m_mixer = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QString card = settings.value("ALSA/mixer_card","hw:0").toString(); QString dev = settings.value("ALSA/mixer_device", "PCM").toString(); setupMixer(card, dev); } VolumeALSA::~VolumeALSA() { if (m_mixer) snd_mixer_close(m_mixer); } void VolumeALSA::setVolume(const VolumeSettings &vol) { if (!pcm_element) return; snd_mixer_selem_set_playback_volume(pcm_element, SND_MIXER_SCHN_FRONT_LEFT, vol.left); snd_mixer_selem_set_playback_volume(pcm_element, SND_MIXER_SCHN_FRONT_RIGHT, vol.right); } VolumeSettings VolumeALSA::volume() const { VolumeSettings vol; if (!pcm_element) return vol; long value = 0; snd_mixer_handle_events(m_mixer); snd_mixer_selem_get_playback_volume(pcm_element, SND_MIXER_SCHN_FRONT_LEFT, &value); vol.left = value; snd_mixer_selem_get_playback_volume(pcm_element, SND_MIXER_SCHN_FRONT_RIGHT, &value); vol.right = value; return vol; } int VolumeALSA::setupMixer(QString card, QString device) { char *name; int err, index; pcm_element = 0; qDebug("OutputALSA: setupMixer()"); if ((err = getMixer(&m_mixer, card)) < 0) return err; parseMixerName(device.toAscii().data(), &name, &index); pcm_element = getMixerElem(m_mixer, name, index); free(name); if (!pcm_element) { qWarning("OutputALSA: Failed to find mixer element"); return -1; } if((err = snd_mixer_selem_set_playback_volume_range(pcm_element, 0, 100)) < 0) { qWarning("OutputALSA: Unable to set volume range: %s", snd_strerror(-err)); pcm_element = NULL; return -1; } qDebug("OutputALSA: setupMixer() success"); return 0; } void VolumeALSA::parseMixerName(char *str, char **name, int *index) { char *end; while (isspace(*str)) str++; if ((end = strchr(str, ',')) != NULL) { *name = strndup(str, end - str); end++; *index = atoi(end); } else { *name = strdup(str); *index = 0; } } snd_mixer_elem_t* VolumeALSA::getMixerElem(snd_mixer_t *mixer, char *name, int index) { snd_mixer_selem_id_t* selem_id; snd_mixer_elem_t* elem; snd_mixer_selem_id_alloca(&selem_id); if (index != -1) snd_mixer_selem_id_set_index(selem_id, index); if (name != NULL) snd_mixer_selem_id_set_name(selem_id, name); elem = snd_mixer_find_selem(mixer, selem_id); return elem; } int VolumeALSA::getMixer(snd_mixer_t **mixer, QString card) { char *dev; int err; dev = strdup(card.toAscii().data()); if ((err = snd_mixer_open(mixer, 0)) < 0) { qWarning("OutputALSA: Failed to open empty mixer: %s", snd_strerror(-err)); mixer = NULL; return -1; } if ((err = snd_mixer_attach(*mixer, dev)) < 0) { qWarning("OutputALSA: Attaching to mixer %s failed: %s", dev, snd_strerror(-err)); free(dev); return -1; } free(dev); if ((err = snd_mixer_selem_register(*mixer, NULL, NULL)) < 0) { qWarning("OutputALSA: Failed to register mixer: %s", snd_strerror(-err)); return -1; } if ((err = snd_mixer_load(*mixer)) < 0) { qWarning("OutputALSA: Failed to load mixer: %s", snd_strerror(-err)); return -1; } return (*mixer != NULL); } qmmp-0.7.4/src/plugins/Output/alsa/settingsdialog.ui0000664000175000017500000002025012256224735021272 0ustar useruser SettingsDialog 0 0 403 280 ALSA Plugin Settings 6 6 6 0 Device Settings 6 9 Audio device QComboBox::NoInsert Mixer 9 6 Mixer card: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Mixer device: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Advanced Settings 6 9 Soundcard Buffer time (ms): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 10000 500 Qt::Horizontal 188 20 Period time (ms): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 20 5000 100 Qt::Horizontal 188 20 Use mmap access Qt::Vertical 60 81 Use snd_pcm_pause function Qt::Horizontal 191 20 0 0 QDialogButtonBox::Cancel|QDialogButtonBox::Ok buttonBox accepted() SettingsDialog accept() 270 284 130 281 buttonBox rejected() SettingsDialog reject() 377 286 152 301 qmmp-0.7.4/src/plugins/Output/alsa/translations/0000775000175000017500000000000012256224735020435 5ustar useruserqmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_zh_CN.ts0000664000175000017500000000625212256224735024371 0ustar useruser OutputALSAFactory ALSA Plugin ALSA 插件 About ALSA Output Plugin 关于 ALSA 输出插件 Qmmp ALSA Output Plugin Qmmp ALSA 输出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Device Settings 设备设置 Audio device 音频设备 Mixer 混频 Mixer card: 混频卡: Mixer device: 混频设备: Advanced Settings 高级设置 Soundcard 声卡 Buffer time (ms): 缓冲时间(ms): Period time (ms): 周期时间(ms): Use snd_pcm_pause function 使用 snd_pcm_pause 功能 ALSA Plugin Settings ALSA 插件设置 Use mmap access 使用内存映射 qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_de.ts0000664000175000017500000000632312256224735023757 0ustar useruser OutputALSAFactory ALSA Plugin ALSA-Modul About ALSA Output Plugin Über ALSA-Ausgabe-Modul Qmmp ALSA Output Plugin Qmmp ALSA-Ausgabe-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Einstellungen ALSA-Modul Device Settings Geräte-Einstellungen Audio device Audiogerät Mixer Mixer Mixer card: Mixerkarte: Mixer device: Mixergerät: Advanced Settings Erweiterte Einstellungen Soundcard Soundkarte Buffer time (ms): Pufferzeit (ms): Period time (ms): Zeitraster (ms): Use mmap access Mmap-Unterstützung aktivieren Use snd_pcm_pause function „snd_pcm_pause“-Funktion verwenden qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_cs.ts0000664000175000017500000000632312256224735023774 0ustar useruser OutputALSAFactory ALSA Plugin Modul ALSA About ALSA Output Plugin O modulu ALSA Qmmp ALSA Output Plugin Výstupní modul Qmmp ALSA Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Nastavení pluginu ALSA Device Settings Nastavení zařízení Audio device Zvukové zařízení Mixer Mixér Mixer card: Zvuková karta: Mixer device: Ovládání hlasitosti: Advanced Settings Pokročilá nastavení Soundcard Zvuková karta Buffer time (ms): Velikost bufferu (ms): Period time (ms): Délka periody (ms): Use mmap access Použít mmap Use snd_pcm_pause function Použít funkci snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_zh_TW.ts0000664000175000017500000000625512256224735024426 0ustar useruser OutputALSAFactory ALSA Plugin ALSA 插件 About ALSA Output Plugin 關於 ALSA 匯出插件 Qmmp ALSA Output Plugin Qmmp ALSA 匯出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Device Settings 裝置設定 Audio device 聲訊裝置 Mixer 混頻 Mixer card: 混頻卡: Mixer device: 混頻裝置: Advanced Settings 進階設定 Soundcard 音效卡 Buffer time (ms): 緩衝時間(ms): Period time (ms): 周期時間(ms): Use snd_pcm_pause function 使用 snd_pcm_pause 功能 ALSA Plugin Settings ALSA 插件設定 Use mmap access 使用內存對映 qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_es.ts0000664000175000017500000000641612256224735024001 0ustar useruser OutputALSAFactory ALSA Plugin Módulo ALSA About ALSA Output Plugin Acerca del módulo de salida ALSA Qmmp ALSA Output Plugin Módulo de salida ALSA para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Configuración del módulo ALSA Device Settings Configuración del dispositivo Audio device Dispositivo de sonido Mixer Mezclador Mixer card: Tarjeta mezcladora: Mixer device: Dispositivo mezclador: Advanced Settings Configuración avanzada Soundcard Tarjeta de sonido Buffer time (ms): Tiempo del buffer (ms): Period time (ms): Periodo (ms): Use mmap access Usar accesso Mmap Use snd_pcm_pause function Usa la función snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_fr.ts0000664000175000017500000000626112256224735023777 0ustar useruser OutputALSAFactory ALSA Plugin About ALSA Output Plugin Qmmp ALSA Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Device Settings Audio device Mixer Mixer card: Mixer device: Advanced Settings Soundcard Buffer time (ms): Period time (ms): Use mmap access Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_he.ts0000664000175000017500000000646312256224735023770 0ustar useruser OutputALSAFactory ALSA Plugin תוספת ALSA About ALSA Output Plugin אודות תוספת פלט ALSA Qmmp ALSA Output Plugin תוספת פלט ALSA ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings הגדרות תוספת ALSA Device Settings הגדרות התקן Audio device התקן שמע Mixer מערבל Mixer card: כרטיס מערבל: Mixer device: התקן מערבל: Advanced Settings הגדרות מתקדמות Soundcard כרטיס קול Buffer time (ms): זמן אגירה (מ״ש): Period time (ms): זמן משך (מ״ש): Use mmap access נצל גישת mmap Use snd_pcm_pause function השתמש בפונקציית snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_hu.ts0000664000175000017500000000626112256224735024004 0ustar useruser OutputALSAFactory ALSA Plugin About ALSA Output Plugin Qmmp ALSA Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Device Settings Audio device Mixer Mixer card: Mixer device: Advanced Settings Soundcard Buffer time (ms): Period time (ms): Use mmap access Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_ja.ts0000664000175000017500000000651712256224735023766 0ustar useruser OutputALSAFactory ALSA Plugin ALSA プラグイン About ALSA Output Plugin ALSA 出力プラグインについて Qmmp ALSA Output Plugin QMMP ALSA 出力プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings ALSA プラグイン設定 Device Settings デバイス設定 Audio device 音響デバイス Mixer ミキサー Mixer card: ミキサーカード: Mixer device: ミキサーデバイス: Advanced Settings 上級設定 Soundcard サウンドカード Buffer time (ms): バッファー時間 (ミリ秒): Period time (ms): 割り込み間隔 (ミリ秒): Use mmap access メモリマップアクセスを利用 Use snd_pcm_pause function snd_pcm_pause 機能を利用 qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_it.ts0000664000175000017500000000635312256224735024006 0ustar useruser OutputALSAFactory ALSA Plugin Modulo ALSA About ALSA Output Plugin Informazioni sul modulo d'uscita ALSA Qmmp ALSA Output Plugin Modulo d'uscita ALSA per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Impostazioni modulo ALSA Device Settings Impostazione del device Audio device Dispositivo audio Mixer Mixer Mixer card: Scheda Mixer: Mixer device: Dispositivo Mixer: Advanced Settings Impostazoni avanzate Soundcard Scheda audio Buffer time (ms): Tempo di buffering (ms): Period time (ms): Periodo (ms): Use mmap access Usa accesso Mmap Use snd_pcm_pause function Usa la funzione snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_kk.ts0000664000175000017500000000626112256224735023775 0ustar useruser OutputALSAFactory ALSA Plugin About ALSA Output Plugin Qmmp ALSA Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Device Settings Audio device Mixer Mixer card: Mixer device: Advanced Settings Soundcard Buffer time (ms): Period time (ms): Use mmap access Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_lt.ts0000664000175000017500000000634412256224735024011 0ustar useruser OutputALSAFactory ALSA Plugin ALSA įskiepis About ALSA Output Plugin Apie ALSA įskiepį Qmmp ALSA Output Plugin Apie ALSA Qmmp įskiepį Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog Device Settings Įrangos nustatymai Audio device Garso įranga Mixer Glotintuvas Mixer card: Glotintuvo plokštė : Mixer device: Glotintuvo įranga: Advanced Settings Papildomi nustatymai Soundcard Garso plokštė Buffer time (ms): Buferio laikas (ms): Period time (ms): Periodo laikas (ms): Use snd_pcm_pause function Naudoti snd_pcm_pause funciją ALSA Plugin Settings ALSA įskiepio nustatymai Use mmap access Naudoti mmap prieigą qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_nl.ts0000664000175000017500000000632512256224735024002 0ustar useruser OutputALSAFactory ALSA Plugin ALSA Module About ALSA Output Plugin Over de ALSA Uitvoer Module Qmmp ALSA Output Plugin ALSA Uitvoer Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings ALSA Module Instellingen Device Settings Apparaat Instellingen Audio device Audio Apparaat Mixer Mixer Mixer card: Mixerkaart: Mixer device: Mixer apparaat: Advanced Settings Gevanceerde Instellingen Soundcard Geluidskaart Buffer time (ms): Buffertijd (ms): Period time (ms): Tijdsperiode (ms): Use mmap access Gebruik MMAP toegang Use snd_pcm_pause function Gebruik de snd_pcm_pause functie qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_pl.ts0000664000175000017500000000635012256224735024002 0ustar useruser OutputALSAFactory ALSA Plugin Wtyczka ALSA About ALSA Output Plugin O wtyczce dźwiękowej ALSA Qmmp ALSA Output Plugin Wtyczka ALSA dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Ustawienia wtyczki ALSA Device Settings Ustawienia urządzenia Audio device Urządzenie dźwiękowe Mixer Mikser Mixer card: Karta miksująca: Mixer device: Urządzenie miksujące: Advanced Settings Zaawansowane ustawienia Soundcard Karta dźwiękowa Buffer time (ms): Wielkość buforu (ms): Period time (ms): Czas cyklu (ms): Use mmap access Użyj dostępu mmap Use snd_pcm_pause function Użyj funkcji snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_ru.ts0000664000175000017500000000673212256224735024021 0ustar useruser OutputALSAFactory ALSA Plugin Модуль ALSA About ALSA Output Plugin О модуле вывода ALSA Qmmp ALSA Output Plugin Модуль вывода ALSA для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> SettingsDialog Device Settings Параметры устройства Audio device Аудио устройство Mixer Микшер Mixer card: Карта микшера: Mixer device: Устройство микшера: Advanced Settings Дополнительные настройки Soundcard Звуковая карта Buffer time (ms): Время буферизации (мс): Period time (ms): Время периода (мс): Use snd_pcm_pause function Использовать функцию snd_pcm_pause ALSA Plugin Settings Настройки модуля ALSA Use mmap access Использовать доступ mmap qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_sk.ts0000664000175000017500000000626112256224735024005 0ustar useruser OutputALSAFactory ALSA Plugin About ALSA Output Plugin Qmmp ALSA Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Device Settings Audio device Mixer Mixer card: Mixer device: Advanced Settings Soundcard Buffer time (ms): Period time (ms): Use mmap access Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_tr.ts0000664000175000017500000000635712256224735024023 0ustar useruser OutputALSAFactory ALSA Plugin ALSA Eklentisi About ALSA Output Plugin ALSA Çıktı Eklentisi Hakkında Qmmp ALSA Output Plugin Qmmp ALSA Çıktı Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings ALSA Eklentisi Ayarları Device Settings Aygıt Ayarları Audio device Ses aygıtı Mixer Karıştırıcı Mixer card: Karıştırıcı kartı: Mixer device: Karıştırıcı aygıtı: Advanced Settings Gelişmiş Ayarlar Soundcard Ses kartı Buffer time (ms): Arabellek süresi (ms): Period time (ms): Periyot süresi (ms): Use mmap access mmap erişimi kullan Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_gl_ES.ts0000664000175000017500000000641112256224735024356 0ustar useruser OutputALSAFactory ALSA Plugin Engadido ALSA About ALSA Output Plugin Sobre o engadido Alsa Qmmp ALSA Output Plugin Engadido ALSA de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Preferencias do engadido ALSA Device Settings Preferencias de dispositivo Audio device Dispositivo de audio Mixer Mesturador Mixer card: Tarxeta mesturadora: Mixer device: Dispositivo mesturador: Advanced Settings Opcións avanzadas Soundcard Tarxeta de son Buffer time (ms): Tempo de búfer (ms): Period time (ms): Tempo de periodo (ms): Use mmap access Usar acceso mmap Use snd_pcm_pause function Usar a función snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/translations.qrc0000664000175000017500000000142512256224735023667 0ustar useruser alsa_plugin_ru.qm alsa_plugin_uk_UA.qm alsa_plugin_zh_CN.qm alsa_plugin_zh_TW.qm alsa_plugin_tr.qm alsa_plugin_cs.qm alsa_plugin_pt_BR.qm alsa_plugin_de.qm alsa_plugin_pl_PL.qm alsa_plugin_fr.qm alsa_plugin_it.qm alsa_plugin_kk.qm alsa_plugin_lt.qm alsa_plugin_hu.qm alsa_plugin_nl.qm alsa_plugin_ja.qm alsa_plugin_sk.qm alsa_plugin_es.qm alsa_plugin_he.qm alsa_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_uk_UA.ts0000664000175000017500000000672412256224735024400 0ustar useruser OutputALSAFactory ALSA Plugin Модуль ALSA About ALSA Output Plugin Про модуль виводу ALSA Qmmp ALSA Output Plugin Модуль виводу ALSA для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog Device Settings Параметри пристроїв Audio device Аудіо пристрій Mixer Мікшер Mixer card: Карта мікшера: Mixer device: Пристрій мікшера: Advanced Settings Додаткові налаштування Soundcard Звукова карта Buffer time (ms): Час буферизації (мс): Period time (ms): Час періоду (мс): Use snd_pcm_pause function Використовувати функцію snd_pcm_pause ALSA Plugin Settings Налаштування модуля ALSA Use mmap access Використовувати доступ mmap qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_pl_PL.ts0000664000175000017500000000635012256224735024375 0ustar useruser OutputALSAFactory ALSA Plugin Wtyczka ALSA About ALSA Output Plugin O wtyczce dźwiękowej ALSA Qmmp ALSA Output Plugin Wtyczka ALSA dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Ustawienia wtyczki ALSA Device Settings Ustawienia urządzenia Audio device Urządzenie dźwiękowe Mixer Mikser Mixer card: Karta miksująca: Mixer device: Urządzenie miksujące: Advanced Settings Zaawansowane ustawienia Soundcard Karta dźwiękowa Buffer time (ms): Wielkość buforu (ms): Period time (ms): Czas cyklu (ms): Use mmap access Użyj dostępu mmap Use snd_pcm_pause function Użyj funkcji snd_pcm_pause qmmp-0.7.4/src/plugins/Output/alsa/translations/alsa_plugin_pt_BR.ts0000664000175000017500000000626112256224735024376 0ustar useruser OutputALSAFactory ALSA Plugin About ALSA Output Plugin Qmmp ALSA Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog ALSA Plugin Settings Device Settings Audio device Mixer Mixer card: Mixer device: Advanced Settings Soundcard Buffer time (ms): Period time (ms): Use mmap access Use snd_pcm_pause function qmmp-0.7.4/src/plugins/Output/alsa/outputalsafactory.cpp0000664000175000017500000000517012256224735022214 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "outputalsa.h" #include "outputalsafactory.h" const OutputProperties OutputALSAFactory::properties() const { OutputProperties properties; properties.name = tr("ALSA Plugin"); properties.shortName = "alsa"; properties.hasAbout = true; properties.hasSettings = true; return properties; } Output* OutputALSAFactory::create() { return new OutputALSA(); } Volume *OutputALSAFactory::createVolume() { return new VolumeALSA(); } void OutputALSAFactory::showSettings(QWidget* parent) { SettingsDialog *s = new SettingsDialog(parent); s -> show(); } void OutputALSAFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About ALSA Output Plugin"), tr("Qmmp ALSA Output Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *OutputALSAFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/alsa_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(alsa,OutputALSAFactory) qmmp-0.7.4/src/plugins/Output/alsa/settingsdialog.h0000664000175000017500000000420212256224735021103 0ustar useruser/*************************************************************************** * Copyright (C) 2006 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include extern "C"{ #include } #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private slots: void setText(int); void showMixerDevices(int); private: Ui::SettingsDialog ui; void getCards(); void getSoftDevices(); void getCardDevices(int card); void getMixerDevices(QString card); int getMixer(snd_mixer_t **mixer, QString card); QStringList m_devices; QList m_cards; }; #endif qmmp-0.7.4/src/plugins/Output/alsa/alsa.pro0000664000175000017500000000235512256224735017363 0ustar useruserinclude(../../plugins.pri) HEADERS += outputalsa.h \ outputalsafactory.h \ settingsdialog.h SOURCES += outputalsa.cpp \ outputalsafactory.cpp \ settingsdialog.cpp TARGET=$$PLUGINS_PREFIX/Output/alsa QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/libalsa.so INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin \ link_pkgconfig TEMPLATE = lib LIBS += -lqmmp PKGCONFIG += alsa FORMS += settingsdialog.ui TRANSLATIONS = translations/alsa_plugin_ru.ts \ translations/alsa_plugin_uk_UA.ts \ translations/alsa_plugin_zh_CN.ts \ translations/alsa_plugin_zh_TW.ts \ translations/alsa_plugin_cs.ts \ translations/alsa_plugin_pl.ts \ translations/alsa_plugin_de.ts \ translations/alsa_plugin_it.ts \ translations/alsa_plugin_tr.ts \ translations/alsa_plugin_lt.ts \ translations/alsa_plugin_nl.ts \ translations/alsa_plugin_ja.ts \ translations/alsa_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/jack/0000775000175000017500000000000012256224735015704 5ustar useruserqmmp-0.7.4/src/plugins/Output/jack/outputjack.cpp0000664000175000017500000000614312256224735020605 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2008 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "outputjack.h" #include #include #include #include #include #include #define JACK_TIMEOUT 500000L OutputJACK::OutputJACK() : Output(), m_inited(false) { JACK_Init(); m_wait_time = 0; jack_device = 0; } OutputJACK::~OutputJACK() { uninitialize(); } bool OutputJACK::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { qDebug("OutputJACK: initialize"); int bits = 0; Qmmp::AudioFormat input_format = Qmmp::PCM_S8; switch(format) { case Qmmp::PCM_S8: bits = 8; input_format = Qmmp::PCM_S8; break; default: bits = 16; input_format = Qmmp::PCM_S16LE; } if(JACK_Open(&jack_device, bits, (unsigned long *)&freq, chan)) { m_inited = false; return false; } m_inited = true; configure(freq, chan, input_format); return true; } qint64 OutputJACK::latency() { return 0; } qint64 OutputJACK::writeAudio(unsigned char *data, qint64 maxSize) { if(!m_inited) return -1; m = JACK_Write(jack_device, (unsigned char*)data, maxSize); if (!m) { usleep(2000); if(JACK_GetState(jack_device) != PLAYING) m_wait_time += 2000; if(m_wait_time > JACK_TIMEOUT) return -1; } else m_wait_time = 0; return m; } void OutputJACK::reset() { JACK_Reset(jack_device); } void OutputJACK::uninitialize() { if (!m_inited) return; JACK_Close(jack_device); m_inited = false; } qmmp-0.7.4/src/plugins/Output/jack/outputjackfactory.cpp0000664000175000017500000000500712256224735022173 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2008 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "outputjack.h" #include "outputjackfactory.h" const OutputProperties OutputJACKFactory::properties() const { OutputProperties properties; properties.name = tr("JACK Plugin"); properties.hasAbout = true; properties.hasSettings = false; properties.shortName = "jack"; return properties; } Output* OutputJACKFactory::create() { return new OutputJACK(); } Volume *OutputJACKFactory::createVolume() { return 0; } void OutputJACKFactory::showSettings(QWidget*) { } void OutputJACKFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Jack Output Plugin"), tr("Qmmp Jack Output Plugin")+"\n"+ tr("Written by: Yuriy Zhuravlev ")); } QTranslator *OutputJACKFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/jack_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(jack,OutputJACKFactory) qmmp-0.7.4/src/plugins/Output/jack/CMakeLists.txt0000664000175000017500000000350212256224735020444 0ustar useruserproject(libjack) cmake_minimum_required(VERSION 2.4.7) INCLUDE (CheckCXXSourceCompiles) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libjack and samplerate pkg_check_modules(JACK jack samplerate) include_directories(${JACK_INCLUDE_DIRS}) link_directories(${JACK_LIBRARY_DIRS}) ADD_DEFINITIONS(${JACK_CFLAGS}) IF(JACK_FOUND) CHECK_CXX_SOURCE_COMPILES(" #include #include #include #include int main (int argc, char **argv) { jack_latency_range_t range; exit(0); }" JACK_NEW_API) ENDIF(JACK_FOUND) IF(JACK_NEW_API) ADD_DEFINITIONS(-DJACK_NEW_API) ENDIF(JACK_NEW_API) SET(libjack_SRCS outputjackfactory.cpp outputjack.cpp bio2jack.c ) SET(libjack_HDRS bio2jack.h outputjack.h ) SET(libjack_MOC_HDRS outputjackfactory.h ) SET(libjack_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libjack_RCC_SRCS ${libjack_RCCS}) QT4_WRAP_CPP(libjack_MOC_SRCS ${libjack_MOC_HDRS}) IF(JACK_FOUND) ADD_LIBRARY(jack MODULE ${libjack_SRCS} ${libjack_MOC_SRCS} ${libjack_RCC_SRCS} ${libjack_HDRS}) add_dependencies(jack qmmp) set_target_properties(jack PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread ) target_link_libraries(jack ${QT_LIBRARIES} -lqmmp ${JACK_LDFLAGS}) install(TARGETS jack DESTINATION ${LIB_DIR}/qmmp/Output) ENDIF(JACK_FOUND) qmmp-0.7.4/src/plugins/Output/jack/outputjack.h0000664000175000017500000000376212256224735020256 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2008 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTJACK_H #define OUTPUTJACK_H class OutputJACK; #include extern "C" { #include } #include "bio2jack.h" class OutputJACK : public Output { public: OutputJACK(); ~OutputJACK(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(){} void reset(); private: // helper functions void uninitialize(); qint64 m, m_wait_time; bool m_inited; int jack_device; }; #endif qmmp-0.7.4/src/plugins/Output/jack/jack.pro0000664000175000017500000000234612256224735017343 0ustar useruserinclude(../../plugins.pri) HEADERS += outputjackfactory.h \ outputjack.h \ bio2jack.h SOURCES += outputjackfactory.cpp \ outputjack.cpp \ bio2jack.c TARGET=$$PLUGINS_PREFIX/Output/jack QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/libjack.so DEFINES += JACK_NEW_API INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin \ link_pkgconfig TEMPLATE = lib LIBS += -lqmmp PKGCONFIG += jack samplerate TRANSLATIONS = translations/jack_plugin_ru.ts \ translations/jack_plugin_uk_UA.ts \ translations/jack_plugin_zh_CN.ts \ translations/jack_plugin_zh_TW.ts \ translations/jack_plugin_cs.ts \ translations/jack_plugin_pl.ts \ translations/jack_plugin_de.ts \ translations/jack_plugin_it.ts \ translations/jack_plugin_tr.ts \ translations/jack_plugin_lt.ts \ translations/jack_plugin_nl.ts \ translations/jack_plugin_ja.ts \ translations/jack_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/jack/translations/0000775000175000017500000000000012256224735020425 5ustar useruserqmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_pt_BR.ts0000664000175000017500000000170312256224735024352 0ustar useruser OutputJACKFactory JACK Plugin About Jack Output Plugin Qmmp Jack Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_zh_CN.ts0000664000175000017500000000174712256224735024355 0ustar useruser OutputJACKFactory JACK Plugin JACK 插件 About Jack Output Plugin 关于 Jack 输出插件 Qmmp Jack Output Plugin Qmmp Jack 输出插件 Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 作者:Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_zh_TW.ts0000664000175000017500000000174712256224735024407 0ustar useruser OutputJACKFactory JACK Plugin JACK 插件 About Jack Output Plugin 關於 Jack 匯出插件 Qmmp Jack Output Plugin Qmmp Jack 匯出插件 Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 作者:Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/translations.qrc0000664000175000017500000000142512256224735023657 0ustar useruser jack_plugin_ru.qm jack_plugin_uk_UA.qm jack_plugin_zh_CN.qm jack_plugin_zh_TW.qm jack_plugin_tr.qm jack_plugin_cs.qm jack_plugin_pt_BR.qm jack_plugin_de.qm jack_plugin_pl_PL.qm jack_plugin_fr.qm jack_plugin_it.qm jack_plugin_kk.qm jack_plugin_lt.qm jack_plugin_hu.qm jack_plugin_nl.qm jack_plugin_ja.qm jack_plugin_sk.qm jack_plugin_es.qm jack_plugin_he.qm jack_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_gl_ES.ts0000664000175000017500000000175112256224735024340 0ustar useruser OutputJACKFactory JACK Plugin Engadido JACK About Jack Output Plugin Sobre o engadido Jack Qmmp Jack Output Plugin Engadido Jack de Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Escrito por: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_de.ts0000664000175000017500000000174512256224735023742 0ustar useruser OutputJACKFactory JACK Plugin JACK-Modul About Jack Output Plugin Über JACK-Ausgabe-Modul Qmmp Jack Output Plugin Qmmp JACK-Ausgabe-Modul Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_cs.ts0000664000175000017500000000173312256224735023754 0ustar useruser OutputJACKFactory JACK Plugin Modul JACK About Jack Output Plugin O modulu JACK Qmmp Jack Output Plugin Výstupní modul Qmmp JACK Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_es.ts0000664000175000017500000000177412256224735023763 0ustar useruser OutputJACKFactory JACK Plugin Módulo JACK About Jack Output Plugin Acerca del módulo de salida Jack Qmmp Jack Output Plugin Módulo de salida Jack para Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Escrito por: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_fr.ts0000664000175000017500000000170312256224735023753 0ustar useruser OutputJACKFactory JACK Plugin About Jack Output Plugin Qmmp Jack Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_he.ts0000664000175000017500000000201612256224735023736 0ustar useruser OutputJACKFactory JACK Plugin תוספת JACK About Jack Output Plugin אודות תוספת פלט Jack Qmmp Jack Output Plugin תוספת פלט Jack ‫Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> חוברה על ידי: Yuriy Zhuravlev ‫<slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_hu.ts0000664000175000017500000000170312256224735023760 0ustar useruser OutputJACKFactory JACK Plugin About Jack Output Plugin Qmmp Jack Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_ja.ts0000664000175000017500000000204212256224735023733 0ustar useruser OutputJACKFactory JACK Plugin JACK プラグイン About Jack Output Plugin JACK 出力プラグインについて Qmmp Jack Output Plugin QMMP JACK 出力プラグイン Written by: Yuriy Zhuravlev <slalkerg@gmail.com> 制作: Юрий Журавлёв (Yuriy Zhuravlev) <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_it.ts0000664000175000017500000000177212256224735023766 0ustar useruser OutputJACKFactory JACK Plugin Modulo JACK About Jack Output Plugin Informazioni sul modulo JACK in nuscita Qmmp Jack Output Plugin Modulo JACK d'uscita Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autore: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_kk.ts0000664000175000017500000000170312256224735023751 0ustar useruser OutputJACKFactory JACK Plugin About Jack Output Plugin Qmmp Jack Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_lt.ts0000664000175000017500000000176612256224735023774 0ustar useruser OutputJACKFactory JACK Plugin JACK Įskiepis About Jack Output Plugin Apie JACK išvesties įskiepį Qmmp Jack Output Plugin Qmmp Jack išvesties įskiepis Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Sukūrė: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_nl.ts0000664000175000017500000000175412256224735023763 0ustar useruser OutputJACKFactory JACK Plugin JACK Module About Jack Output Plugin Over de Jack Output Module Qmmp Jack Output Plugin JACK Output Module voor Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Auteur: Yuriy Žuravljov <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_pl.ts0000664000175000017500000000174612256224735023766 0ustar useruser OutputJACKFactory JACK Plugin Wtyczka JACK About Jack Output Plugin O wtyczce dźwiękowej Jack Qmmp Jack Output Plugin Wtyczka Jack dla Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_ru.ts0000664000175000017500000000204012256224735023765 0ustar useruser OutputJACKFactory JACK Plugin Модуль JACK About Jack Output Plugin О модуле вывода Jack Qmmp Jack Output Plugin Модуль вывода Jack для Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Разработчик: Юрий Журавлёв <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_sk.ts0000664000175000017500000000170312256224735023761 0ustar useruser OutputJACKFactory JACK Plugin About Jack Output Plugin Qmmp Jack Output Plugin Written by: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_tr.ts0000664000175000017500000000177512256224735024002 0ustar useruser OutputJACKFactory JACK Plugin JACK Eklentisi About Jack Output Plugin Jack Çıkışı Eklentisi Hakkında Qmmp Jack Output Plugin Qmmp Jack Çıkışı Eklentisi Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Yazan: Yuriy Zhuravlev <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_uk_UA.ts0000664000175000017500000000204212256224735024345 0ustar useruser OutputJACKFactory JACK Plugin Модуль JACK About Jack Output Plugin Про модуль виводу Jack Qmmp Jack Output Plugin Модуль виводу Jack для Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Розробник: Юрій Журавльов <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/translations/jack_plugin_pl_PL.ts0000664000175000017500000000174612256224735024361 0ustar useruser OutputJACKFactory JACK Plugin Wtyczka JACK About Jack Output Plugin O wtyczce dźwiękowej Jack Qmmp Jack Output Plugin Wtyczka Jack dla Qmmp Written by: Yuriy Zhuravlev <slalkerg@gmail.com> Autor: Jurij Žuravljov <slalkerg@gmail.com> qmmp-0.7.4/src/plugins/Output/jack/bio2jack.c0000664000175000017500000025115012256224735017540 0ustar useruser/* * Copyright 2003-2006 Chris Morgan * * 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.1 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* NOTE: All functions that take a jack_driver_t* do NOT lock the device, in order to get a */ /* jack_driver_t* you must call getDriver() which will pthread_mutex_lock() */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "bio2jack.h" /* enable/disable TRACING through the JACK_Callback() function */ /* this can sometimes be too much information */ #define TRACE_CALLBACK 0 /* set to 1 for verbose output */ #define VERBOSE_OUTPUT 0 /* set to 1 to enable debug messages */ #define DEBUG_OUTPUT 0 /* set to 1 to enable tracing */ #define TRACE_ENABLE 0 /* set to 1 to enable the function timers */ #define TIMER_ENABLE 0 /* set to 1 to enable tracing of getDriver() and releaseDriver() */ #define TRACE_getReleaseDevice 0 #define ENABLE_WARNINGS 0 #define DEFAULT_RB_SIZE 4096 #define OUTFILE stderr #if TIMER_ENABLE /* This seemingly construct makes timing arbitrary functions really easy all you have to do is place a 'TIMER("start\n")' at the beginning and a 'TIMER("stop\n")' at the end of any function and this does the rest (naturally you can place any printf-compliant text you like in the argument along with the associated values). */ static struct timeval timer_now; #define TIMER(format,args...) gettimeofday(&timer_now,0); \ fprintf(OUTFILE, "%ld.%06ld: %s::%s(%d) "format, timer_now.tv_sec, timer_now.tv_usec, __FILE__, __FUNCTION__, __LINE__, ##args) #else #define TIMER(...) #endif #if TRACE_ENABLE #define TRACE(format,args...) fprintf(OUTFILE, "%s::%s(%d) "format, __FILE__, __FUNCTION__, __LINE__,##args); \ fflush(OUTFILE); #else #define TRACE(...) #endif #if DEBUG_OUTPUT #define DEBUG(format,args...) fprintf(OUTFILE, "%s::%s(%d) "format, __FILE__, __FUNCTION__, __LINE__,##args); \ fflush(OUTFILE); #else #define DEBUG(...) #endif #if TRACE_CALLBACK #define CALLBACK_TRACE(format,args...) fprintf(OUTFILE, "%s::%s(%d) "format, __FILE__, __FUNCTION__, __LINE__,##args); \ fflush(OUTFILE); #else #define CALLBACK_TRACE(...) #endif #if ENABLE_WARNINGS #define WARN(format,args...) fprintf(OUTFILE, "WARN: %s::%s(%d) "format, __FILE__,__FUNCTION__,__LINE__,##args); \ fflush(OUTFILE); #else #define WARN(...) #endif #define ERR(format,args...) fprintf(OUTFILE, "ERR: %s::%s(%d) "format, __FILE__,__FUNCTION__,__LINE__,##args); \ fflush(OUTFILE); #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) < (b)) ? (b) : (a)) #define MAX_OUTPUT_PORTS 10 #define MAX_INPUT_PORTS 10 typedef struct jack_driver_s { bool allocated; /* whether or not this device has been allocated */ int deviceID; /* id of this device */ int clientCtr; /* to prevent overlapping client ids */ long jack_sample_rate; /* jack samples(frames) per second */ long client_sample_rate; /* client samples(frames) per second */ double output_sample_rate_ratio; /* ratio between jack's output rate & ours */ double input_sample_rate_ratio; /* ratio between our input rate & jack's */ unsigned long num_input_channels; /* number of input channels(1 is mono, 2 stereo etc..) */ unsigned long num_output_channels; /* number of output channels(1 is mono, 2 stereo etc..) */ unsigned long bits_per_channel; /* number of bits per channel (only 8 & 16 are currently supported) */ unsigned long bytes_per_output_frame; /* (num_output_channels * bits_per_channel) / 8 */ unsigned long bytes_per_input_frame; /* (num_input_channels * bits_per_channel) / 8 */ unsigned long bytes_per_jack_output_frame; /* (num_output_channels * bits_per_channel) / 8 */ unsigned long bytes_per_jack_input_frame; /* (num_input_channels * bits_per_channel) / 8 */ unsigned long latencyMS; /* latency in ms between writing and actual audio output of the written data */ long clientBytesInJack; /* number of INPUT bytes(from the client of bio2jack) we wrote to jack(not necessary the number of bytes we wrote to jack) */ long jack_buffer_size; /* size of the buffer jack will pass in to the process callback */ unsigned long callback_buffer1_size; /* number of bytes in the buffer allocated for processing data in JACK_Callback */ char *callback_buffer1; unsigned long callback_buffer2_size; /* number of bytes in the buffer allocated for processing data in JACK_Callback */ char *callback_buffer2; unsigned long rw_buffer1_size; /* number of bytes in the buffer allocated for processing data in JACK_(Read|Write) */ char *rw_buffer1; struct timeval previousTime; /* time of last JACK_Callback() write to jack, allows for MS accurate bytes played */ unsigned long written_client_bytes; /* input bytes we wrote to jack, not necessarily actual bytes we wrote to jack due to channel and other conversion */ unsigned long played_client_bytes; /* input bytes that jack has played */ unsigned long client_bytes; /* total bytes written by the client of bio2jack via JACK_Write() */ jack_port_t *output_port[MAX_OUTPUT_PORTS]; /* output ports */ jack_port_t *input_port[MAX_OUTPUT_PORTS]; /* input ports */ jack_client_t *client; /* pointer to jack client */ char **jack_port_name; /* user given strings for the port names, can be NULL */ unsigned int jack_port_name_count; /* the number of port names given */ unsigned long jack_output_port_flags; /* flags to be passed to jack when opening the output ports */ unsigned long jack_input_port_flags; /* flags to be passed to jack when opening the output ports */ jack_ringbuffer_t *pPlayPtr; /* the playback ringbuffer */ jack_ringbuffer_t *pRecPtr; /* the recording ringbuffer */ SRC_STATE *output_src; /* SRC object for the output stream */ SRC_STATE *input_src; /* SRC object for the output stream */ enum status_enum state; /* one of PLAYING, PAUSED, STOPPED, CLOSED, RESET etc */ unsigned int volume[MAX_OUTPUT_PORTS]; /* percentage of sample value to preserve, 100 would be no attenuation */ enum JACK_VOLUME_TYPE volumeEffectType; /* linear or dbAttenuation, if dbAttenuation volume is the number of dBs of attenuation to apply, 0 volume being no attenuation, full volume */ long position_byte_offset; /* an offset that we will apply to returned position queries to achieve */ /* the position that the user of the driver desires set */ bool in_use; /* true if this device is currently in use */ pthread_mutex_t mutex; /* mutex to lock this specific device */ /* variables used for trying to restart the connection to jack */ bool jackd_died; /* true if jackd has died and we should try to restart it */ struct timeval last_reconnect_attempt; } jack_driver_t; static char *client_name; /* the name bio2jack will use when creating a new jack client. client_name_%deviceID% will be used */ static bool do_sample_rate_conversion; /* whether the client has requested sample rate conversion, default to on for improved compatibility */ /* Which SRC converter function we should use when doing sample rate conversion. Default to the fastest of the 'good quality' set. */ static int preferred_src_converter = SRC_SINC_FASTEST; static bool init_done = 0; /* just to prevent clients from calling JACK_Init twice, that would be very bad */ static enum JACK_PORT_CONNECTION_MODE port_connection_mode = CONNECT_ALL; /* enable/disable code that allows us to close a device without actually closing the jack device */ /* this works around the issue where jack doesn't always close devices by the time the close function call returns */ #define JACK_CLOSE_HACK 1 typedef jack_default_audio_sample_t sample_t; typedef jack_nframes_t nframes_t; /* allocate devices for output */ /* if you increase this past 10, you might want to update 'out_client_name = ... ' in JACK_OpenDevice */ #define MAX_OUTDEVICES 10 static jack_driver_t outDev[MAX_OUTDEVICES]; static pthread_mutex_t device_mutex = PTHREAD_MUTEX_INITIALIZER; /* this is to lock the entire outDev array to make managing it in a threaded environment sane */ #if JACK_CLOSE_HACK static void JACK_CloseDevice(jack_driver_t * drv, bool close_client); #else static void JACK_CloseDevice(jack_driver_t * drv); #endif /* Prototypes */ static int JACK_OpenDevice(jack_driver_t * drv); static unsigned long JACK_GetBytesFreeSpaceFromDriver(jack_driver_t * drv); static void JACK_ResetFromDriver(jack_driver_t * drv); static long JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, int type); static void JACK_CleanupDriver(jack_driver_t * drv); /* Return the difference between two timeval structures in terms of milliseconds */ long TimeValDifference(struct timeval *start, struct timeval *end) { double long ms; /* milliseconds value */ ms = end->tv_sec - start->tv_sec; /* compute seconds difference */ ms *= (double) 1000; /* convert to milliseconds */ ms += (double) (end->tv_usec - start->tv_usec) / (double) 1000; /* add on microseconds difference */ return (long) ms; } /* get a device and lock the devices mutex */ /* */ /* also attempt to reconnect to jack since this function is called from */ /* most other bio2jack functions it provides a good point to attempt reconnection */ /* */ /* Ok, I know this looks complicated and it kind of is. The point is that when you're trying to trace mutexes it's more important to know *who* called us than just that we were called. This uses from pre-processor trickery so that the fprintf is actually placed in the function making the getDriver call. Thus, the __FUNCTION__ and __LINE__ macros will actually reference our caller, rather than getDriver. The reason the fprintf call is passes as a parameter is because this macro has to still return a jack_driver_t* and we want to log both before *and* after the getDriver call for easier detection of blocked calls. */ #if TRACE_getReleaseDevice #define getDriver(x) _getDriver(x,fprintf(OUTFILE, "%s::%s(%d) getting driver %d\n", __FILE__, __FUNCTION__, __LINE__,x)); TRACE("got driver %d\n",x); jack_driver_t * _getDriver(int deviceID, int ignored) { fflush(OUTFILE); #else jack_driver_t * getDriver(int deviceID) { #endif jack_driver_t *drv = &outDev[deviceID]; int err = 0; if((err = pthread_mutex_lock(&drv->mutex)) != 0) ERR("lock returned an error: %d\n", err); /* should we try to restart the jack server? */ if(drv->jackd_died && drv->client == 0) { struct timeval now; gettimeofday(&now, 0); /* wait 250ms before trying again */ if(TimeValDifference(&drv->last_reconnect_attempt, &now) >= 250) { JACK_OpenDevice(drv); drv->last_reconnect_attempt = now; } } return drv; } #if TRACE_getReleaseDevice #define tryGetDriver(x) _tryGetDriver(x,fprintf(OUTFILE, "%s::%s(%d) trying to get driver %d\n", __FILE__, __FUNCTION__, __LINE__,x)); TRACE("got driver %d\n",x); jack_driver_t * _tryGetDriver(int deviceID, int ignored) { fflush(OUTFILE); #else jack_driver_t * tryGetDriver(int deviceID) { #endif jack_driver_t *drv = &outDev[deviceID]; int err; if((err = pthread_mutex_trylock(&drv->mutex)) == 0) return drv; if(err == EBUSY) { TRACE("driver %d is busy\n",deviceID); return 0; } ERR("lock returned an error\n"); return 0; } /* release a device's mutex */ /* */ /* This macro is similar to the one for getDriver above, only simpler since we only really need to know when the lock was release for the sake of debugging. */ #if TRACE_getReleaseDevice #define releaseDriver(x) TRACE("releasing driver %d\n",x->deviceID); _releaseDriver(x); void _releaseDriver(jack_driver_t * drv) #else void releaseDriver(jack_driver_t * drv) #endif { /* #if TRACE_getReleaseDevice TRACE("deviceID == %d\n", drv->deviceID); #endif */ int err = 0; if((err = pthread_mutex_unlock(&drv->mutex)) != 0) ERR("lock returned an error: %d\n", err); } /* Return a string corresponding to the input state */ char * DEBUGSTATE(enum status_enum state) { if(state == PLAYING) return "PLAYING"; else if(state == PAUSED) return "PAUSED"; else if(state == STOPPED) return "STOPPED"; else if(state == CLOSED) return "CLOSED"; else if(state == RESET) return "RESET"; else return "unknown state"; } #define SAMPLE_MAX_16BIT 32767.0f #define SAMPLE_MAX_8BIT 255.0f /* floating point volume routine */ /* volume should be a value between 0.0 and 1.0 */ static void float_volume_effect(sample_t * buf, unsigned long nsamples, float volume, int skip) { if(volume < 0) volume = 0; if(volume > 1.0) volume = 1.0; while(nsamples--) { *buf = (*buf) * volume; buf += skip; } } /* place one channel into a multi-channel stream */ static inline void mux(sample_t * dst, sample_t * src, unsigned long nsamples, unsigned long dst_skip) { /* ALERT: signed sign-extension portability !!! */ while(nsamples--) { *dst = *src; dst += dst_skip; src++; } } /* pull one channel out of a multi-channel stream */ static void demux(sample_t * dst, sample_t * src, unsigned long nsamples, unsigned long src_skip) { /* ALERT: signed sign-extension portability !!! */ while(nsamples--) { *dst = *src; dst++; src += src_skip; } } /* convert from 16 bit to floating point */ static inline void sample_move_short_float(sample_t * dst, short *src, unsigned long nsamples) { /* ALERT: signed sign-extension portability !!! */ unsigned long i; for(i = 0; i < nsamples; i++) dst[i] = (sample_t) (src[i]) / SAMPLE_MAX_16BIT; } /* convert from floating point to 16 bit */ static inline void sample_move_float_short(short *dst, sample_t * src, unsigned long nsamples) { /* ALERT: signed sign-extension portability !!! */ unsigned long i; for(i = 0; i < nsamples; i++) dst[i] = (short) ((src[i]) * SAMPLE_MAX_16BIT); } /* convert from 8 bit to floating point */ static inline void sample_move_char_float(sample_t * dst, unsigned char *src, unsigned long nsamples) { /* ALERT: signed sign-extension portability !!! */ unsigned long i; for(i = 0; i < nsamples; i++) dst[i] = (sample_t) (src[i]) / SAMPLE_MAX_8BIT; } /* convert from floating point to 8 bit */ static inline void sample_move_float_char(unsigned char *dst, sample_t * src, unsigned long nsamples) { /* ALERT: signed sign-extension portability !!! */ unsigned long i; for(i = 0; i < nsamples; i++) dst[i] = (char) ((src[i]) * SAMPLE_MAX_8BIT); } /* fill dst buffer with nsamples worth of silence */ static inline void sample_silence_float(sample_t * dst, unsigned long nsamples) { /* ALERT: signed sign-extension portability !!! */ while(nsamples--) { *dst = 0; dst++; } } static inline bool ensure_buffer_size(char **buffer, unsigned long *cur_size, unsigned long needed_size) { DEBUG("current size = %lu, needed size = %lu\n", *cur_size, needed_size); if(*cur_size >= needed_size) return TRUE; DEBUG("reallocing\n"); char *tmp = realloc(*buffer, needed_size); if(tmp) { *cur_size = needed_size; *buffer = tmp; return TRUE; } DEBUG("reallocing failed\n"); return FALSE; } /****************************************************************** * JACK_callback * * every time the jack server wants something from us it calls this * function, so we either deliver it some sound to play or deliver it nothing * to play */ static int JACK_callback(nframes_t nframes, void *arg) { jack_driver_t *drv = (jack_driver_t *) arg; unsigned int i; int src_error = 0; TIMER("start\n"); gettimeofday(&drv->previousTime, 0); /* record the current time */ CALLBACK_TRACE("nframes %ld, sizeof(sample_t) == %d\n", (long) nframes, sizeof(sample_t)); if(!drv->client) ERR("client is closed, this is weird...\n"); sample_t *out_buffer[MAX_OUTPUT_PORTS]; /* retrieve the buffers for the output ports */ for(i = 0; i < drv->num_output_channels; i++) out_buffer[i] = (sample_t *) jack_port_get_buffer(drv->output_port[i], nframes); sample_t *in_buffer[MAX_INPUT_PORTS]; /* retrieve the buffers for the input ports */ for(i = 0; i < drv->num_input_channels; i++) in_buffer[i] = (sample_t *) jack_port_get_buffer(drv->input_port[i], nframes); /* handle playing state */ if(drv->state == PLAYING) { /* handle playback data, if any */ if(drv->num_output_channels > 0) { unsigned long jackFramesAvailable = nframes; /* frames we have left to write to jack */ unsigned long numFramesToWrite; /* num frames we are writing */ size_t inputBytesAvailable = jack_ringbuffer_read_space(drv->pPlayPtr); unsigned long inputFramesAvailable; /* frames we have available */ inputFramesAvailable = inputBytesAvailable / drv->bytes_per_jack_output_frame; size_t jackBytesAvailable = jackFramesAvailable * drv->bytes_per_jack_output_frame; long read = 0; CALLBACK_TRACE("playing... jackFramesAvailable = %ld inputFramesAvailable = %ld\n", jackFramesAvailable, inputFramesAvailable); #if JACK_CLOSE_HACK if(drv->in_use == FALSE) { /* output silence if nothing is being outputted */ for(i = 0; i < drv->num_output_channels; i++) sample_silence_float(out_buffer[i], nframes); return -1; } #endif /* make sure our buffer is large enough for the data we are writing */ /* ie. callback_buffer2_size < (bytes we already wrote + bytes we are going to write in this loop) */ if(!ensure_buffer_size (&drv->callback_buffer2, &drv->callback_buffer2_size, jackBytesAvailable)) { ERR("allocated %lu bytes, need %lu bytes\n", drv->callback_buffer2_size, (unsigned long)jackBytesAvailable); return -1; } /* do sample rate conversion if needed & requested */ if(drv->output_src && drv->output_sample_rate_ratio != 1.0) { long bytes_needed_write = nframes * drv->bytes_per_jack_output_frame; /* make a very good guess at how many raw bytes we'll need to satisfy jack's request after conversion */ long bytes_needed_read = min(inputBytesAvailable, (double) (bytes_needed_write + drv-> output_sample_rate_ratio * drv-> bytes_per_jack_output_frame) / drv->output_sample_rate_ratio); DEBUG("guessing that we need %ld bytes in and %ld out for rate conversion ratio = %f\n", bytes_needed_read, bytes_needed_write, drv->output_sample_rate_ratio); if(!ensure_buffer_size(&drv->callback_buffer1, &drv->callback_buffer1_size, bytes_needed_read)) { ERR("could not realloc callback_buffer2!\n"); return 1; } if(!ensure_buffer_size(&drv->callback_buffer2, &drv->callback_buffer2_size, bytes_needed_write)) { ERR("could not realloc callback_buffer2!\n"); return 1; } if(jackFramesAvailable && inputBytesAvailable > 0) { /* read in the data, but don't move the read pointer until we know how much SRC used */ jack_ringbuffer_peek(drv->pPlayPtr, drv->callback_buffer1, bytes_needed_read); SRC_DATA srcdata; srcdata.data_in = (sample_t *) drv->callback_buffer1; srcdata.input_frames = bytes_needed_read / drv->bytes_per_jack_output_frame; srcdata.src_ratio = drv->output_sample_rate_ratio; srcdata.data_out = (sample_t *) drv->callback_buffer2; srcdata.output_frames = nframes; srcdata.end_of_input = 0; // it's a stream, it never ends DEBUG("input_frames = %ld, output_frames = %ld\n", srcdata.input_frames, srcdata.output_frames); /* convert the sample rate */ src_error = src_process(drv->output_src, &srcdata); DEBUG("used = %ld, generated = %ld, error = %d: %s.\n", srcdata.input_frames_used, srcdata.output_frames_gen, src_error, src_strerror(src_error)); if(src_error == 0) { /* now we can move the read pointer */ jack_ringbuffer_read_advance(drv->pPlayPtr, srcdata. input_frames_used * drv->bytes_per_jack_output_frame); /* add on what we wrote */ read = srcdata.input_frames_used * drv->bytes_per_output_frame; jackFramesAvailable -= srcdata.output_frames_gen; /* take away what was used */ } } } else /* no resampling needed or requested */ { /* read as much data from the buffer as is available */ if(jackFramesAvailable && inputBytesAvailable > 0) { /* write as many bytes as we have space remaining, or as much as we have data to write */ numFramesToWrite = min(jackFramesAvailable, inputFramesAvailable); jack_ringbuffer_read(drv->pPlayPtr, drv->callback_buffer2, jackBytesAvailable); /* add on what we wrote */ read = numFramesToWrite * drv->bytes_per_output_frame; jackFramesAvailable -= numFramesToWrite; /* take away what was written */ } } drv->written_client_bytes += read; drv->played_client_bytes += drv->clientBytesInJack; /* move forward by the previous bytes we wrote since those must have finished by now */ drv->clientBytesInJack = read; /* record the input bytes we wrote to jack */ /* see if we still have jackBytesLeft here, if we do that means that we ran out of wave data to play and had a buffer underrun, fill in the rest of the space with zero bytes so at least there is silence */ if(jackFramesAvailable) { WARN("buffer underrun of %ld frames\n", jackFramesAvailable); for(i = 0; i < drv->num_output_channels; i++) sample_silence_float(out_buffer[i] + (nframes - jackFramesAvailable), jackFramesAvailable); } /* if we aren't converting or we are converting and src_error == 0 then we should */ /* apply volume and demux */ if(!(drv->output_src && drv->output_sample_rate_ratio != 1.0) || (src_error == 0)) { /* apply volume */ for(i = 0; i < drv->num_output_channels; i++) { if(drv->volumeEffectType == dbAttenuation) { /* assume the volume setting is dB of attenuation, a volume of 0 */ /* is 0dB attenuation */ float volume = powf(10.0, -((float) drv->volume[i]) / 20.0); float_volume_effect((sample_t *) drv->callback_buffer2 + i, (nframes - jackFramesAvailable), volume, drv->num_output_channels); } else { float_volume_effect((sample_t *) drv->callback_buffer2 + i, (nframes - jackFramesAvailable), ((float) drv->volume[i] / 100.0), drv->num_output_channels); } } /* demux the stream: we skip over the number of samples we have output channels as the channel data */ /* is encoded like chan1,chan2,chan3,chan1,chan2,chan3... */ for(i = 0; i < drv->num_output_channels; i++) { demux(out_buffer[i], (sample_t *) drv->callback_buffer2 + i, (nframes - jackFramesAvailable), drv->num_output_channels); } } } /* handle record data, if any */ if(drv->num_input_channels > 0) { long jack_bytes = nframes * drv->bytes_per_jack_input_frame; /* how many bytes jack is feeding us */ if(!ensure_buffer_size(&drv->callback_buffer1, &drv->callback_buffer1_size, jack_bytes)) { ERR("allocated %lu bytes, need %lu bytes\n", drv->callback_buffer1_size, jack_bytes); return -1; } /* mux the invividual channels into one stream */ for(i = 0; i < drv->num_input_channels; i++) { mux((sample_t *) drv->callback_buffer1 + i, in_buffer[i], nframes, drv->num_input_channels); } /* do sample rate conversion if needed & requested */ if(drv->input_src && drv->input_sample_rate_ratio != 1.0) { /* make a very good guess at how many raw bytes we'll need to read all the data jack gave us */ long bytes_needed_write = (double) (jack_bytes + drv->input_sample_rate_ratio * drv->bytes_per_jack_input_frame) * drv->input_sample_rate_ratio; DEBUG("guessing that we need %ld bytes in and %ld out for rate conversion ratio = %f\n", nframes * drv->bytes_per_jack_input_frame, bytes_needed_write, drv->input_sample_rate_ratio); if(!ensure_buffer_size(&drv->callback_buffer2, &drv->callback_buffer2_size, bytes_needed_write)) { ERR("could not realloc callback_buffer2!\n"); return 1; } SRC_DATA srcdata; srcdata.data_in = (sample_t *) drv->callback_buffer1; srcdata.input_frames = nframes; srcdata.src_ratio = drv->input_sample_rate_ratio; srcdata.data_out = (sample_t *) drv->callback_buffer2; srcdata.output_frames = drv->callback_buffer2_size / drv->bytes_per_jack_input_frame; srcdata.end_of_input = 0; // it's a stream, it never ends DEBUG("input_frames = %ld, output_frames = %ld\n", srcdata.input_frames, srcdata.output_frames); /* convert the sample rate */ src_error = src_process(drv->input_src, &srcdata); DEBUG("used = %ld, generated = %ld, error = %d: %s.\n", srcdata.input_frames_used, srcdata.output_frames_gen, src_error, src_strerror(src_error)); if(src_error == 0) { long write_space = jack_ringbuffer_write_space(drv->pRecPtr); long bytes_used = srcdata.output_frames_gen * drv->bytes_per_jack_input_frame; /* if there isn't enough room, make some. sure this discards data, but when dealing with input sources it seems like it's better to throw away old data than new */ if(write_space < bytes_used) { /* the ringbuffer is designed such that only one thread should ever access each pointer. since calling read_advance here will be touching the read pointer which is also accessed by JACK_Read, we need to lock the mutex first for safety */ jack_driver_t *d = tryGetDriver(drv->deviceID); if( d ) { /* double check the write space after we've gained the lock, just in case JACK_Read was being called before we gained it */ write_space = jack_ringbuffer_write_space(drv->pRecPtr); if(write_space < bytes_used) { /* hey, we warn about underruns, we might as well warn about overruns as well */ WARN("buffer overrun of %ld bytes\n", jack_bytes - write_space); jack_ringbuffer_read_advance(drv->pRecPtr, bytes_used - write_space); } releaseDriver(drv); } } jack_ringbuffer_write(drv->pRecPtr, drv->callback_buffer2, bytes_used); } } else /* no resampling needed */ { long write_space = jack_ringbuffer_write_space(drv->pRecPtr); /* if there isn't enough room, make some. sure this discards data, but when dealing with input sources it seems like it's better to throw away old data than new */ if(write_space < jack_bytes) { /* the ringbuffer is designed such that only one thread should ever access each pointer. since calling read_advance here will be touching the read pointer which is also accessed by JACK_Read, we need to lock the mutex first for safety */ jack_driver_t *d = tryGetDriver(drv->deviceID); if( d ) { /* double check the write space after we've gained the lock, just in case JACK_Read was being called before we gained it */ write_space = jack_ringbuffer_write_space(drv->pRecPtr); if(write_space < jack_bytes) { ERR("buffer overrun of %ld bytes\n", jack_bytes - write_space); jack_ringbuffer_read_advance(drv->pRecPtr, jack_bytes - write_space); } releaseDriver(drv); } } jack_ringbuffer_write(drv->pRecPtr, drv->callback_buffer1, jack_bytes); } } } else if(drv->state == PAUSED || drv->state == STOPPED || drv->state == CLOSED || drv->state == RESET) { CALLBACK_TRACE("%s, outputting silence\n", DEBUGSTATE(drv->state)); /* output silence if nothing is being outputted */ for(i = 0; i < drv->num_output_channels; i++) sample_silence_float(out_buffer[i], nframes); /* if we were told to reset then zero out some variables */ /* and transition to STOPPED */ if(drv->state == RESET) { drv->written_client_bytes = 0; drv->played_client_bytes = 0; /* number of the clients bytes that jack has played */ drv->client_bytes = 0; /* bytes that the client wrote to use */ drv->clientBytesInJack = 0; /* number of input bytes in jack(not necessary the number of bytes written to jack) */ drv->position_byte_offset = 0; if(drv->pPlayPtr) jack_ringbuffer_reset(drv->pPlayPtr); if(drv->pRecPtr) jack_ringbuffer_reset(drv->pRecPtr); drv->state = STOPPED; /* transition to STOPPED */ } } CALLBACK_TRACE("done\n"); TIMER("finish\n"); return 0; } /****************************************************************** * JACK_bufsize * * Called whenever the jack server changes the the max number * of frames passed to JACK_callback */ static int JACK_bufsize(nframes_t nframes, void *arg) { jack_driver_t *drv = (jack_driver_t *) arg; TRACE("the maximum buffer size is now %lu frames\n", (long) nframes); drv->jack_buffer_size = nframes; return 0; } /****************************************************************** * JACK_srate */ int JACK_srate(nframes_t nframes, void *arg) { jack_driver_t *drv = (jack_driver_t *) arg; drv->jack_sample_rate = (long) nframes; /* make sure to recalculate the ratios needed for proper sample rate conversion */ drv->output_sample_rate_ratio = (double) drv->jack_sample_rate / (double) drv->client_sample_rate; if(drv->output_src) src_set_ratio(drv->output_src, drv->output_sample_rate_ratio); drv->input_sample_rate_ratio = (double) drv->client_sample_rate / (double) drv->jack_sample_rate; if(drv->input_src) src_set_ratio(drv->input_src, drv->input_sample_rate_ratio); TRACE("the sample rate is now %lu/sec\n", (long) nframes); return 0; } /****************************************************************** * JACK_shutdown * * if this is called then jack shut down... handle this appropriately */ void JACK_shutdown(void *arg) { jack_driver_t *drv = (jack_driver_t *) arg; TRACE("\n"); getDriver(drv->deviceID); drv->client = 0; /* reset client */ drv->jackd_died = TRUE; TRACE("jack shutdown, setting client to 0 and jackd_died to true, closing device\n"); #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif TRACE("trying to reconnect right now\n"); /* lets see if we can't reestablish the connection */ /*if(JACK_OpenDevice(drv) != ERR_SUCCESS) { ERR("unable to reconnect with jack\n"); }*/ releaseDriver(drv); } /****************************************************************** * JACK_Error * * Callback for jack errors */ static void JACK_Error(const char *desc) { ERR("%s\n", desc); } /****************************************************************** * JACK_OpenDevice * * RETURNS: ERR_SUCCESS upon success */ static int JACK_OpenDevice(jack_driver_t * drv) { const char **ports; char *our_client_name = 0; unsigned int i; int failed = 0; TRACE("creating jack client and setting up callbacks\n"); #if JACK_CLOSE_HACK /* see if this device is already open */ if(drv->client) { /* if this device is already in use then it is bad for us to be in here */ if(drv->in_use) return ERR_OPENING_JACK; TRACE("using existing client\n"); drv->in_use = TRUE; return ERR_SUCCESS; } #endif /* set up an error handler */ jack_set_error_function(JACK_Error); /* build the client name */ our_client_name = (char *) malloc(snprintf (our_client_name, 0, "%s_%d_%d%02d", client_name, getpid(), drv->deviceID, drv->clientCtr + 1) + 1); sprintf(our_client_name, "%s_%d_%d%02d", client_name, getpid(), drv->deviceID, drv->clientCtr++); /* try to become a client of the JACK server */ TRACE("client name '%s'\n", our_client_name); if((drv->client = jack_client_open(our_client_name, JackNullOption | JackNoStartServer, NULL)) == 0) { /* try once more */ TRACE("trying once more to jack_client_new"); if((drv->client = jack_client_open(our_client_name, JackNullOption | JackNoStartServer, NULL)) == 0) { ERR("jack server not running?\n"); free(our_client_name); return ERR_OPENING_JACK; } } free(our_client_name); TRACE("setting up jack callbacks\n"); /* JACK server to call `JACK_callback()' whenever there is work to be done. */ jack_set_process_callback(drv->client, JACK_callback, drv); /* setup a buffer size callback */ jack_set_buffer_size_callback(drv->client, JACK_bufsize, drv); /* tell the JACK server to call `srate()' whenever the sample rate of the system changes. */ jack_set_sample_rate_callback(drv->client, JACK_srate, drv); /* tell the JACK server to call `jack_shutdown()' if it ever shuts down, either entirely, or if it just decides to stop calling us. */ jack_on_shutdown(drv->client, JACK_shutdown, drv); /* display the current sample rate. once the client is activated (see below), you should rely on your own sample rate callback (see above) for this value. */ drv->jack_sample_rate = jack_get_sample_rate(drv->client); drv->output_sample_rate_ratio = (double) drv->jack_sample_rate / (double) drv->client_sample_rate; drv->input_sample_rate_ratio = (double) drv->client_sample_rate / (double) drv->jack_sample_rate; TRACE("client sample rate: %lu, jack sample rate: %lu, output ratio = %f, input ratio = %f\n", drv->client_sample_rate, drv->jack_sample_rate, drv->output_sample_rate_ratio, drv->input_sample_rate_ratio); drv->jack_buffer_size = jack_get_buffer_size(drv->client); /* create the output ports */ TRACE("creating output ports\n"); for(i = 0; i < drv->num_output_channels; i++) { char portname[32]; sprintf(portname, "out_%d", i); TRACE("port %d is named '%s'\n", i, portname); /* NOTE: Yes, this is supposed to be JackPortIsOutput since this is an output */ /* port FROM bio2jack */ drv->output_port[i] = jack_port_register(drv->client, portname, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); } /* create the input ports */ TRACE("creating input ports\n"); for(i = 0; i < drv->num_input_channels; i++) { char portname[32]; sprintf(portname, "in_%d", i); TRACE("port %d is named '%s'\n", i, portname); /* NOTE: Yes, this is supposed to be JackPortIsInput since this is an input */ /* port TO bio2jack */ drv->input_port[i] = jack_port_register(drv->client, portname, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); } #if JACK_CLOSE_HACK drv->in_use = TRUE; #endif /* tell the JACK server that we are ready to roll */ TRACE("calling jack_activate()\n"); if(jack_activate(drv->client)) { ERR("cannot activate client\n"); return ERR_OPENING_JACK; } /* if we have output channels and the port connection mode isn't CONNECT_NONE */ /* then we should connect up some ports */ if((drv->num_output_channels > 0) && (port_connection_mode != CONNECT_NONE)) { /* determine how we are to acquire output port names */ if((drv->jack_port_name_count == 0) || (drv->jack_port_name_count == 1)) { if(drv->jack_port_name_count == 0) { TRACE("jack_get_ports() passing in NULL/NULL\n"); ports = jack_get_ports(drv->client, NULL, JACK_DEFAULT_AUDIO_TYPE, drv->jack_output_port_flags); } else { TRACE("jack_get_ports() passing in port of '%s'\n", drv->jack_port_name[0]); ports = jack_get_ports(drv->client, drv->jack_port_name[0], NULL, drv->jack_output_port_flags); } /* display a trace of the output ports we found */ unsigned int num_ports = 0; if(ports) { for(i = 0; ports[i]; i++) { TRACE("ports[%d] = '%s'\n", i, ports[i]); num_ports++; } } /* ensure that we found enough ports */ if(!ports || (i < drv->num_output_channels)) { TRACE("ERR: jack_get_ports() failed to find ports with jack port flags of 0x%lX'\n", drv->jack_output_port_flags); #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif return ERR_PORT_NOT_FOUND; } /* connect a port for each output channel. Note: you can't do this before the client is activated (this may change in the future). */ for(i = 0; i < drv->num_output_channels; i++) { TRACE("jack_connect() to port %d('%p')\n", i, drv->output_port[i]); if(jack_connect(drv->client, jack_port_name(drv->output_port[i]), ports[i])) { ERR("cannot connect to output port %d('%s')\n", i, ports[i]); failed = 1; } } /* only if we are in CONNECT_ALL mode should we keep connecting ports up beyond */ /* the minimum number of ports required for each output channel coming into bio2jack */ if(port_connection_mode == CONNECT_ALL) { /* It's much cheaper and easier to let JACK do the processing required to connect 2 channels to 4 or 4 channels to 2 or any other combinations. This effectively eliminates the need for sample_move_d16_d16() */ if(drv->num_output_channels < num_ports) { for(i = drv->num_output_channels; ports[i]; i++) { int n = i % drv->num_output_channels; TRACE("jack_connect() to port %d('%p')\n", i, drv->output_port[n]); if(jack_connect(drv->client, jack_port_name(drv->output_port[n]), ports[i])) { // non fatal ERR("cannot connect to output port %d('%s')\n", n, ports[i]); } } } else if(drv->num_output_channels > num_ports) { for(i = num_ports; i < drv->num_output_channels; i++) { int n = i % num_ports; TRACE("jack_connect() to port %d('%p')\n", i, drv->output_port[n]); if(jack_connect(drv->client, jack_port_name(drv->output_port[i]), ports[n])) { // non fatal ERR("cannot connect to output port %d('%s')\n", i, ports[n]); } } } } free(ports); /* free the returned array of ports */ } else { for(i = 0; i < drv->jack_port_name_count; i++) { TRACE("jack_get_ports() portname %d of '%s\n", i, drv->jack_port_name[i]); ports = jack_get_ports(drv->client, drv->jack_port_name[i], NULL, drv->jack_output_port_flags); if(!ports) { ERR("jack_get_ports() failed to find ports with jack port flags of 0x%lX'\n", drv->jack_output_port_flags); return ERR_PORT_NOT_FOUND; } TRACE("ports[%d] = '%s'\n", 0, ports[0]); /* display a trace of the output port we found */ /* connect the port */ TRACE("jack_connect() to port %d('%p')\n", i, drv->output_port[i]); if(jack_connect(drv->client, jack_port_name(drv->output_port[i]), ports[0])) { ERR("cannot connect to output port %d('%s')\n", 0, ports[0]); failed = 1; } free(ports); /* free the returned array of ports */ } } } /* if( drv->num_output_channels > 0 ) */ if(drv->num_input_channels > 0) { /* determine how we are to acquire input port names */ if((drv->jack_port_name_count == 0) || (drv->jack_port_name_count == 1)) { if(drv->jack_port_name_count == 0) { TRACE("jack_get_ports() passing in NULL/NULL\n"); ports = jack_get_ports(drv->client, NULL, NULL, drv->jack_input_port_flags); } else { TRACE("jack_get_ports() passing in port of '%s'\n", drv->jack_port_name[0]); ports = jack_get_ports(drv->client, drv->jack_port_name[0], NULL, drv->jack_input_port_flags); } /* display a trace of the input ports we found */ unsigned int num_ports = 0; if(ports) { for(i = 0; ports[i]; i++) { TRACE("ports[%d] = '%s'\n", i, ports[i]); num_ports++; } } /* ensure that we found enough ports */ if(!ports || (i < drv->num_input_channels)) { TRACE("ERR: jack_get_ports() failed to find ports with jack port flags of 0x%lX'\n", drv->jack_input_port_flags); #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif return ERR_PORT_NOT_FOUND; } /* connect the ports. Note: you can't do this before the client is activated (this may change in the future). */ for(i = 0; i < drv->num_input_channels; i++) { TRACE("jack_connect() to port %d('%p')\n", i, drv->input_port[i]); if(jack_connect(drv->client, ports[i], jack_port_name(drv->input_port[i]))) { ERR("cannot connect to input port %d('%s')\n", i, ports[i]); failed = 1; } } /* It's much cheaper and easier to let JACK do the processing required to connect 2 channels to 4 or 4 channels to 2 or any other combinations. This effectively eliminates the need for sample_move_d16_d16() */ if(drv->num_input_channels < num_ports) { for(i = drv->num_input_channels; ports[i]; i++) { int n = i % drv->num_input_channels; TRACE("jack_connect() to port %d('%p')\n", i, drv->input_port[n]); if(jack_connect(drv->client, ports[i], jack_port_name(drv->input_port[n]))) { // non fatal ERR("cannot connect to input port %d('%s')\n", n, ports[i]); } } } else if(drv->num_input_channels > num_ports) { for(i = num_ports; i < drv->num_input_channels; i++) { int n = i % num_ports; TRACE("jack_connect() to port %d('%p')\n", i, drv->input_port[n]); if(jack_connect(drv->client, ports[n], jack_port_name(drv->input_port[i]))) { // non fatal ERR("cannot connect to input port %d('%s')\n", i, ports[n]); } } } free(ports); /* free the returned array of ports */ } else { for(i = 0; i < drv->jack_port_name_count; i++) { TRACE("jack_get_ports() portname %d of '%s\n", i, drv->jack_port_name[i]); ports = jack_get_ports(drv->client, drv->jack_port_name[i], NULL, drv->jack_input_port_flags); if(!ports) { ERR("jack_get_ports() failed to find ports with jack port flags of 0x%lX'\n", drv->jack_input_port_flags); return ERR_PORT_NOT_FOUND; } TRACE("ports[%d] = '%s'\n", 0, ports[0]); /* display a trace of the input port we found */ /* connect the port */ TRACE("jack_connect() to port %d('%p')\n", i, drv->input_port[i]); if(jack_connect(drv->client, jack_port_name(drv->input_port[i]), ports[0])) { ERR("cannot connect to input port %d('%s')\n", 0, ports[0]); failed = 1; } free(ports); /* free the returned array of ports */ } } } /* if( drv->num_input_channels > 0 ) */ /* if something failed we need to shut the client down and return 0 */ if(failed) { TRACE("failed, closing and returning error\n"); #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif return ERR_OPENING_JACK; } TRACE("success\n"); drv->jackd_died = FALSE; /* clear out this flag so we don't keep attempting to restart things */ drv->state = PLAYING; /* clients seem to behave much better with this on from the start, especially when recording */ return ERR_SUCCESS; /* return success */ } /****************************************************************** * JACK_CloseDevice * * Close the connection to the server cleanly. * If close_client is TRUE we close the client for this device instead of * just marking the device as in_use(JACK_CLOSE_HACK only) */ #if JACK_CLOSE_HACK static void JACK_CloseDevice(jack_driver_t * drv, bool close_client) #else static void JACK_CloseDevice(jack_driver_t * drv) #endif { unsigned int i; #if JACK_CLOSE_HACK if(close_client) { #endif TRACE("closing the jack client thread\n"); if(drv->client) { TRACE("after jack_deactivate()\n"); int errorCode = jack_client_close(drv->client); if(errorCode) ERR("jack_client_close() failed returning an error code of %d\n", errorCode); } /* reset client */ drv->client = 0; /* free up the port strings */ TRACE("freeing up %d port strings\n", drv->jack_port_name_count); if(drv->jack_port_name_count > 1) { for(i = 0; i < drv->jack_port_name_count; i++) free(drv->jack_port_name[i]); free(drv->jack_port_name); } JACK_CleanupDriver(drv); JACK_ResetFromDriver(drv); #if JACK_CLOSE_HACK } else { TRACE("setting in_use to FALSE\n"); drv->in_use = FALSE; if(!drv->client) { TRACE("critical error, closing a device that has no client\n"); } } #endif } /**************************************/ /* External interface functions below */ /**************************************/ /* Clear out any buffered data, stop playing, zero out some variables */ static void JACK_ResetFromDriver(jack_driver_t * drv) { TRACE("resetting drv->deviceID(%d)\n", drv->deviceID); /* NOTE: we use the RESET state so we don't need to worry about clearing out */ /* variables that the callback modifies while the callback is running */ /* we set the state to RESET and the callback clears the variables out for us */ drv->state = RESET; /* tell the callback that we are to reset, the callback will transition this to STOPPED */ } /* Clear out any buffered data, stop playing, zero out some variables */ void JACK_Reset(int deviceID) { jack_driver_t *drv = getDriver(deviceID); TRACE("resetting deviceID(%d)\n", deviceID); JACK_ResetFromDriver(drv); releaseDriver(drv); } /* * open the audio device for writing to * * deviceID is set to the opened device * if client is non-zero and in_use is FALSE then just set in_use to TRUE * * return value is zero upon success, non-zero upon failure * * if ERR_RATE_MISMATCH (*rate) will be updated with the jack servers rate */ int JACK_Open(int *deviceID, unsigned int bits_per_channel, unsigned long *rate, int channels) { /* we call through to JACK_OpenEx(), but default the input channels to 0 for better backwards compatibility with clients written before recording was available */ return JACK_OpenEx(deviceID, bits_per_channel, rate, 0, channels, NULL, 0, JackPortIsPhysical); } /* * see JACK_Open() for comments * NOTE: jack_port_name has three ways of being used: * - NULL - finds all ports with the given flags * - A single regex string used to retrieve all port names * - A series of port names, one for each output channel * * we set *deviceID */ int JACK_OpenEx(int *deviceID, unsigned int bits_per_channel, unsigned long *rate, unsigned int input_channels, unsigned int output_channels, const char **jack_port_name, unsigned int jack_port_name_count, unsigned long jack_port_flags) { jack_driver_t *drv = 0; unsigned int i; int retval; if(input_channels < 1 && output_channels < 1) { ERR("no input OR output channels, nothing to do\n"); return ERR_OPENING_JACK; } switch (bits_per_channel) { case 8: case 16: break; default: ERR("invalid bits_per_channel\n"); return ERR_OPENING_JACK; } /* Lock the device_mutex and find one that's not allocated already. We'll keep this lock until we've either made use of it, or given up. */ pthread_mutex_lock(&device_mutex); for(i = 0; i < MAX_OUTDEVICES; i++) { if(!outDev[i].allocated) { drv = &outDev[i]; break; } } if(!drv) { ERR("no more devices available\n"); return ERR_OPENING_JACK; } /* We found an unallocated device, now lock it for extra saftey */ getDriver(drv->deviceID); TRACE("bits_per_channel=%d rate=%ld, input_channels=%d, output_channels=%d\n", bits_per_channel, *rate, input_channels, output_channels); if(output_channels > MAX_OUTPUT_PORTS) { ERR("output_channels == %d, MAX_OUTPUT_PORTS == %d\n", output_channels, MAX_OUTPUT_PORTS); releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return ERR_TOO_MANY_OUTPUT_CHANNELS; } if(input_channels > MAX_INPUT_PORTS) { ERR("input_channels == %d, MAX_INPUT_PORTS == %d\n", input_channels, MAX_INPUT_PORTS); releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return ERR_TOO_MANY_INPUT_CHANNELS; } drv->jack_output_port_flags = jack_port_flags | JackPortIsInput; /* port must be input(ie we can put data into it), so mask this in */ drv->jack_input_port_flags = jack_port_flags | JackPortIsOutput; /* port must be output(ie we can get data from it), so mask this in */ /* check that we have the correct number of port names FIXME?: not sure how we should handle output ports vs input ports.... */ if((jack_port_name_count > 1) && ((jack_port_name_count < output_channels) || (jack_port_name_count < input_channels))) { ERR("specified individual port names but not enough, gave %d names, need %d\n", jack_port_name_count, output_channels); releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return ERR_PORT_NAME_OUTPUT_CHANNEL_MISMATCH; } else { /* copy this data into the device information */ drv->jack_port_name_count = jack_port_name_count; if(drv->jack_port_name_count != 0) { drv->jack_port_name = (char **) malloc(sizeof(char *) * drv->jack_port_name_count); for(i = 0; i < drv->jack_port_name_count; i++) { drv->jack_port_name[i] = strdup(jack_port_name[i]); TRACE("jack_port_name[%d] == '%s'\n", i, jack_port_name[i]); } } else { drv->jack_port_name = NULL; TRACE("jack_port_name = NULL\n"); } } /* initialize some variables */ drv->in_use = FALSE; JACK_ResetFromDriver(drv); /* flushes all queued buffers, sets status to STOPPED and resets some variables */ /* drv->jack_sample_rate is set by JACK_OpenDevice() */ drv->client_sample_rate = *rate; drv->bits_per_channel = bits_per_channel; drv->num_input_channels = input_channels; drv->num_output_channels = output_channels; drv->bytes_per_input_frame = (drv->bits_per_channel * drv->num_input_channels) / 8; drv->bytes_per_output_frame = (drv->bits_per_channel * drv->num_output_channels) / 8; drv->bytes_per_jack_output_frame = sizeof(sample_t) * drv->num_output_channels; drv->bytes_per_jack_input_frame = sizeof(sample_t) * drv->num_input_channels; if(drv->num_output_channels > 0) { drv->pPlayPtr = jack_ringbuffer_create(drv->num_output_channels * drv->bytes_per_jack_output_frame * DEFAULT_RB_SIZE); } if(drv->num_input_channels > 0) { drv->pRecPtr = jack_ringbuffer_create(drv->num_input_channels * drv->bytes_per_jack_input_frame * DEFAULT_RB_SIZE); } DEBUG("bytes_per_output_frame == %ld\n", drv->bytes_per_output_frame); DEBUG("bytes_per_input_frame == %ld\n", drv->bytes_per_input_frame); DEBUG("bytes_per_jack_output_frame == %ld\n", drv->bytes_per_jack_output_frame); DEBUG("bytes_per_jack_input_frame == %ld\n", drv->bytes_per_jack_input_frame); /* go and open up the device */ retval = JACK_OpenDevice(drv); if(retval != ERR_SUCCESS) { TRACE("error opening jack device\n"); releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return retval; } else { TRACE("succeeded opening jack device\n"); } /* setup SRC objects just in case they'll be needed but only if requested */ if(do_sample_rate_conversion) { int error; if(drv->num_output_channels > 0) { drv->output_src = src_new(preferred_src_converter, drv->num_output_channels, &error); if(error != 0) { src_delete(drv->output_src); drv->output_src = 0; ERR("Could not created SRC object for output stream %d: %s\n", error, src_strerror(error)); } } if(drv->num_input_channels > 0) { drv->input_src = src_new(preferred_src_converter, drv->num_input_channels, &error); if(error != 0) { src_delete(drv->input_src); drv->input_src = 0; ERR("Could not created SRC object for input stream %d: %s\n", error, src_strerror(error)); } } } else if((long) (*rate) != drv->jack_sample_rate) { TRACE("rate of %ld doesn't match jack sample rate of %ld, returning error\n", *rate, drv->jack_sample_rate); *rate = drv->jack_sample_rate; #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return ERR_RATE_MISMATCH; } drv->allocated = TRUE; /* record that we opened this device */ DEBUG("sizeof(sample_t) == %d\n", sizeof(sample_t)); int periodSize = jack_get_buffer_size(drv->client); int periods = 0; /* FIXME: maybe we should keep different latency values for input vs output? */ if(drv->num_output_channels > 0) { #ifdef JACK_NEW_API jack_latency_range_t range; jack_port_get_latency_range(drv->output_port[0], JackPlaybackLatency, &range); periods = range.max / periodSize; #else periods = jack_port_get_total_latency(drv->client, drv->output_port[0]) / periodSize; #endif drv->latencyMS = periodSize * periods * 1000 / (drv->jack_sample_rate * (drv->bits_per_channel / 8 * drv->num_output_channels)); } else if(drv->num_input_channels > 0) { #ifdef JACK_NEW_API jack_latency_range_t range; jack_port_get_latency_range(drv->output_port[0], JackPlaybackLatency, &range); periods = range.max / periodSize; #else periods = jack_port_get_total_latency(drv->client, drv->output_port[0]) / periodSize; #endif drv->latencyMS = periodSize * periods * 1000 / (drv->jack_sample_rate * (drv->bits_per_channel / 8 * drv->num_input_channels)); } TRACE("drv->latencyMS == %ldms\n", drv->latencyMS); *deviceID = drv->deviceID; /* set the deviceID for the caller */ releaseDriver(drv); pthread_mutex_unlock(&device_mutex); return ERR_SUCCESS; /* success */ } /* Close the jack device */ //FIXME: add error handling in here at some point... /* NOTE: return 0 for success, non-zero for failure */ int JACK_Close(int deviceID) { jack_driver_t *drv = getDriver(deviceID); TRACE("deviceID(%d)\n", deviceID); #if JACK_CLOSE_HACK JACK_CloseDevice(drv, TRUE); #else JACK_CloseDevice(drv); #endif JACK_ResetFromDriver(drv); /* reset this device to a normal starting state */ pthread_mutex_lock(&device_mutex); /* free buffer memory */ drv->callback_buffer1_size = 0; if(drv->callback_buffer1) free(drv->callback_buffer1); drv->callback_buffer1 = 0; drv->callback_buffer2_size = 0; if(drv->callback_buffer2) free(drv->callback_buffer2); drv->callback_buffer2 = 0; drv->rw_buffer1_size = 0; if(drv->rw_buffer1) free(drv->rw_buffer1); drv->rw_buffer1 = 0; if(drv->pPlayPtr) jack_ringbuffer_free(drv->pPlayPtr); drv->pPlayPtr = 0; if(drv->pRecPtr) jack_ringbuffer_free(drv->pRecPtr); drv->pRecPtr = 0; /* free the SRC objects */ if(drv->output_src) src_delete(drv->output_src); drv->output_src = 0; if(drv->input_src) src_delete(drv->input_src); drv->input_src = 0; drv->allocated = FALSE; /* release this device */ pthread_mutex_unlock(&device_mutex); releaseDriver(drv); return 0; } /* If we haven't already taken in the max allowed data then create a wave header */ /* to package the audio data and attach the wave header to the end of the */ /* linked list of wave headers */ /* These wave headers will be peeled off as they are played by the callback routine */ /* Return value is the number of bytes written */ /* NOTE: this function takes the length of data to be written bytes */ long JACK_Write(int deviceID, unsigned char *data, unsigned long bytes) { jack_driver_t *drv = getDriver(deviceID); long frames_free, frames; TIMER("start\n"); TRACE("deviceID(%d), bytes == %ld\n", deviceID, bytes); /* check and see that we have enough space for this audio */ frames_free = jack_ringbuffer_write_space(drv->pPlayPtr) / drv->bytes_per_jack_output_frame; frames = bytes / drv->bytes_per_output_frame; TRACE("frames free == %ld, bytes = %lu\n", frames_free, bytes); TRACE("state = '%s'\n", DEBUGSTATE(drv->state)); /* if we are currently STOPPED we should start playing now... do this before the check for bytes == 0 since some clients like to write 0 bytes the first time out */ if(drv->state == STOPPED) { TRACE("currently STOPPED, transitioning to PLAYING\n"); drv->state = PLAYING; } /* handle the case where the user calls this routine with 0 bytes */ if(bytes == 0 || frames_free < 1) { TRACE("no room left\n"); TIMER("finish (nothing to do, buffer is full)\n"); releaseDriver(drv); return 0; /* indicate that we couldn't write any bytes */ } frames = min(frames, frames_free); long jack_bytes = frames * drv->bytes_per_jack_output_frame; if(!ensure_buffer_size(&drv->rw_buffer1, &drv->rw_buffer1_size, jack_bytes)) { ERR("couldn't allocate enough space for the buffer\n"); releaseDriver(drv); return 0; } /* adjust bytes to be how many client bytes we're actually writing */ bytes = frames * drv->bytes_per_output_frame; /* convert from client samples to jack samples we have to tell it how many samples there are, which is frames * channels */ switch (drv->bits_per_channel) { case 8: sample_move_char_float((sample_t *) drv->rw_buffer1, (unsigned char *) data, frames * drv->num_output_channels); break; case 16: sample_move_short_float((sample_t *) drv->rw_buffer1, (short *) data, frames * drv->num_output_channels); break; } DEBUG("ringbuffer read space = %d, write space = %d\n", jack_ringbuffer_read_space(drv->pPlayPtr), jack_ringbuffer_write_space(drv->pPlayPtr)); jack_ringbuffer_write(drv->pPlayPtr, drv->rw_buffer1, jack_bytes); DEBUG("wrote %lu bytes, %lu jack_bytes\n", bytes, jack_bytes); DEBUG("ringbuffer read space = %d, write space = %d\n", jack_ringbuffer_read_space(drv->pPlayPtr), jack_ringbuffer_write_space(drv->pPlayPtr)); drv->client_bytes += bytes; /* update client_bytes */ TIMER("finish\n"); DEBUG("returning bytes written of %ld\n", bytes); releaseDriver(drv); return bytes; /* return the number of bytes we wrote out */ } long JACK_Read(int deviceID, unsigned char *data, unsigned long bytes) { jack_driver_t *drv = getDriver(deviceID); long frames_available, frames; TIMER("start\n"); TRACE("deviceID(%d), bytes == %ld\n", deviceID, bytes); /* find out if there's any room to write this data */ frames_available = jack_ringbuffer_read_space(drv->pRecPtr) / drv->bytes_per_jack_input_frame; frames = bytes / drv->bytes_per_input_frame; DEBUG("frames available = %ld, bytes = %lu\n", frames_available, bytes); TRACE("state = '%s'\n", DEBUGSTATE(drv->state)); /* if we are currently STOPPED we should start recording now... */ if(drv->state == STOPPED) { TRACE("currently STOPPED, transitioning to PLAYING\n"); drv->state = PLAYING; } /* handle the case where the user calls this routine with 0 bytes */ if(bytes == 0 || frames_available < 1) { TRACE("no bytes in buffer\n"); TIMER("finish (nothing to do)\n"); releaseDriver(drv); return 0; } frames = min(frames, frames_available); long jack_bytes = frames * drv->bytes_per_jack_input_frame; if(!ensure_buffer_size(&drv->rw_buffer1, &drv->rw_buffer1_size, jack_bytes)) { ERR("couldn't allocate enough space for the buffer\n"); releaseDriver(drv); return 0; } DEBUG("ringbuffer read space = %d, write space = %d\n", jack_ringbuffer_read_space(drv->pRecPtr), jack_ringbuffer_write_space(drv->pRecPtr)); jack_ringbuffer_read(drv->pRecPtr, drv->rw_buffer1, frames * drv->bytes_per_jack_input_frame); DEBUG("ringbuffer read space = %d, write space = %d\n", jack_ringbuffer_read_space(drv->pRecPtr), jack_ringbuffer_write_space(drv->pRecPtr)); unsigned int i; for(i = 0; i < drv->num_output_channels; i++) { /* apply volume to the floating value */ if(drv->volumeEffectType == dbAttenuation) { /* assume the volume setting is dB of attenuation, a volume of 0 */ /* is 0dB attenuation */ float volume = powf(10.0, -((float) drv->volume[i]) / 20.0); float_volume_effect((sample_t *) drv->rw_buffer1 + i, frames, volume, drv->num_output_channels); } else { float_volume_effect((sample_t *) drv->rw_buffer1 + i, frames, ((float) drv->volume[i] / 100.0), drv->num_output_channels); } } /* convert from jack samples to client samples we have to tell it how many samples there are, which is frames * channels */ switch (drv->bits_per_channel) { case 8: sample_move_float_char((unsigned char *) data, (sample_t *) drv->rw_buffer1, frames * drv->num_input_channels); break; case 16: sample_move_float_short((short *) data, (sample_t *) drv->rw_buffer1, frames * drv->num_input_channels); break; } TIMER("finish\n"); long read_bytes = frames * drv->bytes_per_input_frame; DEBUG("returning bytes read of %ld\n", bytes); releaseDriver(drv); return read_bytes; } /* return ERR_SUCCESS for success */ static int JACK_SetVolumeForChannelFromDriver(jack_driver_t * drv, unsigned int channel, unsigned int volume) { /* TODO?: maybe we should have different volume levels for input & output */ /* ensure that we have the channel we are setting volume for */ if(channel > (drv->num_output_channels - 1)) return 1; if(volume > 100) volume = 100; /* check for values in excess of max */ drv->volume[channel] = volume; return ERR_SUCCESS; } /* return ERR_SUCCESS for success */ int JACK_SetVolumeForChannel(int deviceID, unsigned int channel, unsigned int volume) { jack_driver_t *drv = getDriver(deviceID); int retval = JACK_SetVolumeForChannelFromDriver(drv, channel, volume); releaseDriver(drv); return retval; } /* Set the volume */ /* return 0 for success */ /* NOTE: we check for invalid volume values */ int JACK_SetAllVolume(int deviceID, unsigned int volume) { jack_driver_t *drv = getDriver(deviceID); unsigned int i; TRACE("deviceID(%d), setting volume of %d\n", deviceID, volume); for(i = 0; i < drv->num_output_channels; i++) { if(JACK_SetVolumeForChannelFromDriver(drv, i, volume) != ERR_SUCCESS) { releaseDriver(drv); return 1; } } releaseDriver(drv); return ERR_SUCCESS; } /* Return the current volume in the inputted pointers */ /* NOTE: we check for null pointers being passed in just in case */ void JACK_GetVolumeForChannel(int deviceID, unsigned int channel, unsigned int *volume) { jack_driver_t *drv = getDriver(deviceID); /* ensure that we have the channel we are getting volume for */ if(channel > (drv->num_output_channels - 1)) { ERR("asking for channel index %d but we only have %ld channels\n", channel, drv->num_output_channels); releaseDriver(drv); return; } if(volume) *volume = drv->volume[channel]; #if VERBOSE_OUTPUT if(volume) { TRACE("deviceID(%d), returning volume of %d for channel %d\n", deviceID, *volume, channel); } else { TRACE("volume is null, can't dereference it\n"); } #endif releaseDriver(drv); } /* linear means 0 volume is silence, 100 is full volume */ /* dbAttenuation means 0 volume is 0dB attenuation */ /* Bio2jack defaults to linear */ enum JACK_VOLUME_TYPE JACK_SetVolumeEffectType(int deviceID, enum JACK_VOLUME_TYPE type) { enum JACK_VOLUME_TYPE retval; jack_driver_t *drv = getDriver(deviceID); TRACE("setting type of '%s'\n", (type == dbAttenuation ? "dbAttenuation" : "linear")); retval = drv->volumeEffectType; drv->volumeEffectType = type; releaseDriver(drv); return retval; } /* Controls the state of the playback(playing, paused, ...) */ int JACK_SetState(int deviceID, enum status_enum state) { jack_driver_t *drv = getDriver(deviceID); switch (state) { case PAUSED: drv->state = PAUSED; break; case PLAYING: drv->state = PLAYING; break; case STOPPED: drv->state = STOPPED; break; default: TRACE("unknown state of %d\n", state); } TRACE("%s\n", DEBUGSTATE(drv->state)); releaseDriver(drv); return 0; } /* Retrieve the current state of the device */ enum status_enum JACK_GetState(int deviceID) { jack_driver_t *drv = getDriver(deviceID); enum status_enum return_val; return_val = drv->state; releaseDriver(drv); TRACE("deviceID(%d), returning current state of %s\n", deviceID, DEBUGSTATE(return_val)); return return_val; } /* Retrieve the number of bytes per second we are outputting */ unsigned long JACK_GetOutputBytesPerSecondFromDriver(jack_driver_t * drv) { unsigned long return_val; return_val = drv->bytes_per_output_frame * drv->client_sample_rate; #if VERBOSE_OUTPUT TRACE("deviceID(%d), return_val = %ld\n", drv->deviceID, return_val); #endif return return_val; } /* Retrieve the number of bytes per second we are outputting */ unsigned long JACK_GetOutputBytesPerSecond(int deviceID) { jack_driver_t *drv = getDriver(deviceID); unsigned long return_val; return_val = JACK_GetOutputBytesPerSecondFromDriver(drv); releaseDriver(drv); return return_val; } /* Retrieve the number of input bytes(from jack) per second we are outputting to the user of bio2jack */ static long JACK_GetInputBytesPerSecondFromDriver(jack_driver_t * drv) { long return_val; return_val = drv->bytes_per_input_frame * drv->client_sample_rate; #if VERBOSE_OUTPUT TRACE("drv->deviceID(%d), return_val = %ld\n", drv->deviceID, return_val); #endif return return_val; } /* Retrieve the number of input bytes(from jack) per second we are outputting to the user of bio2jack */ unsigned long JACK_GetInputBytesPerSecond(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val = JACK_GetInputBytesPerSecondFromDriver(drv); releaseDriver(drv); #if VERBOSE_OUTPUT TRACE("deviceID(%d), return_val = %ld\n", deviceID, return_val); #endif return return_val; } /* Return the number of bytes we have buffered thus far for output */ /* NOTE: convert from output bytes to input bytes in here */ static long JACK_GetBytesStoredFromDriver(jack_driver_t * drv) { if(drv->pPlayPtr == 0 || drv->bytes_per_jack_output_frame == 0) return 0; /* leave at least one frame in the buffer at all times to prevent underruns */ long return_val = jack_ringbuffer_read_space(drv->pPlayPtr) - drv->jack_buffer_size; if(return_val <= 0) { return_val = 0; } else { /* adjust from jack bytes to client bytes */ return_val = return_val / drv->bytes_per_jack_output_frame * drv->bytes_per_output_frame; } return return_val; } /* An approximation of how many bytes we have to send out to jack */ /* that is computed as if we were sending jack a continuous stream of */ /* bytes rather than chunks during discrete callbacks. */ /* Return the number of bytes we have buffered thus far for output */ /* NOTE: convert from output bytes to input bytes in here */ unsigned long JACK_GetBytesStored(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long retval = JACK_GetBytesStoredFromDriver(drv); releaseDriver(drv); TRACE("deviceID(%d), retval = %ld\n", deviceID, retval); return retval; } static unsigned long JACK_GetBytesFreeSpaceFromDriver(jack_driver_t * drv) { if(drv->pPlayPtr == 0 || drv->bytes_per_jack_output_frame == 0) return 0; /* leave at least one frame in the buffer at all times to prevent underruns */ long return_val = jack_ringbuffer_write_space(drv->pPlayPtr) - drv->jack_buffer_size; if(return_val <= 0) { return_val = 0; } else { /* adjust from jack bytes to client bytes */ return_val = return_val / drv->bytes_per_jack_output_frame * drv->bytes_per_output_frame; } return return_val; } /* Return the number of bytes we can write to the device */ unsigned long JACK_GetBytesFreeSpace(int deviceID) { jack_driver_t *drv = getDriver(deviceID); unsigned long return_val; return_val = JACK_GetBytesFreeSpaceFromDriver(drv); releaseDriver(drv); TRACE("deviceID(%d), retval == %ld\n", deviceID, return_val); return return_val; } /* bytes of space used in the input buffer */ unsigned long JACK_GetBytesUsedSpace(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val; if(drv->pRecPtr == 0 || drv->bytes_per_jack_input_frame == 0) { return_val = 0; } else { /* adjust from jack bytes to client bytes */ return_val = jack_ringbuffer_read_space(drv->pRecPtr) / drv->bytes_per_jack_input_frame * drv->bytes_per_input_frame; } releaseDriver(drv); if(return_val < 0) return_val = 0; TRACE("deviceID(%d), retval == %ld\n", deviceID, return_val); return return_val; } /* Get the current position of the driver, either in bytes or */ /* in milliseconds */ /* NOTE: this is position relative to input bytes, output bytes may differ greatly due to input vs. output channel count */ static long JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, int type) { long return_val = 0; struct timeval now; long elapsedMS; double sec2msFactor = 1000; #if TRACE_ENABLE char *type_str = "UNKNOWN type"; #endif /* if we are reset we should return a position of 0 */ if(drv->state == RESET) { TRACE("we are currently RESET, returning 0\n"); return 0; } if(type == WRITTEN) { #if TRACE_ENABLE type_str = "WRITTEN"; #endif return_val = drv->client_bytes; } else if(type == WRITTEN_TO_JACK) { #if TRACE_ENABLE type_str = "WRITTEN_TO_JACK"; #endif return_val = drv->written_client_bytes; } else if(type == PLAYED) /* account for the elapsed time for the played_bytes */ { #if TRACE_ENABLE type_str = "PLAYED"; #endif return_val = drv->played_client_bytes; gettimeofday(&now, 0); elapsedMS = TimeValDifference(&drv->previousTime, &now); /* find the elapsed milliseconds since last JACK_Callback() */ TRACE("elapsedMS since last callback is '%ld'\n", elapsedMS); /* account for the bytes played since the last JACK_Callback() */ /* NOTE: [Xms * (Bytes/Sec)] * (1 sec/1,000ms) */ /* NOTE: don't do any compensation if no data has been sent to jack since the last callback */ /* as this would result a bogus computed result */ if(drv->clientBytesInJack != 0) { return_val += (long) ((double) elapsedMS * ((double) JACK_GetOutputBytesPerSecondFromDriver(drv) / sec2msFactor)); } else { TRACE("clientBytesInJack == 0\n"); } } /* add on the offset */ return_val += drv->position_byte_offset; /* convert byte position to milliseconds value if necessary */ if(position == MILLISECONDS) { if(JACK_GetOutputBytesPerSecondFromDriver(drv) != 0) { return_val = (long) (((double) return_val / (double) JACK_GetOutputBytesPerSecondFromDriver(drv)) * (double) sec2msFactor); } else { return_val = 0; } } #if TRACE_ENABLE TRACE("drv->deviceID(%d), type(%s), return_val = %ld\n", drv->deviceID, type_str, return_val); #endif return return_val; } /* Get the current position of the driver, either in bytes or */ /* in milliseconds */ /* NOTE: this is position relative to input bytes, output bytes may differ greatly due to input vs. output channel count */ long JACK_GetPosition(int deviceID, enum pos_enum position, int type) { jack_driver_t *drv = getDriver(deviceID); long retval = JACK_GetPositionFromDriver(drv, position, type); releaseDriver(drv); TRACE("retval == %ld\n", retval); return retval; } // Set position always applies to written bytes // NOTE: we must apply this instantly because if we pass this as a message // to the callback we risk the user sending us audio data in the mean time // and there is no need to send this as a message, we don't modify any // internal variables void JACK_SetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, long value) { double sec2msFactor = 1000; #if TRACE_ENABLE long input_value = value; #endif /* convert the incoming value from milliseconds into bytes */ if(position == MILLISECONDS) { value = (long) (((double) value * (double) JACK_GetOutputBytesPerSecondFromDriver(drv)) / sec2msFactor); } /* ensure that if the user asks for the position */ /* they will at this instant get the correct position */ drv->position_byte_offset = value - drv->client_bytes; TRACE("deviceID(%d) input_value of %ld %s, new value of %ld, setting position_byte_offset to %ld\n", drv->deviceID, input_value, (position == MILLISECONDS) ? "ms" : "bytes", value, drv->position_byte_offset); } // Set position always applies to written bytes // NOTE: we must apply this instantly because if we pass this as a message // to the callback we risk the user sending us audio data in the mean time // and there is no need to send this as a message, we don't modify any // internal variables void JACK_SetPosition(int deviceID, enum pos_enum position, long value) { jack_driver_t *drv = getDriver(deviceID); JACK_SetPositionFromDriver(drv, position, value); releaseDriver(drv); TRACE("deviceID(%d) value of %ld\n", drv->deviceID, value); } /* Return the number of bytes per frame, or (output_channels * bits_per_channel) / 8 */ unsigned long JACK_GetBytesPerOutputFrame(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val = drv->bytes_per_output_frame; releaseDriver(drv); TRACE("deviceID(%d), return_val = %ld\n", deviceID, return_val); return return_val; } /* Return the number of bytes per frame, or (input_channels * bits_per_channel) / 8 */ unsigned long JACK_GetBytesPerInputFrame(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val = drv->bytes_per_input_frame; releaseDriver(drv); TRACE("deviceID(%d), return_val = %ld\n", deviceID, return_val); return return_val; } /* Return the number of output bytes we buffer max */ long JACK_GetMaxOutputBufferedBytes(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val; if(drv->pPlayPtr == 0 || drv->bytes_per_jack_output_frame == 0) return_val = 0; /* adjust from jack bytes to client bytes */ return_val = (jack_ringbuffer_read_space(drv->pPlayPtr) + jack_ringbuffer_write_space(drv->pPlayPtr)) / drv->bytes_per_jack_output_frame * drv->bytes_per_output_frame; releaseDriver(drv); TRACE("return_val = %ld\n", return_val); return return_val; } /* Return the number of input bytes we buffer max */ long JACK_GetMaxInputBufferedBytes(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val; if(drv->pRecPtr == 0 || drv->bytes_per_jack_input_frame == 0) return_val = 0; /* adjust from jack bytes to client bytes */ return_val = (jack_ringbuffer_read_space(drv->pRecPtr) + jack_ringbuffer_write_space(drv->pRecPtr)) / drv->bytes_per_jack_input_frame * drv->bytes_per_input_frame; releaseDriver(drv); TRACE("return_val = %ld\n", return_val); return return_val; } /* Get the number of output channels */ int JACK_GetNumOutputChannels(int deviceID) { jack_driver_t *drv = getDriver(deviceID); int return_val = drv->num_output_channels; releaseDriver(drv); TRACE("getting num_output_channels of %d\n", return_val); return return_val; } /* Get the number of input channels */ int JACK_GetNumInputChannels(int deviceID) { jack_driver_t *drv = getDriver(deviceID); int return_val = drv->num_input_channels; releaseDriver(drv); TRACE("getting num_input_channels of %d\n", return_val); return return_val; } /* Get the number of samples per second, the sample rate */ long JACK_GetSampleRate(int deviceID) { jack_driver_t *drv = getDriver(deviceID); int return_val = drv->client_sample_rate; releaseDriver(drv); TRACE("getting sample_rate of %d\n", return_val); return return_val; } void JACK_CleanupDriver(jack_driver_t * drv) { TRACE("\n"); /* things that need to be reset both in JACK_Init & JACK_CloseDevice */ drv->client = 0; drv->in_use = FALSE; drv->state = CLOSED; drv->jack_sample_rate = 0; drv->output_sample_rate_ratio = 1.0; drv->input_sample_rate_ratio = 1.0; drv->jackd_died = FALSE; gettimeofday(&drv->previousTime, 0); /* record the current time */ gettimeofday(&drv->last_reconnect_attempt, 0); } /* Initialize the jack porting library to a clean state */ void JACK_Init(void) { jack_driver_t *drv; int x, y; if(init_done) { TRACE("not initing twice\n"); return; } init_done = 1; TRACE("\n"); pthread_mutex_lock(&device_mutex); /* initialize the device structures */ for(x = 0; x < MAX_OUTDEVICES; x++) { drv = &outDev[x]; pthread_mutex_init(&drv->mutex, NULL); getDriver(x); memset(drv, 0, sizeof(jack_driver_t)); drv->volumeEffectType = linear; drv->deviceID = x; for(y = 0; y < MAX_OUTPUT_PORTS; y++) /* make all volume 25% as a default */ drv->volume[y] = 25; JACK_CleanupDriver(drv); JACK_ResetFromDriver(drv); } client_name = 0; /* initialize the name to null */ do_sample_rate_conversion = TRUE; /* default to on */ JACK_SetClientName("bio2jack"); pthread_mutex_unlock(&device_mutex); TRACE("finished\n"); } /* Get the latency, in frames, of jack */ long JACK_GetJackOutputLatency(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val = 0; if(drv->client && drv->num_input_channels) { #ifdef JACK_NEW_API jack_latency_range_t range; jack_port_get_latency_range(drv->output_port[0], JackCaptureLatency, &range); return_val = range.max; #else return_val = jack_port_get_total_latency(drv->client, drv->output_port[0]); #endif } TRACE("got latency of %ld frames\n", return_val); releaseDriver(drv); return return_val; } /* Get the latency, in frames, of jack */ long JACK_GetJackInputLatency(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val = 0; if(drv->client && drv->num_input_channels) { #ifdef JACK_NEW_API jack_latency_range_t range; jack_port_get_latency_range(drv->output_port[0], JackPlaybackLatency, &range); return_val = range.max; #else return_val = jack_port_get_total_latency(drv->client, drv->output_port[0]); #endif } TRACE("got latency of %ld frames\n", return_val); releaseDriver(drv); return return_val; } /* bytes that jack requests during each callback */ unsigned long JACK_GetJackBufferedBytes(int deviceID) { jack_driver_t *drv = getDriver(deviceID); long return_val; if(drv->bytes_per_jack_output_frame == 0) { return_val = 0; } else { /* adjust from jack bytes to client bytes */ return_val = drv->jack_buffer_size / drv->bytes_per_jack_output_frame * drv->bytes_per_output_frame * drv->num_output_channels; } releaseDriver(drv); return return_val; } /* value = TRUE, perform sample rate conversion */ void JACK_DoSampleRateConversion(bool value) { do_sample_rate_conversion = value; } /* FIXME: put the filename of the resample library header file with the decoders in here */ /* consider mapping them in the bio2jack.h header file since its useless to the user unless */ /* they can figure out wtf the settings on */ void JACK_SetSampleRateConversionFunction(int converter) { preferred_src_converter = converter; } /* set the client name that will be reported to jack when we open a */ /* connection via JACK_OpenDevice() */ void JACK_SetClientName(char *name) { if(name) { if(client_name) free(client_name); /* jack_client_name_size() is the max length of a client name, including the terminating null. */ int size = strlen(name) + 1; /* take into account the terminating null */ if(size > jack_client_name_size()) size = jack_client_name_size(); client_name = malloc(size); if(client_name) snprintf(client_name, size, "%s", name); else ERR("unable to allocate %d bytes for client_name\n", size); } } void JACK_SetPortConnectionMode(enum JACK_PORT_CONNECTION_MODE mode) { port_connection_mode = mode; } qmmp-0.7.4/src/plugins/Output/jack/bio2jack.h0000664000175000017500000001465012256224735017547 0ustar useruser/* * Copyright 2003-2004 Chris Morgan * * 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.1 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _H_JACK_OUT_H #define _H_JACK_OUT_H #include #ifdef __cplusplus extern "C" { #else #define bool long #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define ERR_SUCCESS 0 #define ERR_OPENING_JACK 1 #define ERR_RATE_MISMATCH 2 #define ERR_BYTES_PER_OUTPUT_FRAME_INVALID 3 #define ERR_BYTES_PER_INPUT_FRAME_INVALID 4 #define ERR_TOO_MANY_OUTPUT_CHANNELS 5 #define ERR_PORT_NAME_OUTPUT_CHANNEL_MISMATCH 6 #define ERR_PORT_NOT_FOUND 7 #define ERR_TOO_MANY_INPUT_CHANNELS 8 #define ERR_PORT_NAME_INPUT_CHANNEL_MISMATCH 9 enum status_enum { PLAYING, PAUSED, STOPPED, CLOSED, RESET }; enum pos_enum { BYTES, MILLISECONDS }; #define PLAYED 1 /* played out of the speakers(estimated value but should be close */ #define WRITTEN_TO_JACK 2 /* amount written out to jack */ #define WRITTEN 3 /* amount written to the bio2jack device */ /**********************/ /* External functions */ void JACK_Init(void); /* call this before any other bio2jack calls */ void JACK_DoSampleRateConversion(bool value); /* whether the next device that's Open()d should do sample rate conversion if necessary */ void JACK_SetSampleRateConversionFunction(int converter); /* which SRC converter function should be used for the next Open()d device */ int JACK_Open(int *deviceID, unsigned int bits_per_sample, unsigned long *rate, int channels); /* Note: defaults to 0 input channels if you need input (record) use OpenEx instead */ int JACK_OpenEx(int *deviceID, unsigned int bits_per_channel, unsigned long *rate, unsigned int input_channels, unsigned int output_channels, const char **jack_port_name, unsigned int jack_port_name_count, unsigned long jack_port_flags); int JACK_Close(int deviceID); /* return 0 for success */ void JACK_Reset(int deviceID); /* free all buffered data and reset several values in the device */ long JACK_Write(int deviceID, unsigned char *data, unsigned long bytes); /* returns the number of bytes written */ long JACK_Read(int deviceID, unsigned char *data, unsigned long bytes); /* returns the number of bytes read */ /* state setting values */ /* set/get the written/played/buffered value based on a byte or millisecond input value */ long JACK_GetPosition(int deviceID, enum pos_enum position, int type); void JACK_SetPosition(int deviceID, enum pos_enum position, long value); long JACK_GetJackLatency(int deviceID); /* deprectated, you probably want JACK_GetJackOutputLatency */ long JACK_GetJackOutputLatency(int deviceID); /* return the output latency in frames */ long JACK_GetJackInputLatency(int deviceID); /* return the input latency in frames */ int JACK_SetState(int deviceID, enum status_enum state); /* playing, paused, stopped */ enum status_enum JACK_GetState(int deviceID); long JACK_GetMaxOutputBufferedBytes(int deviceID); long JACK_GetMaxInputBufferedBytes(int deviceID); /* bytes that jack requests during each callback */ unsigned long JACK_GetJackBufferedBytes(int deviceID); /* Properties of the jack driver */ /* linear means 0 volume is silence, 100 is full volume */ /* dbAttenuation means 0 volume is 0dB attenuation */ /* Bio2jack defaults to linear */ /* Note: volume controls only effect output channels for now */ enum JACK_VOLUME_TYPE { linear, dbAttenuation }; enum JACK_VOLUME_TYPE JACK_SetVolumeEffectType(int deviceID, enum JACK_VOLUME_TYPE type); int JACK_SetAllVolume(int deviceID, unsigned int volume); /* returns 0 on success */ int JACK_SetVolumeForChannel(int deviceID, unsigned int channel, unsigned int volume); void JACK_GetVolumeForChannel(int deviceID, unsigned int channel, unsigned int *volume); unsigned long JACK_GetOutputBytesPerSecond(int deviceID); /* bytes_per_output_frame * sample_rate */ unsigned long JACK_GetInputBytesPerSecond(int deviceID); /* bytes_per_input_frame * sample_rate */ unsigned long JACK_GetBytesStored(int deviceID); /* bytes currently buffered in the output buffer */ unsigned long JACK_GetBytesFreeSpace(int deviceID); /* bytes of free space in the output buffer */ unsigned long JACK_GetBytesUsedSpace(int deviceID); /* bytes of space used in the input buffer */ unsigned long JACK_GetBytesPerOutputFrame(int deviceID); unsigned long JACK_GetBytesPerInputFrame(int deviceID); /* Note: these will probably be removed in a future release */ int JACK_GetNumInputChannels(int deviceID); int JACK_GetNumOutputChannels(int deviceID); long JACK_GetSampleRate(int deviceID); /* samples per second */ void JACK_SetClientName(char *name); /* sets the name that bio2jack will use when creating a new jack client. name_%pid%_%deviceID%%counter% will be used NOTE: this defaults to name = bio2jack NOTE: we limit the size of the client name to jack_client_name_size() */ enum JACK_PORT_CONNECTION_MODE { CONNECT_ALL, /* connect to all avaliable ports */ CONNECT_OUTPUT, /* connect only to the ports we need for output */ CONNECT_NONE /* don't connect to any ports */ }; /* set the mode for port connections */ /* defaults to CONNECT_ALL */ void JACK_SetPortConnectionMode(enum JACK_PORT_CONNECTION_MODE mode); #ifdef __cplusplus } #endif #endif /* #ifndef JACK_OUT_H */ qmmp-0.7.4/src/plugins/Output/jack/outputjackfactory.h0000664000175000017500000000372212256224735021642 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTJACKFACTORY_H #define OUTPUTJACKFACTORY_H #include #include #include #include #include #include class OutputJACKFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/null/0000775000175000017500000000000012256224735015746 5ustar useruserqmmp-0.7.4/src/plugins/Output/null/CMakeLists.txt0000664000175000017500000000237012256224735020510 0ustar useruserproject(libnull) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libnull_SRCS outputnull.cpp outputnullfactory.cpp ) SET(libnull_MOC_HDRS outputnullfactory.h ) SET(libnull_HDRS outputnull.h ) SET(libnull_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libnull_RCC_SRCS ${libnull_RCCS}) QT4_WRAP_CPP(libnull_MOC_SRCS ${libnull_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(null MODULE ${libnull_SRCS} ${libnull_MOC_SRCS} ${libnull_UIS_H} ${libnull_RCC_SRCS} ${libnull_HDRS}) add_dependencies(null qmmp) target_link_libraries(null ${QT_LIBRARIES} -lqmmp) install(TARGETS null DESTINATION ${LIB_DIR}/qmmp/Output) qmmp-0.7.4/src/plugins/Output/null/outputnull.h0000664000175000017500000000361612256224735020360 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTNULL_H #define OUTPUTNULL_H #include /** @author Ilya Kotov */ class OutputNull : public Output { public: OutputNull(); ~OutputNull(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(); void reset(); private: qint64 m_bytes_per_second; }; #endif // OutputNull_H qmmp-0.7.4/src/plugins/Output/null/outputnullfactory.h0000664000175000017500000000372212256224735021746 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTNULLFACTORY_H #define OUTPUTNULLFACTORY_H #include #include #include #include #include #include class OutputNullFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/null/outputnull.cpp0000664000175000017500000000442312256224735020710 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "outputnull.h" OutputNull::OutputNull() : Output() { m_bytes_per_second = 0; } OutputNull::~OutputNull() {} bool OutputNull::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { switch (format) { case Qmmp::PCM_S8: m_bytes_per_second = freq * chan; break; case Qmmp::PCM_S24LE: case Qmmp::PCM_S32LE: m_bytes_per_second = freq * chan * 4; break; case Qmmp::PCM_S16LE: default: m_bytes_per_second = freq * chan * 2; } configure(freq, chan, format); return true; } qint64 OutputNull::latency() { return 0; } qint64 OutputNull::writeAudio(unsigned char *data, qint64 maxSize) { Q_UNUSED(data); usleep(maxSize * 1000000 / m_bytes_per_second); return maxSize; } void OutputNull::drain() {} void OutputNull::reset() {} qmmp-0.7.4/src/plugins/Output/null/translations/0000775000175000017500000000000012256224735020467 5ustar useruserqmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_gl_ES.ts0000664000175000017500000000174512256224735024447 0ustar useruser OutputNullFactory Null Plugin Engadido Null About Null Output Plugin Sobre o engadido Null Qmmp Null Output Plugin Engadido Null de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/translations.qrc0000664000175000017500000000142512256224735023721 0ustar useruser null_plugin_ru.qm null_plugin_uk_UA.qm null_plugin_zh_CN.qm null_plugin_zh_TW.qm null_plugin_tr.qm null_plugin_cs.qm null_plugin_pt_BR.qm null_plugin_de.qm null_plugin_pl_PL.qm null_plugin_fr.qm null_plugin_it.qm null_plugin_kk.qm null_plugin_lt.qm null_plugin_hu.qm null_plugin_nl.qm null_plugin_ja.qm null_plugin_sk.qm null_plugin_es.qm null_plugin_he.qm null_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_uk_UA.ts0000664000175000017500000000214412256224735024454 0ustar useruser OutputNullFactory Null Plugin Модуль нульового виведення About Null Output Plugin Про модуль нульового виведення Qmmp Null Output Plugin Модуль нульового виведення для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_pl_PL.ts0000664000175000017500000000175312256224735024463 0ustar useruser OutputNullFactory Null Plugin Wtyczka Null About Null Output Plugin O wtyczce wyjściowej Null Qmmp Null Output Plugin Wtyczka wyjściowa Null dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_de.ts0000664000175000017500000000174112256224735024042 0ustar useruser OutputNullFactory Null Plugin Null-Modul About Null Output Plugin Über Null-Ausgabe-Modul Qmmp Null Output Plugin Qmmp Null-Ausgabe-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_cs.ts0000664000175000017500000000175412256224735024063 0ustar useruser OutputNullFactory Null Plugin Nulový modul About Null Output Plugin O modulu pro nulový výstup Qmmp Null Output Plugin Modul Qmmp pro nulový výstup Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_es.ts0000664000175000017500000000200212256224735024050 0ustar useruser OutputNullFactory Null Plugin Módulo de salida nula About Null Output Plugin Acerca del módulo de salida nula Qmmp Null Output Plugin Módulo de salida nula para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_fr.ts0000664000175000017500000000170112256224735024055 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_he.ts0000664000175000017500000000201312256224735024037 0ustar useruser OutputNullFactory Null Plugin תוספת אפסית About Null Output Plugin אודות תוספת אפסית Qmmp Null Output Plugin תוספת אפסית Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_hu.ts0000664000175000017500000000170112256224735024062 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_ja.ts0000664000175000017500000000203012256224735024034 0ustar useruser OutputNullFactory Null Plugin NULL プラグイン About Null Output Plugin NULL 出力プラグインについて Qmmp Null Output Plugin QMMP NULL 出力プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_it.ts0000664000175000017500000000200212256224735024055 0ustar useruser OutputNullFactory Null Plugin Modulo di uscita nullo About Null Output Plugin Informazioni sul modulo di uscita nullo Qmmp Null Output Plugin Modulo di uscita nullo per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_kk.ts0000664000175000017500000000170112256224735024053 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_lt.ts0000664000175000017500000000176212256224735024074 0ustar useruser OutputNullFactory Null Plugin Null Įskiepis About Null Output Plugin Apie Null išvesties įskiepį Qmmp Null Output Plugin Qmmp Null išvesties įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_nl.ts0000664000175000017500000000174712256224735024071 0ustar useruser OutputNullFactory Null Plugin Null Module About Null Output Plugin Over de Null Output Module Qmmp Null Output Plugin Null Output Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_pl.ts0000664000175000017500000000175312256224735024070 0ustar useruser OutputNullFactory Null Plugin Wtyczka Null About Null Output Plugin O wtyczce wyjściowej Null Qmmp Null Output Plugin Wtyczka wyjściowa Null dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_ru.ts0000664000175000017500000000211712256224735024076 0ustar useruser OutputNullFactory Null Plugin Модуль нулевого вывода About Null Output Plugin О модуле нулевого вывода Qmmp Null Output Plugin Модуль нулевого вывода для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_sk.ts0000664000175000017500000000170112256224735024063 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_tr.ts0000664000175000017500000000176012256224735024100 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_pt_BR.ts0000664000175000017500000000170112256224735024454 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_zh_CN.ts0000664000175000017500000000174212256224735024454 0ustar useruser OutputNullFactory Null Plugin 无输出插件 About Null Output Plugin 关于无输出插件 Qmmp Null Output Plugin Qmmp 无输出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/translations/null_plugin_zh_TW.ts0000664000175000017500000000176212256224735024510 0ustar useruser OutputNullFactory Null Plugin About Null Output Plugin Qmmp Null Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/null/outputnullfactory.cpp0000664000175000017500000000504112256224735022275 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "outputnull.h" #include "outputnullfactory.h" const OutputProperties OutputNullFactory::properties() const { OutputProperties properties; properties.name = tr("Null Plugin"); properties.hasAbout = true; properties.hasSettings = false; properties.shortName = "null"; return properties; } Output* OutputNullFactory::create() { return new OutputNull(); } Volume *OutputNullFactory::createVolume() { return 0; } void OutputNullFactory::showSettings(QWidget* parent) { Q_UNUSED(parent); } void OutputNullFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Null Output Plugin"), tr("Qmmp Null Output Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *OutputNullFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/null_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(null, OutputNullFactory) qmmp-0.7.4/src/plugins/Output/null/null.pro0000664000175000017500000000233112256224735017441 0ustar useruserinclude(../../plugins.pri) HEADERS += outputnullfactory.h \ outputnull.h SOURCES += outputnullfactory.cpp \ outputnull.cpp TARGET=$$PLUGINS_PREFIX/Output/null INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin TEMPLATE = lib TRANSLATIONS = translations/null_plugin_cs.ts \ translations/null_plugin_de.ts \ translations/null_plugin_zh_CN.ts \ translations/null_plugin_zh_TW.ts \ translations/null_plugin_ru.ts \ translations/null_plugin_pl.ts \ translations/null_plugin_uk_UA.ts \ translations/null_plugin_it.ts \ translations/null_plugin_tr.ts \ translations/null_plugin_lt.ts \ translations/null_plugin_nl.ts \ translations/null_plugin_ja.ts \ translations/null_plugin_es.ts RESOURCES = translations/translations.qrc unix { isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target LIBS += -lqmmp QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/libnull.so } win32 { LIBS += -lqmmp0 QMAKE_LIBDIR += ../../../../bin } qmmp-0.7.4/src/plugins/Output/oss4/0000775000175000017500000000000012256224735015664 5ustar useruserqmmp-0.7.4/src/plugins/Output/oss4/oss4.pro0000664000175000017500000000242012256224735017274 0ustar useruserinclude(../../plugins.pri) FORMS += settingsdialog.ui HEADERS += outputoss4factory.h \ outputoss4.h \ settingsdialog.h SOURCES += outputoss4factory.cpp \ outputoss4.cpp \ settingsdialog.cpp TARGET=$$PLUGINS_PREFIX/Output/oss4 QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/liboss4.so INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin DEFINES += HAVE_SYS_SOUNDCARD_H INCLUDEPATH += /usr/lib/oss/include TEMPLATE = lib LIBS += -lqmmp TRANSLATIONS = translations/oss4_plugin_cs.ts \ translations/oss4_plugin_de.ts \ translations/oss4_plugin_zh_CN.ts \ translations/oss4_plugin_zh_TW.ts \ translations/oss4_plugin_ru.ts \ translations/oss4_plugin_pl.ts \ translations/oss4_plugin_uk_UA.ts \ translations/oss4_plugin_it.ts \ translations/oss4_plugin_tr.ts \ translations/oss4_plugin_lt.ts \ translations/oss4_plugin_nl.ts \ translations/oss4_plugin_ja.ts \ translations/oss4_plugin_es.ts \ RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/oss4/CMakeLists.txt0000664000175000017500000000414412256224735020427 0ustar useruserproject(liboss4) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) INCLUDE(CheckIncludeFile) INCLUDE(CheckCXXSourceCompiles) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) #oss4 include_directories(/usr/lib/oss/include /usr/local/lib/oss/include) CHECK_INCLUDE_FILE(sys/soundcard.h SYS_SOUNDCARD_H_FOUND) IF(SYS_SOUNDCARD_H_FOUND) ADD_DEFINITIONS(-DHAVE_SYS_SOUNDCARD_H) SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_SOUNDCARD_H) ENDIF(SYS_SOUNDCARD_H_FOUND) SET(CMAKE_REQUIRED_INCLUDES /usr/lib/oss/include/ /usr/local/lib/oss/include ${CMAKE_REQUIRED_INCLUDES}) CHECK_CXX_SOURCE_COMPILES(" #include #include #include #ifdef HAVE_SYS_SOUNDCARD_H #include #else #include #endif #ifndef SNDCTL_DSP_COOKEDMODE #error \\\"oss test failed\\\" #endif int main (int argc, char **argv) { exit(0); }" OSS4_SUPPORT) IF(OSS4_SUPPORT) SET(OSS4_FOUND TRUE CACHE INTERNAL "oss4") ENDIF(OSS4_SUPPORT) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(liboss4_SRCS outputoss4factory.cpp outputoss4.cpp settingsdialog.cpp ) SET(liboss4_MOC_HDRS outputoss4factory.h settingsdialog.h ) SET(liboss4_HDRS outputoss4.h ) SET(liboss4_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(liboss4_RCC_SRCS ${liboss4_RCCS}) QT4_WRAP_CPP(liboss4_MOC_SRCS ${liboss4_MOC_HDRS}) SET(liboss4_UIS settingsdialog.ui ) IF(OSS4_FOUND) QT4_WRAP_UI(liboss4_UIS_H ${liboss4_UIS}) ADD_LIBRARY(oss4 MODULE ${liboss4_SRCS} ${liboss4_MOC_SRCS} ${liboss4_UIS_H} ${liboss4_RCC_SRCS} ${liboss4_HDRS}) add_dependencies(oss4 qmmp) target_link_libraries(oss4 ${QT_LIBRARIES} -lqmmp) install(TARGETS oss4 DESTINATION ${LIB_DIR}/qmmp/Output) ENDIF(OSS4_FOUND) qmmp-0.7.4/src/plugins/Output/oss4/outputoss4factory.h0000664000175000017500000000371612256224735021605 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTOSSFACTORY_H #define OUTPUTOSSFACTORY_H #include #include #include #include #include #include class OutputOSS4Factory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/oss4/outputoss4.h0000664000175000017500000000456012256224735020213 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTOSS4_H #define OUTPUTOSS4_H #include #include #define DEFAULT_DEV "/dev/dsp" #define DEFAULT_MIXER "/dev/mixer" class VolumeOSS4; /** @author Ilya Kotov */ class OutputOSS4 : public Output { public: OutputOSS4(); virtual ~OutputOSS4(); bool initialize(quint32, int, Qmmp::AudioFormat format); int fd(); //output api qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(); void reset(); qint64 latency(); static OutputOSS4 *instance(); static VolumeOSS4 *m_vc; private: void post(); void sync(); QString m_audio_device; int m_audio_fd; static OutputOSS4 *m_instance; }; class VolumeOSS4 : public Volume { public: VolumeOSS4(); ~VolumeOSS4(); void setVolume(const VolumeSettings &vol); VolumeSettings volume() const; void restore(); private: int m_volume; }; #endif qmmp-0.7.4/src/plugins/Output/oss4/settingsdialog.cpp0000664000175000017500000000722212256224735021413 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C" { #ifdef HAVE_SYS_SOUNDCARD_H #include #else #include #endif //#include } #include #include #include #include #include #include #include #include #include "outputoss4.h" #include "settingsdialog.h" SettingsDialog::SettingsDialog (QWidget *parent) : QDialog (parent) { ui.setupUi (this); setAttribute (Qt::WA_DeleteOnClose); int mixer_fd = -1; oss_sysinfo info; if ((mixer_fd = ::open(DEFAULT_MIXER, O_RDWR)) < 0) { qWarning("SettingsDialog: %s", strerror(errno)); return; } if (ioctl(mixer_fd, SNDCTL_SYSINFO, &info) < 0) { qWarning("SettingsDialog: ioctl SNDCTL_SYSINFO failed: %s", strerror(errno)); return; } if (info.numaudios < 1) { qWarning("SettingsDialog: no device found"); return; } m_devices << DEFAULT_DEV; ui.deviceComboBox->addItem(tr("Default") + " (" + DEFAULT_DEV + ")"); for (int i = 0; i < info.numaudios; ++i) { oss_audioinfo audio_info; audio_info.dev = i; if (ioctl(mixer_fd, SNDCTL_AUDIOINFO, &audio_info) < 0) { qWarning("SettingsDialog: ioctl SNDCTL_AUDIOINFO failed: %s", strerror(errno)); return; } if (audio_info.caps & PCM_CAP_OUTPUT) { m_devices << audio_info.devnode; ui.deviceComboBox->addItem(QString("%1 (%2)").arg(audio_info.name).arg(audio_info.devnode)); } } QSettings settings(Qmmp::configFile(), QSettings::IniFormat); ui.deviceComboBox->setEditText(settings.value("OSS4/device", DEFAULT_DEV).toString()); connect (ui.deviceComboBox, SIGNAL(activated(int)),SLOT(setText(int))); } SettingsDialog::~SettingsDialog() {} void SettingsDialog::setText(int n) { ui.deviceComboBox->setEditText(m_devices.at(n)); } void SettingsDialog::accept() { qDebug("%s", Q_FUNC_INFO); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("OSS4/device", ui.deviceComboBox->currentText ()); QDialog::accept(); } qmmp-0.7.4/src/plugins/Output/oss4/outputoss4factory.cpp0000664000175000017500000000516712256224735022142 0ustar useruser/*************************************************************************** * Copyright (C) 2007 by Zhuravlev Uriy * * stalkerg@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "outputoss4.h" #include "outputoss4factory.h" Output* OutputOSS4Factory::create() { return new OutputOSS4(); } const OutputProperties OutputOSS4Factory::properties() const { OutputProperties properties; properties.name = tr("OSS4 Plugin"); properties.shortName = "oss4"; properties.hasAbout = true; properties.hasSettings = true; return properties; } Volume *OutputOSS4Factory::createVolume() { return new VolumeOSS4; } void OutputOSS4Factory::showSettings(QWidget* parent) { SettingsDialog *s = new SettingsDialog(parent); s->show(); } void OutputOSS4Factory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About OSS4 Output Plugin"), tr("Qmmp OSS4 Output Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *OutputOSS4Factory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/oss4_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(oss4,OutputOSS4Factory) qmmp-0.7.4/src/plugins/Output/oss4/settingsdialog.ui0000664000175000017500000000432312256224735021245 0ustar useruser SettingsDialog 0 0 276 68 OSS4 Plugin Settings 9 6 0 0 true QDialogButtonBox::Cancel|QDialogButtonBox::Ok 0 0 Device: buttonBox accepted() SettingsDialog accept() 179 51 274 2 buttonBox rejected() SettingsDialog reject() 231 46 271 44 qmmp-0.7.4/src/plugins/Output/oss4/translations/0000775000175000017500000000000012256224735020405 5ustar useruserqmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_pt_BR.ts0000664000175000017500000000303212256224735024307 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_zh_CN.ts0000664000175000017500000000304612256224735024307 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4 插件 About OSS4 Output Plugin 关于 OSS4 输出插件 Qmmp OSS4 Output Plugin Qmmp OSS4 输出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings OSS4 插件设置 Device: 设备: Default 默认 qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_zh_TW.ts0000664000175000017500000000304612256224735024341 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4 插件 About OSS4 Output Plugin 關於 OSS4 輸出插件 Qmmp OSS4 Output Plugin Qmmp OSS4 輸出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings OSS4 插件設定 Device: 設備: Default 默認 qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_de.ts0000664000175000017500000000305312256224735023674 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4-Modul About OSS4 Output Plugin Über OSS4-Ausgabe-Modul Qmmp OSS4 Output Plugin Qmmp OSS4-Ausgabe-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Einstellungen OSS4-Modul Device: Gerät: Default Standard qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_cs.ts0000664000175000017500000000305012256224735023706 0ustar useruser OutputOSS4Factory OSS4 Plugin Modul OSS4 About OSS4 Output Plugin O modulu OSS4 Qmmp OSS4 Output Plugin Výstupní modul Qmmp pro OSS4 Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Nastavení modulu OSS4 Device: Zařízení: Default Výchozí qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_es.ts0000664000175000017500000000312412256224735023712 0ustar useruser OutputOSS4Factory OSS4 Plugin Módulo OSS4 About OSS4 Output Plugin Acerca del módulo de salida OSS4 Qmmp OSS4 Output Plugin Módulo de salida OSS4 para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Configuración del módulo OSS4 Device: Dispositivo: Default Predeterminado qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_fr.ts0000664000175000017500000000303212256224735023710 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_he.ts0000664000175000017500000000313412256224735023700 0ustar useruser OutputOSS4Factory OSS4 Plugin תוספת OSS4 About OSS4 Output Plugin אודות תוספת פלט OSS4 Qmmp OSS4 Output Plugin תוספת פלט OSS4 ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings הגדרות תוספת OSS4 Device: התקן: Default משתמט qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_hu.ts0000664000175000017500000000303212256224735023715 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_ja.ts0000664000175000017500000000314512256224735023700 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4 プラグイン About OSS4 Output Plugin OSS4 プラグインについて Qmmp OSS4 Output Plugin QMMP OSS4 プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings OSS4 プラグイン設定 Device: デバイス: Default 初期設定値 qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_it.ts0000664000175000017500000000302712256224735023721 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/translations.qrc0000664000175000017500000000142512256224735023637 0ustar useruser oss4_plugin_ru.qm oss4_plugin_uk_UA.qm oss4_plugin_zh_CN.qm oss4_plugin_zh_TW.qm oss4_plugin_tr.qm oss4_plugin_cs.qm oss4_plugin_pt_BR.qm oss4_plugin_de.qm oss4_plugin_pl_PL.qm oss4_plugin_fr.qm oss4_plugin_it.qm oss4_plugin_kk.qm oss4_plugin_lt.qm oss4_plugin_hu.qm oss4_plugin_nl.qm oss4_plugin_ja.qm oss4_plugin_sk.qm oss4_plugin_es.qm oss4_plugin_he.qm oss4_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_kk.ts0000664000175000017500000000303212256224735023706 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_lt.ts0000664000175000017500000000310512256224735023721 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4 Įskiepis About OSS4 Output Plugin Apie OSS4 išvesties įskiepį Qmmp OSS4 Output Plugin Qmmp OSS4 išvesties įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings OSS4 įskiepio nustatymai Device: Įrenginys: Default Numatytieji qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_nl.ts0000664000175000017500000000306612256224735023721 0ustar useruser OutputOSS4Factory OSS4 Plugin OSS4 Module About OSS4 Output Plugin Over de OSS4 Uitvoer Module Qmmp OSS4 Output Plugin OSS4 Uitvoer Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings OSS4 Module Instellingen Device: Apparaat: Default Standaard qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_pl.ts0000664000175000017500000000307012256224735023716 0ustar useruser OutputOSS4Factory OSS4 Plugin Wtyczka OSS4 About OSS4 Output Plugin O wtyczce wyjściowej OSS4 Qmmp OSS4 Output Plugin Wtyczka OSS4 dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Stworzona przez Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Ustawienia wtyczki OSS4 Device: Urządzenie: Default Domyślne qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_ru.ts0000664000175000017500000000322012256224735023726 0ustar useruser OutputOSS4Factory OSS4 Plugin Модуль OSS4 About OSS4 Output Plugin Модуль поддержки OSS4 для Qmmp Qmmp OSS4 Output Plugin Модуль OSS4 для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Настройки модуля OSS4 Device: Устройство: Default По умолчанию qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_sk.ts0000664000175000017500000000303212256224735023716 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_tr.ts0000664000175000017500000000303212256224735023726 0ustar useruser OutputOSS4Factory OSS4 Plugin About OSS4 Output Plugin Qmmp OSS4 Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Device: Default qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_gl_ES.ts0000664000175000017500000000307412256224735024300 0ustar useruser OutputOSS4Factory OSS4 Plugin Engadido OSS4 About OSS4 Output Plugin Sobre o engadido OSS4 Qmmp OSS4 Output Plugin Engadido OSS4 de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Preferencias do engadido OSS4 Device: Dispositivo: Default Por defecto qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_uk_UA.ts0000664000175000017500000000322212256224735024306 0ustar useruser OutputOSS4Factory OSS4 Plugin Модуль OSS4 About OSS4 Output Plugin Модуль підтримки OSS4 для Qmmp Qmmp OSS4 Output Plugin Модуль OSS4 для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Налаштування модуля OSS4 Device: Пристрій: Default За замовчанням qmmp-0.7.4/src/plugins/Output/oss4/translations/oss4_plugin_pl_PL.ts0000664000175000017500000000307012256224735024311 0ustar useruser OutputOSS4Factory OSS4 Plugin Wtyczka OSS4 About OSS4 Output Plugin O wtyczce wyjściowej OSS4 Qmmp OSS4 Output Plugin Wtyczka OSS4 dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Stworzona przez Ilya Kotov <forkotov02@hotmail.ru> SettingsDialog OSS4 Plugin Settings Ustawienia wtyczki OSS4 Device: Urządzenie: Default Domyślne qmmp-0.7.4/src/plugins/Output/oss4/settingsdialog.h0000664000175000017500000000352712256224735021064 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent); ~SettingsDialog(); private slots: void setText(int n); private: virtual void accept(); Ui::SettingsDialog ui; QStringList m_devices; }; #endif qmmp-0.7.4/src/plugins/Output/oss4/outputoss4.cpp0000664000175000017500000001340512256224735020544 0ustar useruser/*************************************************************************** * Copyright (C) 2010-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include extern "C" { #ifdef HAVE_SYS_SOUNDCARD_H #include #else #include #endif //#include } #include #include #include #include #include #include #include #include #include #include #include "outputoss4.h" OutputOSS4 *OutputOSS4::m_instance = 0; VolumeOSS4 *OutputOSS4::m_vc = 0; OutputOSS4::OutputOSS4() : Output() { m_audio_fd = -1; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_audio_device = settings.value("OSS4/device", DEFAULT_DEV).toString(); m_instance = this; } OutputOSS4::~OutputOSS4() { if (m_audio_fd >= 0) { ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); close(m_audio_fd); m_audio_fd = -1; } m_instance = 0; } int OutputOSS4::fd() { return m_audio_fd; } OutputOSS4 *OutputOSS4::instance() { return m_instance; } void OutputOSS4::post() { ioctl(m_audio_fd, SNDCTL_DSP_POST, 0); } void OutputOSS4::sync() { ioctl(m_audio_fd, SNDCTL_DSP_SYNC, 0); } bool OutputOSS4::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { m_audio_fd = open(m_audio_device.toAscii(), O_WRONLY); if (m_audio_fd < 0) { qWarning("OSS4Output: unable to open output device '%s'; error: %s", qPrintable(m_audio_device), strerror(errno)); return false; } ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); int p; switch (format) { case Qmmp::PCM_S32LE: p = AFMT_S32_LE; break; case Qmmp::PCM_S24LE: p = AFMT_S24_LE; break; case Qmmp::PCM_S16LE: p = AFMT_S16_LE; break; case Qmmp::PCM_S8: p = AFMT_S8; break; default: qWarning("OutputOSS4: unsupported audio format"); return false; } if (ioctl(m_audio_fd, SNDCTL_DSP_SETFMT, &p) == -1) qWarning("OutputOSS4: ioctl SNDCTL_DSP_SETFMT failed: %s",strerror(errno)); if(ioctl(m_audio_fd, SNDCTL_DSP_CHANNELS, &chan) == -1) qWarning("OutputOSS4: ioctl SNDCTL_DSP_CHANNELS failed: %s", strerror(errno)); if (ioctl(m_audio_fd, SNDCTL_DSP_SPEED, &freq) < 0) qWarning("OutputOSS4: ioctl SNDCTL_DSP_SPEED failed: %s", strerror(errno)); int enabled = 1; if(ioctl(m_audio_fd, SNDCTL_DSP_COOKEDMODE, &enabled) == -1) qWarning("OutputOSS4: ioctl SNDCTL_DSP_COOKEDMODE: %s", strerror(errno)); ioctl(m_audio_fd, SNDCTL_DSP_RESET, 0); configure(freq, chan, format); if(m_vc) m_vc->restore(); return true; } qint64 OutputOSS4::latency() { return 0; } qint64 OutputOSS4::writeAudio(unsigned char *data, qint64 maxSize) { qint64 m = write(m_audio_fd, data, maxSize); post(); return m; } void OutputOSS4::drain() { ioctl(m_audio_fd, SNDCTL_DSP_SYNC, 0); } void OutputOSS4::reset() { ioctl(m_audio_fd, SNDCTL_DSP_SKIP, 0); } /***** MIXER *****/ VolumeOSS4::VolumeOSS4() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_volume = settings.value("OSS4/volume", 0x3232).toInt(); OutputOSS4::m_vc = this; } VolumeOSS4::~VolumeOSS4() { VolumeSettings vol = volume(); m_volume = (vol.right << 8) | vol.left; OutputOSS4::m_vc = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("OSS4/volume", m_volume); } void VolumeOSS4::setVolume(const VolumeSettings &vol) { m_volume = (vol.right << 8) | vol.left; if(OutputOSS4::instance() && OutputOSS4::instance()->fd() >= 0) { ioctl(OutputOSS4::instance()->fd(), SNDCTL_DSP_SETPLAYVOL, &m_volume); } } VolumeSettings VolumeOSS4::volume() const { VolumeSettings vol; if(OutputOSS4::instance() && OutputOSS4::instance()->fd() >= 0) { int v = 0; if (ioctl(OutputOSS4::instance()->fd(), SNDCTL_DSP_GETPLAYVOL, &v) < 0) v = 0; vol.left = v & 0x00FF; vol.right = (v & 0xFF00) >> 8; } else { vol.left = m_volume & 0x00FF; vol.right = (m_volume & 0xFF00) >> 8; } return vol; } void VolumeOSS4::restore() { if(OutputOSS4::instance() && OutputOSS4::instance()->fd() >= 0) { ioctl(OutputOSS4::instance()->fd(), SNDCTL_DSP_SETPLAYVOL, &m_volume); } } qmmp-0.7.4/src/plugins/Output/Output.pro0000664000175000017500000000062612256224735017022 0ustar useruserinclude(../../../qmmp.pri) CONFIG += release warn_on TEMPLATE = subdirs win32:SUBDIRS += waveout SUBDIRS += null unix{ contains(CONFIG, JACK_PLUGIN){ SUBDIRS += jack } contains(CONFIG, OSS_PLUGIN){ SUBDIRS += oss } contains(CONFIG, PULSE_AUDIO_PLUGIN){ SUBDIRS += pulseaudio } contains(CONFIG, ALSA_PLUGIN){ SUBDIRS += alsa } contains(CONFIG, OSS4_PLUGIN){ SUBDIRS += oss4 } } qmmp-0.7.4/src/plugins/Output/CMakeLists.txt0000664000175000017500000000147012256224735017536 0ustar useruserSET(USE_ALSA TRUE CACHE BOOL "enable/disable alsa plugin") SET(USE_JACK TRUE CACHE BOOL "enable/disable jack plugin") SET(USE_OSS FALSE CACHE BOOL "enable/disable oss plugin") SET(USE_OSS4 TRUE CACHE BOOL "enable/disable oss4 plugin") SET(USE_PULSE TRUE CACHE BOOL "enable/disable pulse audio plugin") SET(USE_NULL TRUE CACHE BOOL "enable/disable null output plugin") SET(USE_WAVEOUT TRUE CACHE BOOL "enable/disable Win32 waveout plugin") IF(USE_ALSA) add_subdirectory(alsa) ENDIF(USE_ALSA) IF(USE_JACK) add_subdirectory(jack) ENDIF(USE_JACK) IF(USE_OSS) add_subdirectory(oss) ENDIF(USE_OSS) IF(USE_OSS4) add_subdirectory(oss4) ENDIF(USE_OSS4) IF(USE_PULSE) add_subdirectory(pulseaudio) ENDIF(USE_PULSE) IF(USE_NULL) add_subdirectory(null) ENDIF(USE_NULL) IF(USE_WAVEOUT) add_subdirectory(waveout) ENDIF(USE_WAVEOUT) qmmp-0.7.4/src/plugins/Output/waveout/0000775000175000017500000000000012256224735016466 5ustar useruserqmmp-0.7.4/src/plugins/Output/waveout/outputwaveout.cpp0000664000175000017500000001770412256224735022156 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "outputwaveout.h" #define MAX_WAVEBLOCKS 256 static CRITICAL_SECTION cs; static HWAVEOUT dev = NULL; static unsigned int ScheduledBlocks = 0; static int PlayedWaveHeadersCount = 0; // free index static WAVEHDR* PlayedWaveHeaders [MAX_WAVEBLOCKS]; static void CALLBACK wave_callback (HWAVE hWave, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2) { if (uMsg == WOM_DONE) { EnterCriticalSection (&cs); PlayedWaveHeaders [PlayedWaveHeadersCount++] = (WAVEHDR*) dwParam1; ScheduledBlocks--; // decrease the number of USED blocks LeaveCriticalSection (&cs); } } static void free_memory (void) { WAVEHDR* wh; HGLOBAL hg; EnterCriticalSection (&cs); wh = PlayedWaveHeaders [--PlayedWaveHeadersCount]; LeaveCriticalSection (&cs); waveOutUnprepareHeader (dev, wh, sizeof (WAVEHDR)); hg = GlobalHandle (wh -> lpData); // Deallocate the buffer memory GlobalUnlock (hg); GlobalFree (hg); hg = GlobalHandle (wh); // Deallocate the header memory GlobalUnlock (hg); GlobalFree (hg); } OutputWaveOut::OutputWaveOut() : Output() { //m_connection = 0; //m_dev = 0; } OutputWaveOut::~OutputWaveOut() { uninitialize(); } bool OutputWaveOut::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { if (!waveOutGetNumDevs ()) { qWarning("OutputWaveOut: no audio device found"); return false; } WAVEFORMATEX fmt; UINT deviceID = WAVE_MAPPER; fmt.wFormatTag = WAVE_FORMAT_PCM; fmt.wBitsPerSample = 16; fmt.nChannels = chan; fmt.nSamplesPerSec = (unsigned long)(freq); fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample/8; fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nChannels * fmt.wBitsPerSample/8; switch (waveOutOpen (&dev, deviceID, &fmt, (DWORD)wave_callback, 0, CALLBACK_FUNCTION)) { case MMSYSERR_ALLOCATED: qWarning("OutputWaveOut: Device is already open."); return false; case MMSYSERR_BADDEVICEID: qWarning("OutputWaveOut: The specified device is out of range."); return false; case MMSYSERR_NODRIVER: qWarning("OutputWaveOut: There is no audio driver in this system."); return false; case MMSYSERR_NOMEM: qWarning("OutputWaveOut: Unable to allocate sound memory."); return false; case WAVERR_BADFORMAT: qWarning("OutputWaveOut: This audio format is not supported."); return false; case WAVERR_SYNC: qWarning("OutputWaveOut: The device is synchronous."); return false; default: qWarning("OutputWaveOut: Unknown media error."); return false; case MMSYSERR_NOERROR: break; } waveOutReset (dev); InitializeCriticalSection (&cs); configure(freq, chan, Qmmp::PCM_S16LE); return true; } qint64 OutputWaveOut::latency() { return 0; } qint64 OutputWaveOut::writeAudio(unsigned char *data, qint64 len) { HGLOBAL hg; HGLOBAL hg2; LPWAVEHDR wh; void* allocptr; len = qMin(len, (qint64)1024); while (PlayedWaveHeadersCount > 0) // free used blocks ... free_memory (); if (ScheduledBlocks >= sizeof(PlayedWaveHeaders)/sizeof(*PlayedWaveHeaders)) // wait for a free block ... { usleep(50000); return 0; } if ((hg2 = GlobalAlloc (GMEM_MOVEABLE, len)) == NULL) // allocate some memory for a copy of the buffer { qWarning("OutputWaveOut: GlobalAlloc failed"); return 0; } allocptr = GlobalLock (hg2); CopyMemory (allocptr, data, len); // Here we can call any modification output functions we want.... if ((hg = GlobalAlloc (GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof (WAVEHDR))) == NULL) // now make a header and WRITE IT! return -1; wh = (wavehdr_tag*)GlobalLock (hg); wh->dwBufferLength = len; wh->lpData = (CHAR *)allocptr; if (waveOutPrepareHeader (dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR) { GlobalUnlock (hg); GlobalFree (hg); return -1; } if (waveOutWrite (dev, wh, sizeof (WAVEHDR)) != MMSYSERR_NOERROR) { GlobalUnlock (hg); GlobalFree (hg); return -1; } EnterCriticalSection (&cs); ScheduledBlocks++; LeaveCriticalSection (&cs); return len; } void OutputWaveOut::drain() { while (ScheduledBlocks > 0) Sleep(10); while (PlayedWaveHeadersCount > 0) // free used blocks ... free_memory(); } void OutputWaveOut::suspend() { waveOutPause(dev); } void OutputWaveOut::resume() { waveOutRestart(dev); } void OutputWaveOut::reset() { while (PlayedWaveHeadersCount > 0) // free used blocks ... free_memory (); waveOutReset (dev); } void OutputWaveOut::uninitialize() { if (dev) { waveOutReset(dev); // reset the device while (ScheduledBlocks > 0); Sleep (10); while (PlayedWaveHeadersCount > 0) // free used blocks ... free_memory (); waveOutReset (dev); // reset the device waveOutClose (dev); // close the device dev = 0; } DeleteCriticalSection (&cs); return; } /***** MIXER *****/ VolumeWaveOut::VolumeWaveOut() {} VolumeWaveOut::~VolumeWaveOut() {} void VolumeWaveOut::setVolume(const VolumeSettings &vol) { DWORD data = (vol.right*0xFFFF/100 << 16) | vol.left*0xFFFF/100; waveOutSetVolume(0, data); } VolumeSettings VolumeWaveOut::volume() const { VolumeSettings vol; DWORD data; waveOutGetVolume(0, (PDWORD)&data); vol.left = (long)LOWORD(data) * 100 / 0xFFFF + 1; vol.right = (long)HIWORD(data) * 100 / 0xFFFF + 1; return vol; } bool VolumeWaveOut::isSupported() const { WAVEOUTCAPS waveCaps; if(waveOutGetDevCaps(0,(LPWAVEOUTCAPS)&waveCaps, sizeof(WAVEOUTCAPS)) != MMSYSERR_NOERROR) return false; return (waveCaps.dwSupport & WAVECAPS_VOLUME) != 0; } qmmp-0.7.4/src/plugins/Output/waveout/outputwaveoutfactory.cpp0000664000175000017500000000562212256224735023542 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include "outputwaveout.h" #include "outputwaveoutfactory.h" const OutputProperties OutputWaveOutFactory::properties() const { OutputProperties properties; properties.name = tr("WaveOut Plugin"); properties.hasAbout = true; properties.hasSettings = false; properties.shortName = "waveout"; return properties; } Output* OutputWaveOutFactory::create() { return new OutputWaveOut(); } Volume *OutputWaveOutFactory::createVolume() { VolumeWaveOut *vol = new VolumeWaveOut(); if(!vol->isSupported()) { qDebug("OutputWaveOutFactory: device doesn't support volume control"); delete vol; return 0; } return vol; } void OutputWaveOutFactory::showSettings(QWidget* parent) { Q_UNUSED(parent); } void OutputWaveOutFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About WaveOut Output Plugin"), tr("Qmmp WaveOut Output Plugin")+"\n"+ tr("Written by: Ilya Kotov ") + "\n" + tr("Based on aacDECdrop player")); } QTranslator *OutputWaveOutFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/waveout_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(waveout,OutputWaveOutFactory) qmmp-0.7.4/src/plugins/Output/waveout/outputwaveoutfactory.h0000664000175000017500000000401312256224735023200 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTPULSEAUDIOFACTORY_H #define OUTPUTPULSEAUDIOFACTORY_H #include #include #include #include #include #include class OutputWaveOutFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/waveout/CMakeLists.txt0000664000175000017500000000245312256224735021232 0ustar useruserproject(libwaveout) cmake_minimum_required(VERSION 2.4.7) INCLUDE(CheckIncludeFile) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # Win32 waveout CHECK_INCLUDE_FILE(windows.h WINDOWS_H_FOUND) SET(libwaveout_SRCS outputwaveout.cpp outputwaveoutfactory.cpp ) SET(libwaveout_MOC_HDRS outputwaveoutfactory.h ) SET(libwaveout_HDRS outputwaveout.h ) SET(libwaveout_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libwaveout_RCC_SRCS ${libwaveout_RCCS}) QT4_WRAP_CPP(libwaveout_MOC_SRCS ${libwaveout_MOC_HDRS}) IF(WINDOWS_H_FOUND) ADD_LIBRARY(waveout MODULE ${libwaveout_SRCS} ${libwaveout_MOC_SRCS} ${libwaveout_RCC_SRCS} ${libwaveout_HDRS}) add_dependencies(waveout qmmp) target_link_libraries(waveout ${QT_LIBRARIES} -lqmmp -lwinmm) install(TARGETS waveout DESTINATION ${LIB_DIR}/qmmp/Output) ENDIF(WINDOWS_H_FOUND) qmmp-0.7.4/src/plugins/Output/waveout/translations/0000775000175000017500000000000012256224735021207 5ustar useruserqmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_pl_PL.ts0000664000175000017500000000233112256224735025714 0ustar useruser OutputWaveOutFactory WaveOut Plugin Wtyczka WaveOut About WaveOut Output Plugin O wtyczce WaveOut Qmmp WaveOut Output Plugin Wtyczka WaveOut dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Oparta na kodzie odtwarzacza aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_pt_BR.ts0000664000175000017500000000224512256224735025720 0ustar useruser OutputWaveOutFactory WaveOut Plugin About WaveOut Output Plugin Qmmp WaveOut Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player qmmp-0.7.4/src/plugins/Output/waveout/translations/translations.qrc0000664000175000017500000000152112256224735024436 0ustar useruser waveout_plugin_ru.qm waveout_plugin_uk_UA.qm waveout_plugin_zh_CN.qm waveout_plugin_zh_TW.qm waveout_plugin_tr.qm waveout_plugin_cs.qm waveout_plugin_pt_BR.qm waveout_plugin_de.qm waveout_plugin_pl_PL.qm waveout_plugin_fr.qm waveout_plugin_it.qm waveout_plugin_kk.qm waveout_plugin_lt.qm waveout_plugin_hu.qm waveout_plugin_nl.qm waveout_plugin_ja.qm waveout_plugin_sk.qm waveout_plugin_es.qm waveout_plugin_he.qm waveout_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_zh_CN.ts0000664000175000017500000000233112256224735025707 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut 插件 About WaveOut Output Plugin 关于 WaveOut 输出插件 Qmmp WaveOut Output Plugin Qmmp WaveOut 输出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player 基于 aacDECdrop 播放器 qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_zh_TW.ts0000664000175000017500000000233112256224735025741 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut 插件 About WaveOut Output Plugin 關於 WaveOut 匯出插件 Qmmp WaveOut Output Plugin Qmmp WaveOut 匯出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player 基於 aacDECdrop 播放器 qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_de.ts0000664000175000017500000000233512256224735025302 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut-Modul About WaveOut Output Plugin Über WaveOut-Ausgabe-Modul Qmmp WaveOut Output Plugin Qmmp WaveOut-Ausgabe-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Basiert auf dem aacDECdrop-Player qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_cs.ts0000664000175000017500000000234512256224735025320 0ustar useruser OutputWaveOutFactory WaveOut Plugin Modul WaveOut About WaveOut Output Plugin O výstupním modulu WaveOut Qmmp WaveOut Output Plugin Výstupní modul Qmmp WaveOut Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Založeno na přehrávači aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_es.ts0000664000175000017500000000236612256224735025325 0ustar useruser OutputWaveOutFactory WaveOut Plugin Módulo WaveOut About WaveOut Output Plugin Acerca del módulo de salida WaveOut Qmmp WaveOut Output Plugin Módulo de salida WaveOut para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Basado en el reproductor aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_fr.ts0000664000175000017500000000224512256224735025321 0ustar useruser OutputWaveOutFactory WaveOut Plugin About WaveOut Output Plugin Qmmp WaveOut Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_he.ts0000664000175000017500000000240112256224735025300 0ustar useruser OutputWaveOutFactory WaveOut Plugin תוספת WaveOut About WaveOut Output Plugin אודות תוספת WaveOut Qmmp WaveOut Output Plugin תוספת פלט WaveOut ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Based on aacDECdrop player מבוססת על נגן aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_hu.ts0000664000175000017500000000224512256224735025326 0ustar useruser OutputWaveOutFactory WaveOut Plugin About WaveOut Output Plugin Qmmp WaveOut Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_ja.ts0000664000175000017500000000243412256224735025304 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut プラグイン About WaveOut Output Plugin WaveOut 出力プラグインについて Qmmp WaveOut Output Plugin QMMP WaveOut 出力プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Based on aacDECdrop player aacDECdrop プレイヤーを基に作成 qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_it.ts0000664000175000017500000000240312256224735025322 0ustar useruser OutputWaveOutFactory WaveOut Plugin Modulo WaveOut About WaveOut Output Plugin Informazioni sul modulo d'uscita WaveOut Qmmp WaveOut Output Plugin Modulo d'uscita WaveOut per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Basato sul riproduttore audio aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_kk.ts0000664000175000017500000000224512256224735025317 0ustar useruser OutputWaveOutFactory WaveOut Plugin About WaveOut Output Plugin Qmmp WaveOut Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_lt.ts0000664000175000017500000000233312256224735025327 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut įskiepis About WaveOut Output Plugin Apie WaveOut įskiepį Qmmp WaveOut Output Plugin Qmmp WaveOut įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Sukurtas aacDECdrop grotuvo pagrindu qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_nl.ts0000664000175000017500000000234412256224735025323 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut Module About WaveOut Output Plugin Over de WaveOut Output Module Qmmp WaveOut Output Plugin WaveOut Output Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Gebasseerd op de aacDECdrop speler qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_pl.ts0000664000175000017500000000233112256224735025321 0ustar useruser OutputWaveOutFactory WaveOut Plugin Wtyczka WaveOut About WaveOut Output Plugin O wtyczce WaveOut Qmmp WaveOut Output Plugin Wtyczka WaveOut dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Oparta na kodzie odtwarzacza aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_ru.ts0000664000175000017500000000247312256224735025343 0ustar useruser OutputWaveOutFactory WaveOut Plugin Модуль WaveOut About WaveOut Output Plugin О модуле вывода WaveOut Qmmp WaveOut Output Plugin Модуль вывода WaveOut для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Based on aacDECdrop player Основан на базе проигрывателя aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_sk.ts0000664000175000017500000000224512256224735025327 0ustar useruser OutputWaveOutFactory WaveOut Plugin About WaveOut Output Plugin Qmmp WaveOut Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_gl_ES.ts0000664000175000017500000000234012256224735025677 0ustar useruser OutputWaveOutFactory WaveOut Plugin Engadido WaveOut About WaveOut Output Plugin Sobre o engadido WaveOut Qmmp WaveOut Output Plugin Engadido WaveOut de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player Baseado no reprodutor aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_tr.ts0000664000175000017500000000234712256224735025342 0ustar useruser OutputWaveOutFactory WaveOut Plugin WaveOut Eklentisi About WaveOut Output Plugin WaveOut Çıktı Eklentisi Qmmp WaveOut Output Plugin Qmmp WaveOut Çıktı Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> Based on aacDECdrop player aacDECdrop oynatıcısı temellidir qmmp-0.7.4/src/plugins/Output/waveout/translations/waveout_plugin_uk_UA.ts0000664000175000017500000000247112256224735025717 0ustar useruser OutputWaveOutFactory WaveOut Plugin Модуль WaveOut About WaveOut Output Plugin Про модуль виведення WaveOut Qmmp WaveOut Output Plugin Модуль виведення WaveOut для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Based on aacDECdrop player Базується на програвачі aacDECdrop qmmp-0.7.4/src/plugins/Output/waveout/outputwaveout.h0000664000175000017500000000447612256224735021625 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTWAVEOUT_H #define OUTPUTWAVEOUT_H #include #include #include #include /** @author Ilya Kotov */ class OutputWaveOut : public Output { public: OutputWaveOut(); ~OutputWaveOut(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 size); void drain(); void suspend(); void resume(); void reset(); private: // helper functions void status(); void uninitialize(); }; class VolumeWaveOut : public Volume { public: VolumeWaveOut(); ~VolumeWaveOut(); void setVolume(const VolumeSettings &vol); VolumeSettings volume() const; bool isSupported() const; }; #endif // OUTPUTWAVEOUT_H qmmp-0.7.4/src/plugins/Output/waveout/waveout.pro0000664000175000017500000000225212256224735020703 0ustar useruserinclude(../../plugins.pri) HEADERS += outputwaveoutfactory.h \ outputwaveout.h SOURCES += outputwaveoutfactory.cpp \ outputwaveout.cpp HEADERS += ../../../../src/qmmp/output.h TARGET=$$PLUGINS_PREFIX/Output/waveout INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../bin CONFIG += release \ warn_on \ thread \ plugin TEMPLATE = lib LIBS += -lqmmp0 -lwinmm TRANSLATIONS = translations/waveout_plugin_cs.ts \ translations/waveout_plugin_de.ts \ translations/waveout_plugin_zh_CN.ts \ translations/waveout_plugin_zh_TW.ts \ translations/waveout_plugin_ru.ts \ translations/waveout_plugin_pl.ts \ translations/waveout_plugin_uk_UA.ts \ translations/waveout_plugin_it.ts \ translations/waveout_plugin_tr.ts \ translations/waveout_plugin_lt.ts \ translations/waveout_plugin_nl.ts \ translations/waveout_plugin_ja.ts \ translations/waveout_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/pulseaudio/0000775000175000017500000000000012256224735017146 5ustar useruserqmmp-0.7.4/src/plugins/Output/pulseaudio/outputpulseaudio.cpp0000664000175000017500000001022312256224735023303 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ extern "C"{ #include } #include "outputpulseaudio.h" OutputPulseAudio::OutputPulseAudio(): Output() { m_connection = 0; } OutputPulseAudio::~OutputPulseAudio() { uninitialize(); } bool OutputPulseAudio::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) { pa_sample_spec ss; switch (format) { case Qmmp::PCM_S8: ss.format = PA_SAMPLE_U8; break; case Qmmp::PCM_S16LE: ss.format = PA_SAMPLE_S16LE; break; case Qmmp::PCM_S24LE: ss.format = PA_SAMPLE_S24_32LE; break; case Qmmp::PCM_S32LE: ss.format = PA_SAMPLE_S32LE; break; default: ss.format = PA_SAMPLE_S16LE; } ss.channels = chan; ss.rate = freq; int error; m_connection = pa_simple_new(NULL, // Use the default server. "Qmmp", // Our application's name. PA_STREAM_PLAYBACK, NULL, // Use the default device. "Music", // Description of our stream. &ss, // Our sample format. NULL, // Use default channel map NULL, // Use default buffering attributes. &error // Error code. ); if (!m_connection) { qWarning("OutputPulseAudio: pa_simple_new() failed: %s", pa_strerror(error)); return false; } Output::configure(freq, chan, format); return true; } qint64 OutputPulseAudio::latency() { if (!m_connection) return 0; int error = 0; qint64 delay = pa_simple_get_latency(m_connection, &error)/1000; if (error) { qWarning("OutputPulseAudio: %s", pa_strerror (error)); delay = 0; } return delay; } qint64 OutputPulseAudio::writeAudio(unsigned char *data, qint64 maxSize) { int error; if (!m_connection) return -1; int i = 0; if ((i = pa_simple_write(m_connection, data, maxSize, &error)) < 0) { qWarning("OutputPulseAudio: pa_simple_write() failed: %s", pa_strerror(error)); return -1; } return maxSize; } void OutputPulseAudio::drain() { int error; if (m_connection) pa_simple_drain(m_connection, &error); } void OutputPulseAudio::reset() { int error; if (m_connection) pa_simple_flush(m_connection, &error); } void OutputPulseAudio::uninitialize() { if (m_connection) { qDebug("OutputPulseAudio: closing connection"); pa_simple_free(m_connection); m_connection = 0; } } qmmp-0.7.4/src/plugins/Output/pulseaudio/outputpulseaudio.h0000664000175000017500000000403312256224735022752 0ustar useruser/*************************************************************************** * Copyright (C) 2006-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTPULSEAUDIO_H #define OUTPUTPULSEAUDIO_H #include extern "C"{ #include } #include /** @author Ilya Kotov */ class OutputPulseAudio : public Output { public: OutputPulseAudio(); ~OutputPulseAudio(); bool initialize(quint32, int, Qmmp::AudioFormat format); //output api qint64 latency(); qint64 writeAudio(unsigned char *data, qint64 maxSize); void drain(); void reset(); private: // helper functions void uninitialize(); pa_simple *m_connection; }; #endif // OUTPUTPULSEAUDIO_H qmmp-0.7.4/src/plugins/Output/pulseaudio/CMakeLists.txt0000664000175000017500000000314612256224735021712 0ustar useruserproject(libpulseaudio) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # pulseaudio pkg_check_modules(PULSE libpulse-simple>=0.9.15) include_directories(${PULSE_INCLUDE_DIRS}) link_directories(${PULSE_LIBRARY_DIRS}) ADD_DEFINITIONS(${PULSE_CFLAGS}) SET(libpulseaudio_SRCS outputpulseaudio.cpp outputpulseaudiofactory.cpp ) SET(libpulseaudio_MOC_HDRS outputpulseaudiofactory.h ) SET(libpulseaudio_HDRS outputpulseaudio.h ) SET(libpulseaudio_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libpulseaudio_RCC_SRCS ${libpulseaudio_RCCS}) QT4_WRAP_CPP(libpulseaudio_MOC_SRCS ${libpulseaudio_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(PULSE_FOUND) ADD_LIBRARY(pulseaudio MODULE ${libpulseaudio_SRCS} ${libpulseaudio_MOC_SRCS} ${libpulseaudio_UIS_H} ${libpulseaudio_RCC_SRCS} ${libpulseaudio_HDRS}) add_dependencies(pulseaudio qmmp) target_link_libraries(pulseaudio ${QT_LIBRARIES} -lqmmp ${PULSE_LDFLAGS}) install(TARGETS pulseaudio DESTINATION ${LIB_DIR}/qmmp/Output) ENDIF(PULSE_FOUND) qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/0000775000175000017500000000000012256224735021667 5ustar useruserqmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_pt_BR.ts0000664000175000017500000000176112256224735027062 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin About PulseAudio Output Plugin Qmmp PulseAudio Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_zh_CN.ts0000664000175000017500000000204512256224735027051 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio 插件 About PulseAudio Output Plugin 关于 PulseAudio 输出插件 Qmmp PulseAudio Output Plugin Qmmp PulseAudio 输出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_zh_TW.ts0000664000175000017500000000204512256224735027103 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio 插件 About PulseAudio Output Plugin 關於 PulseAudio 匯出插件 Qmmp PulseAudio Output Plugin Qmmp PulseAudio 匯出插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/translations.qrc0000664000175000017500000000161512256224735025122 0ustar useruser pulseaudio_plugin_ru.qm pulseaudio_plugin_uk_UA.qm pulseaudio_plugin_zh_CN.qm pulseaudio_plugin_zh_TW.qm pulseaudio_plugin_tr.qm pulseaudio_plugin_cs.qm pulseaudio_plugin_pt_BR.qm pulseaudio_plugin_de.qm pulseaudio_plugin_pl_PL.qm pulseaudio_plugin_fr.qm pulseaudio_plugin_it.qm pulseaudio_plugin_kk.qm pulseaudio_plugin_lt.qm pulseaudio_plugin_hu.qm pulseaudio_plugin_nl.qm pulseaudio_plugin_ja.qm pulseaudio_plugin_sk.qm pulseaudio_plugin_es.qm pulseaudio_plugin_he.qm pulseaudio_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_gl_ES.ts0000664000175000017500000000205412256224735027041 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Engadido PulseAudio About PulseAudio Output Plugin Sobre o engadido PulseAudio Qmmp PulseAudio Output Plugin Engadido para PulseAudio de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_de.ts0000664000175000017500000000204312256224735026436 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio-Modul About PulseAudio Output Plugin Über PulseAudio-Ausgabe-Modul Qmmp PulseAudio Output Plugin Qmmp PulseAudio-Ausgabe-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_cs.ts0000664000175000017500000000203012256224735026447 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Modul PulseAudio About PulseAudio Output Plugin O modulu PulseAudio Qmmp PulseAudio Output Plugin Výstupní modul Qmmp PulseAudio Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_es.ts0000664000175000017500000000207212256224735026457 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Módulo PulseAudio About PulseAudio Output Plugin Acerca del módulo de salida PulseAudio Qmmp PulseAudio Output Plugin Módulo de salida PulseAudio para Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_fr.ts0000664000175000017500000000176112256224735026463 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin About PulseAudio Output Plugin Qmmp PulseAudio Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_he.ts0000664000175000017500000000211412256224735026441 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin תוספת PulseAudio About PulseAudio Output Plugin אודות תוספת פלט PulseAudio Qmmp PulseAudio Output Plugin תוספת פלט PulseAudio ‫Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_hu.ts0000664000175000017500000000176112256224735026470 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin About PulseAudio Output Plugin Qmmp PulseAudio Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_ja.ts0000664000175000017500000000213212256224735026437 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio プラグイン About PulseAudio Output Plugin PulseAudio 出力プラグインについて Qmmp PulseAudio Output Plugin QMMP PulseAudio 出力プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_it.ts0000664000175000017500000000207712256224735026471 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin MOdulo PulseAudio About PulseAudio Output Plugin Informazioni sul Modulo d'uscita PulseAudio Qmmp PulseAudio Output Plugin Modulo d'uscita PulseAudio per Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_kk.ts0000664000175000017500000000176112256224735026461 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin About PulseAudio Output Plugin Qmmp PulseAudio Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_lt.ts0000664000175000017500000000203612256224735026467 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio įskiepis About PulseAudio Output Plugin Apie PulseAudio įskiepį Qmmp PulseAudio Output Plugin PulseAudio Qmmp įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_nl.ts0000664000175000017500000000206112256224735026457 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio Module About PulseAudio Output Plugin Over de PulseAudio Uitvoer Module Qmmp PulseAudio Output Plugin PulseAudio Audio Uitvoer Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_pl.ts0000664000175000017500000000202612256224735026462 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Wtyczka PulseAudio About PulseAudio Output Plugin O wtyczce PulseAudio Qmmp PulseAudio Output Plugin Wtyczka PulseAudio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_ru.ts0000664000175000017500000000214012256224735026472 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Модуль PulseAudio About PulseAudio Output Plugin О модуле вывода PulseAudio Qmmp PulseAudio Output Plugin Модуль вывода PulseAudio для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_sk.ts0000664000175000017500000000176112256224735026471 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin About PulseAudio Output Plugin Qmmp PulseAudio Output Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_tr.ts0000664000175000017500000000207312256224735026476 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin PulseAudio Eklentisi About PulseAudio Output Plugin PulseAudio Çıkışı Eklentisi Hakkında Qmmp PulseAudio Output Plugin Qmmp PulseAudio Çıkışı Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_uk_UA.ts0000664000175000017500000000215112256224735027052 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Модуль PulseAudio About PulseAudio Output Plugin Про модуль виведення PulseAudio Qmmp PulseAudio Output Plugin Модуль виведення PulseAudio для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/translations/pulseaudio_plugin_pl_PL.ts0000664000175000017500000000202612256224735027055 0ustar useruser OutputPulseAudioFactory PulseAudio Plugin Wtyczka PulseAudio About PulseAudio Output Plugin O wtyczce PulseAudio Qmmp PulseAudio Output Plugin Wtyczka PulseAudio dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Output/pulseaudio/pulseaudio.pro0000664000175000017500000000242212256224735022042 0ustar useruserinclude(../../plugins.pri) HEADERS += outputpulseaudiofactory.h \ outputpulseaudio.h SOURCES += outputpulseaudiofactory.cpp \ outputpulseaudio.cpp TARGET=$$PLUGINS_PREFIX/Output/pulseaudio QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/libpulseaudio.so INCLUDEPATH += ../../../ QMAKE_LIBDIR += ../../../../lib CONFIG += release \ warn_on \ thread \ plugin \ link_pkgconfig TEMPLATE = lib LIBS += -lqmmp PKGCONFIG += libpulse-simple TRANSLATIONS = translations/pulseaudio_plugin_cs.ts \ translations/pulseaudio_plugin_de.ts \ translations/pulseaudio_plugin_zh_CN.ts \ translations/pulseaudio_plugin_zh_TW.ts \ translations/pulseaudio_plugin_ru.ts \ translations/pulseaudio_plugin_pl.ts \ translations/pulseaudio_plugin_uk_UA.ts \ translations/pulseaudio_plugin_it.ts \ translations/pulseaudio_plugin_tr.ts \ translations/pulseaudio_plugin_lt.ts \ translations/pulseaudio_plugin_nl.ts \ translations/pulseaudio_plugin_ja.ts \ translations/pulseaudio_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty (LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Output INSTALLS += target qmmp-0.7.4/src/plugins/Output/pulseaudio/outputpulseaudiofactory.h0000664000175000017500000000377612256224735024357 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef OUTPUTPULSEAUDIOFACTORY_H #define OUTPUTPULSEAUDIOFACTORY_H #include #include #include #include #include #include class OutputPulseAudioFactory : public QObject, OutputFactory { Q_OBJECT Q_INTERFACES(OutputFactory) public: const OutputProperties properties() const; Output* create(); Volume *createVolume(); void showSettings(QWidget* parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Output/pulseaudio/outputpulseaudiofactory.cpp0000664000175000017500000000517412256224735024704 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "outputpulseaudio.h" #include "outputpulseaudiofactory.h" const OutputProperties OutputPulseAudioFactory::properties() const { OutputProperties properties; properties.name = tr("PulseAudio Plugin"); properties.hasAbout = true; properties.hasSettings = false; properties.shortName = "pulse"; return properties; } Output* OutputPulseAudioFactory::create() { return new OutputPulseAudio(); } Volume *OutputPulseAudioFactory::createVolume() { return 0; } void OutputPulseAudioFactory::showSettings(QWidget* parent) { Q_UNUSED(parent); } void OutputPulseAudioFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About PulseAudio Output Plugin"), tr("Qmmp PulseAudio Output Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *OutputPulseAudioFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/pulseaudio_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(pulseaudio, OutputPulseAudioFactory) qmmp-0.7.4/src/plugins/Visual/0000775000175000017500000000000012256224735014737 5ustar useruserqmmp-0.7.4/src/plugins/Visual/CMakeLists.txt0000664000175000017500000000041012256224735017472 0ustar useruserSET(USE_ANALYZER TRUE CACHE BOOL "enable/disable analyzer plugin") SET(USE_PROJECTM TRUE CACHE BOOL "enable/disable projectm plugin") IF(USE_ANALYZER) add_subdirectory(analyzer) ENDIF(USE_ANALYZER) IF(USE_PROJECTM) add_subdirectory(projectm) ENDIF(USE_PROJECTM) qmmp-0.7.4/src/plugins/Visual/projectm/0000775000175000017500000000000012256224735016562 5ustar useruserqmmp-0.7.4/src/plugins/Visual/projectm/visualprojectmfactory.cpp0000664000175000017500000000532612256224735023733 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "visualprojectmfactory.h" #include "projectmplugin.h" const VisualProperties VisualProjectMFactory::properties() const { VisualProperties properties; properties.name = tr("ProjectM"); properties.shortName = "projectm"; properties.hasSettings = false; properties.hasAbout = true; return properties; } Visual *VisualProjectMFactory::create(QWidget *parent) { return new ProjectMPlugin(parent); } QDialog *VisualProjectMFactory::createConfigDialog(QWidget *parent) { Q_UNUSED(parent); return 0; } void VisualProjectMFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About ProjectM Visual Plugin"), tr("Qmmp ProjectM Visual Plugin")+"\n"+ tr("This plugin adds projectM visualization")+"\n"+ tr("Written by: Ilya Kotov ")+"\n"+ tr("Based on llibrojectM-qt library")); } QTranslator *VisualProjectMFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/projectm_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(projectm,VisualProjectMFactory) qmmp-0.7.4/src/plugins/Visual/projectm/projectmwidget.h0000664000175000017500000000435712256224735021773 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PROJECTMWIDGET_H #define PROJECTMWIDGET_H #include class QMenu; class projectM; /** @author Ilya Kotov */ class ProjectMWidget : public QGLWidget { Q_OBJECT public: ProjectMWidget(QWidget *parent = 0); ~ProjectMWidget(); projectM *projectMInstance(); protected: virtual void initializeGL(); virtual void resizeGL(int width, int height); virtual void paintGL(); virtual void mousePressEvent (QMouseEvent *event); private slots: void showHelp(); void showPresetName(); void showTitle(); void nextPreset(); void previousPreset(); void randomPreset(); void lockPreset(); void fullScreen(); void updateTitle(); private: void createActions(); projectM *m_projectM; QMenu *m_menu; }; #endif qmmp-0.7.4/src/plugins/Visual/projectm/CMakeLists.txt0000664000175000017500000000373312256224735021330 0ustar useruserproject(libprojectm) cmake_minimum_required(VERSION 2.4.7) SET (QT_USE_QTOPENGL TRUE) INCLUDE(FindQt4) include(${QT_USE_FILE}) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) cmake_policy(SET CMP0005 OLD) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # projectM pkg_search_module(PROJECTM libprojectM) pkg_search_module(PROJECTM_20 libprojectM>=2.0.0) ADD_DEFINITIONS(${PROJECTM_CFLAGS}) IF(PROJECTM_20_FOUND) ADD_DEFINITIONS(-DPROJECTM_20) ENDIF(PROJECTM_20_FOUND) find_file(PROJECTM_CONFIG config.inp PATHS "/usr/share/projectM/" "/usr/local/share/projectM/") IF(PROJECTM_CONFIG) ADD_DEFINITIONS(-DPROJECTM_CONFIG=\\\"${PROJECTM_CONFIG}\\\") MESSAGE(STATUS "Found projectM configuration: ${PROJECTM_CONFIG}") ENDIF(PROJECTM_CONFIG) SET(libprojectm_SRCS projectmwidget.cpp projectmplugin.cpp visualprojectmfactory.cpp ) SET(libprojectm_MOC_HDRS projectmwidget.h projectmplugin.h visualprojectmfactory.h ) SET(libprojectm_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libprojectm_RCC_SRCS ${libprojectm_RCCS}) QT4_WRAP_CPP(libprojectm_MOC_SRCS ${libprojectm_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) IF(PROJECTM_FOUND) ADD_LIBRARY(projectm MODULE ${libprojectm_SRCS} ${libprojectm_MOC_SRCS} ${libprojectm_RCC_SRCS}) add_dependencies(projectm qmmp) target_link_libraries(projectm ${QT_LIBRARIES} -lqmmp ${PROJECTM_LDFLAGS} -lGL) install(TARGETS projectm DESTINATION ${LIB_DIR}/qmmp/Visual) ENDIF(PROJECTM_FOUND) qmmp-0.7.4/src/plugins/Visual/projectm/visualprojectmfactory.h0000664000175000017500000000373212256224735023377 0ustar useruser/*************************************************************************** * Copyright (C) 2009 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VISUALPROJECTMFACTORY_H #define VISUALPROJECTMFACTORY_H #include #include #include /** @author Ilya Kotov */ class VisualProjectMFactory : public QObject, public VisualFactory { Q_OBJECT Q_INTERFACES(VisualFactory); public: const VisualProperties properties() const; Visual *create(QWidget *parent); QDialog *createConfigDialog(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/Visual/projectm/projectmwidget.cpp0000664000175000017500000001472012256224735022321 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * Copyright (C) 2007 by projectM team * * * * Carmelo Piccione carmelo.piccione+projectM@gmail.com * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "projectmwidget.h" #ifndef PROJECTM_CONFIG #define PROJECTM_CONFIG "/usr/share/projectM/config.inp" #endif ProjectMWidget::ProjectMWidget(QWidget *parent) : QGLWidget(parent) { setMouseTracking(true); m_projectM = 0; QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()),SLOT(updateGL ())); timer->start(0); m_menu = new QMenu(this); connect(SoundCore::instance(), SIGNAL(metaDataChanged()), SLOT(updateTitle())); } ProjectMWidget::~ProjectMWidget() { if (m_projectM) delete m_projectM; m_projectM = 0; } projectM *ProjectMWidget::projectMInstance() { return m_projectM; } void ProjectMWidget::initializeGL() { glShadeModel(GL_SMOOTH); glClearColor(0,0,0,0); // Setup our viewport glViewport(0, 0, width(), height()); // Change to the projection matrix and set our viewing volume. glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDrawBuffer(GL_BACK); glReadBuffer(GL_BACK); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); glEnable(GL_POINT_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glLineStipple(2, 0xAAAA); if (!m_projectM) { m_projectM = new projectM(PROJECTM_CONFIG, projectM::FLAG_DISABLE_PLAYLIST_LOAD); QString presetPath (m_projectM->settings().presetURL.c_str()); QDir presetDir(presetPath); presetDir.setFilter(QDir::Files); QStringList filters; filters << "*.prjm" << "*.milk"; QFileInfoList l = presetDir.entryInfoList(filters); #ifdef PROJECTM_20 RatingList list; list.push_back(3); list.push_back(3); #endif foreach (QFileInfo info, l) { #if PROJECTM_20 m_projectM->addPresetURL (info.absoluteFilePath().toStdString(), info.fileName().toStdString(), list); #else m_projectM->addPresetURL (info.absoluteFilePath().toStdString(), info.fileName().toStdString(), 1); #endif } createActions(); updateTitle(); } } void ProjectMWidget::resizeGL (int w, int h) { if (m_projectM) { m_projectM->projectM_resetGL(w, h); initializeGL(); } } void ProjectMWidget::paintGL() { if (m_projectM) m_projectM->renderFrame(); } void ProjectMWidget::mousePressEvent (QMouseEvent *event) { if (event->button () == Qt::RightButton) m_menu->exec(event->globalPos()); } void ProjectMWidget::createActions() { m_menu->addAction(tr("&Help"), this, SLOT(showHelp()), tr("F1")); m_menu->addAction(tr("&Show Song Title"), this, SLOT(showTitle()), tr("F2")); m_menu->addAction(tr("&Show Preset Name"), this, SLOT(showPresetName()), tr("F3")); m_menu->addSeparator(); m_menu->addAction(tr("&Next Preset"), this, SLOT(nextPreset()), tr("N")); m_menu->addAction(tr("&Previous Preset"), this, SLOT(previousPreset()), tr("P")); m_menu->addAction(tr("&Random Preset"), this, SLOT(randomPreset()), tr("R")); m_menu->addAction(tr("&Lock Preset"), this, SLOT(lockPreset()), tr("L")); m_menu->addSeparator(); m_menu->addAction(tr("&Fullscreen"), this, SLOT(fullScreen()), tr("F")); m_menu->addSeparator(); parentWidget()->addActions(m_menu->actions()); } void ProjectMWidget::showHelp() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_F1, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::showPresetName() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_F3, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::showTitle() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_F2, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::nextPreset() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_n, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::previousPreset() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_p, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::randomPreset() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_r, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::lockPreset() { m_projectM->key_handler(PROJECTM_KEYDOWN, PROJECTM_K_l, PROJECTM_KMOD_LSHIFT); } void ProjectMWidget::fullScreen() { parentWidget()->setWindowState (parentWidget()->windowState() ^Qt::WindowFullScreen); } void ProjectMWidget::updateTitle() { std::string artist = SoundCore::instance()->metaData(Qmmp::ARTIST).toLocal8Bit().constData(); std::string title = SoundCore::instance()->metaData(Qmmp::TITLE).toLocal8Bit().constData(); m_projectM->projectM_setTitle(artist + " - " + title); } qmmp-0.7.4/src/plugins/Visual/projectm/translations/0000775000175000017500000000000012256224735021303 5ustar useruserqmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_uk_UA.ts0000664000175000017500000001133512256224735026143 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help &Довідка F1 &Show Song Title &Показати назву пісні F2 &Show Preset Name &Показати ім'я предустановки F3 &Next Preset &Наступна предустановка N &Previous Preset &Попередня предустановка P &Random Preset &Випадкова предустановка R &Lock Preset &Заблокувати предустановку L &Fullscreen &Повноекранний режим F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Про модуль ProjectM для Qmmp Qmmp ProjectM Visual Plugin Модуль projectM для Qmmp This plugin adds projectM visualization Цей модуль додає візуалізацію projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> Based on llibrojectM-qt library Базується на бібліотеці libprojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_pl_PL.ts0000664000175000017500000001070212256224735026142 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help &Pomoc F1 &Show Song Title Pokaż &tytuł utworu F2 &Show Preset Name Pokaż nazwę &Wizualizacji F3 &Next Preset &Następna animacja N &Previous Preset &Poprzednia animacja P &Random Preset &Losowa animacja R R &Lock Preset &Zablokuj animację L L &Fullscreen P&ełny ekran F VisualProjectMFactory ProjectM About ProjectM Visual Plugin O Wtyczce ProjectM Qmmp ProjectM Visual Plugin Wtyczka ProjectM dla Qmmp This plugin adds projectM visualization Ta wtyczka dodaje obsługę wizualizacji projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Oparta na bibliotece llibrojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/translations.qrc0000664000175000017500000000154512256224735024540 0ustar useruser projectm_plugin_ru.qm projectm_plugin_uk_UA.qm projectm_plugin_zh_CN.qm projectm_plugin_zh_TW.qm projectm_plugin_tr.qm projectm_plugin_cs.qm projectm_plugin_pt_BR.qm projectm_plugin_de.qm projectm_plugin_pl_PL.qm projectm_plugin_fr.qm projectm_plugin_it.qm projectm_plugin_kk.qm projectm_plugin_lt.qm projectm_plugin_hu.qm projectm_plugin_nl.qm projectm_plugin_ja.qm projectm_plugin_sk.qm projectm_plugin_es.qm projectm_plugin_he.qm projectm_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_de.ts0000664000175000017500000001106112256224735025523 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Hilfe F1 F1 &Show Song Title Na&me des Titels anzeigen F2 F2 &Show Preset Name N&ame der Voreinstellung anzeigen F3 F3 &Next Preset &Nächste Voreinstellung N N &Previous Preset Vor&herige Voreinstellung P H &Random Preset &Zufällige Voreinstellung R Z &Lock Preset V&oreinstellung sperren L O &Fullscreen &Vollbild F V VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin Über ProjectM-Visualisierungsmodul Qmmp ProjectM Visual Plugin Qmmp ProjectM-Visualisierungsmodul This plugin adds projectM visualization Dieses Modul fügt Unterstützung für ProjectM-Visualisierungen hinzu Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Basiert auf der libprojectM-Qt-Bibliothek qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_cs.ts0000664000175000017500000001100712256224735025540 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Nápověda F1 F1 &Show Song Title &Zobrazit název skladby F2 F2 &Show Preset Name Zobrazit název &předvoleb F3 F3 &Next Preset &Další předvolby N N &Previous Preset Př&edchozí předvolby P P &Random Preset Ná&hodné předvolby R R &Lock Preset U&zamknout předvolby L L &Fullscreen &Celá obrazovka F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin O vizualizačním modulu ProjectM Qmmp ProjectM Visual Plugin Vizualizační modul Qmmp ProjectM This plugin adds projectM visualization Tento modul přidává vizualizaci ProjectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Založeno na knihovně libprojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_es.ts0000664000175000017500000001103512256224735025543 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Ayuda F1 F1 &Show Song Title &Mostrar el título de la canción F2 F2 &Show Preset Name &Mostrar nombre preprogramado F3 F3 &Next Preset &Preprogramado siguiente N N &Previous Preset &Preprogramado anterior P P &Random Preset &Preprogramado aleatorio R R &Lock Preset &Bloquear preprogramado L L &Fullscreen &Pantalla completa F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin Acerca del módulo visual ProjectM Qmmp ProjectM Visual Plugin Módulo visual Projectm para Qmmp This plugin adds projectM visualization Este módulo añade visualización projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Basado en la librería llibrojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_fr.ts0000664000175000017500000001100612256224735025541 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help F1 &Show Song Title F2 &Show Preset Name F3 &Next Preset N &Previous Preset P &Random Preset R &Lock Preset L &Fullscreen F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Qmmp ProjectM Visual Plugin This plugin adds projectM visualization Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_he.ts0000664000175000017500000001102712256224735025531 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help &עזרה F1 &Show Song Title הצג &כותרת שיר F2 &Show Preset Name הצג &שם קביעה F3 &Next Preset קביעה &באה N &Previous Preset קביעה &קודמת P &Random Preset קביעה &אקריאת R &Lock Preset &נעל קביעה L &Fullscreen &מסך מלא F VisualProjectMFactory ProjectM About ProjectM Visual Plugin אודות תוספת חיזוי ProjectM Qmmp ProjectM Visual Plugin תוספת חיזוי ProjectM ‫Qmmp This plugin adds projectM visualization תוספת זו מוסיפה חיזוי של ProjectM Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> Based on llibrojectM-qt library מבוססת על ספריית llibrojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_hu.ts0000664000175000017500000001100612256224735025546 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help F1 &Show Song Title F2 &Show Preset Name F3 &Next Preset N &Previous Preset P &Random Preset R &Lock Preset L &Fullscreen F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Qmmp ProjectM Visual Plugin This plugin adds projectM visualization Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_ja.ts0000664000175000017500000001116412256224735025531 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help ヘルプ(&H) F1 F1 &Show Song Title 曲名を表示(&S) F2 F2 &Show Preset Name プリセット名を表示(&H) F3 F3 &Next Preset 次のプリセット(&N) N N &Previous Preset 前のプリセット(&P) P P &Random Preset プリセットを無作為に(&R) R R &Lock Preset プリセットをロック(&L) L L &Fullscreen フルスクリーン(&F) F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin ProjectM 視覚効果プラグインについて Qmmp ProjectM Visual Plugin QMMP ProjectM 視覚効果プラグイン This plugin adds projectM visualization このプラグインは ProjectM 視覚効果を加えます Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> Based on llibrojectM-qt library libprojectM ライブラリを基に作成 qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_it.ts0000664000175000017500000001113112256224735025545 0ustar useruser ProjectMPlugin ProjectM Visualizzatore musicale ProjectM ProjectMWidget &Help Aiuto F1 F1 &Show Song Title Mostra il titolo del brano F2 F2 &Show Preset Name Mostra nome del brano programmato F3 F3 &Next Preset Brano programmato successivo N N &Previous Preset >Brano programmato precedente P P &Random Preset Brano programmato casuale R R &Lock Preset Blocca programmazione L L &Fullscreen &Schermo intero F F VisualProjectMFactory ProjectM Visualizzatore musicale ProjectM About ProjectM Visual Plugin Informazioni sul visualizzatore musicale ProjectM Qmmp ProjectM Visual Plugin Modulo Visulaizzatore Projectm per Qmmp This plugin adds projectM visualization Questo modulo aggiunge visualizzazione musicale dei brani grazie a projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Basato sulla libreria llibrojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_kk.ts0000664000175000017500000001100612256224735025537 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help F1 &Show Song Title F2 &Show Preset Name F3 &Next Preset N &Previous Preset P &Random Preset R &Lock Preset L &Fullscreen F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Qmmp ProjectM Visual Plugin This plugin adds projectM visualization Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_pt_BR.ts0000664000175000017500000001100612256224735026140 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help F1 &Show Song Title F2 &Show Preset Name F3 &Next Preset N &Previous Preset P &Random Preset R &Lock Preset L &Fullscreen F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Qmmp ProjectM Visual Plugin This plugin adds projectM visualization Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_lt.ts0000664000175000017500000001120112256224735025546 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Pagalba F1 &Show Song Title &Rodyti dainos pavadinimą F2 &Show Preset Name &Rodyti vizualizacijos pavadinimą F3 &Next Preset &Sekanti N &Previous Preset &Atgal P &Random Preset &Atsitiktinė R &Lock Preset &Užrakinti L &Fullscreen &Visas ekranas F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin Apie Qmmp vizualizacijos įskiepį Qmmp ProjectM Visual Plugin Qmmp ProjectM vizualizacijos įskiepis This plugin adds projectM visualization Šis įskiepis leidžia naudoti projectM vizualizacijas Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Sukurta libprojectM-qt pagrindu qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_nl.ts0000664000175000017500000001077712256224735025561 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Hulp F1 &Show Song Title &Weergeef Titel van Nummer F2 &Show Preset Name &Weergeef Naam van Voorinstellingen F3 &Next Preset &Volgende Instelling N &Previous Preset &Vorige Instelling P &Random Preset &Willekeurige Instelling R &Lock Preset &Zet Instelling Vast L &Fullscreen &Volledig scherm F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin Over de ProjectM Visuele Module Qmmp ProjectM Visual Plugin ProjectM Visuele Module voor Qmmp This plugin adds projectM visualization Deze plugin voegt projectM visualisatie toe Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Gebasseerd op de libprojectM-qt bibliotheek qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_pl.ts0000664000175000017500000001070212256224735025547 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help &Pomoc F1 &Show Song Title Pokaż &tytuł utworu F2 &Show Preset Name Pokaż nazwę &Wizualizacji F3 &Next Preset &Następna animacja N &Previous Preset &Poprzednia animacja P &Random Preset &Losowa animacja R R &Lock Preset &Zablokuj animację L L &Fullscreen P&ełny ekran F VisualProjectMFactory ProjectM About ProjectM Visual Plugin O Wtyczce ProjectM Qmmp ProjectM Visual Plugin Wtyczka ProjectM dla Qmmp This plugin adds projectM visualization Ta wtyczka dodaje obsługę wizualizacji projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Oparta na bibliotece llibrojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_ru.ts0000664000175000017500000001165312256224735025570 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help &Справка F1 &Show Song Title &Показать название песни F2 &Show Preset Name &Показать имя предустановки F3 &Next Preset &Следующая предустановка N &Previous Preset &Предыдущая предустановка P &Random Preset &Случайная предустановка R &Lock Preset &Заблокировать предустановку L &Fullscreen &Полноэкранный режим F VisualProjectMFactory ProjectM About ProjectM Visual Plugin О модуле ProjectM для Qmmp Qmmp ProjectM Visual Plugin Модуль projectM для Qmmp This plugin adds projectM visualization Этот модуль добавляет визуализацию projectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> Based on llibrojectM-qt library Основан на базе библиотеки libprojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_sk.ts0000664000175000017500000001100612256224735025547 0ustar useruser ProjectMPlugin ProjectM ProjectMWidget &Help F1 &Show Song Title F2 &Show Preset Name F3 &Next Preset N &Previous Preset P &Random Preset R &Lock Preset L &Fullscreen F VisualProjectMFactory ProjectM About ProjectM Visual Plugin Qmmp ProjectM Visual Plugin This plugin adds projectM visualization Written by: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_tr.ts0000664000175000017500000001074512256224735025570 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Yardım F1 F1 &Show Song Title &Şarkı Başlığını Göster F2 F2 &Show Preset Name &Preset Adını Göster F3 F3 &Next Preset &Sonraki Preset N N &Previous Preset &Önceki Preset P P &Random Preset &Rastgele Preset R R &Lock Preset Preset &Kilitle L L &Fullscreen &Tam Ekran F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin ProjectM Görsel Eklenti Hakkında Qmmp ProjectM Visual Plugin Qmmp ProjectM Görsel Eklentisi This plugin adds projectM visualization Bu eklenti projectM görselliğini ekler Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library librojectM qt kitaplığı temellidir qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_zh_CN.ts0000664000175000017500000001077312256224735026145 0ustar useruser ProjectMPlugin ProjectM projectM ProjectMWidget &Help 帮助(&H) F1 F1 &Show Song Title 显示歌曲标题(&S) F2 F2 &Show Preset Name 显示边框形式名称(&S) F3 F3 &Next Preset 下一边框形式(&N) N N &Previous Preset 上一边框形式(&P) P P &Random Preset 随意边框形式(&R) R R &Lock Preset 锁定边框形式(&L) L L &Fullscreen 全屏(&F) F F VisualProjectMFactory ProjectM projectM About ProjectM Visual Plugin 关于 ProjectM 可视化插件 Qmmp ProjectM Visual Plugin Qmmp ProjectM 可视化插件 This plugin adds projectM visualization 此插件添加 projectM 可视化 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library 基于 llibrojectM-qt 库 qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_zh_TW.ts0000664000175000017500000001100112256224735026160 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help 幫助(&H) F1 F1 &Show Song Title 顯示曲目標題(&S) F2 F2 &Show Preset Name 顯示邊框形式名稱(&S) F3 F3 &Next Preset 下一邊框形式(&N) N N &Previous Preset 上一邊框形式(&P) P P &Random Preset 隨意邊框形式(&R) R R &Lock Preset 鎖定邊框形式(&L) L L &Fullscreen 全屏(&F) F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin 關於 ProjectM 可視化插件 Qmmp ProjectM Visual Plugin Qmmp ProjectM 可視化插件 This plugin adds projectM visualization 此插件添加 ProjectM 可視化 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library 基於 llibrojectM-qt 程式庫 qmmp-0.7.4/src/plugins/Visual/projectm/translations/projectm_plugin_gl_ES.ts0000664000175000017500000001075312256224735026133 0ustar useruser ProjectMPlugin ProjectM ProjectM ProjectMWidget &Help &Axuda F1 F1 &Show Song Title &Amosar título de canción F2 F2 &Show Preset Name &Amosar nome de perfil F3 F3 &Next Preset &Perfil seguinte N N &Previous Preset &Perfil anterior P P &Random Preset &Perfil aleatorio R R &Lock Preset &Bloquear perfil L L &Fullscreen &Pantalla completa F F VisualProjectMFactory ProjectM ProjectM About ProjectM Visual Plugin Sobre o engadido visual ProjectM Qmmp ProjectM Visual Plugin Engadido ProjectM de Qmmp This plugin adds projectM visualization Este engadido provén visualización ProjectM Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> Based on llibrojectM-qt library Baseado na libraría libprojectM-qt qmmp-0.7.4/src/plugins/Visual/projectm/projectmplugin.cpp0000664000175000017500000000560412256224735022335 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include "projectmwidget.h" #include "projectmplugin.h" ProjectMPlugin::ProjectMPlugin (QWidget *parent) : Visual (parent) { setlocale(LC_NUMERIC, "C"); //fixes problem with none-english locales setWindowTitle(tr("ProjectM")); m_projectMWidget = new ProjectMWidget(this); QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(m_projectMWidget); layout->setContentsMargins(0,0,0,0); setLayout(layout); resize(300,300); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); restoreGeometry(settings.value("ProjectM/geometry").toByteArray()); } ProjectMPlugin::~ProjectMPlugin() {} void ProjectMPlugin::clear() { update(); } void ProjectMPlugin::add (unsigned char *data, qint64 size, int chan) { Q_UNUSED(chan); //TODO multichannel support if (m_projectMWidget->projectMInstance()) m_projectMWidget->projectMInstance()->pcm()->addPCM16Data((short *)data, size/4); } void ProjectMPlugin::closeEvent (QCloseEvent *event) { //save geometry QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("ProjectM/geometry", saveGeometry()); Visual::closeEvent(event); //removes visualization object } qmmp-0.7.4/src/plugins/Visual/projectm/projectmplugin.h0000664000175000017500000000362712256224735022005 0ustar useruser/*************************************************************************** * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PROJECTMPLUGIN_H #define PROJECTMPLUGIN_H #include #include class QTimer; class Buffer; class ProjectMWidget; class ProjectMPlugin : public Visual { Q_OBJECT public: ProjectMPlugin(QWidget *parent = 0); virtual ~ProjectMPlugin(); void add(unsigned char *data, qint64 size, int chan); void clear(); private: void closeEvent(QCloseEvent *event); QTimer *m_timer; ProjectMWidget *m_projectMWidget; }; #endif qmmp-0.7.4/src/plugins/Visual/projectm/projectm.pro0000664000175000017500000000324312256224735021131 0ustar useruserinclude(../../plugins.pri) contains(CONFIG, WITH_PROJECTM20){ DEFINES += PROJECTM_20 } TARGET =$$PLUGINS_PREFIX/Visual/projectm QMAKE_CLEAN =$$PLUGINS_PREFIX/Visual/libprojectm.so HEADERS += projectmwidget.h \ visualprojectmfactory.h \ projectmplugin.h SOURCES += projectmplugin.cpp \ visualprojectmfactory.cpp \ projectmwidget.cpp INCLUDEPATH += ../../../ CONFIG += warn_on \ plugin \ link_pkgconfig PKGCONFIG += libprojectM TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib QT += opengl LIBS += -lqmmp -L/usr/lib -I/usr/include TRANSLATIONS = translations/projectm_plugin_cs.ts \ translations/projectm_plugin_de.ts \ translations/projectm_plugin_zh_CN.ts \ translations/projectm_plugin_zh_TW.ts \ translations/projectm_plugin_pl.ts \ translations/projectm_plugin_ru.ts \ translations/projectm_plugin_uk_UA.ts \ translations/projectm_plugin_it.ts \ translations/projectm_plugin_tr.ts \ translations/projectm_plugin_lt.ts \ translations/projectm_plugin_nl.ts \ translations/projectm_plugin_ja.ts \ translations/projectm_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Visual INSTALLS += target #projectM config path PROJECTM_CONFIG_FILES = /usr/share/projectM/config.inp \ /usr/local/share/projectM/config.inp for(path, PROJECTM_CONFIG_FILES) { exists($$path) { message ("found projectm configuration: "$$path) DEFINES += PROJECTM_CONFIG=\\\"$$path\\\" } } qmmp-0.7.4/src/plugins/Visual/Visual.pro0000664000175000017500000000020712256224735016723 0ustar useruserinclude(../../../qmmp.pri) TEMPLATE = subdirs SUBDIRS += analyzer unix{ contains(CONFIG, PROJECTM_PLUGIN){ SUBDIRS += projectm } } qmmp-0.7.4/src/plugins/Visual/analyzer/0000775000175000017500000000000012256224735016564 5ustar useruserqmmp-0.7.4/src/plugins/Visual/analyzer/fft.c0000664000175000017500000002154712256224735017520 0ustar useruser/* fft.c: Iterative implementation of a FFT * Copyright (C) 1999 Richard Boulton * Convolution stuff by Ralph Loader * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * TODO * Remove compiling in of FFT_BUFFER_SIZE? (Might slow things down, but would * be nice to be able to change size at runtime.) * Finish making / checking thread-safety. * More optimisations. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "fft.h" //#include #include #include #ifndef PI #ifdef M_PI #define PI M_PI #else #define PI 3.14159265358979323846 /* pi */ #endif #endif /* ########### */ /* # Structs # */ /* ########### */ struct _struct_fft_state { /* Temporary data stores to perform FFT in. */ float real[FFT_BUFFER_SIZE]; float imag[FFT_BUFFER_SIZE]; }; /* ############################# */ /* # Local function prototypes # */ /* ############################# */ static void fft_prepare(const sound_sample * input, float *re, float *im); static void fft_calculate(float *re, float *im); static void fft_output(const float *re, const float *im, float *output); static int reverseBits(unsigned int initial); /* #################### */ /* # Global variables # */ /* #################### */ /* Table to speed up bit reverse copy */ static unsigned int bitReverse[FFT_BUFFER_SIZE]; /* The next two tables could be made to use less space in memory, since they * overlap hugely, but hey. */ static float sintable[FFT_BUFFER_SIZE / 2]; static float costable[FFT_BUFFER_SIZE / 2]; /* ############################## */ /* # Externally called routines # */ /* ############################## */ /* --------- */ /* FFT stuff */ /* --------- */ /* * Initialisation routine - sets up tables and space to work in. * Returns a pointer to internal state, to be used when performing calls. * On error, returns NULL. * The pointer should be freed when it is finished with, by fft_close(). */ fft_state * fft_init(void) { fft_state *state; unsigned int i; state = (fft_state *) malloc(sizeof(fft_state)); if (!state) return NULL; for (i = 0; i < FFT_BUFFER_SIZE; i++) { bitReverse[i] = reverseBits(i); } for (i = 0; i < FFT_BUFFER_SIZE / 2; i++) { float j = 2 * PI * i / FFT_BUFFER_SIZE; costable[i] = cos(j); sintable[i] = sin(j); } return state; } /* * Do all the steps of the FFT, taking as input sound data (as described in * sound.h) and returning the intensities of each frequency as floats in the * range 0 to ((FFT_BUFFER_SIZE / 2) * 32768) ^ 2 * * FIXME - the above range assumes no frequencies present have an amplitude * larger than that of the sample variation. But this is false: we could have * a wave such that its maximums are always between samples, and it's just * inside the representable range at the places samples get taken. * Question: what _is_ the maximum value possible. Twice that value? Root * two times that value? Hmmm. Think it depends on the frequency, too. * * The input array is assumed to have FFT_BUFFER_SIZE elements, * and the output array is assumed to have (FFT_BUFFER_SIZE / 2 + 1) elements. * state is a (non-NULL) pointer returned by fft_init. */ void fft_perform(const sound_sample * input, float *output, fft_state * state) { /* Convert data from sound format to be ready for FFT */ fft_prepare(input, state->real, state->imag); /* Do the actual FFT */ fft_calculate(state->real, state->imag); /* Convert the FFT output into intensities */ fft_output(state->real, state->imag, output); } /* * Free the state. */ void fft_close(fft_state * state) { if (state) free(state); } /* ########################### */ /* # Locally called routines # */ /* ########################### */ /* * Prepare data to perform an FFT on */ static void fft_prepare(const sound_sample * input, float *re, float *im) { unsigned int i; float *realptr = re; float *imagptr = im; /* Get input, in reverse bit order */ for (i = 0; i < FFT_BUFFER_SIZE; i++) { *realptr++ = input[bitReverse[i]]; *imagptr++ = 0; } } /* * Take result of an FFT and calculate the intensities of each frequency * Note: only produces half as many data points as the input had. * This is roughly a consequence of the Nyquist sampling theorm thingy. * (FIXME - make this comment better, and helpful.) * * The two divisions by 4 are also a consequence of this: the contributions * returned for each frequency are split into two parts, one at i in the * table, and the other at FFT_BUFFER_SIZE - i, except for i = 0 and * FFT_BUFFER_SIZE which would otherwise get float (and then 4* when squared) * the contributions. */ static void fft_output(const float *re, const float *im, float *output) { float *outputptr = output; const float *realptr = re; const float *imagptr = im; float *endptr = output + FFT_BUFFER_SIZE / 2; #ifdef DEBUG unsigned int i, j; #endif while (outputptr <= endptr) { *outputptr = (*realptr * *realptr) + (*imagptr * *imagptr); outputptr++; realptr++; imagptr++; } /* Do divisions to keep the constant and highest frequency terms in scale * with the other terms. */ *output /= 4; *endptr /= 4; #ifdef DEBUG printf("Recalculated input:\n"); for (i = 0; i < FFT_BUFFER_SIZE; i++) { float val_real = 0; float val_imag = 0; for (j = 0; j < FFT_BUFFER_SIZE; j++) { float fact_real = cos(-2 * j * i * PI / FFT_BUFFER_SIZE); float fact_imag = sin(-2 * j * i * PI / FFT_BUFFER_SIZE); val_real += fact_real * re[j] - fact_imag * im[j]; val_imag += fact_real * im[j] + fact_imag * re[j]; } printf("%5d = %8f + i * %8f\n", i, val_real / FFT_BUFFER_SIZE, val_imag / FFT_BUFFER_SIZE); } printf("\n"); #endif } /* * Actually perform the FFT */ static void fft_calculate(float *re, float *im) { unsigned int i, j, k; unsigned int exchanges; float fact_real, fact_imag; float tmp_real, tmp_imag; unsigned int factfact; /* Set up some variables to reduce calculation in the loops */ exchanges = 1; factfact = FFT_BUFFER_SIZE / 2; /* Loop through the divide and conquer steps */ for (i = FFT_BUFFER_SIZE_LOG; i != 0; i--) { /* In this step, we have 2 ^ (i - 1) exchange groups, each with * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges */ /* Loop through the exchanges in a group */ for (j = 0; j != exchanges; j++) { /* Work out factor for this exchange * factor ^ (exchanges) = -1 * So, real = cos(j * PI / exchanges), * imag = sin(j * PI / exchanges) */ fact_real = costable[j * factfact]; fact_imag = sintable[j * factfact]; /* Loop through all the exchange groups */ for (k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { int k1 = k + exchanges; /* newval[k] := val[k] + factor * val[k1] * newval[k1] := val[k] - factor * val[k1] **/ #ifdef DEBUG printf("%d %d %d\n", i, j, k); printf("Exchange %d with %d\n", k, k1); printf("Factor %9f + i * %8f\n", fact_real, fact_imag); #endif /* FIXME - potential scope for more optimization here? */ tmp_real = fact_real * re[k1] - fact_imag * im[k1]; tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; re[k1] = re[k] - tmp_real; im[k1] = im[k] - tmp_imag; re[k] += tmp_real; im[k] += tmp_imag; #ifdef DEBUG for (k1 = 0; k1 < FFT_BUFFER_SIZE; k1++) { printf("%5d = %8f + i * %8f\n", k1, real[k1], imag[k1]); } #endif } } exchanges <<= 1; factfact >>= 1; } } static int reverseBits(unsigned int initial) { unsigned int reversed = 0, loop; for (loop = 0; loop < FFT_BUFFER_SIZE_LOG; loop++) { reversed <<= 1; reversed += (initial & 1); initial >>= 1; } return reversed; } qmmp-0.7.4/src/plugins/Visual/analyzer/fft.h0000664000175000017500000000260712256224735017521 0ustar useruser/* fft.h: Header for iterative implementation of a FFT * Copyright (C) 1999 Richard Boulton * * 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 program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _FFT_H_ #define _FFT_H_ #define FFT_BUFFER_SIZE_LOG 9 #define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) /* sound sample - should be an signed 16 bit value */ typedef short int sound_sample; #ifdef __cplusplus extern "C" { #endif /* FFT library */ typedef struct _struct_fft_state fft_state; fft_state *fft_init(void); void fft_perform(const sound_sample * input, float *output, fft_state * state); void fft_close(fft_state * state); #ifdef __cplusplus } #endif #endif /* _FFT_H_ */ qmmp-0.7.4/src/plugins/Visual/analyzer/colorwidget.h0000664000175000017500000000345712256224735021270 0ustar useruser/*************************************************************************** * Copyright (C) 2005-2012 by Ilya Kotov * * qmmeter_freedevelop@mail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef COLORWIDGET_H #define COLORWIDGET_H #include #include /** @author Ilya Kotov */ class ColorWidget : public QFrame { Q_OBJECT public: ColorWidget(QWidget *parent = 0); ~ColorWidget(); const QString colorName() const; public slots: void setColor (QString); private: void mousePressEvent(QMouseEvent *); }; #endif qmmp-0.7.4/src/plugins/Visual/analyzer/CMakeLists.txt0000664000175000017500000000306012256224735021323 0ustar useruserproject(libanalyzer) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmp include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libanalyzer_SRCS analyzer.cpp colorwidget.cpp settingsdialog.cpp visualanalyzerfactory.cpp fft.c ) SET(libanalyzer_HDRS inlines.h fft.h ) SET(libanalyzer_MOC_HDRS analyzer.h colorwidget.h settingsdialog.h visualanalyzerfactory.h ) SET(libanalyzer_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libanalyzer_RCC_SRCS ${libanalyzer_RCCS}) QT4_WRAP_CPP(libanalyzer_MOC_SRCS ${libanalyzer_MOC_HDRS}) # user interface SET(libanalyzer_UIS settingsdialog.ui ) QT4_WRAP_UI(libanalyzer_UIS_H ${libanalyzer_UIS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(analyzer MODULE ${libanalyzer_SRCS} ${libanalyzer_MOC_SRCS} ${libanalyzer_UIS_H} ${libanalyzer_RCC_SRCS} ${libanalyzer_HDRS}) add_dependencies(analyzer qmmp) target_link_libraries(analyzer ${QT_LIBRARIES} -lqmmp) install(TARGETS analyzer DESTINATION ${LIB_DIR}/qmmp/Visual) qmmp-0.7.4/src/plugins/Visual/analyzer/colorwidget.cpp0000664000175000017500000000435412256224735021620 0ustar useruser/*************************************************************************** * Copyright (C) 2005-2012 by Ilya Kotov * * qmmeter_freedevelop@mail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "colorwidget.h" ColorWidget::ColorWidget(QWidget *parent) : QFrame(parent) { setFrameShape(QFrame::Box); setAutoFillBackground(true); } ColorWidget::~ColorWidget() {} void ColorWidget::mousePressEvent(QMouseEvent *) { QColor color = QColorDialog::getColor(palette().color(backgroundRole()), parentWidget(), tr("Select Color")); if (color.isValid()) { QPalette palette; palette.setColor(backgroundRole(), color); setPalette(palette); } } void ColorWidget::setColor(QString c) { QPalette palette; palette.setColor(backgroundRole(), c); setPalette(palette); } const QString ColorWidget::colorName() const { return palette().color(backgroundRole()).name(); } qmmp-0.7.4/src/plugins/Visual/analyzer/settingsdialog.cpp0000664000175000017500000000733612256224735022321 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include "settingsdialog.h" SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) { m_ui.setupUi(this); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_ui.analyzerComboBox->setCurrentIndex(settings.value("Analyzer/analyzer_falloff", 3).toInt()-1); m_ui.peaksCheckBox->setChecked(settings.value("Analyzer/show_peaks", true).toBool()); m_ui.peaksComboBox->setCurrentIndex(settings.value("Analyzer/peaks_falloff", 3).toInt()-1); m_ui.fpsComboBox->setCurrentIndex(settings.value("Analyzer/refresh_rate", 2).toInt()-1); m_ui.colorWidget1->setColor(settings.value("Analyzer/color1", "Green").toString()); m_ui.colorWidget2->setColor(settings.value("Analyzer/color2", "Yellow").toString()); m_ui.colorWidget3->setColor(settings.value("Analyzer/color3", "Red").toString()); m_ui.bgColorWidget->setColor(settings.value("Analyzer/bg_color", "Black").toString()); m_ui.peakColorWidget->setColor(settings.value("Analyzer/peak_color", "Cyan").toString()); QSize cells_size = settings.value("Analyzer/cells_size", QSize(15, 6)).toSize(); m_ui.cellWidthSpinBox->setValue(cells_size.width()); m_ui.cellHeightSpinBox->setValue(cells_size.height()); } SettingsDialog::~SettingsDialog() { } void SettingsDialog::accept() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Analyzer/analyzer_falloff", m_ui.analyzerComboBox->currentIndex() + 1); settings.setValue("Analyzer/peaks_falloff", m_ui.peaksComboBox->currentIndex() + 1); settings.setValue("Analyzer/refresh_rate", m_ui.fpsComboBox->currentIndex() + 1); settings.setValue("Analyzer/show_peaks", m_ui.peaksCheckBox->isChecked()); settings.setValue("Analyzer/color1", m_ui.colorWidget1->colorName()); settings.setValue("Analyzer/color2", m_ui.colorWidget2->colorName()); settings.setValue("Analyzer/color3", m_ui.colorWidget3->colorName()); settings.setValue("Analyzer/bg_color", m_ui.bgColorWidget->colorName()); settings.setValue("Analyzer/peak_color", m_ui.peakColorWidget->colorName()); settings.setValue("Analyzer/cells_size", QSize(m_ui.cellWidthSpinBox->value(), m_ui.cellHeightSpinBox->value())); QDialog::accept(); } qmmp-0.7.4/src/plugins/Visual/analyzer/visualanalyzerfactory.cpp0000664000175000017500000000513712256224735023737 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include "settingsdialog.h" #include "visualanalyzerfactory.h" #include "analyzer.h" const VisualProperties VisualAnalyzerFactory::properties() const { VisualProperties properties; properties.name = tr("Analyzer Plugin"); properties.shortName = "analyzer"; properties.hasSettings = true; properties.hasAbout = true; return properties; } Visual *VisualAnalyzerFactory::create(QWidget *parent) { return new Analyzer(parent); } QDialog *VisualAnalyzerFactory::createConfigDialog(QWidget *parent) { return new SettingsDialog(parent); } void VisualAnalyzerFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About Analyzer Visual Plugin"), tr("Qmmp Analyzer Visual Plugin")+"\n"+ tr("Written by: Ilya Kotov ")); } QTranslator *VisualAnalyzerFactory::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/analyzer_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(analyzer,VisualAnalyzerFactory) qmmp-0.7.4/src/plugins/Visual/analyzer/settingsdialog.ui0000664000175000017500000003175612256224735022157 0ustar useruser SettingsDialog 0 0 314 310 Analyzer Plugin Settings 0 0 General Qt::LeftToRight Show peaks Analyzer falloff: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 2 Slowest Slow Medium Fast Fastest Peaks falloff: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 2 Slowest Slow Medium Fast Fastest Refresh rate: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 50 FPS 25 FPS 10 FPS 5 FPS Cells size: 2 50 X 2 50 Qt::Horizontal 40 20 0 0 Colors Peaks: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 20 20 20 20 Analyzer #1: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 20 20 20 20 Background: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 20 20 20 20 Analyzer #2: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 20 20 20 20 Qt::Horizontal 111 20 Analyzer #3: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 20 20 20 20 Qt::Horizontal 40 20 Qt::Horizontal 40 20 QDialogButtonBox::Cancel|QDialogButtonBox::Ok ColorWidget QWidget
colorwidget.h
1
buttonBox accepted() SettingsDialog accept() 204 303 53 308 buttonBox rejected() SettingsDialog reject() 228 307 78 288
qmmp-0.7.4/src/plugins/Visual/analyzer/translations/0000775000175000017500000000000012256224735021305 5ustar useruserqmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_uk_UA.ts0000664000175000017500000001377312256224735026157 0ustar useruser Analyzer Qmmp Analyzer Аналізатор Qmmp F ColorWidget Select Color Виберіть колір SettingsDialog Analyzer Plugin Settings Налаштування аналізатора General Загальні Show peaks Показувати піки Analyzer falloff: Падіння аналізатора: Slowest Найповільніше Slow Повільне Medium Середнє Fast Швидке Fastest Найшвидше Peaks falloff: Падіння піків: Refresh rate: Частота оновлення: 50 FPS 50 кад/с 25 FPS 25 кад/с 10 FPS 10 кад/с 5 FPS 5 кад/с Cells size: Розмір клітинок: Colors Кольори Peaks: Піки: Analyzer #1: Аналізатор #1: Background: Тло: Analyzer #2: Аналізатор #2: Analyzer #3: Аналізатор #3: VisualAnalyzerFactory Analyzer Plugin Модуль аналізатора About Analyzer Visual Plugin Про модуль аналізатора Qmmp Analyzer Visual Plugin Модуль аналізатора для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Розробник: Ілля Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_de.ts0000664000175000017500000001340312256224735025531 0ustar useruser Analyzer Qmmp Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Einstellungen Analyzer-Plugin General Allgemein Show peaks Spitzen anzeigen Analyzer falloff: Abfallen des Analyzers: Slowest Sehr langsam Slow Langsam Medium Mittel Fast Schnell Fastest Sehr schnell Peaks falloff: Abfallen der Spitzen: Refresh rate: Wiederholrate: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors Farben Peaks: Spitzen: Analyzer #1: Analyzer Nr. 1: Background: Hintergrund: Analyzer #2: Analyzer Nr. 2: Analyzer #3: Analyzer Nr. 3: VisualAnalyzerFactory Analyzer Plugin Analyzer-Modul About Analyzer Visual Plugin Über Analyzer-Visualisierungs-Modul Qmmp Analyzer Visual Plugin Qmmp Analyzer-Visualisierungs-Modul Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_cs.ts0000664000175000017500000001344112256224735025550 0ustar useruser Analyzer Qmmp Analyzer Frekvenční analyzátor Qmmp F F ColorWidget Select Color Vyberte barvu SettingsDialog Analyzer Plugin Settings Nastavení modulu frekvenčního analyzátoru General Obecné Show peaks Zobrazovat špičky Analyzer falloff: Pokles analyzátoru: Slowest Nejpomalejší Slow Pomalý Medium Střední Fast Rychlý Fastest Nejrychlejší Peaks falloff: Pokles špiček: Refresh rate: Obnovovací frekvence: 50 FPS 50 Hz 25 FPS 25 Hz 10 FPS 10 Hz 5 FPS 5 Hz Cells size: Velikost polí: Colors Barvy Peaks: Špičky: Analyzer #1: Analyzátor #1: Background: Pozadí: Analyzer #2: Analyzátor #2: Analyzer #3: Analyzátor #3: VisualAnalyzerFactory Analyzer Plugin Modul frekvenčního analyzátoru About Analyzer Visual Plugin O modulu frekvenčního analyzátoru Qmmp Analyzer Visual Plugin Modul frekvenčního analyzátoru pro Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilja Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_es.ts0000664000175000017500000001341012256224735025546 0ustar useruser Analyzer Qmmp Analyzer Analizador Qmmp F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Configuración del módulo analizador General General Show peaks Mostrar picos Analyzer falloff: Caída del analizador: Slowest Muy lenta Slow Lenta Medium Media Fast Rápida Fastest Muy rápida Peaks falloff: Caída de picos: Refresh rate: Velocidad de actualización: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors Colores Peaks: Picos: Analyzer #1: Analizador nº1: Background: Fondo: Analyzer #2: Analizador nº2: Analyzer #3: Analizzatore N° 3: VisualAnalyzerFactory Analyzer Plugin Modulo analizzatore About Analyzer Visual Plugin Info sul modulo Analizzatore visivo Qmmp Analyzer Visual Plugin Modulo Analizzatore visivo Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_fr.ts0000664000175000017500000001351412256224735025553 0ustar useruser Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings General Show peaks Analyzer falloff: Slowest Slow Medium Fast Fastest Peaks falloff: Refresh rate: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Peaks: Analyzer #1: Background: Analyzer #2: Analyzer #3: VisualAnalyzerFactory Analyzer Plugin About Analyzer Visual Plugin Qmmp Analyzer Visual Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_he.ts0000664000175000017500000001354112256224735025540 0ustar useruser Analyzer Qmmp Analyzer מאבחן Qmmp F ColorWidget Select Color בחר צבע SettingsDialog Analyzer Plugin Settings הגדרות תוספת אבחון General כללי Show peaks פסגות הצג שיאים Analyzer falloff: נפילת אבחון: Slowest הכי איטית Slow איטית Medium בינונית Fast מהירה Fastest הכי מהירה Peaks falloff: נפילת שיאים: Refresh rate: רענון שיעור: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: מימד תאים: Colors צבעים Peaks: שיאים: Analyzer #1: מאבחן 1: Background: רקע אחורי: Analyzer #2: מאבחן 2: Analyzer #3: מאבחן 3: VisualAnalyzerFactory Analyzer Plugin תוספת אבחון About Analyzer Visual Plugin אודות תוספת אבחון חזותי Qmmp Analyzer Visual Plugin תוספת אבחון חזותי Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> חוברה על ידי: Ilya Kotov ‫<forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_hu.ts0000664000175000017500000001351412256224735025560 0ustar useruser Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings General Show peaks Analyzer falloff: Slowest Slow Medium Fast Fastest Peaks falloff: Refresh rate: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Peaks: Analyzer #1: Background: Analyzer #2: Analyzer #3: VisualAnalyzerFactory Analyzer Plugin About Analyzer Visual Plugin Qmmp Analyzer Visual Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_ja.ts0000664000175000017500000001365012256224735025537 0ustar useruser Analyzer Qmmp Analyzer QMMP アナライザー F F ColorWidget Select Color 色を選択 SettingsDialog Analyzer Plugin Settings アナライザープラグイン設定 General 一般 Show peaks ピーク表示 Analyzer falloff: アナライザー減衰速度: Slowest さらに遅く Slow 遅く Medium 適度 Fast 速く Fastest さらに速く Peaks falloff: ピーク減衰速度: Refresh rate: 再描画の頻度: 50 FPS 50 フレーム毎秒 25 FPS 25 フレーム毎秒 10 FPS 10 フレーム毎秒 5 FPS 5 フレーム毎秒 Cells size: セルサイズ: Colors Peaks: 峰: Analyzer #1: 第一アナライザー: Background: 背景: Analyzer #2: 第二アナライザー: Analyzer #3: 第三アナライザー: VisualAnalyzerFactory Analyzer Plugin アナライザープラグイン About Analyzer Visual Plugin アナライザー視覚効果プラグインについて Qmmp Analyzer Visual Plugin QMMP アナライザー視覚効果プラグイン Written by: Ilya Kotov <forkotov02@hotmail.ru> 制作: Илья Котов (Ilya Kotov) <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_it.ts0000664000175000017500000001342012256224735025554 0ustar useruser Analyzer Qmmp Analyzer Analizzatore Qmmp F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Impostazioni Del modulo Analizzatore General Generale Show peaks Mostra i picchi Analyzer falloff: Ricaduta analizzatore Slowest Molto lenta Slow Lenta Medium Media Fast Rapida Fastest Molto rapida Peaks falloff: Ricaduta picchi Refresh rate: Velocità di aggiornamento: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors Colori Peaks: Picchi: Analyzer #1: Analizzatore Nr. 1: Background: Sfondo: Analyzer #2: Analizzatore N° 2: Analyzer #3: Analizzatore N° 3: VisualAnalyzerFactory Analyzer Plugin Modulo analizzatore About Analyzer Visual Plugin Info sul modulo Analizzatore visivo Qmmp Analyzer Visual Plugin Modulo Analizzatore visivo Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autore: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_kk.ts0000664000175000017500000001351412256224735025551 0ustar useruser Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings General Show peaks Analyzer falloff: Slowest Slow Medium Fast Fastest Peaks falloff: Refresh rate: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Peaks: Analyzer #1: Background: Analyzer #2: Analyzer #3: VisualAnalyzerFactory Analyzer Plugin About Analyzer Visual Plugin Qmmp Analyzer Visual Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_lt.ts0000664000175000017500000001342312256224735025562 0ustar useruser Analyzer Qmmp Analyzer Qmmp analizatorius F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Analizatoriaus įskiepio nustatymai General Bendri Show peaks Rodyti pikus Analyzer falloff: Analizatoriaus kritimas: Slowest Lėčiausias Slow Lėtas Medium Vidutinis Fast Greitas Fastest Greičiausias Peaks falloff: Pikų kritimas: Refresh rate: Atnaujinimo dažnis: 50 FPS 50 FPS/с 25 FPS 25 FPS/с 10 FPS 10 FPS/с 5 FPS 5 FPS/с Cells size: Colors Spalvos Peaks: Pikai: Analyzer #1: Analizatorius #1: Background: Fonas: Analyzer #2: Analizatorius #2: Analyzer #3: Analizatorius #3: VisualAnalyzerFactory Analyzer Plugin Analizatoriaus įskiepis About Analyzer Visual Plugin Apie analizatoriaus įskiepį Qmmp Analyzer Visual Plugin Qmmp analizatoriaus įskiepis Written by: Ilya Kotov <forkotov02@hotmail.ru> Sukūrė: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_nl.ts0000664000175000017500000001332312256224735025553 0ustar useruser Analyzer Qmmp Analyzer Qmmp Analysator F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Analysator Module Instellingen General Algemeen Show peaks Laat toppen zien Analyzer falloff: Analysator uitval: Slowest Traagst Slow Traag Medium Normaal Fast Snel Fastest Snelst Peaks falloff: Toppen uitval: Refresh rate: Ververs frequentie: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Kleuren Peaks: Toppen: Analyzer #1: Analysator #1: Background: Achtergrond: Analyzer #2: Analysator #2: Analyzer #3: Analysator #3: VisualAnalyzerFactory Analyzer Plugin Analysator Module About Analyzer Visual Plugin Over de Visuele Analysator Module Qmmp Analyzer Visual Plugin Visuele Analysator Module voor Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Auteur: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_pl.ts0000664000175000017500000001270712256224735025562 0ustar useruser Analyzer Qmmp Analyzer Qmmp Analizator F F SettingsDialog Analyzer Plugin Settings Ustawienia Wtyczki Analizator General Ogólne Show peaks Pokaż piki Analyzer falloff: Analizator opadanie: Slowest Najwolniej Slow Wolno Medium Średnio Fast Szybko Fastest Najszybciej Peaks falloff: Opadanie pików: Refresh rate: Odświeżanie: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Rozmiar komórki: Colors Kolory Peaks: Piki: Analyzer #1: Analizator #1: Background: Tło: Analyzer #2: Analizator #2: Analyzer #3: Analizator #3: VisualAnalyzerFactory Analyzer Plugin Wtyczka Analizator About Analyzer Visual Plugin O wtyczce Analizator Qmmp Analyzer Visual Plugin Wtyczka wizualna Analizator dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_ru.ts0000664000175000017500000001402412256224735025567 0ustar useruser Analyzer Qmmp Analyzer Анализатор Qmmp F ColorWidget Select Color Выберите цвет SettingsDialog Analyzer Plugin Settings Настройки анализатора General Общие Show peaks Показывать пики Analyzer falloff: Падение анализатора: Slowest Самое медленное Slow Медленное Medium Среднее Fast Быстрое Fastest Самое быстрое Peaks falloff: Падение пиков: Refresh rate: Частота обновления: 50 FPS 50 кад/с 25 FPS 25 кад/с 10 FPS 10 кад/с 5 FPS 5 кад/с Cells size: Размер ячеек: Colors Цвета Peaks: Пики: Analyzer #1: Анализатор #1: Background: Фон: Analyzer #2: Анализатор #2: Analyzer #3: Анализатор #3: VisualAnalyzerFactory Analyzer Plugin Анализатор About Analyzer Visual Plugin Об анализаторе (модуле визуализации) Qmmp Analyzer Visual Plugin Модуль анализатора для Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Разработчик: Илья Котов <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_sk.ts0000664000175000017500000001351412256224735025561 0ustar useruser Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings General Show peaks Analyzer falloff: Slowest Slow Medium Fast Fastest Peaks falloff: Refresh rate: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Peaks: Analyzer #1: Background: Analyzer #2: Analyzer #3: VisualAnalyzerFactory Analyzer Plugin About Analyzer Visual Plugin Qmmp Analyzer Visual Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_tr.ts0000664000175000017500000001335112256224735025570 0ustar useruser Analyzer Qmmp Analyzer Qmmp Çözümleyici F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings Çözümleyici Eklentisi Ayarları General Genel Show peaks Tepeleri göster Analyzer falloff: Slowest En yavaş Slow Yavaş Medium Orta Fast Hızlı Fastest En hızlı Peaks falloff: Refresh rate: Yineleme oranı: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors Renkler Peaks: Analyzer #1: Çözümleyici #1: Background: Arkaplan: Analyzer #2: Çözümleyici #2: Analyzer #3: Çözümleyici #2: VisualAnalyzerFactory Analyzer Plugin Çözümleyici Eklentisi About Analyzer Visual Plugin Çözümleyici Görsel Eklentisi Hakkında Qmmp Analyzer Visual Plugin Qmmp Çözümleyici Görsel Eklentisi Written by: Ilya Kotov <forkotov02@hotmail.ru> Yazan: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_pl_PL.ts0000664000175000017500000001325112256224735026150 0ustar useruser Analyzer Qmmp Analyzer Qmmp Analizator F F ColorWidget Select Color Wybierz kolor SettingsDialog Analyzer Plugin Settings Ustawienia Wtyczki Analizator General Ogólne Show peaks Pokaż piki Analyzer falloff: Analizator opadanie: Slowest Najwolniej Slow Wolno Medium Średnio Fast Szybko Fastest Najszybciej Peaks falloff: Opadanie pików: Refresh rate: Odświeżanie: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Rozmiar komórki: Colors Kolory Peaks: Piki: Analyzer #1: Analizator #1: Background: Tło: Analyzer #2: Analizator #2: Analyzer #3: Analizator #3: VisualAnalyzerFactory Analyzer Plugin Wtyczka Analizator About Analyzer Visual Plugin O wtyczce Analizator Qmmp Analyzer Visual Plugin Wtyczka wizualna Analizator dla Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Autor: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/translations.qrc0000664000175000017500000000154512256224735024542 0ustar useruser analyzer_plugin_ru.qm analyzer_plugin_uk_UA.qm analyzer_plugin_zh_CN.qm analyzer_plugin_zh_TW.qm analyzer_plugin_tr.qm analyzer_plugin_cs.qm analyzer_plugin_pt_BR.qm analyzer_plugin_de.qm analyzer_plugin_pl_PL.qm analyzer_plugin_fr.qm analyzer_plugin_it.qm analyzer_plugin_kk.qm analyzer_plugin_lt.qm analyzer_plugin_hu.qm analyzer_plugin_nl.qm analyzer_plugin_ja.qm analyzer_plugin_sk.qm analyzer_plugin_es.qm analyzer_plugin_he.qm analyzer_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_pt_BR.ts0000664000175000017500000001351412256224735026152 0ustar useruser Analyzer Qmmp Analyzer F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings General Show peaks Analyzer falloff: Slowest Slow Medium Fast Fastest Peaks falloff: Refresh rate: 50 FPS 25 FPS 10 FPS 5 FPS Cells size: Colors Peaks: Analyzer #1: Background: Analyzer #2: Analyzer #3: VisualAnalyzerFactory Analyzer Plugin About Analyzer Visual Plugin Qmmp Analyzer Visual Plugin Written by: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_zh_CN.ts0000664000175000017500000001334412256224735026146 0ustar useruser Analyzer Qmmp Analyzer Qmmp 可视化分析器 F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings 可视化分析器插件设置 General 常规 Show peaks 显示峰值 Analyzer falloff: 分析器下降速度: Slowest 最慢 Slow Medium Fast Fastest 最快 Peaks falloff: 峰值下降速度: Refresh rate: 刷新率: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors 颜色 Peaks: 峰值: Analyzer #1: 分析 #1: Background: 背景: Analyzer #2: 分析 #2: Analyzer #3: 分析 #3: VisualAnalyzerFactory Analyzer Plugin 可视化分析器插件 About Analyzer Visual Plugin 关于可视化分析器插件 Qmmp Analyzer Visual Plugin Qmmp 可视化分析器插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_zh_TW.ts0000664000175000017500000001334412256224735026200 0ustar useruser Analyzer Qmmp Analyzer Qmmp 可視化解析器 F ColorWidget Select Color SettingsDialog Analyzer Plugin Settings 可視化解析器插件設定 General 常規 Show peaks 察看峰值 Analyzer falloff: 解析器下降速度: Slowest 最慢 Slow Medium Fast Fastest 最快 Peaks falloff: 峰值下降速度: Refresh rate: 清除率: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Colors 色彩 Peaks: 峰值: Analyzer #1: 解析 #1: Background: 背景: Analyzer #2: 解析 #2: Analyzer #3: 解析 #3: VisualAnalyzerFactory Analyzer Plugin 可視化解析器插件 About Analyzer Visual Plugin 關於可視化解析器插件 Qmmp Analyzer Visual Plugin Qmmp 可視化解析器插件 Written by: Ilya Kotov <forkotov02@hotmail.ru> 作者:Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/translations/analyzer_plugin_gl_ES.ts0000664000175000017500000001333512256224735026136 0ustar useruser Analyzer Qmmp Analyzer Analizador de Qmmp F F ColorWidget Select Color Seleccionar cor SettingsDialog Analyzer Plugin Settings Preferencias do engadido Analizador General Xeral Show peaks Amosar picos Analyzer falloff: Analizador caída: Slowest O máis lento Slow Lento Medium Medio Fast Rápido Fastest O máis rápido Peaks falloff: Caída de picos: Refresh rate: Taxa de refresco: 50 FPS 50 FPS 25 FPS 25 FPS 10 FPS 10 FPS 5 FPS 5 FPS Cells size: Tamaño de celdas: Colors Cores Peaks: Picos: Analyzer #1: Analizador #1: Background: Fondo: Analyzer #2: Analizador #2: Analyzer #3: Analizador #3: VisualAnalyzerFactory Analyzer Plugin Engadido Analizador About Analyzer Visual Plugin Sobre o engadido Analizador Qmmp Analyzer Visual Plugin Engadido de Analizador de Qmmp Written by: Ilya Kotov <forkotov02@hotmail.ru> Escrito por: Ilya Kotov <forkotov02@hotmail.ru> qmmp-0.7.4/src/plugins/Visual/analyzer/analyzer.h0000664000175000017500000000506612256224735020571 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef ANALYZER_H #define ANALYZER_H #include #include #include class QTimer; class QMenu; class QActionGroup; class Analyzer : public Visual { Q_OBJECT public: Analyzer( QWidget *parent = 0); virtual ~Analyzer(); void add(unsigned char *data, qint64 size, int chan); void clear(); void paintEvent( QPaintEvent * ); protected: virtual void hideEvent (QHideEvent *); virtual void showEvent (QShowEvent *); virtual void closeEvent (QCloseEvent *); public slots: void timeout(); private slots: void toggleFullScreen(); private: void process(short *l, short *r); void draw(QPainter *p); QPixmap m_bg; QTimer *m_timer; int m_fps; double *m_intern_vis_data; double *m_peaks; int *m_x_scale; double m_peaks_falloff; double m_analyzer_falloff; bool m_show_peaks; short *m_left_buffer; short *m_right_buffer; int m_buffer_at; int m_cols, m_rows; //colors QColor m_color1; QColor m_color2; QColor m_color3; QColor m_bgColor; QColor m_peakColor; QSize m_cell_size; }; #endif qmmp-0.7.4/src/plugins/Visual/analyzer/analyzer.cpp0000664000175000017500000002254512256224735021125 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include "fft.h" #include "inlines.h" #include "analyzer.h" #define VISUAL_NODE_SIZE 512 //samples #define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) Analyzer::Analyzer (QWidget *parent) : Visual (parent), m_fps (20) { m_intern_vis_data = 0; m_peaks = 0; m_x_scale = 0; m_buffer_at = 0; m_rows = 0; m_cols = 0; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); restoreGeometry(settings.value("Analyzer/geometry").toByteArray()); //setAttribute(Qt::WA_TranslucentBackground); setMinimumSize(2*300-30,105); m_timer = new QTimer (this); connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); m_left_buffer = new short[VISUAL_BUFFER_SIZE]; m_right_buffer = new short[VISUAL_BUFFER_SIZE]; clear(); setWindowTitle (tr("Qmmp Analyzer")); double peaks_speed[] = { 0.05, 0.1, 0.2, 0.4, 0.8 }; double analyzer_speed[] = { 1.2, 1.8, 2.2, 2.4, 2.8 }; int intervals[] = { 20 , 40 , 100 , 200 }; m_peaks_falloff = peaks_speed[settings.value("Analyzer/peaks_falloff", 3).toInt()-1]; m_analyzer_falloff = analyzer_speed[settings.value("Analyzer/analyzer_falloff", 3).toInt()-1]; m_show_peaks = settings.value("Analyzer/show_peaks", true).toBool(); m_timer->setInterval(intervals[settings.value("Analyzer/refresh_rate", 2).toInt() - 1]); m_color1.setNamedColor(settings.value("Analyzer/color1", "Green").toString()); m_color2.setNamedColor(settings.value("Analyzer/color2", "Yellow").toString()); m_color3.setNamedColor(settings.value("Analyzer/color3", "Red").toString()); m_bgColor.setNamedColor(settings.value("Analyzer/bg_color", "Black").toString()); //m_bgColor.setAlpha(0); m_peakColor.setNamedColor(settings.value("Analyzer/peak_color", "Cyan").toString()); m_cell_size = settings.value("Analyzer/cells_size", QSize(15, 6)).toSize(); QAction *fullScreenAction = new QAction(this); fullScreenAction->setShortcut(tr("F")); connect(fullScreenAction, SIGNAL(triggered()), SLOT(toggleFullScreen())); addAction(fullScreenAction); } Analyzer::~Analyzer() { delete [] m_left_buffer; delete [] m_right_buffer; if(m_peaks) delete [] m_peaks; if(m_intern_vis_data) delete [] m_intern_vis_data; if(m_x_scale) delete [] m_x_scale; } void Analyzer::clear() { m_buffer_at = 0; m_rows = 0; m_cols = 0; update(); } void Analyzer::add (unsigned char *data, qint64 size, int chan) { if (!m_timer->isActive ()) return; if(VISUAL_BUFFER_SIZE == m_buffer_at) { m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); return; } int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); if (chan >= 2) { stereo16_from_multichannel(m_left_buffer + m_buffer_at, m_right_buffer + m_buffer_at,(short *) data, frames, chan); } else { memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); memcpy(m_right_buffer + m_buffer_at, (short *) data, frames << 1); } m_buffer_at += frames; } void Analyzer::timeout() { mutex()->lock (); if(m_buffer_at < VISUAL_NODE_SIZE) { mutex()->unlock (); return; } process (m_left_buffer, m_right_buffer); m_buffer_at -= VISUAL_NODE_SIZE; memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); mutex()->unlock (); update(); } void Analyzer::paintEvent (QPaintEvent * e) { QPainter painter (this); painter.fillRect(e->rect(),m_bgColor); draw(&painter); } void Analyzer::hideEvent (QHideEvent *) { m_timer->stop(); } void Analyzer::showEvent (QShowEvent *) { m_timer->start(); } void Analyzer::closeEvent (QCloseEvent *event) { //save geometry QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Analyzer/geometry", saveGeometry()); Visual::closeEvent(event); //removes visualization before class deleting } void Analyzer::process (short *left, short *right) { static fft_state *state = 0; if (!state) state = fft_init(); int rows = (height() - 2) / m_cell_size.height(); int cols = (width() - 2) / m_cell_size.width() / 2; if(m_rows != rows || m_cols != cols) { m_rows = rows; m_cols = cols; if(m_peaks) delete [] m_peaks; if(m_intern_vis_data) delete [] m_intern_vis_data; if(m_x_scale) delete [] m_x_scale; m_peaks = new double[m_cols * 2]; m_intern_vis_data = new double[m_cols * 2]; m_x_scale = new int[m_cols + 1]; for(int i = 0; i < m_cols * 2; ++i) { m_peaks[i] = 0; m_intern_vis_data[i] = 0; } for(int i = 0; i < m_cols + 1; ++i) m_x_scale[i] = pow(pow(255.0, 1.0 / m_cols), i); } short dest_l[256]; short dest_r[256]; short yl, yr; int j, k, magnitude_l, magnitude_r; calc_freq (dest_l, left); calc_freq (dest_r, right); double y_scale = (double) 1.25 * m_rows / log(256); for (int i = 0; i < m_cols; i++) { j = m_cols * 2 - i - 1; //mirror index yl = yr = 0; magnitude_l = magnitude_r = 0; if(m_x_scale[i] == m_x_scale[i + 1]) { yl = dest_l[i]; yr = dest_r[i]; } for (k = m_x_scale[i]; k < m_x_scale[i + 1]; k++) { yl = qMax(dest_l[k], yl); yr = qMax(dest_r[k], yr); } yl >>= 7; //256 yr >>= 7; if (yl) { magnitude_l = int(log (yl) * y_scale); magnitude_l = qBound(0, magnitude_l, m_rows); } if (yr) { magnitude_r = int(log (yr) * y_scale); magnitude_r = qBound(0, magnitude_r, m_rows); } m_intern_vis_data[i] -= m_analyzer_falloff * m_rows / 15; m_intern_vis_data[i] = magnitude_l > m_intern_vis_data[i] ? magnitude_l : m_intern_vis_data[i]; m_intern_vis_data[j] -= m_analyzer_falloff * m_rows / 15; m_intern_vis_data[j] = magnitude_r > m_intern_vis_data[j] ? magnitude_r : m_intern_vis_data[j]; if (m_show_peaks) { m_peaks[i] -= m_peaks_falloff * m_rows / 15; m_peaks[i] = magnitude_l > m_peaks[i] ? magnitude_l : m_peaks[i]; m_peaks[j] -= m_peaks_falloff * m_rows / 15; m_peaks[j] = magnitude_r > m_peaks[j] ? magnitude_r : m_peaks[j]; } } } void Analyzer::draw (QPainter *p) { QBrush brush(Qt::SolidPattern); int x = 0; int rdx = qMax(0, width() - 2 * m_cell_size.width() * m_cols); for (int j = 0; j < m_cols * 2; ++j) { x = j * m_cell_size.width() + 1; if(j >= m_cols) x += rdx; //correct right part position for (int i = 0; i <= m_intern_vis_data[j]; ++i) { if (i <= m_rows/3) brush.setColor(m_color1); else if (i > m_rows/3 && i <= 2 * m_rows / 3) brush.setColor(m_color2); else brush.setColor(m_color3); p->fillRect (x, height() - i * m_cell_size.height() + 1, m_cell_size.width() - 2, m_cell_size.height() - 2, brush); } if (m_show_peaks) { p->fillRect (x, height() - int(m_peaks[j])*m_cell_size.height() + 1, m_cell_size.width() - 2, m_cell_size.height() - 2, m_peakColor); } } } void Analyzer::toggleFullScreen() { setWindowState(windowState() ^Qt::WindowFullScreen); } qmmp-0.7.4/src/plugins/Visual/analyzer/analyzer.pro0000664000175000017500000000304212256224735021132 0ustar useruserinclude(../../plugins.pri) TARGET=$$PLUGINS_PREFIX/Visual/analyzer QMAKE_CLEAN =$$PLUGINS_PREFIX/Visual/libanalyzer.so FORMS += settingsdialog.ui HEADERS += analyzer.h \ fft.h \ visualanalyzerfactory.h \ inlines.h \ colorwidget.h \ settingsdialog.h SOURCES += analyzer.cpp \ fft.c \ visualanalyzerfactory.cpp \ colorwidget.cpp \ settingsdialog.cpp win32:HEADERS += ../../../../src/qmmp/visual.h win32:INCLUDEPATH += ./ INCLUDEPATH += ../../../ CONFIG += release \ warn_on \ plugin TEMPLATE = lib unix:QMAKE_LIBDIR += ../../../../lib unix:LIBS += -lqmmp -L/usr/lib -I/usr/include win32:QMAKE_LIBDIR += ../../../../bin win32:LIBS += -lqmmp0 TRANSLATIONS = translations/analyzer_plugin_cs.ts \ translations/analyzer_plugin_de.ts \ translations/analyzer_plugin_zh_CN.ts \ translations/analyzer_plugin_zh_TW.ts \ translations/analyzer_plugin_ru.ts \ translations/analyzer_plugin_pl.ts \ translations/analyzer_plugin_uk_UA.ts \ translations/analyzer_plugin_it.ts \ translations/analyzer_plugin_tr.ts \ translations/analyzer_plugin_lt.ts \ translations/analyzer_plugin_nl.ts \ translations/analyzer_plugin_ja.ts \ translations/analyzer_plugin_es.ts RESOURCES = translations/translations.qrc unix{ isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/Visual INSTALLS += target } qmmp-0.7.4/src/plugins/Visual/analyzer/inlines.h0000664000175000017500000000237612256224735020406 0ustar useruser// Copyright (c) 2000-2001 Brad Hughes // // Use, modification and distribution is allowed without limitation, // warranty, or liability of any kind. // #ifndef INLINES_H #define INLINES_H #include "fft.h" // *fast* convenience functions static inline void calc_freq(short* dest, short *src) { static fft_state *state = NULL; float tmp_out[257]; int i; if (!state) state = fft_init(); fft_perform(src, tmp_out, state); for (i = 0; i < 256; i++) dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; } static inline void stereo16_from_multichannel(register short *l, register short *r, register short *s, long cnt, int chan) { while (cnt > 0) { l[0] = s[0]; r[0] = s[1]; s += chan; l++; r++; cnt--; } } static inline void mono16_from_multichannel(register short *l, register short *s, long cnt, int chan) { while (cnt > 0) { l[0] = s[0]; s += chan; l++; cnt--; } } #endif // INLINES_H qmmp-0.7.4/src/plugins/Visual/analyzer/settingsdialog.h0000664000175000017500000000345312256224735021762 0ustar useruser/*************************************************************************** * Copyright (C) 2007-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SETTINGSDIALOG_H #define SETTINGSDIALOG_H #include #include "ui_settingsdialog.h" /** @author Ilya Kotov */ class SettingsDialog : public QDialog { Q_OBJECT public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); public slots: virtual void accept(); private: Ui::SettingsDialog m_ui; }; #endif qmmp-0.7.4/src/plugins/Visual/analyzer/visualanalyzerfactory.h0000664000175000017500000000373212256224735023403 0ustar useruser/*************************************************************************** * Copyright (C) 2008 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef VISUALANALYZERFACTORY_H #define VISUALANALYZERFACTORY_H #include #include #include /** @author Ilya Kotov */ class VisualAnalyzerFactory : public QObject, public VisualFactory { Q_OBJECT Q_INTERFACES(VisualFactory); public: const VisualProperties properties() const; Visual *create(QWidget *parent); QDialog *createConfigDialog(QWidget *parent); void showAbout(QWidget *parent); QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/CMakeLists.txt0000664000175000017500000000071412256224736016237 0ustar useruserSET(USE_ENCA TRUE CACHE BOOL "enable/disable libenca support") include(FindPkgConfig) pkg_search_module(ENCA enca>=1.9) pkg_search_module(TAGLIB taglib>=1.6) add_subdirectory(Input) add_subdirectory(Output) add_subdirectory(Visual) add_subdirectory(Effect) add_subdirectory(General) add_subdirectory(PlayListFormats) add_subdirectory(CommandLineOptions) add_subdirectory(FileDialogs) add_subdirectory(Transports) add_subdirectory(Engines) add_subdirectory(Ui) qmmp-0.7.4/src/plugins/CommandLineOptions/0000775000175000017500000000000012256224736017237 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/0000775000175000017500000000000012256224736022745 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/IncDecVolumeOption.pro0000664000175000017500000000236612256224736027204 0ustar useruserinclude(../../plugins.pri) CONFIG += release \ warn_on \ plugin \ lib TARGET =$$PLUGINS_PREFIX/CommandLineOptions/incdecvolumeoption QMAKE_CLEAN =$$PLUGINS_PREFIX/CommandLineOptions/libincdecvolumeoption.so TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/incdecvolume_plugin_cs.ts \ translations/incdecvolume_plugin_de.ts \ translations/incdecvolume_plugin_pl.ts \ translations/incdecvolume_plugin_ru.ts \ translations/incdecvolume_plugin_uk_UA.ts \ translations/incdecvolume_plugin_zh_TW.ts \ translations/incdecvolume_plugin_zh_CN.ts \ translations/incdecvolume_plugin_it.ts \ translations/incdecvolume_plugin_tr.ts \ translations/incdecvolume_plugin_lt.ts \ translations/incdecvolume_plugin_nl.ts \ translations/incdecvolume_plugin_ja.ts \ translations/incdecvolume_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/CommandLineOptions INSTALLS += target INCLUDEPATH += ../../../../src LIBS += -lqmmpui -lqmmp HEADERS += incdecvolumeoption.h SOURCES += incdecvolumeoption.cpp qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/CMakeLists.txt0000664000175000017500000000273612256224736025515 0ustar useruserproject(libincdecvolumeoption) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmpui include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libincdecvolumeoption_SRCS incdecvolumeoption.cpp ) SET(libincdecvolumeoption_MOC_HDRS incdecvolumeoption.h ) SET(libincdecvolumeoption_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libincdecvolumeoption_RCC_SRCS ${libincdecvolumeoption_RCCS}) QT4_WRAP_CPP(libincdecvolumeoption_MOC_SRCS ${libincdecvolumeoption_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(incdecvolumeoption MODULE ${libincdecvolumeoption_SRCS} ${libincdecvolumeoption_MOC_SRCS} ${libincdecvolumeoption_RCC_SRCS}) add_dependencies(incdecvolumeoption qmmpui) target_link_libraries(incdecvolumeoption ${QT_LIBRARIES} -lqmmpui -lqmmp) install(TARGETS incdecvolumeoption DESTINATION ${LIB_DIR}/qmmp/CommandLineOptions) qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.h0000664000175000017500000000410112256224736027020 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef IncDecVolumeCommandLineOption_H #define IncDecVolumeCommandLineOption_H #include #include #include #include #include class IncDecVolumeCommandLineOption : public QObject, public CommandLineOption { Q_OBJECT Q_INTERFACES(CommandLineOption) public: virtual bool identify(const QString& opt_str)const; virtual const QString name()const; virtual const QString helpString()const; virtual QString executeCommand(const QString& opt_str, const QStringList &args); virtual QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/0000775000175000017500000000000012256224736025466 5ustar useruser././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_pl_PL.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_pl_PL.0000664000175000017500000000112412256224736032606 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Zwiększ głośność z krokiem 5 Decrease volume with step 5 Zmniejsz głośność z krokiem 5 ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_pt_BR.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_pt_BR.0000664000175000017500000000107112256224736032607 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/translations.qrc0000664000175000017500000000166512256224736030726 0ustar useruser incdecvolume_plugin_ru.qm incdecvolume_plugin_uk_UA.qm incdecvolume_plugin_zh_CN.qm incdecvolume_plugin_zh_TW.qm incdecvolume_plugin_tr.qm incdecvolume_plugin_cs.qm incdecvolume_plugin_pt_BR.qm incdecvolume_plugin_de.qm incdecvolume_plugin_pl_PL.qm incdecvolume_plugin_fr.qm incdecvolume_plugin_it.qm incdecvolume_plugin_kk.qm incdecvolume_plugin_lt.qm incdecvolume_plugin_hu.qm incdecvolume_plugin_nl.qm incdecvolume_plugin_ja.qm incdecvolume_plugin_sk.qm incdecvolume_plugin_es.qm incdecvolume_plugin_he.qm incdecvolume_plugin_gl_ES.qm ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_zh_CN.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_zh_CN.0000664000175000017500000000110512256224736032600 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 增大声音(5个单位) Decrease volume with step 5 降低声音(5个单位) ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_zh_TW.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_zh_TW.0000664000175000017500000000110512256224736032632 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 增大聲音(5個單位) Decrease volume with step 5 降低聲音(5個單位) ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_gl_ES.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_gl_ES.0000664000175000017500000000110512256224736032570 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Incrementar o volume en 5 Decrease volume with step 5 Diminuír o volume en 5 ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_uk_UA.tsqmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_uk_UA.0000664000175000017500000000120212256224736032601 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Збільшити гучність на 5 одиниць Decrease volume with step 5 Зменшити гучність на 5 одиниць qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_de.ts0000664000175000017500000000115512256224736032543 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Lautstärke erhöhen (in Fünfer-Schritten) Decrease volume with step 5 Lautstärke verringern (in Fünfer-Schritten) qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_cs.ts0000664000175000017500000000111412256224736032553 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Zvýšit hlasitost s krokem 5 Decrease volume with step 5 Snížit hlasitost s krokem 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_es.ts0000664000175000017500000000111112256224736032552 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Aumentar volumen con paso 5 Decrease volume with step 5 Disminuir volumen con paso 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_fr.ts0000664000175000017500000000107112256224736032557 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_he.ts0000664000175000017500000000107112256224736032544 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_hu.ts0000664000175000017500000000107112256224736032564 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_ja.ts0000664000175000017500000000113112256224736032537 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 音量を100分の5つづつ増大 Decrease volume with step 5 音量を100分の5つづつ減少 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_it.ts0000664000175000017500000000111412256224736032562 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Aumenta il volume con passo 5 Decrease volume with step 5 Diminuisci volume con passo 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_kk.ts0000664000175000017500000000107112256224736032555 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_lt.ts0000664000175000017500000000110012256224736032560 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Pagarsinti 5 procentais Decrease volume with step 5 Pritildyti 5 procentais qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_nl.ts0000664000175000017500000000112212256224736032556 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Verhoog het volume met 5 stappen Decrease volume with step 5 Verlaag het volume met 5 stappen qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_pl.ts0000664000175000017500000000112412256224736032562 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Zwiększ głośność z krokiem 5 Decrease volume with step 5 Zmniejsz głośność z krokiem 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_ru.ts0000664000175000017500000000120412256224736032574 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Увеличить громкость на 5 единиц Decrease volume with step 5 Уменьшить громкость на 5 единиц qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_sk.ts0000664000175000017500000000107112256224736032565 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Decrease volume with step 5 qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/translations/incdecvolume_plugin_tr.ts0000664000175000017500000000107712256224736032603 0ustar useruser IncDecVolumeCommandLineOption Increase volume with step 5 Sesi 5 basamak arttır Decrease volume with step 5 Sesi 5 basamak azalt qmmp-0.7.4/src/plugins/CommandLineOptions/IncDecVolumeOption/incdecvolumeoption.cpp0000664000175000017500000000626112256224736027364 0ustar useruser/*************************************************************************** * Copyright (C) 2008-2012 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include "incdecvolumeoption.h" bool IncDecVolumeCommandLineOption::identify(const QString & str) const { if ( str == QString("--volume-inc") || str == QString("--volume-dec") ) { return true; } return false; } const QString IncDecVolumeCommandLineOption::helpString() const { return QString( "--volume-inc " + tr("Increase volume with step 5")+"\n" "--volume-dec " + tr("Decrease volume with step 5")+"\n" ); } QString IncDecVolumeCommandLineOption::executeCommand(const QString& opt_str, const QStringList &args) { Q_UNUSED(args); SoundCore *core = SoundCore::instance(); int volume = qMax(core->leftVolume(), core->rightVolume()); int balance = 0; int left = core->leftVolume(); int right = core->rightVolume(); if (left || right) balance = (right - left)*100/volume; if (opt_str == "--volume-inc") { volume = qMin (100, volume + 5); } else if (opt_str == "--volume-dec") { volume = qMax (0, volume - 5); } core->setVolume(volume-qMax(balance,0)*volume/100, volume+qMin(balance,0)*volume/100); return QString(); } const QString IncDecVolumeCommandLineOption::name() const { return "IncDecVolumeCommandLineOption"; } QTranslator *IncDecVolumeCommandLineOption::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/incdecvolume_plugin_") + locale); return translator; } Q_EXPORT_PLUGIN2(incdecvolumeoption, IncDecVolumeCommandLineOption) qmmp-0.7.4/src/plugins/CommandLineOptions/CMakeLists.txt0000664000175000017500000000020212256224736021771 0ustar useruseradd_subdirectory(IncDecVolumeOption) add_subdirectory(SeekOption) add_subdirectory(StatusOption) add_subdirectory(PlayListOption) qmmp-0.7.4/src/plugins/CommandLineOptions/CommandLineOptions.pro0000664000175000017500000000017312256224736023524 0ustar useruserTEMPLATE = subdirs SUBDIRS = IncDecVolumeOption \ SeekOption \ StatusOption \ PlayListOption qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/0000775000175000017500000000000012256224736022171 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/playlistoption.h0000664000175000017500000000417112256224736025437 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef PLAYLISTOPTION_H #define PLAYLISTOPTION_H #include #include #include #include #include /** @author Ilya Kotov */ class PlayListOption : public QObject, public CommandLineOption { Q_OBJECT Q_INTERFACES(CommandLineOption) public: virtual bool identify(const QString& opt_str)const; virtual const QString name()const; virtual const QString helpString()const; virtual QString executeCommand(const QString& opt_str, const QStringList &args); virtual QTranslator *createTranslator(QObject *parent); private: QString boolToText(bool enabled); }; #endif qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/CMakeLists.txt0000664000175000017500000000263212256224736024734 0ustar useruserproject(libplaylistoption) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmpui include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(libplaylistoption_SRCS playlistoption.cpp ) SET(libplaylistoption_MOC_HDRS playlistoption.h ) SET(libplaylistoption_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(libplaylistoption_RCC_SRCS ${libplaylistoption_RCCS}) QT4_WRAP_CPP(libplaylistoption_MOC_SRCS ${libplaylistoption_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(playlistoption MODULE ${libplaylistoption_SRCS} ${libplaylistoption_MOC_SRCS} ${libplaylistoption_RCC_SRCS}) add_dependencies(playlistoption qmmpui) target_link_libraries(playlistoption ${QT_LIBRARIES} -lqmmpui -lqmmp) install(TARGETS playlistoption DESTINATION ${LIB_DIR}/qmmp/CommandLineOptions) qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/PlayListOption.pro0000664000175000017500000000226212256224736025647 0ustar useruserinclude(../../plugins.pri) CONFIG += release \ warn_on \ plugin \ lib TARGET =$$PLUGINS_PREFIX/CommandLineOptions/playlistoption QMAKE_CLEAN =$$PLUGINS_PREFIX/CommandLineOptions/libplaylistoption.so TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/playlist_plugin_cs.ts \ translations/playlist_plugin_de.ts \ translations/playlist_plugin_pl.ts \ translations/playlist_plugin_ru.ts \ translations/playlist_plugin_uk_UA.ts \ translations/playlist_plugin_zh_TW.ts \ translations/playlist_plugin_zh_CN.ts \ translations/playlist_plugin_it.ts \ translations/playlist_plugin_tr.ts \ translations/playlist_plugin_lt.ts \ translations/playlist_plugin_nl.ts \ translations/playlist_plugin_ja.ts \ translations/playlist_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/CommandLineOptions INSTALLS += target INCLUDEPATH += ../../../../src LIBS += -lqmmpui -lqmmp HEADERS += playlistoption.h SOURCES += playlistoption.cpp qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/0000775000175000017500000000000012256224736024712 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_CN.ts0000664000175000017500000000461212256224736031565 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_zh_TW.ts0000664000175000017500000000461212256224736031617 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_gl_ES.ts0000664000175000017500000000512612256224736031556 0ustar useruser PlayListOption Show playlist manipulation commands Mostrar os comandos de manipulación de lista de reprodución List all available playlists Amosar tódalas listas de reprodución dispoñibles Show playlist content Amosar o contido da lista Play track <track> in playlist <id> Reproducir a pista <track> na lista <id> Clear playlist Limpar lista de reprodución Toggle playlist repeat Activar repetición de lista Toggle playlist shuffle Activar orde aleatoria Show playlist options Amosar opcións de lista de reprodución Invalid playlist ID ID de lista de reprodución non válida Invalid number of arguments Número de argumentos non válido Invalid track ID ID de pista non válido qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/translations.qrc0000664000175000017500000000154512256224736030147 0ustar useruser playlist_plugin_ru.qm playlist_plugin_uk_UA.qm playlist_plugin_zh_CN.qm playlist_plugin_zh_TW.qm playlist_plugin_tr.qm playlist_plugin_cs.qm playlist_plugin_pt_BR.qm playlist_plugin_de.qm playlist_plugin_pl_PL.qm playlist_plugin_fr.qm playlist_plugin_it.qm playlist_plugin_kk.qm playlist_plugin_lt.qm playlist_plugin_hu.qm playlist_plugin_nl.qm playlist_plugin_ja.qm playlist_plugin_sk.qm playlist_plugin_es.qm playlist_plugin_he.qm playlist_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_uk_UA.ts0000664000175000017500000000566612256224736031602 0ustar useruser PlayListOption Show playlist manipulation commands Показати команди керування списком відтворення List all available playlists Показати всі доступні списки відтворення Show playlist content Показати вміст списка відтворення Play track <track> in playlist <id> Відтворити трек <track> в списку <id> Clear playlist Очистити список відтворення Toggle playlist repeat Увімкнути/вимкнути повторення списка відтворення Toggle playlist shuffle Увімкнути/вимкнути режим випадкового відтворення Show playlist options Показати налаштування списка відткорення Invalid playlist ID Невірний номер списка відтворення Invalid number of arguments Невірне число аргументів Invalid track ID Невірний номер трека qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_de.ts0000664000175000017500000000514512256224736031156 0ustar useruser PlayListOption Show playlist manipulation commands Befehle zum Steuern der Wiedergabeliste anzeigen List all available playlists Alle verfügbaren Wiedergabelisten anzeigen Show playlist content Inhalt der Wiedergabeliste anzeigen Play track <track> in playlist <id> Stück <track> aus der Wiedergabeliste <id> abspielen Clear playlist Wiedergabeliste leeren Toggle playlist repeat Wiederholung der Wiedergabeliste an/aus Toggle playlist shuffle Zufallswiedergabe der Wiedergabeliste an/aus Show playlist options Wiedergabelisten-Einstellungen anzeigen Invalid playlist ID Ungültige Wiedergabenlisten-ID Invalid number of arguments Ungültige Anzahl an Argumenten Invalid track ID Ungültige Stück-ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_cs.ts0000664000175000017500000000507312256224736031173 0ustar useruser PlayListOption Show playlist manipulation commands Zobrazit příkazy pro práci se seznamem skladeb List all available playlists Vypsat všechny dostupné seznamy skladeb Show playlist content Zobrazit obsah seznamu skladeb Play track <track> in playlist <id> Přehrát stopu <track> ze seznamu <id> Clear playlist Vyprázdnit seznam skladeb Toggle playlist repeat Přepnout opakování seznamu skladeb Toggle playlist shuffle Přepnout zamíchání seznamu skladeb Show playlist options Zobrazit možnosti seznamu skladeb Invalid playlist ID Neplatné ID seznamu skladeb Invalid number of arguments Špatný počet argumentů Invalid track ID Neplatné ID stopy qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_es.ts0000664000175000017500000000460712256224736031177 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_fr.ts0000664000175000017500000000461212256224736031173 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_he.ts0000664000175000017500000000461212256224736031160 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_hu.ts0000664000175000017500000000461212256224736031200 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ja.ts0000664000175000017500000000526112256224736031157 0ustar useruser PlayListOption Show playlist manipulation commands プレイリストを操作するコマンドを表示 List all available playlists すべての利用可能なプレイリストを一覧表示 Show playlist content プレイリストの内容を表示 Play track <track> in playlist <id> <id> 番プレイリストより <track> 番目を再生 Clear playlist プレイリストを消去 Toggle playlist repeat プレイリスト繰り返しの有無を切り替え Toggle playlist shuffle プレイリストのシャッフルの有無を切り替え Show playlist options プレイリストのオプションを表示 Invalid playlist ID プレイリストの ID が不正 Invalid number of arguments 引数の項目数が不正 Invalid track ID トラックの ID が不正 qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_it.ts0000664000175000017500000000460712256224736031204 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_kk.ts0000664000175000017500000000461212256224736031171 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_lt.ts0000664000175000017500000000533012256224736031201 0ustar useruser PlayListOption Show playlist manipulation commands Rodyti grojaraščio pagalbą List all available playlists Rodyti visus grojaraščius Show playlist content Rodyti grojaraščio turinį Play track <track> in playlist <id> Groti takelį <track> grojaraštyje <id> Clear playlist Išvalyti grojaraštį Toggle playlist repeat Įjungti grojaraščio kartojimą Toggle playlist shuffle Įjungti grojaraščio sumaišymą Show playlist options Rodyti grojaraščio pasirinkimus Invalid playlist ID Neteisingas grojaraščio ID Invalid number of arguments Neteisingas argumentų kiekis Invalid track ID Neteisingas takelio ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_nl.ts0000664000175000017500000000507312256224736031177 0ustar useruser PlayListOption Show playlist manipulation commands Weergeef afspeellijst manipulatie commando's List all available playlists Weergeef alle beschikbare afspeellijsten Show playlist content Weergeef de inhoud van de afspeellijst Play track <track> in playlist <id> Speel nummer <track> in afspeellijst <id> Clear playlist Maak afspeellijst leeg Toggle playlist repeat Schakel herhaling in afspeellijst Toggle playlist shuffle Schakel schudden in afspeellijst Show playlist options Weergeef opties voor afspeellijst Invalid playlist ID Ongeldige ID voor afspeellijst Invalid number of arguments Ongeldig nummer van argumenten Invalid track ID Ongeldig nummer ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pl.ts0000664000175000017500000000511612256224736031177 0ustar useruser PlayListOption Show playlist manipulation commands Pokaż komendy do manipulacji listami odtwarzania List all available playlists Lista wszystkich dostępnych list odtwarzania Show playlist content Pokaż zawartość listy odtwarzania Play track <track> in playlist <id> Odtwórz utwór <track> na liście <id> Clear playlist Wyczyść listę odtwarzania Toggle playlist repeat Przełącz na powtarzanie listy Toggle playlist shuffle Przełącz na losowe odtwarzanie listy Show playlist options Pokaż opcje listy odtwarzania Invalid playlist ID Niewłaściwy ID listy odtwarzania Invalid number of arguments Niewłaściwa liczba argumentów Invalid track ID Niewłaściwe ID utworu qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_ru.ts0000664000175000017500000000603212256224736031210 0ustar useruser PlayListOption Show playlist manipulation commands Показать команды для работы со списком воспроизведения List all available playlists Показать все доступные списки воспроизведения Show playlist content Показать содержимое списка воспроизведения Play track <track> in playlist <id> Воспроизвести трек <track> в списке воспроизведения <id> Clear playlist Очистить список воспроизведения Toggle playlist repeat Включить/выключить повтор списка воспроизведения Toggle playlist shuffle Включить/выключить случайный порядок Show playlist options Показать настройки списка воспроизведения Invalid playlist ID Неправильный номер списка воспроизведения Invalid number of arguments Неправильное число аргументов Invalid track ID Неправильный номер трека qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_sk.ts0000664000175000017500000000461212256224736031201 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_tr.ts0000664000175000017500000000461212256224736031211 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pl_PL.ts0000664000175000017500000000512112256224736031566 0ustar useruser PlayListOption Show playlist manipulation commands Pokaż komendy do manipulacji listami odtwarzania List all available playlists Lista wszystkich dostępnych list odtwarzania Show playlist content Pokaż zawartość listy odtwarzania Play track <track> in playlist <id> Odtwórz utwór <track> na liście <id> Clear playlist Wyczyść listę odtwarzania Toggle playlist repeat Przełącz na powtarzanie listy Toggle playlist shuffle Przełącz na losowe odtwarzanie listy Show playlist options Pokaż opcje listy odtwarzania Invalid playlist ID Niewłaściwy ID listy odtwarzania Invalid number of arguments Niewłaściwa liczba argumentów Invalid track ID Niewłaściwe ID utworu qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/translations/playlist_plugin_pt_BR.ts0000664000175000017500000000461212256224736031572 0ustar useruser PlayListOption Show playlist manipulation commands List all available playlists Show playlist content Play track <track> in playlist <id> Clear playlist Toggle playlist repeat Toggle playlist shuffle Show playlist options Invalid playlist ID Invalid number of arguments Invalid track ID qmmp-0.7.4/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp0000664000175000017500000001433512256224736025775 0ustar useruser/*************************************************************************** * Copyright (C) 2011 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include #include #include "playlistoption.h" bool PlayListOption::identify(const QString & str) const { return str == QString("--pl-help") || str == QString("--pl-list") || str == QString("--pl-dump") || str == QString("--pl-play") || str == QString("--pl-clear") || str == QString("--pl-repeat-toggle") || str == QString("--pl-shuffle-toggle") || str == QString("--pl-state"); } const QString PlayListOption::helpString() const { return QString( "--pl-help " + tr("Show playlist manipulation commands")+"\n" ); } QString PlayListOption::executeCommand(const QString& opt_str, const QStringList &args) { Q_UNUSED(args); QString out; PlayListManager *pl_manager = PlayListManager::instance(); MediaPlayer *player = MediaPlayer::instance(); if(opt_str == "--pl-help") { out = "--pl-list " + tr("List all available playlists")+"\n"+ "--pl-dump " + tr("Show playlist content")+"\n" + "--pl-play " + tr("Play track in playlist ")+"\n" + "--pl-clear " + tr("Clear playlist")+"\n"+ "--pl-repeat-toggle " + tr("Toggle playlist repeat")+"\n"+ "--pl-shuffle-toggle " + tr("Toggle playlist shuffle")+"\n"+ "--pl-state " + tr("Show playlist options")+"\n"; } else if(opt_str == "--pl-list") { QStringList names = pl_manager->playListNames(); for(int i = 0; i < names.count(); ++i) { if(i == pl_manager->currentPlayListIndex()) out += QString("%1. %2 [*]\n").arg(i+1).arg(names.at(i)); else out += QString("%1. %2\n").arg(i+1).arg(names.at(i)); } } else if(opt_str == "--pl-dump") { MetaDataFormatter formatter("%p%if(%p&%t, - ,)%t%if(%p,,%if(%t,,%f))%if(%l, - %l,)"); int id = args.isEmpty() ? pl_manager->currentPlayListIndex() : args.at(0).toInt() - 1; PlayListModel *model = pl_manager->playListAt(id); if(!model) return tr("Invalid playlist ID") + "\n"; for(int i = 0; i < model->count(); ++i) { out += QString("%1. %2").arg(i+1).arg(formatter.parse(model->item(i))); if(i == model->currentIndex()) out += " [*]"; out += "\n"; } } else if(opt_str == "--pl-play") { if(args.count() > 2 || args.isEmpty()) return tr("Invalid number of arguments") + "\n"; int pl_id = (args.count() == 1) ? pl_manager->currentPlayListIndex() : args.at(0).toInt() - 1; int track_id = (args.count() == 1) ? args.at(0).toInt() - 1 : args.at(1).toInt() - 1; PlayListModel *model = pl_manager->playListAt(pl_id); if(!model) return tr("Invalid playlist ID") + "\n"; PlayListItem *item = model->item(track_id); if(!item) return tr("Invalid track ID") + "\n"; player->stop(); pl_manager->activatePlayList(model); pl_manager->selectPlayList(model); model->setCurrent(item); player->play(); } else if(opt_str == "--pl-clear") { int id = args.isEmpty() ? pl_manager->currentPlayListIndex() : args.at(0).toInt() - 1; PlayListModel *model = pl_manager->playListAt(id); if(!model) return tr("Invalid playlist ID") + "\n"; model->clear(); } else if(opt_str == "--pl-repeat-toggle") { player->setRepeatable(!player->isRepeatable()); } else if(opt_str == "--pl-shuffle-toggle") { pl_manager->setShuffle(!pl_manager->isShuffle()); } else if(opt_str == "--pl-state") { out += "SHUFFLE: " + boolToText(pl_manager->isShuffle()) + "\n"; out += "REPEAT PLAYLIST: " + boolToText(pl_manager->isRepeatableList()) + "\n"; out += "REPEAT TRACK: " + boolToText(player->isRepeatable()) + "\n"; out += "NO PLAYLIST ADVANCE: " + boolToText(player->isNoPlaylistAdvance()) + "\n"; } return out; } const QString PlayListOption::name() const { return "PlayListOption"; } QTranslator *PlayListOption::createTranslator(QObject *parent) { QTranslator *translator = new QTranslator(parent); QString locale = Qmmp::systemLanguageID(); translator->load(QString(":/playlist_plugin_") + locale); return translator; } QString PlayListOption::boolToText(bool enabled) { return QString(enabled ? "[+]" : "[-]"); } Q_EXPORT_PLUGIN2(playlistoption, PlayListOption) qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/0000775000175000017500000000000012256224736021317 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/CMakeLists.txt0000664000175000017500000000245112256224736024061 0ustar useruserproject(seekoption) cmake_minimum_required(VERSION 2.4.7) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) # qt plugin ADD_DEFINITIONS( -Wall ) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) ADD_DEFINITIONS(-DQT_THREAD) include_directories(${CMAKE_CURRENT_BINARY_DIR}) SET(QT_INCLUDES ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/../../../ ) # libqmmpui include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmpui) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) SET(seekoption_SRCS seekoption.cpp ) SET(seekoption_MOC_HDRS seekoption.h ) SET(seekoption_RCCS translations/translations.qrc) QT4_ADD_RESOURCES(seekoption_RCC_SRCS ${seekoption_RCCS}) QT4_WRAP_CPP(seekoption_MOC_SRCS ${seekoption_MOC_HDRS}) # Don't forget to include output directory, otherwise # the UI file won't be wrapped! include_directories(${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(seekoption MODULE ${seekoption_SRCS} ${seekoption_MOC_SRCS} ${seekoption_RCC_SRCS}) add_dependencies(seekoption qmmpui) target_link_libraries(seekoption ${QT_LIBRARIES} -lqmmpui -lqmmp) install(TARGETS seekoption DESTINATION ${LIB_DIR}/qmmp/CommandLineOptions) qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/SeekOption.pro0000664000175000017500000000215712256224736024126 0ustar useruserinclude(../../plugins.pri) CONFIG += release \ warn_on \ plugin \ lib TARGET = $$PLUGINS_PREFIX/CommandLineOptions/seekoption QMAKE_CLEAN = $$PLUGINS_PREFIX/CommandLineOptions/libseekoption.so TEMPLATE = lib QMAKE_LIBDIR += ../../../../lib TRANSLATIONS = translations/seek_plugin_cs.ts \ translations/seek_plugin_de.ts \ translations/seek_plugin_pl.ts \ translations/seek_plugin_ru.ts \ translations/seek_plugin_uk_UA.ts \ translations/seek_plugin_zh_TW.ts \ translations/seek_plugin_zh_CN.ts \ translations/seek_plugin_it.ts \ translations/seek_plugin_tr.ts \ translations/seek_plugin_lt.ts \ translations/seek_plugin_nl.ts \ translations/seek_plugin_ja.ts \ translations/seek_plugin_es.ts RESOURCES = translations/translations.qrc isEmpty(LIB_DIR){ LIB_DIR = /lib } target.path = $$LIB_DIR/qmmp/CommandLineOptions INSTALLS += target INCLUDEPATH += ../../../../src LIBS += -lqmmpui -lqmmp HEADERS += seekoption.h SOURCES += seekoption.cpp qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/0000775000175000017500000000000012256224736024040 5ustar useruserqmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_uk_UA.ts0000664000175000017500000000142512256224736030003 0ustar useruser SeekOption Seek to position in the current track Перейти до позиції всередині поточного трека Seek forward Перейти вперед Seek backwards Перейти назад qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/translations.qrc0000664000175000017500000000142512256224736027272 0ustar useruser seek_plugin_ru.qm seek_plugin_uk_UA.qm seek_plugin_zh_CN.qm seek_plugin_zh_TW.qm seek_plugin_tr.qm seek_plugin_cs.qm seek_plugin_pt_BR.qm seek_plugin_de.qm seek_plugin_pl_PL.qm seek_plugin_fr.qm seek_plugin_it.qm seek_plugin_kk.qm seek_plugin_lt.qm seek_plugin_hu.qm seek_plugin_nl.qm seek_plugin_ja.qm seek_plugin_sk.qm seek_plugin_es.qm seek_plugin_he.qm seek_plugin_gl_ES.qm qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_pl_PL.ts0000664000175000017500000000133312256224736030003 0ustar useruser SeekOption Seek to position in the current track Przewiń do pozycji w aktualnym utworze Seek forward Przewiń do przodu Seek backwards Przewiń do tyłu qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_pt_BR.ts0000664000175000017500000000130712256224736030004 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_zh_CN.ts0000664000175000017500000000131212256224736027773 0ustar useruser SeekOption Seek to position in the current track 在当前音轨移动到定位处 Seek forward 下一定位 Seek backwards 上一定位 qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_zh_TW.ts0000664000175000017500000000131212256224736030025 0ustar useruser SeekOption Seek to position in the current track 在當前音軌移動到定位處 Seek forward 下一定位 Seek backwards 上一定位 qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_de.ts0000664000175000017500000000133312256224736027365 0ustar useruser SeekOption Seek to position in the current track Zu Position im derzeitigen Stück spulen Seek forward Vorwärts spulen Seek backwards Rückwärts spulen qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_cs.ts0000664000175000017500000000131712256224736027404 0ustar useruser SeekOption Seek to position in the current track Přejít na pozici v aktuální stopě Seek forward Jít dopředu Seek backwards Jít dozadu qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_es.ts0000664000175000017500000000131012256224736027377 0ustar useruser SeekOption Seek to position in the current track Ir hasta una posición en la pista actual Seek forward Avanzar Seek backwards Retroceder qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_fr.ts0000664000175000017500000000130712256224736027405 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_he.ts0000664000175000017500000000130712256224736027372 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_hu.ts0000664000175000017500000000130712256224736027412 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_ja.ts0000664000175000017500000000133112256224736027365 0ustar useruser SeekOption Seek to position in the current track 現行トラックの指定位置まで走査 Seek forward 前へ走査 Seek backwards 後ろへ走査 qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_it.ts0000664000175000017500000000130712256224736027412 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_kk.ts0000664000175000017500000000130712256224736027403 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_lt.ts0000664000175000017500000000131112256224736027410 0ustar useruser SeekOption Seek to position in the current track Sekti iki nurodyto laiko takelyje Seek forward Sekti pirmyn Seek backwards Sekti atgal qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_nl.ts0000664000175000017500000000134112256224736027405 0ustar useruser SeekOption Seek to position in the current track Verplaats naar positie in huidige nummer Seek forward Verplaats naar voren Seek backwards Verplaats naar achteren qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_pl.ts0000664000175000017500000000133312256224736027410 0ustar useruser SeekOption Seek to position in the current track Przewiń do pozycji w aktualnym utworze Seek forward Przewiń do przodu Seek backwards Przewiń do tyłu qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_ru.ts0000664000175000017500000000141612256224736027425 0ustar useruser SeekOption Seek to position in the current track Перейти к позиции внутри текущего трека Seek forward Перейти вперёд Seek backwards Перейти назад qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_sk.ts0000664000175000017500000000130712256224736027413 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_tr.ts0000664000175000017500000000130712256224736027423 0ustar useruser SeekOption Seek to position in the current track Seek forward Seek backwards qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/translations/seek_plugin_gl_ES.ts0000664000175000017500000000131412256224736027765 0ustar useruser SeekOption Seek to position in the current track Ir a posición na pista actual Seek forward Ir cara adiante Seek backwards Ir cara atrás qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/seekoption.h0000664000175000017500000000401012256224736023643 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef SEEKOPTION_H #define SEEKOPTION_H #include #include #include #include #include class SeekOption : public QObject, public CommandLineOption { Q_OBJECT Q_INTERFACES(CommandLineOption) public: virtual bool identify(const QString& opt_str)const; virtual const QString name()const; virtual const QString helpString()const; virtual QString executeCommand(const QString& opt_str, const QStringList &args); virtual QTranslator *createTranslator(QObject *parent); }; #endif qmmp-0.7.4/src/plugins/CommandLineOptions/SeekOption/seekoption.cpp0000664000175000017500000000672212256224736024212 0ustar useruser/*************************************************************************** * Copyright (C) 2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * 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 program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include #include #include #include #include #include "seekoption.h" bool SeekOption::identify(const QString &str) const { QStringList opts; opts << "--seek" << "--seek-fwd" << "--seek-bwd"; return opts.contains(str); } const QString SeekOption::helpString() const { QString help; help += QString("--seek