Full Code of jonsafari/mocp for AI

master 48b48e593690 cached
158 files
1.3 MB
388.1k tokens
2096 symbols
1 requests
Download .txt
Showing preview only (1,377K chars total). Download the full file or copy to clipboard to get everything.
Repository: jonsafari/mocp
Branch: master
Commit: 48b48e593690
Files: 158
Total size: 1.3 MB

Directory structure:
gitextract_ut8lc7lf/

├── AUTHORS
├── COPYING
├── ChangeLog
├── Doxyfile
├── INSTALL
├── Makefile.am
├── NEWS
├── README
├── README.md
├── README_equalizer
├── THANKS
├── TODO
├── alsa.c
├── alsa.h
├── audio.c
├── audio.h
├── audio_conversion.c
├── audio_conversion.h
├── common.c
├── common.h
├── compat.c
├── compat.h
├── compiler.h
├── config.example.in
├── config.rpath
├── configure.in
├── decoder.c
├── decoder.h
├── decoder_plugins/
│   ├── Makefile.am
│   ├── aac/
│   │   ├── Makefile.am
│   │   ├── aac.c
│   │   └── aac.m4
│   ├── decoders.m4
│   ├── ffmpeg/
│   │   ├── Makefile.am
│   │   ├── ffmpeg.c
│   │   └── ffmpeg.m4
│   ├── flac/
│   │   ├── Makefile.am
│   │   ├── flac.c
│   │   └── flac.m4
│   ├── modplug/
│   │   ├── Makefile.am
│   │   ├── modplug.c
│   │   └── modplug.m4
│   ├── mp3/
│   │   ├── Makefile.am
│   │   ├── mp3.c
│   │   ├── mp3.m4
│   │   ├── xing.c
│   │   └── xing.h
│   ├── musepack/
│   │   ├── Makefile.am
│   │   ├── musepack.c
│   │   └── musepack.m4
│   ├── sidplay2/
│   │   ├── Makefile.am
│   │   ├── sidplay2.cc
│   │   ├── sidplay2.h
│   │   └── sidplay2.m4
│   ├── sndfile/
│   │   ├── Makefile.am
│   │   ├── sndfile.c
│   │   └── sndfile.m4
│   ├── speex/
│   │   ├── Makefile.am
│   │   ├── speex.c
│   │   └── speex.m4
│   ├── timidity/
│   │   ├── Makefile.am
│   │   ├── timidity.c
│   │   └── timidity.m4
│   ├── vorbis/
│   │   ├── Makefile.am
│   │   ├── vorbis.c
│   │   └── vorbis.m4
│   └── wavpack/
│       ├── Makefile.am
│       ├── wavpack.c
│       └── wavpack.m4
├── doxy_pages/
│   ├── decoder_api.doxy
│   ├── main_page.doxy
│   └── sound_output_driver_api.doxy
├── equalizer.c
├── equalizer.h
├── fifo_buf.c
├── fifo_buf.h
├── files.c
├── files.h
├── interface.c
├── interface.h
├── interface_elements.c
├── interface_elements.h
├── io.c
├── io.h
├── io_curl.c
├── io_curl.h
├── jack.c
├── jack.h
├── keymap.example
├── keys.c
├── keys.h
├── lists.c
├── lists.h
├── log.c
├── log.h
├── lyrics.c
├── lyrics.h
├── m4/
│   ├── ax_c___attribute__.m4
│   ├── ax_cflags_gcc_option.m4
│   ├── ax_compare_version.m4
│   ├── ax_gcc_func_attribute.m4
│   ├── ax_gcc_var_attribute.m4
│   ├── ax_path_bdb.m4
│   ├── ax_pthread.m4
│   ├── ax_require_defined.m4
│   └── ax_with_curses.m4
├── main.c
├── md5.c
├── md5.h
├── menu.c
├── menu.h
├── mocp.1
├── null_out.c
├── null_out.h
├── options.c
├── options.h
├── oss.c
├── oss.h
├── out_buf.c
├── out_buf.h
├── player.c
├── player.h
├── playlist.c
├── playlist.h
├── playlist_file.c
├── playlist_file.h
├── protocol.c
├── protocol.h
├── rbtree.c
├── rbtree.h
├── rcc.c
├── rcc.h
├── server.c
├── server.h
├── sndio_out.c
├── sndio_out.h
├── softmixer.c
├── softmixer.h
├── tags_cache.c
├── tags_cache.h
├── themes/
│   ├── Makefile.am
│   ├── black_theme
│   ├── darkdot_theme
│   ├── example_theme
│   ├── green_theme
│   ├── moca_theme
│   ├── nightly_theme
│   ├── red_theme
│   ├── transparent-background
│   ├── variant_red_theme
│   └── yellow_red_theme
├── themes.c
├── themes.h
├── tools/
│   ├── README
│   ├── maketests.sh
│   └── md5check.sh
├── utf8.c
└── utf8.h

================================================
FILE CONTENTS
================================================

================================================
FILE: AUTHORS
================================================
Damian Pietras <daper@daper.net>


================================================
FILE: COPYING
================================================
		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

			    NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

	    How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) year name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.


================================================
FILE: ChangeLog
================================================
See the NEWS file.


================================================
FILE: Doxyfile
================================================
PROJECT_NAME           = MOC
PROJECT_NUMBER         = 2.6-alpha3
OUTPUT_DIRECTORY       = technical_docs
CREATE_SUBDIRS         = NO
OUTPUT_LANGUAGE        = English
USE_WINDOWS_ENCODING   = NO
BRIEF_MEMBER_DESC      = YES
REPEAT_BRIEF           = YES
ABBREVIATE_BRIEF       =
ALWAYS_DETAILED_SEC    = NO
INLINE_INHERITED_MEMB  = NO
FULL_PATH_NAMES        = YES
STRIP_FROM_PATH        =
STRIP_FROM_INC_PATH    =
SHORT_NAMES            = NO
JAVADOC_AUTOBRIEF      = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP         = NO
INHERIT_DOCS           = YES
DISTRIBUTE_GROUP_DOC   = YES
TAB_SIZE               = 8
ALIASES                =
OPTIMIZE_OUTPUT_FOR_C  = YES
OPTIMIZE_OUTPUT_JAVA   = NO
SUBGROUPING            = YES
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_STATIC         = NO
EXTRACT_LOCAL_CLASSES  = YES
EXTRACT_LOCAL_METHODS  = NO
HIDE_UNDOC_MEMBERS     = YES
HIDE_UNDOC_CLASSES     = YES
HIDE_FRIEND_COMPOUNDS  = NO
HIDE_IN_BODY_DOCS      = NO
INTERNAL_DOCS          = NO
CASE_SENSE_NAMES       = YES
HIDE_SCOPE_NAMES       = NO
SHOW_INCLUDE_FILES     = NO
INLINE_INFO            = YES
SORT_MEMBER_DOCS       = YES
SORT_BRIEF_DOCS        = NO
SORT_BY_SCOPE_NAME     = NO
GENERATE_TODOLIST      = YES
GENERATE_TESTLIST      = YES
GENERATE_BUGLIST       = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS       =
MAX_INITIALIZER_LINES  = 30
SHOW_USED_FILES        = YES
SHOW_DIRECTORIES       = NO
FILE_VERSION_FILTER    =
QUIET                  = NO
WARNINGS               = YES
WARN_IF_UNDOCUMENTED   = YES
WARN_IF_DOC_ERROR      = YES
WARN_NO_PARAMDOC       = NO
WARN_FORMAT            = "$file:$line: $text"
WARN_LOGFILE           =
INPUT                  =
FILE_PATTERNS          = *.c *.h *.doxy
RECURSIVE              = YES
EXCLUDE                =
EXCLUDE_SYMLINKS       = NO
EXCLUDE_PATTERNS       =
EXAMPLE_PATH           =
EXAMPLE_PATTERNS       =
EXAMPLE_RECURSIVE      = NO
IMAGE_PATH             =
INPUT_FILTER           =
FILTER_PATTERNS        =
FILTER_SOURCE_FILES    = NO
SOURCE_BROWSER         = NO
INLINE_SOURCES         = NO
STRIP_CODE_COMMENTS    = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION    = YES
VERBATIM_HEADERS       = YES
ALPHABETICAL_INDEX     = NO
COLS_IN_ALPHA_INDEX    = 5
IGNORE_PREFIX          =
GENERATE_HTML          = YES
HTML_OUTPUT            = html
HTML_FILE_EXTENSION    = .html
HTML_HEADER            =
HTML_FOOTER            =
HTML_STYLESHEET        =
HTML_ALIGN_MEMBERS     = YES
GENERATE_HTMLHELP      = NO
CHM_FILE               =
HHC_LOCATION           =
GENERATE_CHI           = NO
BINARY_TOC             = NO
TOC_EXPAND             = NO
DISABLE_INDEX          = NO
ENUM_VALUES_PER_LINE   = 4
GENERATE_TREEVIEW      = NO
TREEVIEW_WIDTH         = 250
GENERATE_LATEX         = YES
LATEX_OUTPUT           = latex
LATEX_CMD_NAME         = latex
MAKEINDEX_CMD_NAME     = makeindex
COMPACT_LATEX          = NO
PAPER_TYPE             = a4wide
EXTRA_PACKAGES         =
LATEX_HEADER           =
PDF_HYPERLINKS         = NO
USE_PDFLATEX           = NO
LATEX_BATCHMODE        = NO
LATEX_HIDE_INDICES     = NO
GENERATE_RTF           = NO
RTF_OUTPUT             = rtf
COMPACT_RTF            = NO
RTF_HYPERLINKS         = NO
RTF_STYLESHEET_FILE    =
RTF_EXTENSIONS_FILE    =
GENERATE_MAN           = NO
MAN_OUTPUT             = man
MAN_EXTENSION          = .3
MAN_LINKS              = NO
GENERATE_XML           = NO
XML_OUTPUT             = xml
XML_SCHEMA             =
XML_DTD                =
XML_PROGRAMLISTING     = YES
GENERATE_AUTOGEN_DEF   = NO
GENERATE_PERLMOD       = NO
PERLMOD_LATEX          = NO
PERLMOD_PRETTY         = YES
PERLMOD_MAKEVAR_PREFIX =
ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = NO
EXPAND_ONLY_PREDEF     = NO
SEARCH_INCLUDES        = YES
INCLUDE_PATH           =
INCLUDE_FILE_PATTERNS  =
PREDEFINED             =
EXPAND_AS_DEFINED      =
SKIP_FUNCTION_MACROS   = YES
TAGFILES               =
GENERATE_TAGFILE       =
ALLEXTERNALS           = NO
EXTERNAL_GROUPS        = YES
PERL_PATH              = /usr/bin/perl
CLASS_DIAGRAMS         = YES
HIDE_UNDOC_RELATIONS   = YES
HAVE_DOT               = NO
CLASS_GRAPH            = YES
COLLABORATION_GRAPH    = YES
GROUP_GRAPHS           = YES
UML_LOOK               = NO
TEMPLATE_RELATIONS     = NO
INCLUDE_GRAPH          = YES
INCLUDED_BY_GRAPH      = YES
CALL_GRAPH             = NO
GRAPHICAL_HIERARCHY    = YES
DIRECTORY_GRAPH        = YES
DOT_IMAGE_FORMAT       = png
DOT_PATH               =
DOTFILE_DIRS           =
MAX_DOT_GRAPH_WIDTH    = 1024
MAX_DOT_GRAPH_HEIGHT   = 1024
MAX_DOT_GRAPH_DEPTH    = 0
DOT_TRANSPARENT        = NO
DOT_MULTI_TARGETS      = NO
GENERATE_LEGEND        = YES
DOT_CLEANUP            = YES
SEARCHENGINE           = NO


================================================
FILE: INSTALL
================================================
Installation Instructions
*************************

Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.

   Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without warranty of any kind.

Basic Installation
==================

   Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package.  The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.  Some packages provide this
`INSTALL' file but do not implement all of the features documented
below.  The lack of an optional feature in a given package is not
necessarily a bug.  More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').

   It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring.  Caching is
disabled by default to prevent problems with accidental use of stale
cache files.

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.

   The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'.  You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.

   The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.

     Running `configure' might take a while.  While running, it prints
     some messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package, generally using the just-built uninstalled binaries.

  4. Type `make install' to install the programs and any data files and
     documentation.  When installing into a prefix owned by root, it is
     recommended that the package be configured and built as a regular
     user, and only the `make install' phase executed with root
     privileges.

  5. Optionally, type `make installcheck' to repeat any self-tests, but
     this time using the binaries in their final installed location.
     This target does not install anything.  Running this target as a
     regular user, particularly if the prior `make install' required
     root privileges, verifies that the installation completed
     correctly.

  6. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

  7. Often, you can also type `make uninstall' to remove the installed
     files again.  In practice, not all packages have tested that
     uninstallation works correctly, even though it is required by the
     GNU Coding Standards.

  8. Some packages, particularly those that use Automake, provide `make
     distcheck', which can by used by developers to test that all other
     targets like `make install' and `make uninstall' work correctly.
     This target is generally not run by end users.

Compilers and Options
=====================

   Some systems require unusual options for compilation or linking that
the `configure' script does not know about.  Run `./configure --help'
for details on some of the pertinent environment variables.

   You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment.  Here
is an example:

     ./configure CC=c99 CFLAGS=-g LIBS=-lposix

   *Note Defining Variables::, for more details.

Compiling For Multiple Architectures
====================================

   You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you can use GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.  This
is known as a "VPATH" build.

   With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory.  After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.

   On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor.  Like
this:

     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
                 CPP="gcc -E" CXXCPP="g++ -E"

   This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.

Installation Names
==================

   By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc.  You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.

   In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files.  Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.  In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.

   The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.

   The first method involves providing an override variable for each
affected directory.  For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'.  Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated.  The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.

   The second method involves providing the `DESTDIR' variable.  For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names.  The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters.  On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.

Optional Features
=================

   If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.

   Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System).  The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

   For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.

   Some packages offer the ability to configure how verbose the
execution of `make' will be.  For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.

Particular systems
==================

   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:

     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"

and if that doesn't work, install pre-built binaries of GCC for HP-UX.

   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
a workaround.  If GNU CC is not installed, it is therefore recommended
to try

     ./configure CC="cc"

and if that doesn't work, try

     ./configure CC="cc -nodtk"

   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.

   On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'.  It is recommended to use the following options:

     ./configure --prefix=/boot/common

Specifying the System Type
==========================

   There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on.  Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:

     CPU-COMPANY-SYSTEM

where SYSTEM can have one of these forms:

     OS
     KERNEL-OS

   See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.

   If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.

   If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.

Sharing Defaults
================

   If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Defining Variables
==================

   Variables not defined in a site shell script can be set in the
environment passed to `configure'.  However, some packages may run
configure again during the build, and the customized values of these
variables may be lost.  In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'.  For example:

     ./configure CC=/usr/local2/bin/gcc

causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).

Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug.  Until the bug is fixed you can use this workaround:

     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash

`configure' Invocation
======================

   `configure' recognizes the following options to control how it
operates.

`--help'
`-h'
     Print a summary of all of the options to `configure', and exit.

`--help=short'
`--help=recursive'
     Print a summary of the options unique to this package's
     `configure', and exit.  The `short' variant lists options used
     only in the top level, while the `recursive' variant lists options
     also present in any nested packages.

`--version'
`-V'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`--cache-file=FILE'
     Enable the cache: use and save the results of the tests in FILE,
     traditionally `config.cache'.  FILE defaults to `/dev/null' to
     disable caching.

`--config-cache'
`-C'
     Alias for `--cache-file=config.cache'.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.  To
     suppress all normal output, redirect it to `/dev/null' (any error
     messages will still be shown).

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`--prefix=DIR'
     Use DIR as the installation prefix.  *note Installation Names::
     for more details, including other options available for fine-tuning
     the installation locations.

`--no-create'
`-n'
     Run the configure checks, but stop before creating any output
     files.

`configure' also accepts some other, not widely useful, options.  Run
`configure --help' for more details.



================================================
FILE: Makefile.am
================================================
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = themes decoder_plugins
AM_CPPFLAGS = -DSYSTEM_THEMES_DIR=\"$(pkgdatadir)/themes\" \
	      -DPLUGIN_DIR=\"$(plugindir)/$(DECODER_PLUGIN_DIR)\"

bin_PROGRAMS = mocp
mocp_SOURCES = log.c \
	       log.h \
	       protocol.h \
	       protocol.c \
	       server.c \
	       server.h \
	       main.c \
	       common.c \
	       common.h \
	       compiler.h \
	       playlist.c \
	       playlist.h \
	       fifo_buf.c \
	       fifo_buf.h \
	       out_buf.c \
	       out_buf.h \
	       audio.c \
	       audio.h \
	       decoder.c \
	       decoder.h \
	       interface.c \
	       interface.h \
	       interface_elements.c \
	       interface_elements.h \
	       menu.c \
	       menu.h \
	       files.c \
	       files.h \
	       options.c \
	       options.h \
	       player.c \
	       player.h \
	       playlist_file.c \
	       playlist_file.h \
	       themes.c \
	       themes.h \
	       keys.c \
	       keys.h \
	       io.c \
	       io.h \
	       compat.c \
	       compat.h \
	       audio_conversion.c \
	       audio_conversion.h \
	       rbtree.c \
	       rbtree.h \
	       tags_cache.c \
	       tags_cache.h \
	       utf8.c \
	       utf8.h \
	       rcc.c \
	       rcc.h \
	       softmixer.c \
	       softmixer.h \
	       lyrics.h \
	       lyrics.c \
	       lists.h \
	       lists.c \
	       equalizer.h \
	       equalizer.c
EXTRA_mocp_SOURCES = \
		     md5.c \
		     md5.h \
		     null_out.c \
		     null_out.h \
		     sndio_out.c \
		     sndio_out.h \
		     oss.c \
		     oss.h \
		     alsa.c \
		     alsa.h \
		     io_curl.c \
		     io_curl.h \
		     jack.c \
		     jack.h
man_MANS = mocp.1
mocp_LDADD = @EXTRA_OBJS@ -lltdl -lm
mocp_DEPENDENCIES = @EXTRA_OBJS@
mocp_LDFLAGS = @EXTRA_LIBS@ $(RCC_LIBS) -export-dynamic
EXTRA_DIST = README_equalizer mocp.1 THANKS keymap.example Doxyfile \
	         doxy_pages/decoder_api.doxy doxy_pages/main_page.doxy \
	         doxy_pages/sound_output_driver_api.doxy
EXTRA_DIST += @EXTRA_DISTS@
EXTRA_DIST += tools/README tools/md5check.sh tools/maketests.sh
noinst_DATA = tools/README
noinst_SCRIPTS = tools/md5check.sh tools/maketests.sh

doc_DATA = config.example THANKS README README_equalizer keymap.example


================================================
FILE: NEWS
================================================
   [Note that all relevant maintenance applied to the stable version has
    also been applied to the development version.  You should review the
    development version changes in conjunction with those of the current
    stable version maintenance releases.]


2.6 - "Usability"  [alpha3: 2016-11-16]
	* Autotools and packaging changes:
	  - Dropped version micro number for development versions
	  - Upgraded autoconf-archive macros to 2014-02-28 release
	  - Replaced custom shell code with Autoconf archive macros
	* Changed build behaviours:
	  - 'make dist': now defaults to XZ compression
	  - curl-config: replaced by pkg-config
	  - New GCC-5 and 6 warnings addressed
	  - Removed checks for POSIX.1 and C99 mandated headers and functions
	* Changed minimum support and release requirements:
	  - POSIX.1: introduced minimum requirement of IEEE 1003.1-2001
	  - C Compiler: introduced minimum requirement of ISO 9899:1999
	  - FFmpeg/LibAV: raised minimum requirement to release 1.0/10.0
	  - FLAC: raised minimum requirement to release 1.1.3
	  - Berkeley DB: raised minimum requirement to release 4.1
	  - libcurl: raised minimum requirement to version 7.15.1
	  - autoconf: raised minimum requirement to version 2.64
	  - ALSA: raised minimum requirement to version 1.0.11
	* New and changed library requirements:
	  - POPT library: MOC now requires libpopt
	* Documentation:
	  - Improved wording of some error messages
	  - Added environment variables section to the manpage
	* Removed functionality:
	  - Transitional code from the previous release
	  - autogen.sh in favour of autoreconf(1)
	  - Deprecated ffmpeg-config support
	  - Warning of changed executable name
	  - Removed "Search Next" interface command
	* Changed functionality:
	  - Decoupled mono-mixing from softmixer
	  - Made command line toggling arguments case insensitive
	* Added functionality:
	  - Introduced in-memory circular logging buffer
	  - Introduced MOCP_POPTRC environment variable
	  - Introduced MOCP_OPTS environment variable
	  - Add 24-bit support to the OSS sound driver (Vladimir Krylov)
	* New and changed command line options:
	  - echo-args: Show POPT-interpreted command line arguments
	* New and changed audio decoders:
	  - All sndfile-supported extensions are now available
	  - Added .mat[45] extensions as aliases for .mat in sndfile decoder
	  - Added .ircam extension as alias for .sf in sndfile decoder
	  - Added reading from Internet streams to FFmpeg decoder (Jenny Wong)
	* Changes to supported formats and codecs:
	  - All formats provided by Sndfile are now supported
	  - DSD: now supported via FFmpeg/LibAV (.dff and .dsf files)
	  - TTA: now supported via FFmpeg/LibAV
	  - VQF: now supported via FFmpeg/LibAV
	* Miscellaneous
	  - Improved logging from ALSA sound driver and library
	  - Fixed displayed ALSA volume percentage drift

2.5.2  [2016-11-16]
	* New configuration file options:
	  - ALSAStutterDefeat: avoid the ALSA bug which causes stuttering
	* Significant bug fixes:
	  - Fixed error during configure on busybox systems
	  - Fixed calculation of average bitrate in FLAC decoder
	  - Fixed unintentional disabling of MMAP support
	  - Fixed build failure on split ncurses/tinfo systems
	  - Fixed unreaped children when running in foreground mode
	  - Fixed freeze on Nokia devices if audios play to completion
	  - Circumvented ALSA stutter bug
	  - Added missing 'Precache' option to example config file
	* Miscellaneous:
	  - Improved the accuracy of the average bitrate for FLAC
	  - Mitigated out-of-file seeking for several formats
	  - Warn of TagLib version requirement rising to 1.5
	  - Warn of Musepack library changing to libmpc (from libmpcdec)

2.5.1  [2016-02-24]
	* Significant bug fixes:
	  - Corrected the setting of linked libraries for Berkeley DB
	  - Fixed ALSA volume setting problem (Tomasz Golinski)
	  - Fixed clearing of stream status message on error
	  - Resolved FFmpeg/LibAV's downmixing API issues (Andreas Cadhalpun)
	  - Removed duplicate logging of fatal error messages
	* Miscellaneous:
	  - Adapted to FFmpeg 3.0 API
	  - Warn of FFmpeg/LibAV version requirement rising to 1.0/10.0
	  - Warn of pending POSIX.1-2001 compliance requirement
	  - Fixed several warnings and errors on OpenBSD (Brent Cook)
	  - Fixed various (and potential) segfaults (Daniel T. Borelli,
	    Hendrik Iben, Rastislav Barlik)
	  - Fixed various resource leakages
	  - Silenced various compiler warnings
	  - Added instructions on building with autoreconf

2.5.0 - "Consolidation"  [2014-08-13]
	* Autotools and packaging changes:
	  - Upgraded autoconf version requirement to 2.60
	  - Added '--with-alsa' to suppress ALSA sound driver inclusion
	  - Added '--without-oss' to suppress OSS sound driver inclusion
	  - Added '--disable-cache' to remove tags cache support
	  - Added specific GDB support to '--enable-debug'
	  - Refactor decoder plug-ins' autoconf scripts into source directories
	  - Ensure that all decoders get into the source distribution tarball
	  - Removed SID decoder's dependance on .la-file presence
	  - Removed distribution-specific .spec file
	  - Minor reformatting of the configure summary
	  - Added warnings for various deprecations and potential problems
	  - Added warnings for unmet future package requirements
	  - Updated GNU boilerplate text
	* Improved support for embedded systems:
	  - Refined FFmpeg decoder configuration for use with cross-compilation
	  - Provided use of Tremor with the Vorbis decoder
	  - Improve portability to non-GNU library platforms
	  - Added --with-libiconv-prefix configure option
	* Audio driver changes:
	  - Allow use of the OSSv4 per-application mixer API
	  - Provided SNDIO support for OpenBSD systems (Alexander Polakov)
	* New and changed audio decoders:
	  - New TiMidity decoder for MIDI (Hendrik Iben)
	  - Migrate AAC decoder to later FAAD2 API (Max Klinger)
	  - Added AAC+ (HE-AAC) support to AAC decoder
	  - New SidPlay2 decoder for SID (Hendrik Iben)
	  - New Modplug decoder (Hendrik Iben)
	  - New WavPack decoder (Alexandrov Sergey)
	  - Renamed SndFile plugin for consistancy
	  - Removed M4A format support from AAC decoder plugin
	  - Removed WAV format support from ModPlug decoder plugin
	  - Detect huge files in certain formats which SndFile cannot play
	  - Improved (drastically in some cases) the accuracy of AAC durations
	* Overhauled FFmpeg/LibAV decoder:
	  - Resolved FFmpeg API deprecations
	  - Provided LibAV compatibility
	  - Provided proper stereo downmixing
	  - Provided locking support for non-thread-safe library functions
	  - Provided better FFmpeg or LibAV discrimination
	  - Provided better audio duration reliability determination
	  - Increased number of decodable formats (including Xiph Opus)
	  - Added decoding of audio from video formats
	  - Added logging of FFmpeg/LibAV messages
	  - Added seeking in most (but not all) formats
	  - Added handling for "planar" codecs
	  - Excluded experimental codecs from decoding
	  - Fixed misreporting of tags, duration and bitrates
	  - Fixed memory and file descriptor leakages
	  - Fixed severe distortion on 8-bit samples
	  - Fixed loop playing FLAC files
	  - Fixed many FFmpeg/LibAV API breakages
	  - Fixed many miscellaneous bugs
	  - Detect over-length (and therefore broken) WAV files
	  - Fixed log formatting when FFmpeg messages contain newline characters
	* Audio reproduction changes:
	  - Improved support for 8-bit sample size
	  - Added software mixer (Hendrik Iben)
	  - Added parametric equalizer (Hendrik Iben)
	  - Fixed many bugs which produced distorted sound
	  - Fixed bugs in 24-bit sample handling (Tomasz Golinski)
	* General configuration file changes:
	  - Reconciled and regularised example config and keymap files
	  - Introduced lists and function-like syntax
	  - Introduced variable substitution
	  - Introduced symbol and boolean option types
	  - Improved security of the configuration file
	  - Automatic clearing of an overridden default key binding
	  - Made processing of keymap file consistant with that of config file
	* Changed configuration file options:
	  - Layout# options moved to a list and function-like syntax
	  - SoundDriver option moved to a list syntax
	  - Renamed OSSMixerChannel to OSSMixerChannel1
	  - Renamed ALSAMixer to ALSAMixer1
	  - QueueNextSongReturn moved to yes/no values
	  - TagsCacheSize set to zero now disables tag caching
	* New configuration file options:
	  - OnSongChange: run an external command (Jack Miller)
	  - RepeatSongChange: govern the running of the OnSongChange command
	  - OnStop: run an external command on stopping
	  - EnforceTagsEncoding: substitutes ID3v1TagsEncoding for ISO-8859-1
	    encoding in ID3v2 tags (Aleks Sherikov)
	  - FileNamesIconv: converts from local to UTF8 encoding for file names
	    (Aleks Sherikov)
	  - NonUTFXterm: converts UTF8 to local encoding for X-Term titles
		(Aleks Sherikov)
	  - AutoLoadLyrics: says whether MOC should look for lyrics files
	  - PreferredDecoders: allow finer control over decoder selection
	  - XTerms: externalises terminals regarded as X-Terms
	  - UseMIMEMagic: says whether to identify audio files by using MIME
	  - JackStartServer: autostart JACK the server (Max Klinger)
	  - ShowTimePercent: set the percent played state (Daniel T. Borelli)
	  - Various options for SidPlay2, Modplug and TiMidity support
	* New command line options:
	  - '-j' to jump to some position in the current track (Nuno Cardoso)
	  - '-O' to override configuration file settings
	  - '-Q' to display user formatted information (Juho Hämäläinen)
	  - '-q' to queue files from command line (Martin Milata)
	  - '-t' and '--on/off' to toggle or set playback options (Jack Miller)
	  - '-v' to set the volume (Jack Miller)
	* Screen handling changes:
	  - Changed minimum screen height to 7 lines (Tero Marttila)
	  - Added support for GNU screen title (Jonathan Derque)
	  - Restored screen to console mode after reporting fatal errors
	  - Populated playlist panel when loading default playlist file
	  - Removed default playlist autofocus at start
	  - Fixed overlength highlight bar
	  - Fixed screen upset when tags contain control characters
	  - Fixed some screen upsets when tags contain UTF-8 characters (firejox)
	  - Fixed screen upset caused by screen(1) mis-detection
	* New and updated client interaction features:
	  - 'a' command: also add a directory to the playlist (Filippo Giunchedi)
	  - 'L' command: display music lyrics (Géraud Le Falher)
	  - 'Y' command: prune unreadable files from the playlist (tyranix)
	  - Queued messages for display in the message area
	  - Added play queue (Martin Milata)
	  - Mark a fragment of a file which can be passed to external commands
	  - Clear status message after a stream open failure
	  - Minor help menu clarifications
	* Improve text entry history and editting:
	  - Recognise ^u (by default) as delete to start of line
	  - Recognise ^k (by default) as delete to end of line
	  - Save and restore entered text prior to history scrolling
	  - Save history entry modifications
	  - Do not save adjacent duplicate entries
	  - Do not save or modify with blank entries
	  - Position cursor at end of restored or history line
	* Theme changes:
	  - Enabled highlighted playlist numbers and file times (Marc Tschiesche)
	  - Fixed miscoloured frame when switching themes (Alexander Polakov)
	  - Fixed default colour settings
	  - Fixed cursor placement in themes menu (Alex Merenstein)
	  - Fixed ordering of theme files in themes menu
	  - Fixed new attributes application on theme switching (Alex Merenstein)
	* General code cleaning:
	  - Refactoring, optimisations and cosmetic improvements
	  - Silenced many build warnings and errors
	  - Replaced various deprecated, legacy and platform-specific functions
	  - Improved thread safety
	* Significant bug fixes:
	  - Fixed stale locks freeze in tags cache database following a crash
	  - Fixed CURL timeout for internet streaming errors (Daniel Stenberg)
	  - Fixed audio distortion on MP3 file having overly long tag values
	  - Fixed false positive stream detection in the MP3 decoder
	  - Fixed Ogg/Vorbis stream detection in the Vorbis decoder
	  - Fixed 'LRINTF error' raised when reconfiguring MOC
	  - Fixed backspace key mishandling
	  - Fixed client interface meta-key handling
	  - Fixed pthread stack overflow segfault on OpenBSD
	  - Fixed segfault when text entry history becomes full
	  - Fixed segfault processing playlists with relative paths
	  - Fixed memory corruptions when toggling tag reading
	  - Fixed assertion when a second client is started
	  - Fixed slow memory leak in client on long-playing streams
	  - Fixed severe distortion on 11025Hz 16-bit mono audios
	  - Fixed freeze at end of playing audio file
	  - Fixed server crash when attempting to play a deleted file
	  - Fixed MIME type detection on HTTP redirection
	  - Fixed crash when mixer value is above 100%
	  - Fixed handling of huge (greater than 2 GiB) files
	  - Fixed sub-second audio truncation on ALSA
	  - Fixed segfault when MIME-detected MP3 file has no "extension"
	  - Fixed segfault when using '--format' without an audio playing
	  - Workaround for streams that have the actual title as tags/comments
	  - Indentified cause of "undefined symbol" build errors
	  - Plugged all known memory and file descriptor leaks
	  - Fixed nonsense duration values returned on some corrupt FLAC files
	  - Fixed 'time >= 0' assertion at change of audio file
	  - Fixed client event notification failure in some circumstances
	  - Fixed client abort on duplicated playlist filenames
	  - Fixed delayed client exit when server invokes long-running scripts
	    (Alex Merenstein)
	  - Fixed occasional server freeze on logging when running scripts
	  - Fixed non-conforming 'User-Agent' HTTP request header
	* Miscellaneous:
	  - Updated and reformatted mocp manpage and equalizer README file
	  - Made many warning and error reports more informative and consistant
	  - Better logging of more problem determination information
	  - More informative version information display
	  - Introduced MD5-based decoder verification tools
	  - Improved compatibility with 64-bit systems
	  - Improved compatibility with big-endian systems
	  - Moved tags cache to a Berkeley DB
	  - Integration of down-stream distribution patches
	  - Fixed frames to duration calculations in ALSA
	  - Fixed some mutex management bugs
	  - Fixed many bugs which crashed MOC

2.4.4  [2009-01-04]
	* Fix crash when saving a playlist with URLs.
	* Fix hang in case of symlink loop (like symlink to parent directory)
	  when adding files recursively to the playlist.
	* Fix bad memory access when using FILL parameter in layouts that caused
	  "FATAL_ERROR: Layout1 is malformed".
	* Fix compilation with newer ffmpeg. (Alexis Ballier)
	* Increase maximum file title (made from tags) length to 512. Helps on
	  wide terminals.
	* Fix displaying URLs on the playlist when it ends with a slash.
	* Fix compilation of flac plugin by detecting libflac using pkg-config.
	* Fix for multichannel playback. (Maarten van Es)
	* Fix handling of invalid track number in tags. A segfault occurred when
	  the track number was at least a value of 2^31.
	* Support for the new (SVN) libmpcdec API.
	* Remove old, irrelevant comment about iconv from the configuration
	  file.
	* Fix configure to display proper information about compiled RCC.
	* Run libtoolize in autogen.sh to prevent conflicts with installed
	  libtool/libltdl version.

2.4.3  [2007-07-30]
	* Fix displaying tags from Internet streams, sometimes the name of the
	  station or other less useful text was displayed instead the title.
	* Fix a problem with opening Internet streams with curl 7.16.x. (Samid
	  Tennakoon)
	* Fix XTermTitle for urxvt.
	* Fix delete and backspace keys in entries.
	* Fix a race (crash) when issuing the next commands one after another
	  very fast.
	* Fix problems with vmix OSS virtual driver (no supported audio
	  formats).
	* Fix FollowPlayedFile after CLI restart.
	* Updated moc.spec (Klaus Ethgen)

2.4.2  [2007-06-10]
	* Disable 24bit output by default due to reported problems with some
	  sound cards. It can be enabled by setting Allow24bitOutput option
	  to yes.
	* Fix escape key handling. (Jack Miller)
	* Fix CTRL-key combinations in entries. (Jack Miller)
	* Fix a crash when a file is precached and user requests playing a
	  different file.
	* Disabled using mmap() for reading files in the default configuration
	  due to reported incrased memory usage.
	* Fix ffmpeg build failure due to LOG_H defined by ffmpeg headers.
	* Fix reading PLS playlists with more than 9 entries.
	* Fix configure script: libiconv is required to build moc.
	* Fix the A command for '..' directory (Debian Bug#416102)
	* Fix displaying the playlist panel when the width of the terminal is
	  an odd number.

2.4.1  [2006-02-12]
	* Added Command 'P' and a configuration option PlaylistFullPaths to turn
	  on/off displaying full paths for files in the playlist.
	* Fixed choosing endianess when playing float samples (musepack or
	  wave and other libsndfile formats).
	* Fixed a crash when going to '../' with the search entry.
	* Added MP4 to the list of supported by FFmpeg extensions.
	* Fixed clearing playlist from the command line (crash on mocp -c -a -p
	  file.mp3).
	* Fixed handling mixer errors (crash in some situations).
	* Fix searching with '/' (search began with the current item, not the
	  whole list).
	* Correct support librcc: tags ID3v1/v1.1 will be recoded in UTF-8
	  instead of the local encoding. (Alexey Gladkov)
	* Fixed handling invalid time in tags cache.
	* Fixed handling error when time information for a file could not be
	  read.
	* MusicDir and FastDirX are parsed before they are used, this handles
	  not "clean" directories in the config file (like /bin/ - with slash
	  at the end).
	* When interface is killed by SIGTERM or SIGHUP the playlist is saved
	  and the terminal mode is restored.
	* Setting volume in jack using an exponential function instead of
	  linear. (x37v.alex)
	* Draw bottom lines for side menus that don't touch the botom of the
	  main menu.
	* Reload directory content after running a custom command to see changes
	  made in the filesystem by this command.
	* Added missing exec_command# keys in the example keymap file.

2.4.0  [2006-02-12]
	* Layout of the main window can be changed using Layout[123] options.
	  Switching between layouts is done using the 'l' key and now TAB is
	  used to switch between the playlist and the directory menu. For
	  example, you can configure the layout to see both the playlist and a
	  directory content.
	* Support for WMA, RealAudio, MP4 and AAC file using FFmpeg.
	* UTF-8 support.
	* Selecting themes at runtime - T command (this does not change the
	  config file).
	* Executing external commands, like 'cp %f /mnt/usb_drive' where %f is
	  substituted with the path to the currently selected file.
	* Tags are cached at the server side and read in a separate thread.
	  The interface is not locked until the tags are read. Size of the
	  cache can be adjusted using TagsCacheSize. The cache is saved at exit
	  and loaded at startup.
	* Moving items up and down: u and j commands.
	* Workaround for encoding of ID3v1 tags. New options: UseRCC - to use
	  librcc for ID3v1 reencoding (Initial patch by Alexey Gladkov),
	  ID3v1TagsEncoding - assumed encoding for ID3v1 tags.
	* Added UseCursorSelection option (default: no) to display cursor on
	  the selected file. This is useful with braille displays.
	* Added SetXtermTitle option (disable/enable setting xterm title).
	* Added m4a and aac to the list of extensions supported by ffmpeg.
	* Pressing n when nothing is played starts playing from the first item
	  on the playlist.
	* Added FollowPlayedFile option: menu follows the currently played file
	  so that it is scrolled if the file is outside the visible part
	  (default to yes).
	* Numbering items in the playlist. Can be turned off using
	  PlaylistNumbering.
	* New themes: moca_theme (Nicola Vitale), red_theme (yyz), and
	  darkdot_theme (David Lazar).
	* Added a command for adding a URL to the playlist using entry (CTRL-u).
	* A and --append can add files from playlists.
	* Interface show the playlist after startup if something from the
	  playlist is played (CanStartInPlaylist option).
	* Commands: --append, --clear, --play work now as expected even if there
	  is no client running.
	* Use full paths instead of just file names for displaying on the
	  playlist.
	* Internet streams can be paused.
	* Ogg plugin name was changed to vorbis.
	* Added RPM SPEC file. (Fredrik Rambris)
	* Redesign of the interface code. This is a big change in the code, but
	  not really visible to the user. It was necessary to maintain and
	  extend the interface in the future.
	* MOC can now be compiled under OpenBSD. Thanks to Tilo Stritzky for
	  pointing out the issues.
	* Striping leading and trailing white characters from URLs entered by
	  the user.
	* Count speex time without scaning the whole file.
	* -e is an alias for -a.
	* Display the current time for Internet streams.
	* MusicDir can be a playlist.
	* Silent seeking can be configured using SilentSeekTime option.
	* After adding a file to the playlist, the cursor is moved down.
	* The help screen's position is kept when it's not displayed.
	* Some operations like deleting items from the playlist should now be
	  faster.
	* Fixed a possible deadlock while seeking. This fixes a hang on
	  FreeBSD 6.
	* Fixed OSS support on some machones (like G3 iBook).

2.3.3  [2006-01-04]
	* Workaround for backspace key on many terminals (like aterm).
	* Fixed a memory leak when playing Internet streams. (rixx)
	* Fixed a crash when an mpc file coudn't be read.
	* Fixed a memory leak occuring with every played mp3 file.
	* Fixed a memory leak when seeking in MPC file.
	* Fixed compilation on OpenBSD. (Tilo Stritzky)
	* Fixed parsing Icy metadata packages (possible segfault).
	* Fixed resource leak when reading tags from invalid OGG file.
	* Check if FileNamesIconv has valid format at startup like TagsIconv.

2.3.2  [2005-09-25]
	* Optimized 24bit->16bit conversion. Helps playing mp3 on handheld
	  devices without FPU.
	* Fixed a crash when using the playlist with ReadTags turnedoff.
	* Fixed detecting taglib 1.4.
	* Fixed mutex initialization in io objects (crash on some systems -
	  FreeBSD).
	* Moved the man page to section 1.
	* Fixed bahaviour when one or both OSS mixer channels are not available.
	* Sort file names using the current locale settings. (breg)
	* Fixed -p description.
	* Fixed a memory leak when adding an item to a full entry's history.
	* Slightly less CPU usage in the client due to elimination of useless
	  bitrate updates.
	* Fixed a typo: owerwrite -> overwrite.

2.3.1  [2005-08-02]
	* Fixed detecting MPEG stream by the content (Shoutcast fix).
	* Fixed handling ALSA mixer events (crash in some situations).
	* Fixed handling a mixer channel that has no playback volume.
	* Fixed crash when the alsa mixer couldn't be opened.
	* Fixed crash when nothing was decoded (appears sometimes when holding
	  the enter key on an mp3 file).
	* Fixed a crash which shows up on FreeBSD 5.4 after playing a file.
	  Thanks to Joseph Dunn for help.
	* Fixed includes for maximum and minimum values of intiger types (fix
	  compilation on some systems).
	* Fixed the syntax (not a proper C code). Mostly taken from the FreeBSD
	  port.
	* Show stream URL instead of nothing if the title is not available.
	* Fixed yellow_red_theme theme.
	* Fixed a hang after file open error.
	* Fixed counting time after file open error.
	* Fixed some gcc4 warnings.

2.3.0  [2005-07-09]
	* Network streams (shoutcast, icecast, regular HTTP, FTP). You can load
	  an m3u file with a URL or use the 'o' command.
	* JACK output (by Alex Norman).
	* Added support for musepack (mpc).
	* The search command filters out not matching elements from the menu and
	  allows to walk through the items like in the regular menu.
	* Added support for speex format.
	* Plugins: to drop dependencies from many exotic libraries, support for
	  file formats was moved to shared libraries. This should help making
	  MOC packages in future when more formats will be added.
	* Sample rate conversion using libsamplerate and some sound conversions
	  like 16bit -> 24bit etc. With 24bit sound cards 24bit output is used
	  with mp3.
	* Added support for PLS version 2 playlists.
	* Added mono to stereo conversion.
	* MOC now compiles using libtool.
	* Error messages for precached files are not displayed while other file
	  is being played.
	* Input buffer in a separated thread is used for reading files (new
	  options: InputBuffer and Prebuffering).
	* New theme: Yellow/Red (by Morten Grunnet Buhl).
	* Added -A command line option and ASCIILines config option that
	  disables usage of graphic characters to draw lines.
	* Added commands to set volume from 10% to 90% in 10% steps, default
	  bindings are ALT-1 to ALT-9.
	* Added commands to quickly go to a selected directories
	  (by Alex Norman).
	* Added --next and --previous command line options (by Alex Norman).
	* Added --info command line option that prints all information about the
	  currently played file. (Based on the code by Michael Banks)
	* Two mixer channels can be set in the configuration file. They can be
	  switched at run time by pressing x.
	* Documentation of some parts of the code in Doxygen format.
	* Colors can be redefined in themes using 'colordef COLOR = R G B'
	  (works for terminal that can change the colors).
	* Support for 24bit flac files (not tested).
	* Added SeekTime option: how fast the seeking is. (Kamil Tarkowski)
	* A list of sound drivers can be used instead of only one driver in the
	  configuration file. The first working driver will be used.
	* MusicDir can be set to a playlist.
	* Alsa mixer has always 0-100 range despite the actual device range.
	* Added --toggle-pause command line option.
	* Don't block the audio device when paused. Based on a patch
	  by hondza <miscreant@tiscali.cz>
	* Treat an option that is set in the config file more than once as an
	  error.
	* Print descriptions for some errors in the config file.
	* Better error messages in the Ogg plugin.
	* Better detecting Ogg vorbis stream by content.
	* Decreased the time to wait for the pcm to become ready to get samples
	  in alsa. This helps with underruns.
	* Fixed protect attribute in themes.
	* Added black_theme (by Arn).
	* History for "go to a directory" and "enter URL" commands (using
	  arrows).
	* CTRL-l like CTRL-r refreshes the screen.
	* Separated iconv() conversion for file names and tags.
	* Improved performance a bit when operating on big playlists.
	* G command points to the currently played file - on the playlist if
	  it's there, and selects it in the menu.
	* When going to a directory using the i command, TAB completes to the
	  matching part of ambiguous directories.
	* Volume changes made by other programs are detected.
	* Added --recursively command line option (make a playlist from the
	  content of a directory given at command line).
	* Show bitrate in the right time - the value corresponds to what you
	  can hear, not the position that the decoder is at.
	* Added description about creating a decoder plugin.
	* Added introduction pages to Doxygen documentation.
	* Documented decoder plugins API.
	* Added --playit option (play files given on the command line without
	  modifing the playlist).
	* Added UseRealtimePriority (default no) option: set realtime priority
	  for the output buffer thread.
	* Titles in saved playlists are not converted by iconv().
	* Fixed crash on some systems when a file is precached.
	* Refuse to run if an ALSA mixer channel is wrong.
	* Fixed adding items to the playlist when the server's playlist already
	  has added files.
	* Don't try to use colors on black/white terminals.
	* Fixed a memory leak in iconv_str() when iconv() is not available.
	  (breg)

2.2.2  [2005-05-16]
	* Added an option to ignore CRC errors in mp3 files (set to yes by
	  default, like most players do). This fixes playing mp3 files that
	  have bad CRC checksums but are actually good.
	* Fixed marking the currently played item when a new item on the
	  playlist appears.
	* Fixed a crash when going back at the first item with Repeat turned
	  on (Debian Bug#307651).
	* Fixed a crash when the time of a file can't be read.
	* Fixed handling FLAC files with 8-bit samples.
	* Added mp2, mp1, and mpga to the list of supported extensions by MAD:
	  this makes possible to play MPEG Layer I and II files.
	* Fixed a race condition that crashes MOC when switching songs quickly.
	* Fixed a small memory leak in FLAC.
	* Ogg Vorbis is not required for compilation (a bug in the configure
	  script).
	* Use a pipe to wake up another thread from select() instead of a
	  signal. Helps on NetBSD where pthread_kill() doesn't interrupt
	  select().
	* Fixes for compiler warnings on 64-bit systems.
	* Fixed a warning about wprintw() usage on some systems.
	* Fixed setting compiler flags for vorbis.

2.2.1  [2005-04-16]
	* Fixed missing titles of files without tags when added to the playlist.
	* Fixed refreshing the screen after searching.
	* Fixed recognizing AIFF file extension.
	* Fixed compiler warnings on 64bit systems.
	* Fixed detecting ncurses, now also works with curses.
	* Fixed compilation errors on ioctl() use on some systems.
	* Support for libossaudio (NetBSD).
	* Fixed an compiler warning about EV_ERROR on NetBSD.
	* Better checking for vorbis.
	* Fixed --without-sndfile configure option.
	* Fixed a rare deadlock.

2.2.0  [2005-02-26]
	* Added support for FLAC audio format.
	* Added support for various file formats like au, aiff, voc and more
	  using libsndfile. This also provides better support for wav files.
	* Custom keymaps can be used.
	* Synchronizing the playlist between clients (interface instances).
	* Going to a directory by typing the path with file-name completion
	  (i command).
	* Ability to use default (transparent) and grey color.
	  (Marcin Michałowski).
	* Added a theme with transparent background (Marcin Michałowski).
	* Added nightly_theme (Wim Speekenbrink).
	* Added green_theme (Jacek Lehmann).
	* Global theme directory.
	* MOC should now work on big-endian processors.
	* Added XTermTheme option to use a different theme when running on
	  XTerm.
	* Fixed the 'next' command when AutoNext option is turned off.
	* Displaying the total time of files on the playlist and in directories.
	* Faster reading and saving playlists.
	* Added --pause and --unpause command line parameters.
	* Added AlsaMixer and AlsaDevice options.
	* Added G command: go to a directory when the currently played file is.
	* Added U command: go to '..'.
	* Recognize if a file was modified and rereading tags and time if
	  necessary.
	* Fast, silent seeking ('[' and ']' keys).
	* The cursor is hidden when it's not needed.
	* Changed the erroneous name of the time_left_frames to
	  time_total_frames in themes.
	* Added '/' command working as an alias for g (Kamil Tarkowski).
	* Added CTRL-n working like CTRL-g (Kamil Tarkowski).
	* ? key working like h (Kamil Tarkowski).
	* Playlist time displayed in format 000:00:00 (Kamil Tarkowski).
	* True shuffle, not a random item from the playlist.
	* Changing the icon name when changing the xterm title (Jacek Lehmann).
	* Arrow keys and the delete key works in the entry field.
	* Detecting other terminals beside xterm (Jacek Lehmann).
	* Added b (back) command (Kamil Tarkowski).
	* A bit faster getting files time.
	* Added SavePlaylist option.
	* Added a bar showing time of the current file.
	* Repeat without AutoNext plays a song in loop.
	* Added (empty|filled)_mixer_bar, (empty|filled)_time_bar to themes.
	* Fixed setting sound parameters while playing OGG. This caused crashes
	  on big endian machines (Philippe De Muyter).
	* Fixed crash on some file tags.
	* Fixed crash when issuing some errors.
	* Fixed the --help message.
	* Fixed bad terminal state after exiting the client in rare cases.
	* Fixed adding directories recursively when ReadTags is turned off.
	* Fixed going to the root directory with the i command.
	* Fixed getting time when nothing is played.
	* iconv() (character set conversion) for file names.
	* END and HOME keys working in the i command entry (go to a directory).
	* Synchronizing adding/deleting items from the playlist with the
	  server's playlist.
	* Faster operations on big playlists.
	* Fixed saving playlist when more than one client wants to do this.
	* Fixed recursive adding file to the playlist if some directory
	  can't be read.
	* Fixed deleting items from the playlist.
	* Fixed handling a playlist file as command a line argument.
	* Fixed compilation with --disable-debug.
	* Fixed --version information.
	* Fixed sorting when using the A command.
	* Position of time and format in menu is fixed.
	* Searching for a theme in the user directory first.
	* Fixed a memory leak when reading OGG tags.
	* Few fixes when running MOC with file names or directories as
	  arguments.
	* Fixed reading track numbers for mp3 files.
	* Small fixes of ALSA behaviour when underrun occurs.

2.1.4  [2004-12-31]
	* Fixed the 'next' command when AutoNext is turned off.
	* Sorting the files before adding them to the playlist when using the
	  A command.
	* Fixed a memory leak when reading tags of ogg files.
	* Fixed reading track numbers of mp3 files.
	* Detect other X terminals beside xterm.
	* Fixed error messages for mp3 files.
	* Fixed segfault when reading some tags.

2.1.3  [2004-11-15]
	* Fixed compilation with header files not from Linux 2.4.

2.1.2  [2004-11-14]
	* Fixed playing mp3 with UseMmap turned on.
	* Fixed handling ALSA device open errors.
	* Proper handling 8, 16, and 24 bit sound, raise error if using
	  anything else.
	* Fixed a (almost :) deadlock when pressing stop when seeking.

2.1.1  [2004-11-13]
	* Added missing example_theme.

2.1.0  [2004-11-11]
	* Multiple clients. You can have moc interface on many
	  consoles/terminals.
	* Searching the menu (CTRL-g) like M-s in Midnight Commander.
	* Playlist load/save support (m3u files).
	* The apperance can be customized using themes.
	* Displaying file time and format in the menu.
	* Precaching files and not closing the audio device when playing
	  the next file - no more gaps between two songs.
	* ALSA support.
	* Optional character set conversion using iconv().
	* MOC remembers the playlist between runs.
	* Option to hide file names extension.
	* Use of mmap() can be turned off (usefull on NFS).
	* Ability to use different config file/directory tan the default.
	* Pressing CTRL-C interrupts long operations that blocks the interface
	  like reding tags for hundreds of files.
	* Fixed seeking and counting time in VBR mp3 files.
	* Fixes for systems where threads are not processes.
	* Small fixes and cleanups.

2.0.1  [2004-10-21]
	* Do not allow to add '..' to the playlist.
	* Fixed seeking when not playing.
	* Fixed segfault when using f after creating a playlist from the
	  command line.
	* Fixed invoking MOC with relative path arguments
	* Fixed displaying file title longer than the window.
	* Fixed broken menu after resizing terminal when help screen is
	  displayed.

2.0.0  [2004-10-16]
	* Split into client-server, you can detach the interface and leave
	  the server playing songs in the background (keys: q - background,
	  Q - quit).
	* Output buffer with seperate thread.
	* Using OSS directly - better stop and pause.
	* Support xterm resizing.
	* Using xterm title.
	* Autonext option (X key).
	* Faster reading directory contents.
	* Displaying time left to the end of the songs.
	* Fixed moving through symlinked directories.
	* Renamed executable file to mocp due to conflict with QT meta object
	  compiler.
	* Configurable mixer channel, OSS output device, and mixer device.
	* ^r - refresh the screen, r - reread the directory.
	* H command and ShowHiddenFiles - as the option says.
	* Do not allow displaying bitrate too fast to read it.
	* Fixed compilation with pthreads, better configure.
	* Fixed problems when compiling with gcc 3.3
	* Fixed displaying window title longer than the window.
	* Space key working as pause.
	* Fixed possible segfault in trenary expressions.
	* Removed version checker.
	* Fixed sorting directories ('../' was not always on top).
	* Fixed escaping characters in config file, no need for '\\\\'.
	* Stronger checking for parse errors in configuration file.

1.1.0  [2002-12-08]
	* Support for WAV.
	* Playlist without reading/writeing to file.
	* Option in the config file to automaticaly change process priority at
	  startup. Helpful on slow computers.
	* Recursivaly adding files from comamnd line and from the interface.
	* Shuffle and repeat.
	* Nice progress bar for longer operations.
	* Fixed segfault when using the END key.
	* Fixed segfault when playing OGG files.
	* Workaround for kde and gnome terminals.
	* Now MOC can be compiled on FreeBSD.
	* Other fixes.

1.0.0
	* First release intended to be stable and user-friendly :)
	* Added man page.
	* Added version checker (simple command to see if a new version of MOC
	  has been released).
	* Fixed problem when compiling without ogg.
	* Added redraw command.
	* Other small fixes.

0.9.2
	* Fixed -s option.
	* Added 'f' command (switching between short and full file names).
	* Added README file.
	* Added support for config file.
	* Added MusicDir option, 'm' command and '-m' switch.
	* Added ability to turning off messages about broken streams.
	* Fixed including dirent.h for various OS.
	* Fixed and updated configure.

0.9.1
	* Added mixer (using OSS).
	* Added help screen.
	* Fixed some tiny buffer overflows.
	* Small fixes in code.

0.9.0
	* First stable version.


================================================
FILE: README
================================================
                                 MOC
                      m u s i c  o n  c o n s o l e

                          http://moc.daper.net/


--------------------------------------------------------------------------------
What Is It?
--------------------------------------------------------------------------------

MOC (music on console) is a console audio player for LINUX/UNIX designed to be
powerful and easy to use.

You just need to select a file from some directory using the menu similar to
Midnight Commander, and MOC will start playing all files in this directory
beginning from the chosen file.  There is no need to create playlists as in
other players.

If you want to combine some files from one or more directories in one playlist,
you can do this.  The playlist will be remembered between runs or you can save
it as an m3u file to load it whenever you want.

Need the console where MOC is running for more important things?  Need to close
the X terminal emulator?  You don't have to stop playing - just press q and the
interface will be detached leaving the server running.  You can attach it later,
or you can attach one interface in the console, and another in the X terminal
emulator, no need to switch just to play another file.

MOC plays smoothly, regardless of system or I/O load because it uses the output
buffer in a separate thread.  The transition between files is gapless, because
the next file to be played is precached while the current file is playing.

Supported file formats are: MP3, Ogg Vorbis, FLAC, Musepack (mpc), Speex, Opus,
WAVE, those supported by FFmpeg/LibAV (e.g., WMA, RealAudio, AAC, MP4), AIFF,
AU, SVX, Sphere Nist WAV, IRCAM SF, Creative VOC, SID, wavpack, MIDI and
modplug.

Other features:

  - Simple mixer
  - Color themes
  - Menu searching (playlist or directory) like M-s in Midnight Commander
  - The way MOC creates titles from tags is configurable
  - Optional character set conversion for file tags using iconv()
  - OSS, ALSA, SNDIO and JACK output
  - User defined keys
  - Cache for files' tags

--------------------------------------------------------------------------------
Documentation and The MOC Forum
--------------------------------------------------------------------------------

This file is only a brief description of MOC, for more information is
available on the home page (http://moc.daper.net/documentation).

You can also find a discussion forum on the MOC home page.

--------------------------------------------------------------------------------
What Software Is Required To Build It?
--------------------------------------------------------------------------------

To build MOC from the distribution tarball you will need:

  - A POSIX.1-2001 compatible UNIX system with POSIX threads
    (e.g., Linux or OSX)
  - A C compiler which is C99 capable and a C++ compiler (MOC is written
    in C, but libtool and some decoder plugins require a C++ compiler)
  - ncurses (probably already installed in your system)
  - POPT (libpopt) (probably already installed in your system)
  - Berkeley DB (libdb) version 4.1 (unless configured with --disable-cache)
  - GnuPG (gpg) if you are going to verify the tarball (and you should)

If you are building from the SVN repository you will also need:

  - Subversion or git-svn (to checkout the source directory tree)
  - Autoconf version 2.64 and the associated Automake and Libtool

You should choose which of the following audio formats you wish to play and
provide the libraries needed to support them:

  - AAC - libfaad2 version 2.7 (http://www.audiocoding.com/), and
          libid3tag (http://www.underbit.com/products/mad/)
  - FLAC - libFLAC version 1.1.3 (http://flac.sourceforge.net/)
  - MIDI - libtimidity version 0.1 (http://timidity.sourceforge.net/)
  - modplug - libmodplug version 0.7 (http://modplug-xmms.sourceforge.net/)
  - MP3 - libmad with libid3tag (ftp://ftp.mars.org/pub/mpeg/)
  - Musepack (mpc) - libmpc (http://www.musepack.net/), and
                   - taglib version 1.3.1
                     (http://developer.kde.org/~wheeler/taglib.html)
  - Ogg Vorbis - libvorbis, libogg and libvorbisfile (all version 1.0)
                 (http://www.xiph.org/ogg/), or
               - libvorbisidec and libogg (both version 1.0)
                 (http://svn.xiph.org/trunk/Tremor)
  - SID - libsidplay2 version 2.1.1 and libsidutils version 1.0.4
          (http://sidplay2.sourceforge.net/)
  - Speex - libspeex version 1.0 (http://www.speex.org/), and
          - libogg version 1.0 (http://www.xiph.org/ogg/)
  - WMA, RealAudio (.ra), MP4 - FFmpeg version 1.0 (http://www.ffmpeg.org/), or
                              - LibAV version 10.0 (http://www.libav.org/)
  - WAVE, AU, AIFF, SVX, SPH, IRC, VOC - libsndfile version 1.0
                                         (http://www.mega-nerd.com/libsndfile/)
  - wavpack - libwavpack version 4.31 (http://www.wavpack.com/)

For interfacing to the sound sub-system, you will need libraries for one or
more of the following:

  - ALSA - alsa-lib version 1.0.11 (http://www.alsa-project.org/)
  - OSS - the OSS libraries (http://www.opensound.com/)
  - BSD's SNDIO - SNDIO libraries
  - JACK low-latency audio server - JACK version 0.4
                                    (http://jackit.sourceforge.net/)

For network streams:

  - libcurl version 7.15.1 (http://curl.haxx.se/)

For resampling (playing files with sample rate not supported by your
hardware):

  - libresamplerate version 0.1.2 (http://www.mega-nerd.com/SRC/)

For librcc (fixes encoding in broken mp3 tags):

  - http://rusxmms.sourceforge.net/

Note that for Debian-based distributions, you will also require any '-dev'
suffixed versions of the packages above if building from source.

The versions given above are minimum versions and later versions should also
work.  However, MOC may not yet have caught up with the very latest changes
to library interfaces and these may cause problems if they break backwards
compatibility.

--------------------------------------------------------------------------------
On Which Systems Is MOC Running?
--------------------------------------------------------------------------------

MOC is developed and tested on GNU/Linux.

MOC is now C99 and POSIX.1-2001 compliant and so should build and run on
any system which has a C99 capable compiler and is POSIX.1-2001 compatible.
However, there may still be cases where MOC breaks this compliance and any
reports of such breakage are welcome.

There is no intention to support MOC on MS-Windows (so please don't ask).

--------------------------------------------------------------------------------
How Do I Verify the Authenticity of the Tarball?
--------------------------------------------------------------------------------

If you downloaded the official MOC distribution you should have the
following files:

	moc-2.6-alpha3.tar.asc
	moc-2.6-alpha3.tar.md5
	moc-2.6-alpha3.tar.xz

would check the integrity of the download:

	md5sum -c moc-2.6-alpha3.tar.md5

and then verify the tarball thusly:

	xzcat moc-2.6-alpha3.tar.xz | gpg --verify moc-2.6-alpha3.tar.asc -

The signature file (*.asc) was made against the uncompressed tarball,
so if the tarball you have has been recompressed using a tool other
than XZ then uncompress it using the appropriate tool then verify that:

	gunzip moc-2.6-alpha3.tar.gz
	gpg --verify moc-2.6-alpha3.tar.asc

If the tool can output to stdout (and most can) then you can also verify
verify it in a single step similar to the way in which the XZ tarball
was verified above.

Of course, you'll also need the MOC Release Signing Key:

	gpg --recv-key 0x2885A7AA

for which the fingerprint is:

	5935 9B80 406D 9E73 E805  99BE F312 1E4F 2885 A7AA

--------------------------------------------------------------------------------
How Do I Build and Install It?
--------------------------------------------------------------------------------

Generic installation instruction is included in the INSTALL file.

In short, if you are building from an SVN checkout of MOC (but not if you
are building from a downloaded tarball) then you will first need to run:

	autoreconf -if

and then proceed as shown below for a tarball.  (If you are using the
tarball but have applied additional patches then you may also need to run
autoreconf.)

To build MOC from a downloaded tarball just type:

	./configure
	make

And as root:

	make install

Under FreeBSD and NetBSD (and possibly other systems) it is necessary to
run the configure script this way:

	./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include

In addition to the standard configure options documented in the INSTALL
file, there are some MOC-specific options:

	--enable-cache=[yes|no]

	  Specifying 'no' will disable the tags cache support.  If your
	  intent is to remove the Berkeley DB dependancy (rather than
	  simply removing the on-disk cache) then you should also either
	  build MOC without RCC support or use a librcc built with BDB
	  disabled.

	--enable-debug=[yes|no|gdb]

	  Using 'gdb' will cause MOC to be built with options tailored to
	  use with GDB.  (Note that in release 2.6 this option will be
	  split into separate debugging and logging options.)

	--with-oss=[yes|no|DIR]

	  Where DIR is the location of the OSS include directory (and
	  defaults to '/usr/lib/oss').

	--with-vorbis=[yes|no|tremor]

	  Using 'tremor' will cause MOC to build against the integer-only
	  implementation of the Vorbis library (libvorbisidec).

You can install MOC into its own source directory tree and run it from there
so you do not have to install it permanently on your system.  If you're just
wanting to try it out or test some patches, then this is something you may
wish to do:

	./configure --prefix="$PWD" --without-timidity
	make
	make install
	bin/mocp -M .moc

--------------------------------------------------------------------------------
How Do I Use It?
--------------------------------------------------------------------------------

Run program with the 'mocp' command.  The usage is simple; if you need help,
press 'h' and/or read mocp manpage.  There is no complicated command line or
cryptic commands.  Using MOC is as easy as using basic functions of Midnight
Commander.

You can use a configuration file placed in ~/.moc/config, but it's not required.
See config.example provided with MOC.

--------------------------------------------------------------------------------
Using Themes
--------------------------------------------------------------------------------

Yes, there are themes, because people wanted them. :)

Themes can change all colors and only colors.  An example theme file with a
exhaustive description is included (themes/example_theme) and is the
default MOC appearance.

Theme files should be placed in ~/.moc/themes/ or $(datadir)/moc/themes/
(e.g., /usr/local/share/moc/themes) directory, and can be selected with
the Theme configuration options or the -T command line option (see the
manpage and the example configuration file).

Feel free to share the themes you have created.

--------------------------------------------------------------------------------
Defining Keys
--------------------------------------------------------------------------------

You can redefine standard keys.  See the instructions in the keymap.example
file.

--------------------------------------------------------------------------------
How Do I Report A Problem?
--------------------------------------------------------------------------------

Not every release is extensively tested on every system, so the particular
configuration of software, libraries, versions and hardware on your system
might expose a problem.

If you find any problems then you should search the MOC Forum for a solution;
your problem may not be unique.  If you do find an existing topic which
matches your problem but does not offer a solution, or the solution offered
does not work for you and the topic appears still active, then please add your
experience to it; it may be that additional information you can provide will
contain the clue needed to resolve the problem.

If you don't find an answer there and you installed MOC from your Linux
distribution's repository then you should report it via your distribution's
usual reporting channels in the first instance.  If the problem is ultimately
identified as actually being in MOC itself, it should then be reported to the
MOC Maintainer (preferably by the distribution's MOC package maintainer).

If you built MOC from source yourself or you get no resolution from your
distribution then start a new topic on the MOC Forum for your problem or
contact the MOC Maintainer.

Before reporting a problem, you should first read this Forum post:

   Linkname: How to Report Bugs Effectively
        URL: http://moc.daper.net/node/1035

and the essay it references:

   Linkname: How to Report Bugs Effectively
        URL: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

There are two things you must do if at all possible:

1. Make sure you are using the current stable MOC release or, even better,
   can reproduce it on the latest development release or SVN HEAD, and
2. Make sure you include the version and revision information (which you
   can obtain by running 'mocp --version').

If you do not do those two things (and don't offer a good explanation as to
why you didn't) your problem report is likely to be ignored until such time
as you do.

--------------------------------------------------------------------------------
Hacking
--------------------------------------------------------------------------------

Want to modify MOC?  You're welcome to do so, and patch contributions are
also welcome.

MOC is written in C, so you must at least know this language to make simple
changes.  It is multi-threaded program, but there are places where you don't
need to worry about that (the interface is only a single thread process).  It
uses autoconf, automake and libtool chain to generate configuration/compilation
stuff, so you must know how to use it, for example, if you need to link to an
additional library.

The documentation for some parts of the internal API for creating decoder
plugins (file format support) and sound output drivers can be generated using
Doxygen (http://www.doxygen.org/).  Just run the doxygen command from the MOC
source directory.

Before you change anything it is a good idea to check for the latest development
version (check out from the Subversion repository is the best).  Your changes
might conflict with changes already made to the source or your feature might be
already implemented.  See also the TODO file as it is updated regularly and
contains quite detailed information on future plans.

If you need help, just contact MOC's Maintainer via e-mail.  And if you are
planning anything non-trivial it's a good idea to discuss your intentions
with the MOC Maintainer once you've clarified your ideas but before spending
too much time implementing them; it will be more productive if your work fits
with MOC's future direction.

--------------------------------------------------------------------------------
Who Wrote It?  Where Can I Send Bug Reports, Questions or Comments?
--------------------------------------------------------------------------------

	* Original author is Damian Pietras
	* Current maintainer is John Fitzgerald
	* For comments and questions see the official forum:
	              http://moc.daper.net/forum
	* Need to report a bug?  You can reach the maintainer(s) at:
	                 <mocmaint@daper.net>

--------------------------------------------------------------------------------


================================================
FILE: README.md
================================================
# MOC: Music on Console

  http://moc.daper.net

![Screenshot](themes/transparent-background_screenshot_thumb.png?raw=true)



What Is It?
--------------------------------------------------------------------------------

MOC (music on console) is a console audio player for Linux/Unix designed to be
powerful and easy to use.

This is an unofficial mirror, with a few small aesthetic tweaks.  It syncs with 
the subversion upstream every few weeks.
MOC makes it easy to use multimedia keys on your keyboard, which is discussed below.  

Prerequisites
-------------
On Debian/Ubuntu systems, you minimally need the following packages:
```Bash
sudo apt-get install gcc autoconf libtool gettext libdb-dev libpopt-dev libncursesw5-dev
```
I recommend the following packages as well:
```Bash
sudo apt-get install libasound2-dev libcurl4-openssl-dev libogg-dev libvorbis-dev libflac-dev libopus-dev libid3tag0-dev libsndfile1-dev libfaad-dev libavcodec-dev libsamplerate0-dev librcc-dev
```
**Optional**: FFmpeg adds many, many more file formats, including AAC, Opus, MP4, and WMA. You may need to first add www.deb-multimedia.org to your apt-get sources.  Then get FFmpeg:
```Bash
sudo apt-get install libavformat-dev
```

Compilation
-----------
```Bash
autoreconf -if
./configure
make -j 2
sudo make install
```

Keyboard Shortcuts
------------------
For Xfce, go to `Settings -> Keyboard -> Application Shortcuts`, then add shortcuts with
commands like `mocp --next` and others listed in `mocp --help`.  I find that the most
useful keyboard shortcuts are for the following:

* `mocp --toggle-pause` - Play/pause
* `mocp --toggle shuffle` - Enable/disable shuffle
* `mocp --next` - Skip to the next song
* `mocp --previous` - Go to the previous song
* `mocp --seek +5` - Jump 5 seconds forward
* `mocp --seek -5` - Jump 5 seconds back

In Fluxbox you can add the following to your `.fluxbox/keys` file (after using `xev`
to discover key numbers):

```bash
# Play/pause
179 :Exec mocp --toggle-pause
# Skip to next song
225 :Exec mocp --next
# Go to previous song
Mod1 225 :Exec mocp --previous
# Move forward a few seconds: ALT + >
Mod1 60 :Exec mocp --seek +5
# Move backward a few seconds: ALT + <
Mod1 59 :Exec mocp --seek -5
# Go to MOCP tab (should be first tab)
128 :Tab 1
# Toggle shuffle
152 :Exec mocp --toggle shuffle
``` 

Remote Controls
---------------
It's really easy to use a remote control with MOC.  You can use any remote that appears to your computer as a keyboard, like [this one](https://smile.amazon.com/dp/B01MSX306Z) or similar ones.  Then setup keyboard shortcuts as described above for each button you want to use to control MOC.


Original Text
-------------
The rest of the upstream README is as follows:

You just need to select a file from some directory using the menu similar to
Midnight Commander, and MOC will start playing all files in this directory
beginning from the chosen file.  There is no need to create playlists as in
other players.

If you want to combine some files from one or more directories in one playlist,
you can do this.  The playlist will be remembered between runs or you can save
it as an m3u file to load it whenever you want.

Need the console where MOC is running for more important things?  Need to close
the X terminal emulator?  You don't have to stop playing - just press q and the
interface will be detached leaving the server running.  You can attach it later,
or you can attach one interface in the console, and another in the X terminal
emulator, no need to switch just to play another file.

MOC plays smoothly, regardless of system or I/O load because it uses the output
buffer in a separate thread.  The transition between files is gapless, because
the next file to be played is precached while the current file is playing.

Supported file formats are: MP3, Ogg Vorbis, FLAC, Musepack (mpc), Speex, Opus,
WAVE, those supported by FFmpeg/LibAV (e.g., WMA, RealAudio, AAC, MP4), AIFF,
AU, SVX, Sphere Nist WAV, IRCAM SF, Creative VOC, SID, wavpack, MIDI and
modplug.

Other features:

  - Simple mixer
  - Color themes
  - Menu searching (playlist or directory) like M-s in Midnight Commander
  - The way MOC creates titles from tags is configurable
  - Optional character set conversion for file tags using iconv()
  - OSS, ALSA, SNDIO and JACK output
  - User defined keys
  - Cache for files' tags


Documentation and The MOC Forum
--------------------------------------------------------------------------------

This file is only a brief description of MOC, for more information is
available on the home page (http://moc.daper.net/documentation).

You can also find a discussion forum on the MOC home page.


What Software Is Required To Build It?
--------------------------------------------------------------------------------

To build MOC from the distribution tarball you will need:

  - A POSIX.1-2001 compatible UNIX system with POSIX threads
    (e.g., Linux or OSX)
  - A C compiler which is C99 capable and a C++ compiler (MOC is written
    in C, but libtool and some decoder plugins require a C++ compiler)
  - ncurses (probably already installed in your system)
  - POPT (libpopt) (probably already installed in your system)
  - Berkeley DB (libdb) version 4.1 (unless configured with --disable-cache)
  - GnuPG (gpg) if you are going to verify the tarball (and you should)

If you are building from the SVN repository you will also need:

  - Subversion or git-svn (to checkout the source directory tree)
  - Autoconf version 2.64 and the associated Automake and Libtool

You should choose which of the following audio formats you wish to play and
provide the libraries needed to support them:

  - AAC - libfaad2 version 2.7 (http://www.audiocoding.com/), and
    libid3tag (http://www.underbit.com/products/mad/)
  - FLAC - libFLAC version 1.1.3 (http://flac.sourceforge.net/)
  - MIDI - libtimidity version 0.1 (http://timidity.sourceforge.net/)
  - modplug - libmodplug version 0.7 (http://modplug-xmms.sourceforge.net/)
  - MP3 - libmad with libid3tag (ftp://ftp.mars.org/pub/mpeg/)
  - Musepack (mpc)
    - libmpcdec (http://www.musepack.net/), and
    - taglib version 1.3.1 (http://developer.kde.org/~wheeler/taglib.html)
  - Ogg Vorbis
    - libvorbis, libogg and libvorbisfile (all version 1.0) (http://www.xiph.org/ogg/), or
    - libvorbisidec and libogg (both version 1.0) (http://svn.xiph.org/trunk/Tremor)
  - SID - libsidplay2 version 2.1.1 and libsidutils version 1.0.4
    (http://sidplay2.sourceforge.net/)
  - Speex
    - libspeex version 1.0 (http://www.speex.org/), and
    - libogg version 1.0 (http://www.xiph.org/ogg/)
  - WMA, RealAudio (.ra), MP4
    - FFmpeg version 0.7 (http://www.ffmpeg.org/), or
    - LibAV version 0.7 (http://www.libav.org/)
  - WAVE, AU, AIFF, SVX, SPH, IRC, VOC - libsndfile version 1.0 (http://www.mega-nerd.com/libsndfile/)
  - wavpack - libwavpack version 4.31 (http://www.wavpack.com/)

For interfacing to the sound sub-system, you will need libraries for one or
more of the following:

  - ALSA - alsa-lib version 1.0.11 (http://www.alsa-project.org/)
  - OSS - the OSS libraries (http://www.opensound.com/)
  - BSD's SNDIO - SNDIO libraries
  - JACK low-latency audio server - JACK version 0.4 (http://jackit.sourceforge.net/)

For network streams:

  - libcurl version 7.15.1 (http://curl.haxx.se/)

For resampling (playing files with sample rate not supported by your
hardware):

  - libresamplerate version 0.1.2 (http://www.mega-nerd.com/SRC/)

For librcc (fixes encoding in broken mp3 tags):

  - http://rusxmms.sourceforge.net

Note that for Debian-based distributions, you will also require any '-dev'
suffixed versions of the packages above if building from source.

The versions given above are minimum versions and later versions should also
work.  However, MOC may not yet have caught up with the very latest changes
to library interfaces and these may cause problems if they break backwards
compatibility.


On Which Systems Is MOC Running?
--------------------------------------------------------------------------------

MOC is developed and tested on GNU/Linux.

MOC is now C99 and POSIX.1-2001 compliant and so should build and run on
any system which has a C99 capable compiler and is POSIX.1-2001 compatible.
However, there may still be cases where MOC breaks this compliance and any
reports of such breakage are welcome.

There is no intention to support MOC on MS-Windows (so please don't ask).


How Do I Verify the Authenticity of the Tarball?
--------------------------------------------------------------------------------

If you downloaded the official MOC distribution you should have the
following files:

	moc-2.6-alpha2.tar.asc
	moc-2.6-alpha2.tar.md5
	moc-2.6-alpha2.tar.xz

would check the integrity of the download:

	md5sum -c moc-2.6-alpha2.tar.md5

and then verify the tarball thusly:

	xzcat moc-2.6-alpha2.tar.xz | gpg --verify moc-2.6-alpha2.tar.asc -

The signature file (\*.asc) was made against the uncompressed tarball,
so if the tarball you have has been recompressed using a tool other
than XZ then uncompress it using the appropriate tool then verify that:

	gunzip moc-2.6-alpha2.tar.gz
	gpg --verify moc-2.6-alpha2.tar.asc

If the tool can output to stdout (and most can) then you can also verify
verify it in a single step similar to the way in which the XZ tarball
was verified above.

Of course, you'll also need the MOC Release Signing Key:

	gpg --recv-key 0x2885A7AA

for which the fingerprint is:

	5935 9B80 406D 9E73 E805  99BE F312 1E4F 2885 A7AA


How Do I Build and Install It?
--------------------------------------------------------------------------------

Generic installation instruction is included in the INSTALL file.

In short, if you are building from an SVN checkout of MOC (but not if you
are building from a downloaded tarball) then you will first need to run:

	autoreconf -if

and then proceed as shown below for a tarball.  (If you are using the
tarball but have applied additional patches then you may also need to run
autoreconf.)

To build MOC from a downloaded tarball just type:

	./configure
	make

And as root:

	make install

Under FreeBSD and NetBSD (and possibly other systems) it is necessary to
run the configure script this way:

	./configure LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include

In addition to the standard configure options documented in the INSTALL
file, there are some MOC-specific options:

	--enable-cache=[yes|no]

	  Specifying 'no' will disable the tags cache support.  If your
	  intent is to remove the Berkeley DB dependancy (rather than
	  simply removing the on-disk cache) then you should also either
	  build MOC without RCC support or use a librcc built with BDB
	  disabled.

	--enable-debug=[yes|no|gdb]

	  Using 'gdb' will cause MOC to be built with options tailored to
	  use with GDB.  (Note that in release 2.6 this option will be
	  split into separate debugging and logging options.)

	--with-oss=[yes|no|DIR]

	  Where DIR is the location of the OSS include directory (and
	  defaults to '/usr/lib/oss').

	--with-vorbis=[yes|no|tremor]

	  Using 'tremor' will cause MOC to build against the integer-only
	  implementation of the Vorbis library (libvorbisidec).

You can install MOC into its own source directory tree and run it from there
so you do not have to install it permanently on your system.  If you're just
wanting to try it out or test some patches, then this is something you may
wish to do:

	./configure --prefix="$PWD" --without-timidity
	make
	make install
	bin/mocp -M .moc


How Do I Use It?
--------------------------------------------------------------------------------

Run program with the 'mocp' command.  The usage is simple; if you need help,
press 'h' and/or read mocp manpage.  There is no complicated command line or
cryptic commands.  Using MOC is as easy as using basic functions of Midnight
Commander.

You can use a configuration file placed in ~/.moc/config, but it's not required.
See config.example provided with MOC.


Using Themes
--------------------------------------------------------------------------------

Yes, there are themes, because people wanted them. :)

Themes can change all colors and only colors.  An example theme file with a
exhaustive description is included (themes/example_theme) and is the
default MOC appearance.

Theme files should be placed in ~/.moc/themes/ or $(datadir)/moc/themes/
(e.g., /usr/local/share/moc/themes) directory, and can be selected with
the Theme configuration options or the -T command line option (see the
manpage and the example configuration file).

Feel free to share the themes you have created.


Defining Keys
--------------------------------------------------------------------------------

You can redefine standard keys.  See the instructions in the keymap.example file.


How Do I Report A Problem?
--------------------------------------------------------------------------------

Not every release is extensively tested on every system, so the particular
configuration of software, libraries, versions and hardware on your system
might expose a problem.

If you find any problems then you should search the MOC Forum for a solution;
your problem may not be unique.  If you do find an existing topic which
matches your problem but does not offer a solution, or the solution offered
does not work for you and the topic appears still active, then please add your
experience to it; it may be that additional information you can provide will
contain the clue needed to resolve the problem.

If you don't find an answer there and you installed MOC from your Linux
distribution's repository then you should report it via your distribution's
usual reporting channels in the first instance.  If the problem is ultimately
identified as actually being in MOC itself, it should then be reported to the
MOC Maintainer (preferably by the distribution's MOC package maintainer).

If you built MOC from source yourself or you get no resolution from your
distribution then start a new topic on the MOC Forum for your problem or
contact the MOC Maintainer.

Before reporting a problem, you should first read this Forum post:

   Linkname: How to Report Bugs Effectively
        URL: http://moc.daper.net/node/1035

and the essay it references:

   Linkname: How to Report Bugs Effectively
        URL: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

There are two things you must do if at all possible:

1. Make sure you are using the current stable MOC release or, even better,
   can reproduce it on the latest development release or SVN HEAD, and
2. Make sure you include the version and revision information (which you
   can obtain by running 'mocp --version').

If you do not do those two things (and don't offer a good explanation as to
why you didn't) your problem report is likely to be ignored until such time
as you do.


Hacking
--------------------------------------------------------------------------------

Want to modify MOC?  You're welcome to do so, and patch contributions are
also welcome.

MOC is written in C, so you must at least know this language to make simple
changes.  It is multi-threaded program, but there are places where you don't
need to worry about that (the interface is only a single thread process).  It
uses autoconf, automake and libtool chain to generate configuration/compilation
stuff, so you must know how to use it, for example, if you need to link to an
additional library.

The documentation for some parts of the internal API for creating decoder
plugins (file format support) and sound output drivers can be generated using
Doxygen (http://www.doxygen.org/).  Just run the doxygen command from the MOC
source directory.

Before you change anything it is a good idea to check for the latest development
version (check out from the Subversion repository is the best).  Your changes
might conflict with changes already made to the source or your feature might be
already implemented.  See also the TODO file as it is updated regularly and
contains quite detailed information on future plans.

If you need help, just contact MOC's Maintainer via e-mail.  And if you are
planning anything non-trivial it's a good idea to discuss your intentions
with the MOC Maintainer once you've clarified your ideas but before spending
too much time implementing them; it will be more productive if your work fits
with MOC's future direction.


Who Wrote It?  Where Can I Send Bug Reports, Questions or Comments?
--------------------------------------------------------------------------------

- Original author is Damian Pietras
- Current maintainer is John Fitzgerald
- For comments and questions see the official forum: http://moc.daper.net/forum
- Need to report a bug?  You can reach the maintainer(s) at: <mocmaint@daper.net>


================================================
FILE: README_equalizer
================================================
Preamble
---
This document is meant to give you an overview on the idea of having a
parametric equalizer for sound enhancement and how you can create your
own presets.  Also the interaction with the equalizer in MOC is described.

I would like to improve this document to make it more usable; so if you
have any comments and/or ideas feel free to contact me.

- Hendrik Iben (hiben<at>tzi(dot)de)


Content
---
0. Document History
1. Motivation
2. Usage
3. Preset Format
4. Creating Presets
5. TODO
6. References


0. Document History
---
07.09.2008 - Initial version
15.03.2011 - Reformatted


1. Nuts and Bolts / Motivation for Implementing the Equalizer
---
The equalizer is an implementation of a biquadratic peaking equalizer
filter looked up from the Audio EQ Cookbook[1].

It happens to be a parametric equalizer and this means that, different
from other equalizer implementations, the number of bands* is not fixed.
When I started the idea of implementing the equalizer I looked around
in the source of other audio playback software and found that a lot of
them are recycling the code used by the famous XMMS[2] audio player.
I also would have liked to recycle the code but I decided against it
for two reasons:

The first reason is that there is almost no documentation on the algorithm
used.  Maybe the signal processing folks have fun finding out what makes
this thing work but I was totally lost.  So I decided that I wanted to
*know* what I am doing if I do it.

As for the second reason, the code used by XMMS is totally optimized for
integer arithmetic.  There is no problem with this in general but I had
the goal of implementing something that was as accurate as I could and
I wanted to use floating point arithmetic.

So I am no signals processing guy, but I have -- I think -- a solid
understanding of the matter.  I sat down and started to read about
equalizing, audio processing and signal theory in general.  After some
time I found a mathematical description and a C implementation of
biquadratic filters in the Audio Cookbook.  I made an implementation of
the XMMS equalizer and the biquadratic filter using Octave[3] to compare
the outcome of both filters.  I was a bit surprised how different filters
can be but in the end succeeded (?) in finding a quite good biquadratic
filter set that would produce results not unlike the XMMS equalizer.

Although I did not use the XMMS-code I think that people will be more
happy to accept this equalizer if they can use their presets with it.
There is some conversion needed, but it's a straightforward process.
I converted all presets provided by XMMS into presets for this mixer.
They should be available at [4].

* A band is a chosen center frequency where a filter has most impact.
  If you look at WinAmp / XMMS / Beep Media Player you will find that
  they settled on a common set of 10 bands.


2. Using the Equalizer
---
The default keys for the equalizer are:

'e' - Refresh equalizer
'E' - Toggle equalizer (on/off)
'k' - Select next preset
'K' - Select previous preset

Each of these actions results in a message displayed in the message area.
This message will be overridden by the next action.


3. Preset Format
---
Presets for the equalizer are to be placed in a directory called 'eqsets'
in MOC's home directory (e.g., $HOME/.moc/eqsets).  There is no convention
for the filename, but it will serve as the name in the selection process.

File format in pseudo EBNF:

  EQSET
  ((<CF> <BW> <AMP>)|(0 <PREAMP>))*

  CF:     Center frequency (sane values are from ~20 to ~20000).
  BW:     Bandwith in Octaves.  This defines how fast the bands
          influence vanishes over the frequencies.
  AMP:    Amplification factor (in dB) to apply to the band.
  PREAMP: Specifies an amplification factor applied before equalizing.

So a valid equalizer set would be:

  # this is a comment
  EQSET
  # amplify audio by 1.4dB
  0 1.4
  # damp frequencies at 100Hz by -4dB, filter bandwidth 1.5 octaves
  100   1.5 -4
  # amplify frequencies at 4000Hz by 2dB, filter bandwidth 1.5 octaves
  4000  1.5 2

There is no order to stick to when specifying frequencies.


4. Creating Your Own Presets
---
For a start you should have a look at the converted presets[4].  The
bandwidths used in the conversion have been extracted by taking a look
at the filters signal response (implementation and analysis in Octave).
I tried to do this as accurately as possible but I don't know if I made
a mistake.  They sound correct though... :-)

You might note that there is never a positive amplification factor in
the presets although there are in the original preset.  The reason for
this is that I used the maximum amplification in the preset as zero
amplification and adjusted the other values accordingly.

In general, when creating a preset get used to the following idea: Do not
amplify the frequencies you want but damp those that are of no interest.
This has the same effect but avoids clipping and this equalizer type seems
to be very prone to clipping.  Also be very careful with pre-amplifying
the audio for the same reason.

With that said, the next confusing thing is the bandwidth definition.
Every band needs a defined bandwidth in octaves where the bandwidth
defines where the filter's effect has been reduced by 3dB*.  This means
that if you define a band at 1000Hz with a bandwidth of 1.5 octaves and
an amplification of -10dB, at 353.6Hz** and at 2828.4Hz the amplification
will be reduced to -7dB.

If unsure, stay in between 1.0 and 2.0.  Just keep in mind that if two
bands overlap you might get an undesired amplification.

When designing presets, just save the preset and select it in MOC.  After
each change press the refresh key (default 'e').  This will re-create the
equalizer reflecting your changes.

If your preset is not found, have a look at the output of MOC's server
thread.  Parsing errors are emitted there.

*  3dB is commonly used for bandwidth.  -3dB equals about 70.7% of
   original amplification.
** 353.6 =~ 1000*(2^-1.5), 2828.4 =~ 1000*(2^1.5)


5. TODO
---
- The equalizer is currently not optimized in any way.

- It converts all sound data into floating point values to perform the
  equalization and converts them back afterwards.  A better approach
  would be either to provide integer algorithms for equalization or to
  leave the audio data in floating point format.

- There is no sorting for the presets; their order is defined by reading
  the directory content.

- Maybe it would be nice to add a name to the preset different from the
  filename.


6. References
---
[1] Cookbook formulae for audio EQ biquad filter coefficients
    http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
[2] X Multimedia System
    http://www.xmms.org/
[3] GNU Octave
    http://www.gnu.org/software/octave/
[4] Converted WinAmp / XMMS Equalizer sets
    http://www.informatik.uni-bremen.de/~hiben/moc/eqsets.tar.gz


================================================
FILE: THANKS
================================================
Thanks to all people who have helped us make MOC better, suggesting
changes or notifing about bugs:

Alexis Ballier:
	* Adapt to FFmpeg's changed include directory layout.

Rastislav Barlik:
	* Fixed segfault on deleted equalizer file.

Daniel T. Borelli:
	* Added support for key to switch on/off the display of percent played.
	* Added a configuration option to set the initial percent played state.
	* Fixed miscellaneous coding errors.
	* Assisted with testing.
	* Provided basis for fixing foreground mode unreaped children.

Morten Grunnet Buhl:
	* Provided Yellow/Red theme.

Andreas Cadhalpun:
	* Resolved the deprecated 'request_channels' puzzle.

Nuno Cardoso:
	* Options in a hash table.
	* Added -j command line option to jump to a given position.

Josh Coalson:
	* Fixes for compilation with FLAC 1.1.3.

Brent Cook:
	* Various OpenBSD-related patches.

Niels Aan de Brugh:
	* Improved error detection for terminal height limits.

Jonathan Derque:
	* Support for GNU screen title.

Joseph Dunn:
	* Bug reports.
	* He gave me access to his FreeBSD box that allowed me to fix a bug.

Dennis Felsing:
	* Fixed compilation of sidplay2.

Filippo Giunchedi:
	* Added directories to the 'a' command.

Alexey Gladkov:
	* Support for filenames and directory names recoding using librcc.

Tomasz Golinski:
	* Assisted greatly with testing and debugging.
	* Headed the effort to port MOC to OpenWRT.
	* Provided signficant information on DTS, AAC and other formats.
	* Also contributed much time in the refinement of feature ideas.
	* Provided 24-bit format conversion bug fixes.
	* Fixed volume control problem.
	* Provided check for valid output channels and formats.

Juho Hämäläinen:
	* Added -Q (--format) FORMAT_STRING option to display file information.

Hendrik Iben:
	* Added TiMidity decoder for MIDI.
	* Added SidPlay2 decoder for SID.
	* Added Modplug decoder.
	* Added check for newer faad2-library (AAC).
	* Added software mixer.
	* Added parametric equalizer.
	* Merged parametric equalizer and mono-mixing code.
	* Fixed miscellaneous coding errors.
	* Fixed logging of deleted filenames.
	* Assisted with testing.

Daniel Kalør:
	* Provided spelling fixes.
	* Fixed clearing chars when displaying file information.
	* Fixed field overflow when fast-forwarding yields very large bit rates.
	* Repositioned selected track to middle after scrolling off screen.
	* Fixed the symbol for "kilo", use "k" (lowercase).
	* Allowed seeking to beginning of a file in Vorbis/FLAC.

Kari Karvonen:
	* Suggested code for the AutoNext option.

Hasan Keler:
	* Assisted with testing.
	* Also assisted by commenting on feature ideas.

Max Klinger:
	* Silenced compiler warnings on various platforms.
	* Migrated AAC decoder to later FAAD2 API.
	* Replaced GNU-specific getline() with read_line().
	* Resolved JACK deprecation warnings.
	* Prompted option to autostart JACK if the server isn't running.
	* Assisted with testing.
	* Also assisted by commenting on feature ideas.

Adam Kowalski:
	* Many bug reports (also tests).

Florian Kriener:
	* Provided title building code.
	* Corrected many typos and fixed many bugs.

Vladimir Krylov:
	* Added 24-bit support to the OSS sound driver.

Maciej Kubiak:
	* Suggestions and bug reports.

Géraud Le Falher:
	* Fixed crash in lyrics code with overly long filenames.
	* Display lyrics saved in files together with music.

Jacek Lehmann:
	* Provided Green theme and fixes for a few terminals.

Tero Marttila:
	* Changed minimum screen height to 7 lines.

Gregory Maxwell:
	* Provided patch for off_t in io_* functions.

Alex Merenstein:
	* Fixed theme menu cursor placement.
	* Fixed new attributes application during theme switching.
	* Assisted with debugging and testing.

Marcin Michałowski:
	* Added default and grey colours, and made first nice theme.

Martin Milata:
	* Resolved Clang Static Analyzer warnings.
	* Dead code removal.
	* Miscellaneous code fixes.
	* Fix segfault when using -k command line option.
	* Added -q option to queue files from command line.
	* Provided play queue feature.
	* Fixed race condition between two clients and playlist request servicing.

Jack Miller:
	* Added average bitrate field to the output of mocp -i.
	* Provided command line option to toggle/on/off playback options.
	* Provided command line option for setting the volume.
	* Added OnSongChange option which runs a command when song is changed.

Alex Norman:
	* Added JACK output.
	* Assisted with reported JACK issues.
	* Added FastDir option.
	* Other improvements.

Sebastian Parborg:
	* Silenced compiler warnings on various platforms.
	* Fixed bug attempting to read from unopened OSS mixer.
	* Assisted with testing.
	* Also assisted by commenting on feature ideas.

Ted Phelps:
	* Fixed incorrect referencing of ALSA mixer channels.

Petr Pisar:
	* Provided patch upon which the initial locale support was based.

Jonathan Poelen:
	* Removed redundant call to file_type().

Alexander Polakov:
	* Fixed miscoloured frame when switching themes.
	* Provided SNDIO sound driver for OpenBSD systems.
	* Fixed call for bit rate after file open has failed.
	* Assisted with testing.

Elimar Riesebieter:
	* Tested on PPC (made to work on big endian architectures).
	* Builder of the official Debian package.
	* Described --seek option in the manpage.
	* Added JACK to '-R' option sound drivers on manpage.

Alexandrov Sergey:
	* Added Wavpack decoder.
	* Fixed 8-, 24- and 32-bit decoding in Wavpack decoder.

Aleks Sherikov:
	* Added EnforceTagsEncoding, FileNamesIconv, and FileNamesIconv options.

Joerg Sonnenberger:
	* Fixed using ncurses on NetBSD.
	* Fixed detecting curses if ncurses is not present.

Wim Speekenbrink:
	* Author of nightly_theme.

Daniel Stenberg:
	* Fixed CURL timeout so internet streaming errors don't hang MOC.

Ondřej Svoboda:
	* Fixed a fatal error when opening an MP3 file.
	* Fixed a compilation warning in the FFmpeg plugin.
	* Spelling fixes.
	* Source files encoding fixes.

Kamil Tarkowski:
	* Provided 'back' command.
	* Some fixes and small improvements.

Reuben Thomas:
	* Fixed typos in documentation.
	* Fixed and simplify parameters substitution in --format command.
	* Don't run the server if the user doesn't really want to do that when
	  using few commands from command line like --info.
	* Reorganised code that parses command line options.
	* Allowed the use of FormatString tags in --format arguments.

Richard Toohey:
	* Assisted with testing on OpenBSD.

Antonio Trande:
	* Assisted with testing.
	* Also assisted by commenting on feature ideas.
	* Fedora's MOC package builder.

Marc Tschiesche:
	* Provided highlighted playlist numbers and file times.

Zhiming Wang:
	* Assisted with testing on OSX.

Jenny Wong:
	* Provided minor memory corruption patch.
	* Introduced FFmpeg to Internet streams.

Marien Zwart:
	* Assisted with testing.

"cbass":
	* Fixed segfault when trying to play a file using FFmpeg.
	* Migrated to newer FFmpeg API.

"exc":
	* Pointed to an ALSA optimisation with joined channels.

"firejox":
	* Fixed screen upsets due to UTF-8 character handing.

"fluxid":
	* Fixed incorrect setting for themes red channel value.

"GenghisKhan":
	* Reported bugs and significantly helped debugging them.
	* Greatly assisted with debugging the ALSA stutter bug.

"meh":
	* Provided code to prefer reading ID3 tags v2 over v1.

"scorched":
	* Assisted with testing.

"thotypous":
	* Provided code to allow use of the OSSv4 per-application mixer API.

"tokapix":
	* Provided additional proving of the ALSA stutter bug fix.

"tyranix":
	* Provided new command 'Y' to prune unreadable files from the playlist.

"vectis":
	* Assisted with debugging the ALSA stutter bug.

"zaphod":
	* Some strcpy() to strncpy() changes.

There are many people who have contributed in various ways to the
development of MOC.  I hope I've listed all who deserve thanks, but if
not then I apologise and you should remind me so I can include you.


================================================
FILE: TODO
================================================
This file does not list all bugs which:

- are known but rarely encountered,
- are not visible to the user,
- are programming errors detectable only with the aid of testing tools,
- are benign, or
- have been reported but not yet confirmed to be attributable to MOC.

It also does not contain many "To Do" items as these are often quite fluid
and can evolve rapidly over time.

The MOC Maintainer does hold a master list containing bugs, feature requests,
program change requests and future requirements, and once it is possible to
generate this file from that list automatically it may be updated more
frequently so it is current and comprehensive.


Known Bugs:

* Character set problems:
  - Do we assume filesystem in UTF-8?  It's incorrect.
  - id3tags v2.3 with UTF-16 are not properly handled by libid3tag, taglib
    has no problems.  Need to use libtag here?
  - Recognition of ID3 tags v1 is broken (example: small.mp3).  [node/234]
  - Perhaps MOC can add support for the frame field_type to differentiate
    between ID3_FIELD_TYPE_LATIN1 and ID3_FIELD_TYPE_STRING.  [node/234]
  - Some national characters in file and directory names don't get displayed
    correctly.
* Program crashes:
  - I have a problem with MOC 2.4.0 on FreeBSD 6.1-PRERELEASE.  When I build
    MOC with musepack (libmpcdec) support MOC always core dumps on exit.
    (This may have been fixed by other storage-related patches and will be
    removed in MOC 2.7 if no one has confirmed it still exists.)
  - Using DB_THREAD in combination with DB_CREATE and DB_PRIVATE seems to
    cause a segfault on OpenWRT.  The circumvention is to configure MOC on
    OpenWRT with '--disable-cache' or set the MOC configuration option
    'TagsCacheSize' to zero.
* Valgrind-detected memory problems:
  - libasound: memory leaks
  - libdb: uninitialised parameter storage
  - libffmpeg: uninitialised storage in conditions and reads
  - libgme: uninitialised storage in conditions and reads
  - libmagic: uninitialised storage in reads
  - librcc: uninitialised storage in conditions
  - libspeex: uninitialised storage in conditions and reads
  - The problems above occur in libraries but it needs to be determined
    whether they somehow arise from MOC's misuse of them.
  - There are many data race and mutex handling problems (particularly
    around the time of file-to-file transitions), but these are not visible
    to the users and difficult to solve without compromising gapless playback.
* Directory and playlists:
  - When sorting by file name (directories), put files beginning with a
    non-alphanumeric character at the top.
  - mocp -a playlist.pls should not sort added files.  [node/240]
  - Client does not show changes when a file's tags are updated by another
    program.
  - Client continues to show file names after ReadTags is toggled when
    MOC is started with 'ShowTime=yes' and 'ReadTags=no'.
* Decoder problems:
  - Seeking in some formats does not work in the FFmpeg decoder because of
    the limitations of the FFmpeg libraries (and seeking is disabled for
    them).  FLV also has seeking issues and is disabled but will be enabled
    if SEEK_IN_DECODER is set in the FFmpeg decoder plug-in.  (This may be
    parameterised in due course.)
  - Some decoders do not currently pass the MD5 sum or sample count checks.
  - The duration of some AAC audios is incorrectly reported.  This problem
    arises from the limitations of the format, but MOC now makes much more
    accurate guesses.


Transitional Code Removal:

* Remove TagLib version 1.5 requirement warning.
* Remove Musepack libmpc (instead of libmpcdec) requirement warning.
* Remove librcc raised requirement warning.


Pending 2.6 Changes:

* Require at least TagLib version 1.5.
* Require Musepack libmpc (instead of libmpcdec).
* Require at least librcc version 0.2.10.


Pending 2.7 Changes:

* Remove FreeBSD program crash bug if no one has confirmed it still exists.
* Remove 'ALSAStutterDefeat' start-up warning.


Future Wishlist (items marked with $ are bigger changes requiring more time):

* Move TODO to moc.daper.net/roadmap .
* A string-valued variable "TitleFormatString", similar to "FormatString".
  I'd suggest all the same %-escapes, plus:
  %F -- expands to (the expansion of) the current FormatString
  if there is a song playing or paused, and empty string if stopped.
  %S -- expands to play/stop/pause.
* Command line option to play from a specified file/first from the last
  added files.  [node/286]
* Multiple file selection to move many files at once up and down.  [node/288]
* Review strcat()/strcpy()/sprintf() usage, change to
  strncat()/strncpy()/snprintf() where possible.
* More side menus: many directory/playlist views.
* LADSPA/LV2
* Editing the title of an item on the playlist (for Internet streams).
*$ Media library: tree-like menu for artists and albums.
* Seek by a % value (also using keys for 10%, 20%, etc).
* Ability to play from a playlist made of items found after searching.
* JACK: intelligent behaviour when we get disconnected from the server
  - detect it, try connect and exit if it fails.
* FastGo instead of FastDir: go to a directory, URL or a playlist.
* Read tags for sndfile formats.
*$ http://www.peercast.org/
* Crossfade.
* Command to see all information about a file with all tags, also all
  information about an internet stream (from IceCast headers like icy-url,
  icy-pub).
*$ Lyrics downloaded from the Internet.
* lirc.
* Don't use PATH_MAX.
* Seek forward using the content of the output buffer.
*$ Locales.
*$ Song ratings or something like Q in XMMS.
* Configurable sorting.
* Add a key for switching sort modes.
*$ Equalizer like in Beep Media Player
*$ Make equal volume level for every song like in http://volnorm.sourceforge.net
*$ Replaygain.
* Seek to arbitrary position (by typing a number).
*$ ESD.
*$ CUE-sheet.
* Command line option to delete the currently played item from the playlist.
* Scripting.
* Some options can be changed at run-time using a menu.
* posix_fadvise() with POSIX_FADV_WILLNEED instead of the input buffer thread
  for files.
* Recording played sound to a file.
* Upgrade TiMidity decoder plug-in to TiMidity++.  This would add support
  for soundfonts (.sf2) which are now more common.


Maybe Never:

* Report ignored server-specific options when the server is not being run.
* Funny ASCII equalizer.
* Mouse support.  [node/743]


================================================
FILE: alsa.c
================================================
/*
 * MOC - music on console
 * Copyright (C) 2004 Damian Pietras <daper@daper.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

/* Based on aplay copyright (c) by Jaroslav Kysela <perex@suse.cz> */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdlib.h>
#include <inttypes.h>
#include <alsa/asoundlib.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>

#define DEBUG

#define STRERROR_FN alsa_strerror

#include "common.h"
#include "server.h"
#include "audio.h"
#include "options.h"
#include "log.h"

#define BUFFER_MAX_USEC	300000

/* Check that ALSA's and MOC's byte/sample/frame conversions agree. */
#ifndef NDEBUG
# define ALSA_CHECK(fn,val) \
	 do { \
		long v = val; \
		ssize_t ssz = snd_pcm_##fn (handle, 1); \
		if (ssz < 0) \
			debug ("CHECK: snd_pcm_%s() failed: %s", #fn, alsa_strerror (ssz)); \
		else if (v != ssz) \
			debug ("CHECK: snd_pcm_%s() = %zd (vs %ld)", #fn, ssz, v); \
	} while (0)
#else
# define ALSA_CHECK(...) do {} while (0)
#endif

static snd_pcm_t *handle = NULL;

static struct
{
	unsigned int channels;
	unsigned int rate;
	snd_pcm_format_t format;
} params = { 0, 0, SND_PCM_FORMAT_UNKNOWN };

static snd_pcm_uframes_t buffer_frames;
static snd_pcm_uframes_t chunk_frames;
static int chunk_bytes = -1;
static char alsa_buf[512 * 1024];
static int alsa_buf_fill = 0;
static int bytes_per_frame;
static int bytes_per_sample;

static snd_mixer_t *mixer_handle = NULL;
static snd_mixer_elem_t *mixer_elem1 = NULL;
static snd_mixer_elem_t *mixer_elem2 = NULL;
static snd_mixer_elem_t *mixer_elem_curr = NULL;

/* Percentage volume setting for first and second mixer. */
static int volume1 = -1;
static int volume2 = -1;

/* ALSA-provided error code to description function wrapper. */
static inline char *alsa_strerror (int errnum)
{
	char *result;

	if (errnum < 0)
		errnum = -errnum;

	if (errnum < SND_ERROR_BEGIN)
		result = xstrerror (errnum);
	else
		result = xstrdup (snd_strerror (errnum));

	return result;
}

/* Map ALSA's mask to MOC's format (and visa versa). */
static const struct {
	snd_pcm_format_t mask;
	long format;
} format_masks[] = {
	{SND_PCM_FORMAT_S8, SFMT_S8},
	{SND_PCM_FORMAT_U8, SFMT_U8},
	{SND_PCM_FORMAT_S16, SFMT_S16},
	{SND_PCM_FORMAT_U16, SFMT_U16},
	{SND_PCM_FORMAT_S32, SFMT_S32},
	{SND_PCM_FORMAT_U32, SFMT_U32}
};

/* Given an ALSA mask, return a MOC format or zero if unknown. */
static inline long mask_to_format (const snd_pcm_format_mask_t *mask)
{
	long result = 0;

	for (size_t ix = 0; ix < ARRAY_SIZE(format_masks); ix += 1) {
		if (snd_pcm_format_mask_test (mask, format_masks[ix].mask))
			result |= format_masks[ix].format;
	}

#if 0
	if (snd_pcm_format_mask_test (mask, SND_PCM_FORMAT_S24))
		result |= SFMT_S32; /* conversion needed */
#endif

	return result;
}

/* Given a MOC format, return an ALSA mask.
 * Return SND_PCM_FORMAT_UNKNOWN if unknown. */
static inline snd_pcm_format_t format_to_mask (long format)
{
	snd_pcm_format_t result = SND_PCM_FORMAT_UNKNOWN;

	for (size_t ix = 0; ix < ARRAY_SIZE(format_masks); ix += 1) {
		if (format_masks[ix].format == format) {
			result = format_masks[ix].mask;
			break;
		}
	}

	return result;
}

#ifndef NDEBUG
static void alsa_log_cb (const char *unused1 ATTR_UNUSED,
                         int unused2 ATTR_UNUSED,
                         const char *unused3 ATTR_UNUSED,
                         int unused4 ATTR_UNUSED, const char *fmt, ...)
{
	char *msg;
	va_list va;

	assert (fmt);

	va_start (va, fmt);
	msg = format_msg_va (fmt, va);
	va_end (va);

	logit ("ALSA said: %s", msg);
	free (msg);
}
#endif

static snd_pcm_hw_params_t *alsa_open_device (const char *device)
{
	int rc;
	snd_pcm_hw_params_t *result;

	assert (!handle);

	rc = snd_pcm_open (&handle, device, SND_PCM_STREAM_PLAYBACK,
	                                    SND_PCM_NONBLOCK);
	if (rc < 0) {
		error_errno ("Can't open audio", rc);
		goto err1;
	}

	rc = snd_pcm_hw_params_malloc (&result);
	if (rc < 0) {
		error_errno ("Can't allocate hardware parameters structure", rc);
		goto err2;
	}

	rc = snd_pcm_hw_params_any (handle, result);
	if (rc < 0) {
		error_errno ("Can't initialize hardware parameters structure", rc);
		goto err3;
	}

	if (0) {
	err3:
		snd_pcm_hw_params_free (result);
	err2:
		snd_pcm_close (handle);
	err1:
		result = NULL;
		handle = NULL;
	}

	return result;
}

/* Fill caps with the device capabilities. Return 0 on error. */
static int fill_capabilities (struct output_driver_caps *caps)
{
	int result = 0;
	snd_pcm_hw_params_t *hw_params;

	assert (!handle);

	hw_params = alsa_open_device (options_get_str ("ALSADevice"));
	if (!hw_params)
		return 0;

	do {
		int rc;
		unsigned int val;
		snd_pcm_format_mask_t *format_mask;

		rc = snd_pcm_hw_params_get_channels_min (hw_params, &val);
		if (rc < 0) {
			error_errno ("Can't get the minimum number of channels", rc);
			break;
		}
		caps->min_channels = val;

		rc = snd_pcm_hw_params_get_channels_max (hw_params, &val);
		if (rc < 0) {
			error_errno ("Can't get the maximum number of channels", rc);
			break;
		}
		caps->max_channels = val;

		rc = snd_pcm_format_mask_malloc (&format_mask);
		if (rc < 0) {
			error_errno ("Can't allocate format mask", rc);
			break;
		}
		snd_pcm_hw_params_get_format_mask (hw_params, format_mask);
		caps->formats = mask_to_format (format_mask) | SFMT_NE;
		snd_pcm_format_mask_free (format_mask);

		result = 1;
	} while (0);

	snd_pcm_hw_params_free (hw_params);
	snd_pcm_close (handle);
	handle = NULL;

	return result;
}

static void handle_mixer_events (snd_mixer_t *mixer_handle)
{
	struct pollfd *fds = NULL;

	assert (mixer_handle);

	do {
		int rc, count;

		count = snd_mixer_poll_descriptors_count (mixer_handle);
		if (count < 0) {
			log_errno ("snd_mixer_poll_descriptors_count() failed", count);
			break;
		}

		fds = xcalloc (count, sizeof (struct pollfd));

		rc = snd_mixer_poll_descriptors (mixer_handle, fds, count);
		if (rc < 0) {
			log_errno ("snd_mixer_poll_descriptors() failed", rc);
			break;
		}

		rc = poll (fds, count, 0);
		if (rc < 0) {
			error_errno ("poll() failed", errno);
			break;
		}

		if (rc == 0)
			break;

		debug ("Mixer event");

		rc = snd_mixer_handle_events (mixer_handle);
		if (rc < 0)
			log_errno ("snd_mixer_handle_events() failed", rc);
	} while (0);

	free (fds);
}

static int alsa_read_mixer_raw (snd_mixer_elem_t *elem)
{
	int rc, nchannels = 0, volume = 0;
	bool joined;
	snd_mixer_selem_channel_id_t chan_id;

	if (!mixer_handle)
		return -1;

	assert (elem);

	handle_mixer_events (mixer_handle);

	joined = snd_mixer_selem_has_playback_volume_joined (elem);

	for (chan_id = 0; chan_id < SND_MIXER_SCHN_LAST; chan_id += 1) {
		if (snd_mixer_selem_has_playback_channel (elem, chan_id)) {
			long vol;

			nchannels += 1;
			rc = snd_mixer_selem_get_playback_volume (elem, chan_id, &vol);
			if (rc < 0) {
				error_errno ("Can't read mixer", rc);
				return -1;
			}

			assert (RANGE(0, vol, 100));

#if 0
			{
				static int prev_vol[SND_MIXER_SCHN_LAST] = {0};

				if (vol != prev_vol[chan_id]) {
					prev_vol[chan_id] = vol;
					debug ("Vol %d: %ld", chan_id, vol);
				}
			}
#endif

			volume += vol;
		}

		if (joined)
			break;
	}

	if (nchannels == 0) {
		logit ("Mixer has no channels");
		return -1;
	}

	volume /= nchannels;

	return volume;
}

static snd_mixer_elem_t *alsa_init_mixer_channel (const char *name)
{
	snd_mixer_selem_id_t *sid;
	snd_mixer_elem_t *result = NULL;

	assert (mixer_handle);

	snd_mixer_selem_id_malloc (&sid);
	snd_mixer_selem_id_set_index (sid, 0);
	snd_mixer_selem_id_set_name (sid, name);

	do {
		snd_mixer_elem_t *elem = NULL;

		elem = snd_mixer_find_selem (mixer_handle, sid);
		if (!elem) {
			error ("Can't find mixer %s", name);
			break;
		}

		if (!snd_mixer_selem_has_playback_volume (elem)) {
			error ("Mixer device has no playback volume (%s).", name);
			break;
		}

		if (snd_mixer_selem_set_playback_volume_range (elem, 0, 100) < 0) {
			error ("Cannot set playback volume range (%s).", name);
			break;
		}

		logit ("Opened mixer (%s)", name);
		result = elem;
	} while (0);

	snd_mixer_selem_id_free (sid);

	return result;
}

static void alsa_close_mixer ()
{
	if (mixer_handle) {
		int rc;

		rc = snd_mixer_close (mixer_handle);
		if (rc < 0)
			log_errno ("Can't close mixer", rc);

		mixer_handle = NULL;
	}
}

static void alsa_open_mixer (const char *device)
{
	int rc;

	assert (!mixer_handle);

	rc = snd_mixer_open (&mixer_handle, 0);
	if (rc < 0) {
		error_errno ("Can't open ALSA mixer", rc);
		goto err;
	}

	rc = snd_mixer_attach (mixer_handle, device);
	if (rc < 0) {
		error_errno ("Can't attach mixer", rc);
		goto err;
	}

	rc = snd_mixer_selem_register (mixer_handle, NULL, NULL);
	if (rc < 0) {
		error_errno ("Can't register mixer", rc);
		goto err;
	}

	rc = snd_mixer_load (mixer_handle);
	if (rc < 0) {
		error_errno ("Can't load mixer", rc);
		goto err;
	}

	if (0) {
	err:
		alsa_close_mixer ();
	}
}

static void alsa_set_current_mixer ()
{
	int vol;

	if (mixer_elem1 && (vol = alsa_read_mixer_raw (mixer_elem1)) != -1) {
		assert (RANGE(0, vol, 100));
		volume1 = vol;
	}
	else {
		mixer_elem1 = NULL;
		mixer_elem_curr = mixer_elem2;
	}

	if (mixer_elem2 && (vol = alsa_read_mixer_raw (mixer_elem2)) != -1) {
		assert (RANGE(0, vol, 100));
		volume2 = vol;
	}
	else {
		mixer_elem2 = NULL;
		mixer_elem_curr = mixer_elem1;
	}
}

static void alsa_shutdown ()
{
	alsa_close_mixer ();

#ifndef NDEBUG
	snd_lib_error_set_handler (NULL);
#endif
}

static int alsa_init (struct output_driver_caps *caps)
{
	int result = 0;
	const char *device;

	assert (!mixer_handle);

	device = options_get_str ("ALSADevice");
	logit ("Initialising ALSA device: %s", device);

#ifndef NDEBUG
	snd_lib_error_set_handler (alsa_log_cb);
#endif

	alsa_open_mixer (device);

	if (mixer_handle) {
		mixer_elem1 = alsa_init_mixer_channel (options_get_str ("ALSAMixer1"));
		mixer_elem2 = alsa_init_mixer_channel (options_get_str ("ALSAMixer2"));
	}

	mixer_elem_curr = mixer_elem1 ? mixer_elem1 : mixer_elem2;

	if (mixer_elem_curr)
		alsa_set_current_mixer ();

	if (!mixer_elem_curr)
		goto err;

	result = fill_capabilities (caps);
	if (result == 0)
		goto err;

	if (sizeof (long) < 8 && options_was_defaulted ("ALSAStutterDefeat")) {
		fprintf (stderr,
		         "\n"
		         "Warning: Your system may be vulnerable to stuttering audio.\n"
		         "         You should read the example configuration file comments\n"
		         "         for the 'ALSAStutterDefeat' option and set it accordingly.\n"
		         "         Setting the option will remove this warning.\n"
		         "\n");
		xsleep (5, 1);
	}

	if (0) {
	err:
		alsa_shutdown ();
	}

	return result;
}

static int alsa_open (struct sound_params *sound_params)
{
	int rc, result = 0;
	unsigned int period_time, buffer_time;
	char fmt_name[128];
	const char *device;
	snd_pcm_hw_params_t *hw_params;

	assert (!handle);

	params.format = format_to_mask (sound_params->fmt & SFMT_MASK_FORMAT);
	if (params.format == SND_PCM_FORMAT_UNKNOWN) {
		error ("Unknown sample format: %s",
		        sfmt_str (sound_params->fmt, fmt_name, sizeof (fmt_name)));
		return 0;
	}

	device = options_get_str ("ALSADevice");
	logit ("Opening ALSA device: %s", device);

	hw_params = alsa_open_device (device);
	if (!hw_params)
		return 0;

	rc = snd_pcm_hw_params_set_access (handle, hw_params,
	                                   SND_PCM_ACCESS_RW_INTERLEAVED);
	if (rc < 0) {
		error_errno ("Can't set ALSA access type", rc);
		goto err;
	}

	rc = snd_pcm_hw_params_set_format (handle, hw_params, params.format);
	if (rc < 0) {
		error_errno ("Can't set sample format", rc);
		goto err;
	}

	bytes_per_sample = sfmt_Bps (sound_params->fmt);
	logit ("Set sample width: %d bytes", bytes_per_sample);

	if (options_get_bool ("ALSAStutterDefeat")) {
		rc = snd_pcm_hw_params_set_rate_resample (handle, hw_params, 0);
		if (rc == 0)
			logit ("ALSA resampling disabled");
		else
			log_errno ("Unable to disable ALSA resampling", rc);
	}

	params.rate = sound_params->rate;
	rc = snd_pcm_hw_params_set_rate_near (handle, hw_params, &params.rate, 0);
	if (rc < 0) {
		error_errno ("Can't set sample rate", rc);
		goto err;
	}

	logit ("Set rate: %uHz", params.rate);

	rc = snd_pcm_hw_params_set_channels (handle, hw_params,
	                                     sound_params->channels);
	if (rc < 0) {
		error_errno ("Can't set number of channels", rc);
		goto err;
	}

	logit ("Set channels: %d", sound_params->channels);

	rc = snd_pcm_hw_params_get_buffer_time_max (hw_params, &buffer_time, 0);
	if (rc < 0) {
		error_errno ("Can't get maximum buffer time", rc);
		goto err;
	}

	buffer_time = MIN(buffer_time, BUFFER_MAX_USEC);
	period_time = buffer_time / 4;

	rc = snd_pcm_hw_params_set_period_time_near (handle, hw_params,
	                                             &period_time, 0);
	if (rc < 0) {
		error_errno ("Can't set period time", rc);
		goto err;
	}

	rc = snd_pcm_hw_params_set_buffer_time_near (handle, hw_params,
	                                             &buffer_time, 0);
	if (rc < 0) {
		error_errno ("Can't set buffer time", rc);
		goto err;
	}

	rc = snd_pcm_hw_params (handle, hw_params);
	if (rc < 0) {
		error_errno ("Can't set audio parameters", rc);
		goto err;
	}

	snd_pcm_hw_params_get_period_size (hw_params, &chunk_frames, 0);
	debug ("Chunk size: %lu frames", chunk_frames);

	snd_pcm_hw_params_get_buffer_size (hw_params, &buffer_frames);
	debug ("Buffer size: %lu frames", buffer_frames);
	debug ("Buffer time: %"PRIu64"us",
	        (uint64_t) buffer_frames * UINT64_C(1000000) / params.rate);

	bytes_per_frame = sound_params->channels * bytes_per_sample;
	debug ("Frame size: %d bytes", bytes_per_frame);

	chunk_bytes = chunk_frames * bytes_per_frame;

	if (chunk_frames == buffer_frames) {
		error ("Can't use period equal to buffer size (%lu == %lu)",
				chunk_frames, buffer_frames);
		goto err;
	}

	rc = snd_pcm_prepare (handle);
	if (rc < 0) {
		error_errno ("Can't prepare audio interface for use", rc);
		goto err;
	}

	ALSA_CHECK (samples_to_bytes, bytes_per_sample);
	ALSA_CHECK (frames_to_bytes, bytes_per_frame);

	logit ("ALSA device opened");

	params.channels = sound_params->channels;
	alsa_buf_fill = 0;
	result = 1;

err:
	snd_pcm_hw_params_free (hw_params);

	return result;
}

/* Play from alsa_buf as many chunks as possible. Move the remaining data
 * to the beginning of the buffer. Return the number of bytes written
 * or -1 on error. */
static int play_buf_chunks ()
{
	int written = 0;
	bool zero_logged = false;

	while (alsa_buf_fill >= chunk_bytes) {
		int rc;

		rc = snd_pcm_writei (handle, alsa_buf + written, chunk_frames);

		if (rc == 0) {
			if (!zero_logged) {
				debug ("Played 0 bytes");
				zero_logged = true;
			}
			continue;
		}

		zero_logged = false;

		if (rc > 0) {
			int written_bytes = rc * bytes_per_frame;

			written += written_bytes;
			alsa_buf_fill -= written_bytes;

			debug ("Played %d bytes", written_bytes);
			continue;
		}

		rc = snd_pcm_recover (handle, rc, 0);

		switch (rc) {
		case 0:
			break;
		case -EAGAIN:
			if (snd_pcm_wait (handle, 500) < 0)
				logit ("snd_pcm_wait() failed");
			break;
		default:
			error_errno ("Can't play", rc);
			return -1;
		}
	}

	debug ("%d bytes remain in alsa_buf", alsa_buf_fill);
	memmove (alsa_buf, alsa_buf + written, alsa_buf_fill);

	return written;
}

static void alsa_close ()
{
	snd_pcm_sframes_t delay;

	assert (handle != NULL);

	/* play what remained in the buffer */
	if (alsa_buf_fill > 0) {
		unsigned int samples_required;

		assert (alsa_buf_fill < chunk_bytes);

		samples_required = (chunk_bytes - alsa_buf_fill) / bytes_per_sample;
		snd_pcm_format_set_silence (params.format, alsa_buf + alsa_buf_fill,
									samples_required);

		alsa_buf_fill = chunk_bytes;
		play_buf_chunks ();
	}

	/* Wait for ALSA buffers to empty.
	 * Do not be tempted to use snd_pcm_nonblock() and snd_pcm_drain()
	 * here; there are two bugs in ALSA which make it a bad idea (see
	 * the SVN commit log for r2550).  Instead we sleep for the duration
	 * of the still unplayed samples. */
	if (snd_pcm_delay (handle, &delay) == 0 && delay > 0)
		xsleep (delay, params.rate);
	snd_pcm_close (handle);
	logit ("ALSA device closed");

	params.format = 0;
	params.rate = 0;
	params.channels = 0;
	buffer_frames = 0;
	chunk_frames = 0;
	chunk_bytes = -1;
	handle = NULL;
}

static int alsa_play (const char *buff, const size_t size)
{
	int to_write = size;
	int buf_pos = 0;

	assert (chunk_bytes > 0);

	debug ("Got %zu bytes to play", size);

	while (to_write) {
		int to_copy;

		to_copy = MIN(to_write, ssizeof(alsa_buf) - alsa_buf_fill);
		memcpy (alsa_buf + alsa_buf_fill, buff + buf_pos, to_copy);
		to_write -= to_copy;
		buf_pos += to_copy;
		alsa_buf_fill += to_copy;

		debug ("Copied %d bytes to alsa_buf (now filled with %d bytes)",
				to_copy, alsa_buf_fill);

		if (play_buf_chunks() < 0)
			return -1;
	}

	debug ("Played everything");

	return size;
}

static int alsa_read_mixer ()
{
	int actual_vol, *vol;

	actual_vol = alsa_read_mixer_raw (mixer_elem_curr);

	assert (RANGE(0, actual_vol, 100));

	if (mixer_elem_curr == mixer_elem1)
		vol = &volume1;
	else
		vol = &volume2;

	if (*vol != actual_vol) {
		*vol = actual_vol;
		logit ("Mixer volume has changed since we last read it.");
	}

	return actual_vol;
}

static void alsa_set_mixer (int vol)
{
	int rc;

	assert (RANGE(0, vol, 100));

	if (!mixer_handle)
		return;

	if (mixer_elem_curr == mixer_elem1)
		volume1 = vol;
	else
		volume2 = vol;

	debug ("Setting vol to %d", vol);

	rc = snd_mixer_selem_set_playback_volume_all (mixer_elem_curr, vol);
	if (rc < 0)
		error_errno ("Can't set mixer", rc);
}

static int alsa_get_buff_fill ()
{
	int result = 0;

	do {
		int rc;
		snd_pcm_sframes_t delay;

		if (!handle)
			break;

		rc = snd_pcm_delay (handle, &delay);
		if (rc < 0) {
			log_errno ("snd_pcm_delay() failed", rc);
			break;
		}

		/* delay can be negative if an underrun occurs */
		result = MAX(delay, 0) * bytes_per_frame;
	} while (0);

	return result;
}

static int alsa_reset ()
{
	int result = 0;

	do {
		int rc;

		if (!handle) {
			logit ("alsa_reset() when the device is not opened.");
			break;
		}

		rc = snd_pcm_drop (handle);
		if (rc < 0) {
			error_errno ("Can't reset the device", rc);
			break;
		}

		rc = snd_pcm_prepare (handle);
		if (rc < 0) {
			error_errno ("Can't prepare after reset", rc);
			break;
		}

		alsa_buf_fill = 0;
		result = 1;
	} while (0);

	return result;
}

static int alsa_get_rate ()
{
	return params.rate;
}

static void alsa_toggle_mixer_channel ()
{
	if (mixer_elem_curr == mixer_elem1 && mixer_elem2)
		mixer_elem_curr = mixer_elem2;
	else if (mixer_elem1)
		mixer_elem_curr = mixer_elem1;
}

static char *alsa_get_mixer_channel_name ()
{
	char *result;

	if (mixer_elem_curr == mixer_elem1)
		result = xstrdup (options_get_str ("ALSAMixer1"));
	else
		result = xstrdup (options_get_str ("ALSAMixer2"));

	return result;
}

void alsa_funcs (struct hw_funcs *funcs)
{
	funcs->init = alsa_init;
	funcs->shutdown = alsa_shutdown;
	funcs->open = alsa_open;
	funcs->close = alsa_close;
	funcs->play = alsa_play;
	funcs->read_mixer = alsa_read_mixer;
	funcs->set_mixer = alsa_set_mixer;
	funcs->get_buff_fill = alsa_get_buff_fill;
	funcs->reset = alsa_reset;
	funcs->get_rate = alsa_get_rate;
	funcs->toggle_mixer_channel = alsa_toggle_mixer_channel;
	funcs->get_mixer_channel_name = alsa_get_mixer_channel_name;
}


================================================
FILE: alsa.h
================================================
#ifndef ALSA_H
#define ALSA_H

#ifdef __cplusplus
extern "C" {
#endif

void alsa_funcs (struct hw_funcs *funcs);

#ifdef __cplusplus
}
#endif

#endif


================================================
FILE: audio.c
================================================
/*
 * MOC - music on console
 * Copyright (C) 2004-2006 Damian Pietras <daper@daper.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Contributors:
 *  - Kamil Tarkowski <kamilt@interia.pl> - "previous" request
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <assert.h>

#define DEBUG

#include "common.h"
#include "server.h"
#include "decoder.h"
#include "playlist.h"
#include "log.h"
#include "lists.h"

#ifdef HAVE_OSS
# include "oss.h"
#endif
#ifdef HAVE_SNDIO
# include "sndio_out.h"
#endif
#ifdef HAVE_ALSA
# include "alsa.h"
#endif
#ifndef NDEBUG
# include "null_out.h"
#endif
#ifdef HAVE_JACK
# include "jack.h"
#endif

#include "softmixer.h"
#include "equalizer.h"

#include "out_buf.h"
#include "protocol.h"
#include "options.h"
#include "player.h"
#include "audio.h"
#include "files.h"
#include "io.h"
#include "audio_conversion.h"

static pthread_t playing_thread = 0;  /* tid of play thread */
static int play_thread_running = 0;

/* currently played file */
static int curr_playing = -1;
/* file we played before playing songs from queue */
static char *before_queue_fname = NULL;
static char *curr_playing_fname = NULL;
/* This flag is set 1 if audio_play() was called with nonempty queue,
 * so we know that when the queue is empty, we should play the regular
 * playlist from the beginning. */
static int started_playing_in_queue = 0;
static pthread_mutex_t curr_playing_mtx = PTHREAD_MUTEX_INITIALIZER;

static struct out_buf *out_buf;
static struct hw_funcs hw;
static struct output_driver_caps hw_caps; /* capabilities of the output
					     driver */

/* Player state. */
static int state = STATE_STOP;
static int prev_state = STATE_STOP;

/* requests for playing thread */
static int stop_playing = 0;
static int play_next = 0;
static int play_prev = 0;
static pthread_mutex_t request_mtx = PTHREAD_MUTEX_INITIALIZER;

/* Playlists. */
static struct plist playlist;
static struct plist shuffled_plist;
static struct plist queue;
static struct plist *curr_plist; /* currently used playlist */
static pthread_mutex_t plist_mtx = PTHREAD_MUTEX_INITIALIZER;

/* Is the audio device opened? */
static int audio_opened = 0;

/* Current sound parameters (with which the device is opened). */
static struct sound_params driver_sound_params = { 0, 0, 0 };

/* Sound parameters requested by the decoder. */
static struct sound_params req_sound_params = { 0, 0, 0 };

static struct audio_conversion sound_conv;
static int need_audio_conversion = 0;

/* URL of the last played stream. Used to fake pause/unpause of internet
 * streams. Protected by curr_playing_mtx. */
static char *last_stream_url = NULL;

static int current_mixer = 0;

/* Check if the two sample rates don't differ so much that we can't play. */
#define sample_rate_compat(sound, device) ((device) * 1.05 >= sound \
		&& (device) * 0.95 <= sound)

/* Make a human readable description of the sound sample format(s).
 * Put the description in msg which is of size buf_size.
 * Return msg. */
char *sfmt_str (const long format, char *msg, const size_t buf_size)
{
	assert (sound_format_ok(format));

	assert (buf_size > 0);
	msg[0] = 0;

	if (format & SFMT_S8)
		strncat (msg, ", 8-bit signed", buf_size - strlen(msg) - 1);
	if (format & SFMT_U8)
		strncat (msg, ", 8-bit unsigned", buf_size - strlen(msg) - 1);
	if (format & SFMT_S16)
		strncat (msg, ", 16-bit signed", buf_size - strlen(msg) - 1);
	if (format & SFMT_U16)
		strncat (msg, ", 16-bit unsigned", buf_size - strlen(msg) - 1);
	if (format & SFMT_S32)
		strncat (msg, ", 24-bit signed (as 32-bit samples)",
				buf_size - strlen(msg) - 1);
	if (format & SFMT_U32)
		strncat (msg, ", 24-bit unsigned (as 32-bit samples)",
				buf_size - strlen(msg) - 1);
	if (format & SFMT_FLOAT)
		strncat (msg, ", float",
				buf_size - strlen(msg) - 1);

	if (format & SFMT_LE)
		strncat (msg, " little-endian", buf_size - strlen(msg) - 1);
	else if (format & SFMT_BE)
		strncat (msg, " big-endian", buf_size - strlen(msg) - 1);
	if (format & SFMT_NE)
		strncat (msg, " (native)", buf_size - strlen(msg) - 1);

	/* skip first ", " */
	if (msg[0])
		memmove (msg, msg + 2, strlen(msg) + 1);

	return msg;
}

/* Return != 0 if fmt1 and fmt2 have the same sample width. */
int sfmt_same_bps (const long fmt1, const long fmt2)
{
	if (fmt1 & (SFMT_S8 | SFMT_U8)
			&& fmt2 & (SFMT_S8 | SFMT_U8))
		return 1;
	if (fmt1 & (SFMT_S16 | SFMT_U16)
			&& fmt2 & (SFMT_S16 | SFMT_U16))
		return 1;
	if (fmt1 & (SFMT_S32 | SFMT_U32)
			&& fmt2 & (SFMT_S32 | SFMT_U32))
		return 1;
	if (fmt1 & fmt2 & SFMT_FLOAT)
		return 1;

	return 0;
}

/* Return the best matching sample format for the requested format and
 * available format mask. */
static long sfmt_best_matching (const long formats_with_endian,
		const long req_with_endian)
{
	long formats = formats_with_endian & SFMT_MASK_FORMAT;
	long req = req_with_endian & SFMT_MASK_FORMAT;
	long best = 0;

	char fmt_name1[SFMT_STR_MAX] DEBUG_ONLY;
	char fmt_name2[SFMT_STR_MAX] DEBUG_ONLY;

	if (formats & req)
		best = req;
	else if (req == SFMT_S8 || req == SFMT_U8) {
		if (formats & SFMT_S8)
			best = SFMT_S8;
		else if (formats & SFMT_U8)
			best = SFMT_U8;
		else if (formats & SFMT_S16)
			best = SFMT_S16;
		else if (formats & SFMT_U16)
			best = SFMT_U16;
		else if (formats & SFMT_S32)
			best = SFMT_S32;
		else if (formats & SFMT_U32)
			best = SFMT_U32;
		else if (formats & SFMT_FLOAT)
			best = SFMT_FLOAT;
	}
	else if (req == SFMT_S16 || req == SFMT_U16) {
		if (formats & SFMT_S16)
			best = SFMT_S16;
		else if (formats & SFMT_U16)
			best = SFMT_U16;
		else if (formats & SFMT_S32)
			best = SFMT_S32;
		else if (formats & SFMT_U32)
			best = SFMT_U32;
		else if (formats & SFMT_FLOAT)
			best = SFMT_FLOAT;
		else if (formats & SFMT_S8)
			best = SFMT_S8;
		else if (formats & SFMT_U8)
			best = SFMT_U8;
	}
	else if (req == SFMT_S32 || req == SFMT_U32 || req == SFMT_FLOAT) {
		if (formats & SFMT_S32)
			best = SFMT_S32;
		else if (formats & SFMT_U32)
			best = SFMT_U32;
		else if (formats & SFMT_S16)
			best = SFMT_S16;
		else if (formats & SFMT_U16)
			best = SFMT_U16;
		else if (formats & SFMT_FLOAT)
			best = SFMT_FLOAT;
		else if (formats & SFMT_S8)
			best = SFMT_S8;
		else if (formats & SFMT_U8)
			best = SFMT_U8;
	}

	assert (best != 0);

	if (!(best & (SFMT_S8 | SFMT_U8))) {
		if ((formats_with_endian & SFMT_LE)
				&& (formats_with_endian & SFMT_BE))
			best |= SFMT_NE;
		else
			best |= formats_with_endian & SFMT_MASK_ENDIANNESS;
	}

	debug ("Chose %s as the best matching %s",
			sfmt_str(best, fmt_name1, sizeof(fmt_name1)),
			sfmt_str(req_with_endian, fmt_name2, sizeof(fmt_name2)));

	return best;
}

/* Return the number of bytes per sample for the given format. */
int sfmt_Bps (const long format)
{
	int Bps = -1;

	switch (format & SFMT_MASK_FORMAT) {
		case SFMT_S8:
		case SFMT_U8:
			Bps = 1;
			break;
		case SFMT_S16:
		case SFMT_U16:
			Bps = 2;
			break;
		case SFMT_S32:
		case SFMT_U32:
			Bps = 4;
			break;
		case SFMT_FLOAT:
			Bps = sizeof (float);
			break;
	}

	assert (Bps > 0);

	return Bps;
}

/* Move to the next file depending on the options set, the user
 * request and whether or not there are files in the queue. */
static void go_to_another_file ()
{
	bool shuffle = options_get_bool ("Shuffle");
	bool go_next = (play_next || options_get_bool("AutoNext"));
	int curr_playing_curr_pos;
	/* XXX: Shouldn't play_next be protected by mutex? */

	LOCK (curr_playing_mtx);
	LOCK (plist_mtx);

	/* If we move forward in the playlist and there are some songs in
	 * the queue, then play them. */
	if (plist_count(&queue) && go_next) {
		logit ("Playing file from queue");

		if (!before_queue_fname && curr_playing_fname)
			before_queue_fname = xstrdup (curr_playing_fname);

		curr_plist = &queue;
		curr_playing = plist_next (&queue, -1);

		server_queue_pop (queue.items[curr_playing].file);
		plist_delete (&queue, curr_playing);
	}
	else {
		/* If we just finished playing files from the queue and the
		 * appropriate option is set, continue with the file played
		 * before playing the queue. */
		if (before_queue_fname && options_get_bool ("QueueNextSongReturn")) {
			free (curr_playing_fname);
			curr_playing_fname = before_queue_fname;
			before_queue_fname = NULL;
		}

		if (shuffle) {
			curr_plist = &shuffled_plist;

			if (plist_count(&playlist)
					&& !plist_count(&shuffled_plist)) {
				plist_cat (&shuffled_plist, &playlist);
				plist_shuffle (&shuffled_plist);

				if (curr_playing_fname)
					plist_swap_first_fname (&shuffled_plist,
							curr_playing_fname);
			}
		}
		else
			curr_plist = &playlist;

		curr_playing_curr_pos = plist_find_fname (curr_plist,
				curr_playing_fname);

		/* If we came from the queue and the last file in
		 * queue wasn't in the playlist, we try to revert to
		 * the QueueNextSongReturn == true behaviour. */
		if (curr_playing_curr_pos == -1 && before_queue_fname) {
			curr_playing_curr_pos = plist_find_fname (curr_plist,
					before_queue_fname);
		}

		if (play_prev && plist_count(curr_plist)) {
			logit ("Playing previous...");

			if (curr_playing_curr_pos == -1
					|| started_playing_in_queue) {
				curr_playing = plist_prev (curr_plist, -1);
				started_playing_in_queue = 0;
			}
			else
				curr_playing = plist_prev (curr_plist,
						curr_playing_curr_pos);

			if (curr_playing == -1) {
				if (options_get_bool("Repeat"))
					curr_playing = plist_last (curr_plist);
				logit ("Beginning of the list.");
			}
			else
				logit ("Previous item.");
		}
		else if (go_next && plist_count(curr_plist)) {
			logit ("Playing next...");

			if (curr_playing_curr_pos == -1
					|| started_playing_in_queue) {
				curr_playing = plist_next (curr_plist, -1);
				started_playing_in_queue = 0;
			}
			else
				curr_playing = plist_next (curr_plist,
						curr_playing_curr_pos);

			if (curr_playing == -1 && options_get_bool("Repeat")) {
				if (shuffle) {
					plist_clear (&shuffled_plist);
					plist_cat (&shuffled_plist, &playlist);
					plist_shuffle (&shuffled_plist);
				}
				curr_playing = plist_next (curr_plist, -1);
				logit ("Going back to the first item.");
			}
			else if (curr_playing == -1)
				logit ("End of the list");
			else
				logit ("Next item");

		}
		else if (!options_get_bool("Repeat")) {
			curr_playing = -1;
		}
		else
			debug ("Repeating file");

		if (before_queue_fname)
			free (before_queue_fname);
		before_queue_fname = NULL;
	}

	UNLOCK (plist_mtx);
	UNLOCK (curr_playing_mtx);
}

static void *play_thread (void *unused ATTR_UNUSED)
{
	logit ("Entering playing thread");

	while (curr_playing != -1) {
		char *file;

		LOCK (plist_mtx);
		file = plist_get_file (curr_plist, curr_playing);
		UNLOCK (plist_mtx);

		play_next = 0;
		play_prev = 0;

		if (file) {
			int next;
			char *next_file;

			LOCK (curr_playing_mtx);
			LOCK (plist_mtx);
			logit ("Playing item %d: %s", curr_playing, file);

			if (curr_playing_fname)
				free (curr_playing_fname);
			curr_playing_fname = xstrdup (file);

			out_buf_time_set (out_buf, 0.0);

			next = plist_next (curr_plist, curr_playing);
			next_file = next != -1 ? plist_get_file (curr_plist, next) : NULL;
			UNLOCK (plist_mtx);
			UNLOCK (curr_playing_mtx);

			player (file, next_file, out_buf);
			if (next_file)
				free (next_file);

			set_info_rate (0);
			set_info_bitrate (0);
			set_info_channels (1);
			out_buf_time_set (out_buf, 0.0);
			free (file);
		}

		LOCK (curr_playing_mtx);
		if (last_stream_url) {
			free (last_stream_url);
			last_stream_url = NULL;
		}
		UNLOCK (curr_playing_mtx);

		if (stop_playing) {
			LOCK (curr_playing_mtx);
			curr_playing = -1;
			UNLOCK (curr_playing_mtx);
			logit ("stopped");
		}
		else
			go_to_another_file ();
	}

	prev_state = state;
	state = STATE_STOP;
	state_change ();

	if (curr_playing_fname) {
		free (curr_playing_fname);
		curr_playing_fname = NULL;
	}

	audio_close ();
	logit ("Exiting");

	return NULL;
}

void audio_reset ()
{
	if (hw.reset)
		hw.reset ();
}

void audio_stop ()
{
	int rc;

	if (play_thread_running) {
		logit ("audio_stop()");
		LOCK (request_mtx);
		stop_playing = 1;
		UNLOCK (request_mtx);
		player_stop ();
		logit ("pthread_join (playing_thread, NULL)");
		rc = pthread_join (playing_thread, NULL);
		if (rc != 0)
			log_errno ("pthread_join() failed", rc);
		playing_thread = 0;
		play_thread_running = 0;
		stop_playing = 0;
		logit ("done stopping");
	}
	else if (state == STATE_PAUSE) {

		/* Paused internet stream - we are in fact stopped already. */
		if (curr_playing_fname) {
			free (curr_playing_fname);
			curr_playing_fname = NULL;
		}

		prev_state = state;
		state = STATE_STOP;
		state_change ();
	}
}

/* Start playing from the file fname. If fname is an empty string,
 * start playing from the first file on the list. */
void audio_play (const char *fname)
{
	int rc;

	audio_stop ();
	player_reset ();

	LOCK (curr_playing_mtx);
	LOCK (plist_mtx);

	/* If we have songs in the queue and fname is empty string, start
	 * playing file from the queue. */
	if (plist_count(&queue) && !(*fname)) {
		curr_plist = &queue;
		curr_playing = plist_next (&queue, -1);

		/* remove the file from queue */
		server_queue_pop (queue.items[curr_playing].file);
		plist_delete (curr_plist, curr_playing);

		started_playing_in_queue = 1;
	}
	else if (options_get_bool("Shuffle")) {
		plist_clear (&shuffled_plist);
		plist_cat (&shuffled_plist, &playlist);
		plist_shuffle (&shuffled_plist);
		plist_swap_first_fname (&shuffled_plist, fname);

		curr_plist = &shuffled_plist;

		if (*fname)
			curr_playing = plist_find_fname (curr_plist, fname);
		else if (plist_count(curr_plist)) {
			curr_playing = plist_next (curr_plist, -1);
		}
		else
			curr_playing = -1;
	}
	else {
		curr_plist = &playlist;

		if (*fname)
			curr_playing = plist_find_fname (curr_plist, fname);
		else if (plist_count(curr_plist))
			curr_playing = plist_next (curr_plist, -1);
		else
			curr_playing = -1;
	}

	rc = pthread_create (&playing_thread, NULL, play_thread, NULL);
	if (rc != 0)
		error_errno ("Can't create thread", rc);
	play_thread_running = 1;

	UNLOCK (plist_mtx);
	UNLOCK (curr_playing_mtx);
}

void audio_next ()
{
	if (play_thread_running) {
		play_next = 1;
		player_stop ();
	}
}

void audio_prev ()
{
	if (play_thread_running) {
		play_prev = 1;
		player_stop ();
	}
}

void audio_pause ()
{
	LOCK (curr_playing_mtx);
	LOCK (plist_mtx);

	if (curr_playing != -1) {
		char *sname = plist_get_file (curr_plist, curr_playing);

		if (file_type(sname) == F_URL) {
			UNLOCK (curr_playing_mtx);
			UNLOCK (plist_mtx);
			audio_stop ();
			LOCK (curr_playing_mtx);
			LOCK (plist_mtx);

			if (last_stream_url)
				free (last_stream_url);
			last_stream_url = xstrdup (sname);

			/* Pretend that we are paused on this. */
			curr_playing_fname = xstrdup (sname);
		}
		else
			out_buf_pause (out_buf);

		prev_state = state;
		state = STATE_PAUSE;
		state_change ();

		free (sname);
	}

	UNLOCK (plist_mtx);
	UNLOCK (curr_playing_mtx);
}

void audio_unpause ()
{
	LOCK (curr_playing_mtx);
	if (last_stream_url && file_type(last_stream_url) == F_URL) {
		char *url = xstrdup (last_stream_url);

		UNLOCK (curr_playing_mtx);
		audio_play (url);
		free (url);
	}
	else if (curr_playing != -1) {
		out_buf_unpause (out_buf);
		prev_state = state;
		state = STATE_PLAY;
		UNLOCK (curr_playing_mtx);
		state_change ();
	}
	else
		UNLOCK (curr_playing_mtx);
}

static void reset_sound_params (struct sound_params *params)
{
	params->rate = 0;
	params->channels = 0;
	params->fmt = 0;
}

/* Return 0 on error. If sound params == NULL, open the device using
 * the previous parameters. */
int audio_open (struct sound_params *sound_params)
{
	int res;
	static struct sound_params last_params = { 0, 0, 0 };

	if (!sound_params)
		sound_params = &last_params;
	else
		last_params = *sound_params;

	assert (sound_format_ok(sound_params->fmt));

	if (audio_opened) {
		if (sound_params_eq(req_sound_params, *sound_params)) {
			if (audio_get_bps() >= 88200) {
				logit ("Audio device already opened with such parameters.");
				return 1;
			}

			/* Not closing the device would cause that much
			 * sound from the previous file to stay in the buffer
			 * and the user will hear old data, so close it. */
			logit ("Reopening device due to low bps.");
		}

		audio_close ();
	}

	req_sound_params = *sound_params;

	/* Set driver_sound_params to parameters supported by the driver that
	 * are nearly the requested parameters. */

	if (options_get_int("ForceSampleRate")) {
		driver_sound_params.rate = options_get_int("ForceSampleRate");
		logit ("Setting forced driver sample rate to %dHz",
				driver_sound_params.rate);
	}
	else
		driver_sound_params.rate = req_sound_params.rate;

	driver_sound_params.fmt = sfmt_best_matching (hw_caps.formats,
			req_sound_params.fmt);

	/* number of channels */
	driver_sound_params.channels = CLAMP(hw_caps.min_channels,
	                                     req_sound_params.channels,
	                                     hw_caps.max_channels);

	res = hw.open (&driver_sound_params);

	if (res) {
		char fmt_name[SFMT_STR_MAX] LOGIT_ONLY;

		driver_sound_params.rate = hw.get_rate ();
		if (driver_sound_params.fmt != req_sound_params.fmt
				|| driver_sound_params.channels
				!= req_sound_params.channels
				|| (!sample_rate_compat(
						req_sound_params.rate,
						driver_sound_params.rate))) {
			logit ("Conversion of the sound is needed.");
			if (!audio_conv_new (&sound_conv, &req_sound_params,
					&driver_sound_params)) {
				hw.close ();
				reset_sound_params (&req_sound_params);
				return 0;
			}
			need_audio_conversion = 1;
		}
		audio_opened = 1;

		logit ("Requested sound parameters: %s, %d channels, %dHz",
				sfmt_str(req_sound_params.fmt, fmt_name, sizeof(fmt_name)),
				req_sound_params.channels,
				req_sound_params.rate);
		logit ("Driver sound parameters: %s, %d channels, %dHz",
				sfmt_str(driver_sound_params.fmt, fmt_name, sizeof(fmt_name)),
				driver_sound_params.channels,
				driver_sound_params.rate);
	}

	return res;
}

int audio_send_buf (const char *buf, const size_t size)
{
	size_t out_data_len = size;
	int res;
	char *converted = NULL;

	if (need_audio_conversion)
		converted = audio_conv (&sound_conv, buf, size, &out_data_len);

	if (need_audio_conversion && converted)
		res = out_buf_put (out_buf, converted, out_data_len);
	else if (!need_audio_conversion)
		res = out_buf_put (out_buf, buf, size);
	else
		res = 0;

	if (converted)
		free (converted);

	return res;
}

/* Get the current audio format bytes per frame value.
 * May return 0 if the audio device is closed. */
int audio_get_bpf ()
{
	return driver_sound_params.channels
		* (driver_sound_params.fmt ? sfmt_Bps(driver_sound_params.fmt)
				: 0);
}

/* Get the current audio format bytes per second value.
 * May return 0 if the audio device is closed. */
int audio_get_bps ()
{
	return driver_sound_params.rate * audio_get_bpf ();
}

int audio_get_buf_fill ()
{
	return hw.get_buff_fill ();
}

int audio_send_pcm (const char *buf, const size_t size)
{
	char *softmixed = NULL;
	char *equalized = NULL;

	if (equalizer_is_active ())
	{
		equalized = xmalloc (size);
		memcpy (equalized, buf, size);

		equalizer_process_buffer (equalized, size, &driver_sound_params);

		buf = equalized;
	}

	if (softmixer_is_active () || softmixer_is_mono ())
	{
		if (equalized)
		{
			softmixed = equalized;
		}
		else
		{
			softmixed = xmalloc (size);
			memcpy (softmixed, buf, size);
		}

		softmixer_process_buffer (softmixed, size, &driver_sound_params);

		buf = softmixed;
	}

	int played;

	played = hw.play (buf, size);

	if (played < 0)
		fatal ("Audio output error!");

	if (softmixed && !equalized)
		free (softmixed);

	if (equalized)
		free (equalized);

	return played;
}

/* Get current time of the song in seconds. */
int audio_get_time ()
{
	return state != STATE_STOP ? out_buf_time_get (out_buf) : 0;
}

void audio_close ()
{
	if (audio_opened) {
		reset_sound_params (&req_sound_params);
		reset_sound_params (&driver_sound_params);
		hw.close ();
		if (need_audio_conversion) {
			audio_conv_destroy (&sound_conv);
			need_audio_conversion = 0;
		}
		audio_opened = 0;
	}
}

/* Try to initialize drivers from the list and fill funcs with
 * those of the first working driver. */
static void find_working_driver (lists_t_strs *drivers, struct hw_funcs *funcs)
{
	int ix;

	memset (funcs, 0, sizeof(*funcs));

	for (ix = 0; ix < lists_strs_size (drivers); ix += 1) {
		const char *name;

		name = lists_strs_at (drivers, ix);

#ifdef HAVE_SNDIO
		if (!strcasecmp(name, "sndio")) {
			sndio_funcs (funcs);
			printf ("Trying SNDIO...\n");
			if (funcs->init(&hw_caps))
				return;
		}
#endif

#ifdef HAVE_OSS
		if (!strcasecmp(name, "oss")) {
			oss_funcs (funcs);
			printf ("Trying OSS...\n");
			if (funcs->init(&hw_caps))
				return;
		}
#endif

#ifdef HAVE_ALSA
		if (!strcasecmp(name, "alsa")) {
			alsa_funcs (funcs);
			printf ("Trying ALSA...\n");
			if (funcs->init(&hw_caps))
				return;
		}
#endif

#ifdef HAVE_JACK
		if (!strcasecmp(name, "jack")) {
			moc_jack_funcs (funcs);
			printf ("Trying JACK...\n");
			if (funcs->init(&hw_caps))
				return;
		}
#endif

#ifndef NDEBUG
		if (!strcasecmp(name, "null")) {
			null_funcs (funcs);
			printf ("Trying NULL...\n");
			if (funcs->init(&hw_caps))
				return;
		}
#endif
	}

	fatal ("No valid sound driver!");
}

static void print_output_capabilities
            (const struct output_driver_caps *caps LOGIT_ONLY)
{
	char fmt_name[SFMT_STR_MAX] LOGIT_ONLY;

	logit ("Sound driver capabilities: channels %d - %d, formats: %s",
			caps->min_channels, caps->max_channels,
			sfmt_str(caps->formats, fmt_name, sizeof(fmt_name)));
}

void audio_initialize ()
{
	find_working_driver (options_get_list ("SoundDriver"), &hw);

	if (hw_caps.max_channels < hw_caps.min_channels)
		fatal ("Error initializing audio device: "
		       "device reports incorrect number of channels.");
	if (!sound_format_ok (hw_caps.formats))
		fatal ("Error initializing audio device: "
		       "device reports no usable formats.");

	print_output_capabilities (&hw_caps);
	if (!options_get_bool ("Allow24bitOutput")
			&& hw_caps.formats & (SFMT_S32 | SFMT_U32)) {
		logit ("Disabling 24bit modes because Allow24bitOutput is set to no.");
		hw_caps.formats &= ~(SFMT_S32 | SFMT_U32);
		if (!sound_format_ok (hw_caps.formats))
			fatal ("No available sound formats after disabling 24bit modes. "
			       "Consider setting Allow24bitOutput to yes.");
	}

	out_buf = out_buf_new (options_get_int("OutputBuffer") * 1024);

	softmixer_init();
	equalizer_init();

	plist_init (&playlist);
	plist_init (&shuffled_plist);
	plist_init (&queue);
	player_init ();
}

void audio_exit ()
{
	int rc;

	audio_stop ();
	if (hw.shutdown)
		hw.shutdown ();
	out_buf_free (out_buf);
	out_buf = NULL;
	plist_free (&playlist);
	plist_free (&shuffled_plist);
	plist_free (&queue);
	player_cleanup ();
	rc = pthread_mutex_destroy (&curr_playing_mtx);
	if (rc != 0)
		log_errno ("Can't destroy curr_playing_mtx", rc);
	rc = pthread_mutex_destroy (&plist_mtx);
	if (rc != 0)
		log_errno ("Can't destroy plist_mtx", rc);
	rc = pthread_mutex_destroy (&request_mtx);
	if (rc != 0)
		log_errno ("Can't destroy request_mtx", rc);

	if (last_stream_url)
		free (last_stream_url);

	softmixer_shutdown();
	equalizer_shutdown();
}

void audio_seek (const int sec)
{
	int playing;

	LOCK (curr_playing_mtx);
	playing = curr_playing;
	UNLOCK (curr_playing_mtx);

	if (playing != -1 && state == STATE_PLAY)
		player_seek (sec);
	else
		logit ("Seeking when nothing is played.");
}

void audio_jump_to (const int sec)
{
	int playing;

	LOCK (curr_playing_mtx);
	playing = curr_playing;
	UNLOCK (curr_playing_mtx);

	if (playing != -1 && state == STATE_PLAY)
		player_jump_to (sec);
	else
		logit ("Jumping when nothing is played.");
}

int audio_get_state ()
{
	return state;
}

int audio_get_prev_state ()
{
	return prev_state;
}

void audio_plist_add (const char *file)
{
	LOCK (plist_mtx);
	plist_clear (&shuffled_plist);
	if (plist_find_fname(&playlist, file) == -1)
		plist_add (&playlist, file);
	else
		logit ("Wanted to add a file already present: %s", file);
	UNLOCK (plist_mtx);
}

void audio_queue_add (const char *file)
{
	LOCK (plist_mtx);
	if (plist_find_fname(&queue, file) == -1)
		plist_add (&queue, file);
	else
		logit ("Wanted to add a file already present: %s", file);
	UNLOCK (plist_mtx);
}

void audio_plist_clear ()
{
	LOCK (plist_mtx);
	plist_clear (&shuffled_plist);
	plist_clear (&playlist);
	UNLOCK (plist_mtx);
}

void audio_queue_clear ()
{
	LOCK (plist_mtx);
	plist_clear (&queue);
	UNLOCK (plist_mtx);
}

/* Returned memory is malloc()ed. */
char *audio_get_sname ()
{
	char *sname;

	LOCK (curr_playing_mtx);
	sname = xstrdup (curr_playing_fname);
	UNLOCK (curr_playing_mtx);

	return sname;
}

int audio_get_mixer ()
{
	if (current_mixer == 2)
		return softmixer_get_value ();

	return hw.read_mixer ();
}

void audio_set_mixer (const int val)
{
	if (!RANGE(0, val, 100)) {
		logit ("Tried to set mixer to volume out of range.");
		return;
	}

	if (current_mixer == 2)
		softmixer_set_value (val);
	else
		hw.set_mixer (val);
}

void audio_plist_delete (const char *file)
{
	int num;

	LOCK (plist_mtx);
	num = plist_find_fname (&playlist, file);
	if (num != -1)
		plist_delete (&playlist, num);

	num = plist_find_fname (&shuffled_plist, file);
	if (num != -1)
		plist_delete (&shuffled_plist, num);
	UNLOCK (plist_mtx);
}

void audio_queue_delete (const char *file)
{
	int num;

	LOCK (plist_mtx);
	num = plist_find_fname (&queue, file);
	if (num != -1)
		plist_delete (&queue, num);
	UNLOCK (plist_mtx);
}

/* Get the time of a file if the file is on the playlist and
 * the time is available. */
int audio_get_ftime (const char *file)
{
	int i;
	int time;
	time_t mtime;

	mtime = get_mtime (file);

	LOCK (plist_mtx);
	i = plist_find_fname (&playlist, file);
	if (i != -1) {
		time = get_item_time (&playlist, i);
		if (time != -1) {
			if (playlist.items[i].mtime == mtime) {
				debug ("Found time for %s", file);
				UNLOCK (plist_mtx);
				return time;
			}
			logit ("mtime for %s has changed", file);
		}
	}
	UNLOCK (plist_mtx);

	return -1;
}

/* Set the time for a file on the playlist. */
void audio_plist_set_time (const char *file, const int time)
{
	int i;

	LOCK (plist_mtx);
	if ((i = plist_find_fname(&playlist, file)) != -1) {
		plist_set_item_time (&playlist, i, time);
		playlist.items[i].mtime = get_mtime (file);
		debug ("Setting time for %s", file);
	}
	else
		logit ("Request for updating time for a file not present on the"
				" playlist!");
	UNLOCK (plist_mtx);
}

/* Notify that the state was changed (used by the player). */
void audio_state_started_playing ()
{
	prev_state = state;
	state = STATE_PLAY;
	state_change ();
}

int audio_plist_get_serial ()
{
	int serial;

	LOCK (plist_mtx);
	serial = plist_get_serial (&playlist);
	UNLOCK (plist_mtx);

	return serial;
}

void audio_plist_set_serial (const int serial)
{
	LOCK (plist_mtx);
	plist_set_serial (&playlist, serial);
	UNLOCK (plist_mtx);
}

/* Swap 2 files on the playlist. */
void audio_plist_move (const char *file1, const char *file2)
{
	LOCK (plist_mtx);
	plist_swap_files (&playlist, file1, file2);
	UNLOCK (plist_mtx);
}

void audio_queue_move (const char *file1, const char *file2)
{
	LOCK (plist_mtx);
	plist_swap_files (&queue, file1, file2);
	UNLOCK (plist_mtx);
}

/* Return a copy of the song queue.  We cannot just return constant
 * pointer, because it will be used in a different thread.
 * It obviously needs to be freed after use. */
struct plist* audio_queue_get_contents ()
{
	struct plist *ret = (struct plist *)xmalloc (sizeof(struct plist));
	plist_init (ret);

	LOCK (plist_mtx);
	plist_cat (ret, &queue);
	UNLOCK (plist_mtx);

	return ret;
}

struct file_tags *audio_get_curr_tags ()
{
	return player_get_curr_tags ();
}

char *audio_get_mixer_channel_name ()
{
	if (current_mixer == 2)
		return softmixer_name ();

	return hw.get_mixer_channel_name ();
}

void audio_toggle_mixer_channel ()
{
	current_mixer = (current_mixer + 1) % 3;
	if (current_mixer < 2)
		hw.toggle_mixer_channel ();
}


================================================
FILE: audio.h
================================================
#ifndef AUDIO_H
#define AUDIO_H

#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Sound formats.
 *
 * Sound format bits. Only one can be set in the format, the exception is
 * when we want to hold a list of supported formats - they can be bitwise-or'd.
 */
enum sfmt_fmt
{
	SFMT_S8 =    0x00000001, /*!< signed 8-bit */
	SFMT_U8	=    0x00000002, /*!< unsigned 8-bit */
	SFMT_S16 =   0x00000004, /*!< signed 16-bit */
	SFMT_U16 =   0x00000008, /*!< unsigned 16-bit */
	SFMT_S32 =   0x00000010, /*!< signed 24-bit (LSB is 0) */
	SFMT_U32 =   0x00000020, /*!< unsigned 24-bit (LSB set to 0) */
	SFMT_FLOAT = 0x00000040  /*!< float in range -1.0 to 1.0 */
};

/** Sample endianness.
 *
 * Sample endianness - one of them must be set for 16-bit and 24-bit formats.
 */
enum sfmt_endianness
{
	SFMT_LE = 0x00001000, /*!< little-endian */
	SFMT_BE = 0x00002000, /*!< big-endian */

/** Define native endianness to SFMT_LE or SFMT_BE. */
#ifdef WORDS_BIGENDIAN
	SFMT_NE = SFMT_BE
#else
	SFMT_NE = SFMT_LE
#endif
};

/** @name Masks for the sample format.
 *
 * Masks used to extract only one type of information from the sound format.
 */
/*@{*/
#define SFMT_MASK_FORMAT     0x00000fff /*!< sample format */
#define SFMT_MASK_ENDIANNESS 0x00003000 /*!< sample endianness */
/*@}*/

/** Return a value other than 0 if the sound format seems to be proper. */
#define sound_format_ok(f) (((f) & SFMT_MASK_FORMAT) \
		&& (((f) & (SFMT_S8 | SFMT_U8 | SFMT_FLOAT)) \
			|| (f) & SFMT_MASK_ENDIANNESS))

/** Change the sample format to new_fmt (without endianness). */
#define sfmt_set_fmt(f, new_fmt) (((f) & ~SFMT_MASK_FORMAT) | (new_fmt))

/** Change the sample format endianness to endian. */
#define sfmt_set_endian(f, endian) (((f) & ~SFMT_MASK_ENDIANNESS) | (endian))

/** Sound parameters.
 *
 * A structure describing sound parameters. The format is always PCM signed,
 * native endian for this machine.
 */
struct sound_params
{
	int channels; /*!< Number of channels: 1 or 2 */
	int rate; /*!< Rate in Hz */
	long fmt; /*!< Format of the samples (SFMT_* bits) */
};

/** Output driver capabilities.
 *
 * A structure describing the output driver capabilities.
 */
struct output_driver_caps
{
	int min_channels; /*!< Minimum number of channels */
	int max_channels; /*!< Maximum number of channels */
	long formats; /*!< Supported sample formats (or'd sfmt_fmt mask
			with endianness') */
};

/** \struct hw_funcs
 * Functions to control the audio "driver".
 *
 * The structure holds pointers to functions that must be provided by the audio
 * "driver". All functions are executed only by one thread, so you don't need
 * to worry if they are thread safe.
 */
struct hw_funcs
{
	/** Initialize the driver.
	 *
	 * This function is invoked only once when the MOC server starts.
	 *
	 * \param caps Capabilities of the driver which must be filled by the
	 * function.
	 * \return 1 on success and 0 otherwise.
	 */
	int (*init) (struct output_driver_caps *caps);

	/** Clean up at exit.
	 *
	 * This function is invoked only once when the MOC server exits. The
	 * audio device is not in use at this moment. The function should close
	 * any opened devices and free any resources the driver allocated.
	 * After this function was used, no other functions will be invoked.
	 */
	void (*shutdown) ();

	/** Open the sound device.
	 *
	 * This function should open the sound device with the proper
	 * parameters. The function should return 1 on success and 0 otherwise.
	 * After returning 1 functions like play(), get_buff_fill() can be used.
	 *
	 * The sample rate of the driver can differ from the requested rate.
	 * If so, get_rate() should return the actual rate.
	 *
	 * \param sound_params Pointer to the sound_params structure holding
	 * the required parameters.
	 * \return 1 on success and 0 otherwise.
	 */
	int (*open) (struct sound_params *sound_params);

	/** Close the device.
	 *
	 * Request for closing the device.
	 */
	void (*close) ();

	/** Play sound.
	 *
	 * Play sound provided in the buffer. The sound is in the format
	 * requested when the open() function was invoked. The function should
	 * play all sound in the buffer.
	 *
	 * \param buff Pointer to the buffer with the sound.
	 * \param size Size (in bytes) of the buffer.
	 *
	 * \return The number of bytes played or a value less than zero on
	 * error.
	 */
	int (*play) (const char *buff, const size_t size);

	/** Read the volume setting.
	 *
	 * Read the current volume setting. This must work regardless if the
	 * functions open()/close() where used.
	 *
	 * \return Volume value from 0% to 100%.
	 */
	int (*read_mixer) ();

	/** Set the volume setting.
	 *
	 * Set the volume. This must work regardless if the functions
	 * open()/close() where used.
	 *
	 * \param vol Volume from 0% to 100%.
	 */
	void (*set_mixer) (int vol);

	/** Read the hardware/internal buffer fill.
	 *
	 * The function should return the number of bytes of any
	 * hardware or internal buffers are filled. For example: if we play()
	 * 4KB, but only 1KB was really played (could be heard by the user),
	 * the function should return 3072 (3KB).
	 *
	 * \return Current hardware/internal buffer fill in bytes.
	 */
	int (*get_buff_fill) ();

	/** Stop playing immediately.
	 *
	 * Request that the sound should not be played. This should involve
	 * flushing any internal buffer filled with data sent by the play()
	 * function and resetting the device to flush its buffer (if possible).
	 *
	 * \return 1 on success or 0 otherwise.
	 */
	int (*reset) ();

	/** Get the current sample rate setting.
	 *
	 * Get the actual sample rate setting of the audio driver.
	 *
	 * \return Sample rate in Hz.
	 */
	int (*get_rate) ();

	/** Toggle the mixer channel.
	 *
	 * Toggle between the first and the second mixer channel.
	 */
	void (*toggle_mixer_channel) ();

	/** Get the mixer channel's name.
	 *
	 * Get the currently used mixer channel's name.
	 *
	 * \return malloc()ed channel's name.
	 */
	char * (*get_mixer_channel_name) ();
};

/* Are the parameters p1 and p2 equal? */
#define sound_params_eq(p1, p2) ((p1).fmt == (p2).fmt \
		&& (p1).channels == (p2).channels && (p1).rate == (p2).rate)

/* Maximum size of a string needed to hold the value returned by sfmt_str(). */
#define SFMT_STR_MAX	265

char *sfmt_str (const long format, char *msg, const size_t buf_size);
int sfmt_Bps (const long format);
int sfmt_same_bps (const long fmt1, const long fmt2);

void audio_stop ();
void audio_play (const char *fname);
void audio_next ();
void audio_prev ();
void audio_pause ();
void audio_unpause ();
void audio_initialize ();
void audio_exit ();
void audio_seek (const int sec);
void audio_jump_to (const int sec);

int audio_open (struct sound_params *sound_params);
int audio_send_buf (const char *buf, const size_t size);
int audio_send_pcm (const char *buf, const size_t size);
void audio_reset ();
int audio_get_bpf ();
int audio_get_bps ();
int audio_get_buf_fill ();
void audio_close ();
int audio_get_time ();
int audio_get_state ();
int audio_get_prev_state ();
void audio_plist_add (const char *file);
void audio_plist_clear ();
char *audio_get_sname ();
void audio_set_mixer (const int val);
int audio_get_mixer ();
void audio_plist_delete (const char *file);
int audio_get_ftime (const char *file);
void audio_plist_set_time (const char *file, const int time);
void audio_state_started_playing ();
int audio_plist_get_serial ();
void audio_plist_set_serial (const int serial);
struct file_tags *audio_get_curr_tags ();
char *audio_get_mixer_channel_name ();
void audio_toggle_mixer_channel ();
void audio_plist_move (const char *file1, const char *file2);
void audio_queue_add (const char *file);
void audio_queue_delete (const char *file);
void audio_queue_clear ();
void audio_queue_move (const char *file1, const char *file2);
struct plist* audio_queue_get_contents ();

#ifdef __cplusplus
}
#endif

#endif


================================================
FILE: audio_conversion.c
================================================
/*
 * MOC - music on console
 * Copyright (C) 2005 Damian Pietras <daper@daper.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Code for conversion between float and fixed point types is based on
 * libsamplerate:
 * Copyright (C) 2002-2004 Erik de Castro Lopo <erikd@mega-nerd.com>
 */

/* For future: audio conversion should be performed in order:
 * channels -> rate -> format
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <strings.h>

#ifdef HAVE_SAMPLERATE
# include <samplerate.h>
#endif

#define DEBUG

#include "common.h"
#include "audio_conversion.h"
#include "log.h"
#include "options.h"

static void float_to_u8 (const float *in, unsigned char *out,
		const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		float f = in[i] * INT32_MAX;

		if (f >= INT32_MAX)
			out[i] = UINT8_MAX;
		else if (f <= INT32_MIN)
			out[i] = 0;
		else
			out[i] = (unsigned int)((lrintf(f) >> 24) - INT8_MIN);
	}
}

static void float_to_s8 (const float *in, char *out, const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		float f = in[i] * INT32_MAX;

		if (f >= INT32_MAX)
			out[i] = INT8_MAX;
		else if (f <= INT32_MIN)
			out[i] = INT8_MIN;
		else
			out[i] = lrintf(f) >> 24;
	}
}

static void float_to_u16 (const float *in, unsigned char *out,
		const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		uint16_t *out_val = (uint16_t *)(out + i * sizeof (uint16_t));
		float f = in[i] * INT32_MAX;

		if (f >= INT32_MAX)
			*out_val = UINT16_MAX;
		else if (f <= INT32_MIN)
			*out_val = 0;
		else
			*out_val = (unsigned int)((lrintf(f) >> 16) - INT16_MIN);
	}
}

static void float_to_s16 (const float *in, char *out, const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		int16_t *out_val = (int16_t *)(out + i * sizeof (int16_t));
		float f = in[i] * INT32_MAX;

		if (f >= INT32_MAX)
			*out_val = INT16_MAX;
		else if (f <= INT32_MIN)
			*out_val = INT16_MIN;
		else
			*out_val = lrintf(f) >> 16;
	}
}

static void float_to_u32 (const float *in, unsigned char *out,
		const size_t samples)
{
	size_t i;

	/* maximum and minimum values of 32-bit samples */
	const unsigned int U32_MAX = (1 << 24) - 1;
	const int S32_MAX = (1 << 23) - 1;
	const int S32_MIN = -(1 << 23);

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		uint32_t *out_val = (uint32_t *)(out + i * sizeof (uint32_t));
		float f = in[i] * S32_MAX;

		if (f >= S32_MAX)
			*out_val = U32_MAX << 8;
		else if (f <= S32_MIN)
			*out_val = 0;
		else
			*out_val = (uint32_t)(lrintf(f) - S32_MIN) << 8;
	}
}

static void float_to_s32 (const float *in, char *out, const size_t samples)
{
	size_t i;

	/* maximum and minimum values of 32-bit samples */
	const int S32_MAX = (1 << 23) - 1;
	const int S32_MIN = -(1 << 23);

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++) {
		int32_t *out_val = (int32_t *)(out + i * sizeof (int32_t));
		float f = in[i] * S32_MAX;

		if (f >= S32_MAX)
			*out_val = S32_MAX << 8;
		else if (f <= S32_MIN)
			*out_val = S32_MIN * 256;
		else
			*out_val = lrintf(f) << 8;
	}
}

static void u8_to_float (const unsigned char *in, float *out,
		const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = (((int)*in++) + INT8_MIN) / (float)(INT8_MAX + 1);
}

static void s8_to_float (const char *in, float *out, const size_t samples)
{
	size_t i;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = *in++ / (float)(INT8_MAX + 1);
}

static void u16_to_float (const unsigned char *in, float *out,
		const size_t samples)
{
	size_t i;
	const uint16_t *in_16 = (uint16_t *)in;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = ((int)*in_16++ + INT16_MIN) / (float)(INT16_MAX + 1);
}

static void s16_to_float (const char *in, float *out, const size_t samples)
{
	size_t i;
	const int16_t *in_16 = (int16_t *)in;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = *in_16++ / (float)(INT16_MAX + 1);
}

static void u32_to_float (const unsigned char *in, float *out,
		const size_t samples)
{
	size_t i;
	const uint32_t *in_32 = (uint32_t *)in;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = ((float)*in_32++ + (float)INT32_MIN) / ((float)INT32_MAX + 1.0);
}

static void s32_to_float (const char *in, float *out, const size_t samples)
{
	size_t i;
	const int32_t *in_32 = (int32_t *)in;

	assert (in != NULL);
	assert (out != NULL);

	for (i = 0; i < samples; i++)
		out[i] = *in_32++ / ((float)INT32_MAX + 1.0);
}

/* Convert fixed point samples in format fmt (size in bytes) to float.
 * Size of converted sound is put in new_size. Returned memory is malloc()ed. */
static float *fixed_to_float (const char *buf, const size_t size,
		const long fmt, size_t *new_size)
{
	float *out = NULL;
	char fmt_name[SFMT_STR_MAX];

	assert ((fmt & SFMT_MASK_FORMAT) != SFMT_FLOAT);

	switch (fmt & SFMT_MASK_FORMAT) {
		case SFMT_U8:
			*new_size = sizeof(float) * size;
			out = (float *)xmalloc (*new_size);
			u8_to_float ((unsigned char *)buf, out, size);
			break;
		case SFMT_S8:
			*new_size = sizeof(float) * size;
			out = (float *)xmalloc (*new_size);
			s8_to_float (buf, out, size);
			break;
		case SFMT_U16:
			*new_size = sizeof(float) * size / 2;
			out = (float *)xmalloc (*new_size);
			u16_to_float ((unsigned char *)buf, out, size / 2);
			break;
		case SFMT_S16:
			*new_size = sizeof(float) * size / 2;
			out = (float *)xmalloc (*new_size);
			s16_to_float (buf, out, size / 2);
			break;
		case SFMT_U32:
			*new_size = sizeof(float) * size / 4;
			out = (float *)xmalloc (*new_size);
			u32_to_float ((unsigned char *)buf, out, size / 4);
			break;
		case SFMT_S32:
			*new_size = sizeof(float) * size / 4;
			out = (float *)xmalloc (*new_size);
			s32_to_float (buf, out, size / 4);
			break;
		default:
			error ("Can't convert from %s to float!",
			       sfmt_str (fmt, fmt_name, sizeof (fmt_name)));
			abort ();
	}

	return out;
}

/* Convert float samples to fixed point format fmt. Returned samples of size
 * new_size bytes is malloc()ed. */
static char *float_to_fixed (const float *buf, const size_t samples,
		const long fmt, size_t *new_size)
{
	char fmt_name[SFMT_STR_MAX];
	char *new_snd = NULL;

	assert ((fmt & SFMT_MASK_FORMAT) != SFMT_FLOAT);

	switch (fmt & SFMT_MASK_FORMAT) {
		case SFMT_U8:
			*new_size = samples;
			new_snd = (char *)xmalloc (samples);
			float_to_u8 (buf, (unsigned char *)new_snd, samples);
			break;
		case SFMT_S8:
			*new_size = samples;
			new_snd = (char *)xmalloc (samples);
			float_to_s8 (buf, new_snd, samples);
			break;
		case SFMT_U16:
			*new_size = samples * 2;
			new_snd = (char *)xmalloc (*new_size);
			float_to_u16 (buf, (unsigned char *)new_snd, samples);
			break;
		case SFMT_S16:
			*new_size = samples * 2;
			new_snd = (char *)xmalloc (*new_size);
			float_to_s16 (buf, new_snd, samples);
			break;
		case SFMT_U32:
			*new_size = samples * 4;
			new_snd = (char *)xmalloc (*new_size);
			float_to_u32 (buf, (unsigned char *)new_snd, samples);
			break;
		case SFMT_S32:
			*new_size = samples * 4;
			new_snd = (char *)xmalloc (*new_size);
			float_to_s32 (buf, new_snd, samples);
			break;
		default:
			error ("Can't convert from float to %s!",
			       sfmt_str (fmt, fmt_name, sizeof (fmt_name)));
			abort ();
	}

	return new_snd;
}

static void change_sign_8 (uint8_t *buf, const size_t samples)
{
	size_t i;

	for (i = 0; i < samples; i++)
		*buf++ ^= 1 << 7;
}

static void change_sign_16 (uint16_t *buf, const size_t samples)
{
	size_t i;

	for (i = 0; i < samples; i++)
		*buf++ ^= 1 << 15;
}

static void change_sign_32 (uint32_t *buf, const size_t samples)
{
	size_t i;

	for (i = 0; i < samples; i++)
		*buf++ ^= 1 << 31;
}

/* Change the signs of samples in format *fmt.  Also changes fmt to the new
 * format. */
static void change_sign (char *buf, const size_t size, long *fmt)
{
	char fmt_name[SFMT_STR_MAX];

	switch (*fmt & SFMT_MASK_FORMAT) {
		case SFMT_S8:
		case SFMT_U8:
			change_sign_8 ((uint8_t *)buf, size);
			if (*fmt & SFMT_S8)
				*fmt = sfmt_set_fmt (*fmt, SFMT_U8);
			else
				*fmt = sfmt_set_fmt (*fmt, SFMT_S8);
			break;
		case SFMT_S16:
		case SFMT_U16:
			change_sign_16 ((uint16_t *)buf, size / 2);
			if (*fmt & SFMT_S16)
				*fmt = sfmt_set_fmt (*fmt, SFMT_U16);
			else
				*fmt = sfmt_set_fmt (*fmt, SFMT_S16);
			break;
		case SFMT_S32:
		case SFMT_U32:
			change_sign_32 ((uint32_t *)buf, size/4);
			if (*fmt & SFMT_S32)
				*fmt = sfmt_set_fmt (*fmt, SFMT_U32);
			else
				*fmt = sfmt_set_fmt (*fmt, SFMT_S32);
			break;
		default:
			error ("Request for changing sign of unknown format: %s",
			       sfmt_str (*fmt, fmt_name, sizeof (fmt_name)));
			abort ();
	}
}

void audio_conv_bswap_16 (int16_t *buf, const size_t num)
{
	size_t i;

	for (i = 0; i < num; i++)
		buf[i] = bswap_16 (buf[i]);
}

void audio_conv_
Download .txt
gitextract_ut8lc7lf/

├── AUTHORS
├── COPYING
├── ChangeLog
├── Doxyfile
├── INSTALL
├── Makefile.am
├── NEWS
├── README
├── README.md
├── README_equalizer
├── THANKS
├── TODO
├── alsa.c
├── alsa.h
├── audio.c
├── audio.h
├── audio_conversion.c
├── audio_conversion.h
├── common.c
├── common.h
├── compat.c
├── compat.h
├── compiler.h
├── config.example.in
├── config.rpath
├── configure.in
├── decoder.c
├── decoder.h
├── decoder_plugins/
│   ├── Makefile.am
│   ├── aac/
│   │   ├── Makefile.am
│   │   ├── aac.c
│   │   └── aac.m4
│   ├── decoders.m4
│   ├── ffmpeg/
│   │   ├── Makefile.am
│   │   ├── ffmpeg.c
│   │   └── ffmpeg.m4
│   ├── flac/
│   │   ├── Makefile.am
│   │   ├── flac.c
│   │   └── flac.m4
│   ├── modplug/
│   │   ├── Makefile.am
│   │   ├── modplug.c
│   │   └── modplug.m4
│   ├── mp3/
│   │   ├── Makefile.am
│   │   ├── mp3.c
│   │   ├── mp3.m4
│   │   ├── xing.c
│   │   └── xing.h
│   ├── musepack/
│   │   ├── Makefile.am
│   │   ├── musepack.c
│   │   └── musepack.m4
│   ├── sidplay2/
│   │   ├── Makefile.am
│   │   ├── sidplay2.cc
│   │   ├── sidplay2.h
│   │   └── sidplay2.m4
│   ├── sndfile/
│   │   ├── Makefile.am
│   │   ├── sndfile.c
│   │   └── sndfile.m4
│   ├── speex/
│   │   ├── Makefile.am
│   │   ├── speex.c
│   │   └── speex.m4
│   ├── timidity/
│   │   ├── Makefile.am
│   │   ├── timidity.c
│   │   └── timidity.m4
│   ├── vorbis/
│   │   ├── Makefile.am
│   │   ├── vorbis.c
│   │   └── vorbis.m4
│   └── wavpack/
│       ├── Makefile.am
│       ├── wavpack.c
│       └── wavpack.m4
├── doxy_pages/
│   ├── decoder_api.doxy
│   ├── main_page.doxy
│   └── sound_output_driver_api.doxy
├── equalizer.c
├── equalizer.h
├── fifo_buf.c
├── fifo_buf.h
├── files.c
├── files.h
├── interface.c
├── interface.h
├── interface_elements.c
├── interface_elements.h
├── io.c
├── io.h
├── io_curl.c
├── io_curl.h
├── jack.c
├── jack.h
├── keymap.example
├── keys.c
├── keys.h
├── lists.c
├── lists.h
├── log.c
├── log.h
├── lyrics.c
├── lyrics.h
├── m4/
│   ├── ax_c___attribute__.m4
│   ├── ax_cflags_gcc_option.m4
│   ├── ax_compare_version.m4
│   ├── ax_gcc_func_attribute.m4
│   ├── ax_gcc_var_attribute.m4
│   ├── ax_path_bdb.m4
│   ├── ax_pthread.m4
│   ├── ax_require_defined.m4
│   └── ax_with_curses.m4
├── main.c
├── md5.c
├── md5.h
├── menu.c
├── menu.h
├── mocp.1
├── null_out.c
├── null_out.h
├── options.c
├── options.h
├── oss.c
├── oss.h
├── out_buf.c
├── out_buf.h
├── player.c
├── player.h
├── playlist.c
├── playlist.h
├── playlist_file.c
├── playlist_file.h
├── protocol.c
├── protocol.h
├── rbtree.c
├── rbtree.h
├── rcc.c
├── rcc.h
├── server.c
├── server.h
├── sndio_out.c
├── sndio_out.h
├── softmixer.c
├── softmixer.h
├── tags_cache.c
├── tags_cache.h
├── themes/
│   ├── Makefile.am
│   ├── black_theme
│   ├── darkdot_theme
│   ├── example_theme
│   ├── green_theme
│   ├── moca_theme
│   ├── nightly_theme
│   ├── red_theme
│   ├── transparent-background
│   ├── variant_red_theme
│   └── yellow_red_theme
├── themes.c
├── themes.h
├── tools/
│   ├── README
│   ├── maketests.sh
│   └── md5check.sh
├── utf8.c
└── utf8.h
Download .txt
SYMBOL INDEX (2096 symbols across 83 files)

FILE: alsa.c
  function mask_to_format (line 109) | static inline long mask_to_format (const snd_pcm_format_mask_t *mask)
  function snd_pcm_format_t (line 128) | static inline snd_pcm_format_t format_to_mask (long format)
  function alsa_log_cb (line 143) | static void alsa_log_cb (const char *unused1 ATTR_UNUSED,
  function snd_pcm_hw_params_t (line 162) | static snd_pcm_hw_params_t *alsa_open_device (const char *device)
  function fill_capabilities (line 202) | static int fill_capabilities (struct output_driver_caps *caps)
  function handle_mixer_events (line 251) | static void handle_mixer_events (snd_mixer_t *mixer_handle)
  function alsa_read_mixer_raw (line 293) | static int alsa_read_mixer_raw (snd_mixer_elem_t *elem)
  function snd_mixer_elem_t (line 349) | static snd_mixer_elem_t *alsa_init_mixer_channel (const char *name)
  function alsa_close_mixer (line 388) | static void alsa_close_mixer ()
  function alsa_open_mixer (line 401) | static void alsa_open_mixer (const char *device)
  function alsa_set_current_mixer (line 437) | static void alsa_set_current_mixer ()
  function alsa_shutdown (line 460) | static void alsa_shutdown ()
  function alsa_init (line 469) | static int alsa_init (struct output_driver_caps *caps)
  function alsa_open (line 521) | static int alsa_open (struct sound_params *sound_params)
  function play_buf_chunks (line 659) | static int play_buf_chunks ()
  function alsa_close (line 710) | static void alsa_close ()
  function alsa_play (line 749) | static int alsa_play (const char *buff, const size_t size)
  function alsa_read_mixer (line 779) | static int alsa_read_mixer ()
  function alsa_set_mixer (line 800) | static void alsa_set_mixer (int vol)
  function alsa_get_buff_fill (line 821) | static int alsa_get_buff_fill ()
  function alsa_reset (line 845) | static int alsa_reset ()
  function alsa_get_rate (line 876) | static int alsa_get_rate ()
  function alsa_toggle_mixer_channel (line 881) | static void alsa_toggle_mixer_channel ()
  function alsa_funcs (line 901) | void alsa_funcs (struct hw_funcs *funcs)

FILE: alsa.h
  type hw_funcs (line 8) | struct hw_funcs

FILE: audio.c
  type out_buf (line 77) | struct out_buf
  type hw_funcs (line 78) | struct hw_funcs
  type output_driver_caps (line 79) | struct output_driver_caps
  type plist (line 93) | struct plist
  type plist (line 94) | struct plist
  type plist (line 95) | struct plist
  type plist (line 96) | struct plist
  type sound_params (line 103) | struct sound_params
  type sound_params (line 106) | struct sound_params
  type audio_conversion (line 108) | struct audio_conversion
  function sfmt_same_bps (line 164) | int sfmt_same_bps (const long fmt1, const long fmt2)
  function sfmt_best_matching (line 183) | static long sfmt_best_matching (const long formats_with_endian,
  function sfmt_Bps (line 262) | int sfmt_Bps (const long format)
  function go_to_another_file (line 291) | static void go_to_another_file ()
  function audio_reset (line 490) | void audio_reset ()
  function audio_stop (line 496) | void audio_stop ()
  function audio_play (line 531) | void audio_play (const char *fname)
  function audio_next (line 589) | void audio_next ()
  function audio_prev (line 597) | void audio_prev ()
  function audio_pause (line 605) | void audio_pause ()
  function audio_unpause (line 641) | void audio_unpause ()
  function reset_sound_params (line 662) | static void reset_sound_params (struct sound_params *params)
  function audio_open (line 671) | int audio_open (struct sound_params *sound_params)
  function audio_send_buf (line 756) | int audio_send_buf (const char *buf, const size_t size)
  function audio_get_bpf (line 780) | int audio_get_bpf ()
  function audio_get_bps (line 789) | int audio_get_bps ()
  function audio_get_buf_fill (line 794) | int audio_get_buf_fill ()
  function audio_send_pcm (line 799) | int audio_send_pcm (const char *buf, const size_t size)
  function audio_get_time (line 848) | int audio_get_time ()
  function audio_close (line 853) | void audio_close ()
  function find_working_driver (line 869) | static void find_working_driver (lists_t_strs *drivers, struct hw_funcs ...
  function print_output_capabilities (line 929) | static void print_output_capabilities
  function audio_initialize (line 939) | void audio_initialize ()
  function audio_exit (line 971) | void audio_exit ()
  function audio_seek (line 1001) | void audio_seek (const int sec)
  function audio_jump_to (line 1015) | void audio_jump_to (const int sec)
  function audio_get_state (line 1029) | int audio_get_state ()
  function audio_get_prev_state (line 1034) | int audio_get_prev_state ()
  function audio_plist_add (line 1039) | void audio_plist_add (const char *file)
  function audio_queue_add (line 1050) | void audio_queue_add (const char *file)
  function audio_plist_clear (line 1060) | void audio_plist_clear ()
  function audio_queue_clear (line 1068) | void audio_queue_clear ()
  function audio_get_mixer (line 1087) | int audio_get_mixer ()
  function audio_set_mixer (line 1095) | void audio_set_mixer (const int val)
  function audio_plist_delete (line 1108) | void audio_plist_delete (const char *file)
  function audio_queue_delete (line 1123) | void audio_queue_delete (const char *file)
  function audio_get_ftime (line 1136) | int audio_get_ftime (const char *file)
  function audio_plist_set_time (line 1163) | void audio_plist_set_time (const char *file, const int time)
  function audio_state_started_playing (line 1180) | void audio_state_started_playing ()
  function audio_plist_get_serial (line 1187) | int audio_plist_get_serial ()
  function audio_plist_set_serial (line 1198) | void audio_plist_set_serial (const int serial)
  function audio_plist_move (line 1206) | void audio_plist_move (const char *file1, const char *file2)
  function audio_queue_move (line 1213) | void audio_queue_move (const char *file1, const char *file2)
  type plist (line 1223) | struct plist
  type plist (line 1225) | struct plist
  type plist (line 1225) | struct plist
  type plist (line 1225) | struct plist
  type file_tags (line 1235) | struct file_tags
  function audio_toggle_mixer_channel (line 1248) | void audio_toggle_mixer_channel ()

FILE: audio.h
  type sfmt_fmt (line 15) | enum sfmt_fmt
  type sfmt_endianness (line 30) | enum sfmt_endianness
  type sound_params (line 68) | struct sound_params
  type output_driver_caps (line 79) | struct output_driver_caps
  type hw_funcs (line 94) | struct hw_funcs
  type sound_params (line 234) | struct sound_params
  type file_tags (line 256) | struct file_tags
  type plist (line 264) | struct plist

FILE: audio_conversion.c
  function float_to_u8 (line 40) | static void float_to_u8 (const float *in, unsigned char *out,
  function float_to_s8 (line 60) | static void float_to_s8 (const float *in, char *out, const size_t samples)
  function float_to_u16 (line 79) | static void float_to_u16 (const float *in, unsigned char *out,
  function float_to_s16 (line 100) | static void float_to_s16 (const float *in, char *out, const size_t samples)
  function float_to_u32 (line 120) | static void float_to_u32 (const float *in, unsigned char *out,
  function float_to_s32 (line 146) | static void float_to_s32 (const float *in, char *out, const size_t samples)
  function u8_to_float (line 170) | static void u8_to_float (const unsigned char *in, float *out,
  function s8_to_float (line 182) | static void s8_to_float (const char *in, float *out, const size_t samples)
  function u16_to_float (line 193) | static void u16_to_float (const unsigned char *in, float *out,
  function s16_to_float (line 206) | static void s16_to_float (const char *in, float *out, const size_t samples)
  function u32_to_float (line 218) | static void u32_to_float (const unsigned char *in, float *out,
  function s32_to_float (line 231) | static void s32_to_float (const char *in, float *out, const size_t samples)
  function change_sign_8 (line 343) | static void change_sign_8 (uint8_t *buf, const size_t samples)
  function change_sign_16 (line 351) | static void change_sign_16 (uint16_t *buf, const size_t samples)
  function change_sign_32 (line 359) | static void change_sign_32 (uint32_t *buf, const size_t samples)
  function change_sign (line 369) | static void change_sign (char *buf, const size_t size, long *fmt)
  function audio_conv_bswap_16 (line 405) | void audio_conv_bswap_16 (int16_t *buf, const size_t num)
  function audio_conv_bswap_32 (line 413) | void audio_conv_bswap_32 (int32_t *buf, const size_t num)
  function swap_endian (line 422) | static void swap_endian (char *buf, const size_t size, const long fmt)
  function audio_conv_new (line 444) | int audio_conv_new (struct audio_conversion *conv,
  type audio_conversion (line 508) | struct audio_conversion
  type audio_conversion (line 632) | struct audio_conversion
  function audio_conv_destroy (line 745) | void audio_conv_destroy (struct audio_conversion *conv ASSERT_ONLY)

FILE: audio_conversion.h
  type audio_conversion (line 20) | struct audio_conversion
  type audio_conversion (line 33) | struct audio_conversion
  type sound_params (line 34) | struct sound_params
  type sound_params (line 35) | struct sound_params
  type audio_conversion (line 36) | struct audio_conversion
  type audio_conversion (line 38) | struct audio_conversion

FILE: common.c
  function internal_error (line 45) | void internal_error (const char *file, int line, const char *function,
  function internal_fatal (line 68) | void internal_fatal (const char *file LOGIT_ONLY, int line LOGIT_ONLY,
  function xsleep (line 140) | void xsleep (size_t ticks, size_t ticks_per_sec)
  function xsignal (line 221) | void xsignal (int signum, void (*func)(int))
  function set_me_server (line 233) | void set_me_server ()
  function is_valid_symbol (line 327) | bool is_valid_symbol (const char *candidate)
  function get_realtime (line 366) | int get_realtime (struct timespec *ts)
  function sec_to_min (line 385) | void sec_to_min (char *buff, const int seconds)
  type passwd (line 411) | struct passwd
  function common_cleanup (line 432) | void common_cleanup ()

FILE: common.h
  type timespec (line 23) | struct timespec
  type timespec (line 158) | struct timespec

FILE: decoder.c
  type plugin (line 32) | struct plugin {
  type decoder_s_preference (line 45) | struct decoder_s_preference {
  type decoder_t_preference (line 55) | typedef struct decoder_s_preference decoder_t_preference;
  function decoder_t_preference (line 77) | static decoder_t_preference *lookup_preference (const char *extn,
  function find_extn_decoder (line 125) | static int find_extn_decoder (int *decoder_list, int count, const char *...
  function find_mime_decoder (line 144) | static int find_mime_decoder (int *decoder_list, int count, const char *...
  function find_decoder (line 163) | static int find_decoder (const char *extn, const char *file, char **mime)
  function find_type (line 189) | static int find_type (const char *file)
  function is_sound_file (line 203) | int is_sound_file (const char *name)
  type decoder (line 253) | struct decoder
  type decoder (line 265) | struct decoder
  type decoder (line 286) | struct decoder
  type io_stream (line 286) | struct io_stream
  type decoder (line 290) | struct decoder
  type decoder (line 309) | struct decoder
  type io_stream (line 309) | struct io_stream
  type decoder (line 314) | struct decoder
  function lookup_decoder_by_name (line 372) | static int lookup_decoder_by_name (const char *name)
  function present_handle (line 427) | static int present_handle (const lt_dlhandle h)
  function lt_load_plugin (line 439) | static int lt_load_plugin (const char *file, lt_ptr debug_info_ptr)
  function decoder_t_preference (line 523) | static decoder_t_preference *make_preference (const char *prefix)
  function is_listed_decoder (line 545) | static bool is_listed_decoder (decoder_t_preference *pref, int d)
  function load_each_decoder (line 565) | static void load_each_decoder (decoder_t_preference *pref, const char *n...
  function load_decoders (line 588) | static void load_decoders (decoder_t_preference *pref, lists_t_strs *tok...
  function load_each_preference (line 631) | static void load_each_preference (const char *preference)
  function load_preferences (line 653) | static void load_preferences ()
  function load_plugins (line 680) | static void load_plugins (int debug_info)
  function decoder_init (line 704) | void decoder_init (int debug_info)
  function cleanup_decoders (line 710) | static void cleanup_decoders ()
  function cleanup_preferences (line 726) | static void cleanup_preferences ()
  function decoder_cleanup (line 739) | void decoder_cleanup ()
  function decoder_error (line 749) | void decoder_error (struct decoder_error *error,
  function decoder_error_init (line 779) | void decoder_error_init (struct decoder_error *error)
  function decoder_error_clear (line 786) | void decoder_error_clear (struct decoder_error *error)
  function decoder_error_copy (line 795) | void decoder_error_copy (struct decoder_error *dst,
  type decoder_error (line 803) | struct decoder_error

FILE: decoder.h
  type decoder_error_type (line 19) | enum decoder_error_type
  type decoder_error (line 31) | struct decoder_error
  type decoder (line 42) | struct decoder
  type decoder (line 265) | struct decoder
  type decoder (line 268) | struct decoder
  type decoder (line 269) | struct decoder
  type io_stream (line 269) | struct io_stream
  type decoder (line 270) | struct decoder
  type decoder_error (line 293) | struct decoder_error
  type decoder_error_type (line 294) | enum decoder_error_type
  type decoder_error (line 304) | struct decoder_error
  type decoder_error (line 313) | struct decoder_error
  type decoder_error (line 314) | struct decoder_error
  type decoder_error (line 325) | struct decoder_error
  type decoder_error (line 334) | struct decoder_error

FILE: decoder_plugins/aac/aac.c
  type aac_data (line 38) | struct aac_data
  function buffer_length (line 61) | static int buffer_length (const struct aac_data *data)
  type aac_data (line 66) | struct aac_data
  function buffer_fill (line 71) | static int buffer_fill (struct aac_data *data)
  function buffer_flush (line 94) | static inline void buffer_flush (struct aac_data *data)
  function buffer_consume (line 100) | static inline void buffer_consume (struct aac_data *data, int n)
  function buffer_fill_min (line 107) | static int buffer_fill_min (struct aac_data *data, int len)
  function parse_frame (line 123) | static int parse_frame (const unsigned char data[6])
  function buffer_fill_frame (line 150) | static int buffer_fill_frame(struct aac_data *data)
  function aac_count_time (line 203) | static int aac_count_time (struct aac_data *data)
  type aac_data (line 259) | struct aac_data
  type io_stream (line 259) | struct io_stream
  type aac_data (line 262) | struct aac_data
  function aac_close (line 346) | static void aac_close (void *prv_data)
  type aac_data (line 358) | struct aac_data
  type io_stream (line 381) | struct io_stream
  type id3_tag (line 388) | struct id3_tag
  type id3_frame (line 390) | struct id3_frame
  function aac_info (line 406) | static void aac_info (const char *file_name,
  function aac_seek (line 451) | static int aac_seek (void *unused ATTR_UNUSED, int sec ASSERT_ONLY)
  function decode_one_frame (line 468) | static int decode_one_frame (struct aac_data *data, void *buffer, int co...
  function aac_decode (line 530) | static int aac_decode (void *prv_data, char *buf, int buf_len,
  function aac_get_bitrate (line 561) | static int aac_get_bitrate (void *prv_data)
  function aac_get_avg_bitrate (line 568) | static int aac_get_avg_bitrate (void *prv_data)
  function aac_get_duration (line 575) | static int aac_get_duration (void *prv_data)
  function aac_get_name (line 582) | static void aac_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function aac_our_format_ext (line 587) | static int aac_our_format_ext (const char *ext)
  function aac_get_error (line 592) | static void aac_get_error (void *prv_data, struct decoder_error *error)
  function aac_our_mime (line 599) | static int aac_our_mime (const char *mime)
  type decoder (line 607) | struct decoder
  type decoder (line 629) | struct decoder

FILE: decoder_plugins/ffmpeg/ffmpeg.c
  type ffmpeg_data (line 75) | struct ffmpeg_data
  type extn_list (line 109) | struct extn_list {
  function ffmpeg_log_repeats (line 116) | static void ffmpeg_log_repeats (char *msg LOGIT_ONLY)
  function ffmpeg_log_cb (line 156) | static void ffmpeg_log_cb (void *unused ATTR_UNUSED, int level,
  function find_first_audio (line 202) | static unsigned int find_first_audio (AVFormatContext *ic)
  function load_audio_extns (line 224) | static void load_audio_extns (lists_t_strs *list)
  function load_video_extns (line 293) | static void load_video_extns (lists_t_strs *list)
  function locking_cb (line 315) | static int locking_cb (void **mutex, enum AVLockOp op)
  function is_timing_broken (line 360) | static bool is_timing_broken (AVFormatContext *ic)
  function ffmpeg_init (line 388) | static void ffmpeg_init ()
  function ffmpeg_destroy (line 419) | static void ffmpeg_destroy ()
  function ffmpeg_info (line 432) | static void ffmpeg_info (const char *file_name,
  function fmt_from_sample_fmt (line 494) | static long fmt_from_sample_fmt (struct ffmpeg_data *data)
  function is_seek_broken (line 525) | static bool is_seek_broken (struct ffmpeg_data *data)
  function set_downmixing (line 562) | static void set_downmixing (struct ffmpeg_data *data)
  function ffmpeg_io_read_cb (line 570) | static int ffmpeg_io_read_cb (void *s, uint8_t *buf, int count)
  function ffmpeg_io_seek_cb (line 586) | static int64_t ffmpeg_io_seek_cb (void *s, int64_t offset, int whence)
  type ffmpeg_data (line 611) | struct ffmpeg_data
  type ffmpeg_data (line 613) | struct ffmpeg_data
  type ffmpeg_data (line 615) | struct ffmpeg_data
  type ffmpeg_data (line 615) | struct ffmpeg_data
  type ffmpeg_data (line 648) | struct ffmpeg_data
  type ffmpeg_data (line 820) | struct ffmpeg_data
  type io_stream (line 835) | struct io_stream
  type ffmpeg_data (line 837) | struct ffmpeg_data
  function ffmpeg_can_decode (line 846) | static int ffmpeg_can_decode (struct io_stream *stream)
  function put_in_remain_buf (line 871) | static void put_in_remain_buf (struct ffmpeg_data *data, const char *buf,
  function add_to_remain_buf (line 881) | static void add_to_remain_buf (struct ffmpeg_data *data, const char *buf,
  function free_remain_buf (line 895) | static void free_remain_buf (struct ffmpeg_data *data)
  function take_from_remain_buf (line 903) | static int take_from_remain_buf (struct ffmpeg_data *data, char *buf, in...
  function copy_or_buffer (line 925) | static int copy_or_buffer (struct ffmpeg_data *data, char *in, int in_len,
  function AVPacket (line 947) | static inline AVPacket *new_packet (struct ffmpeg_data *data)
  function free_packet (line 969) | static inline void free_packet (AVPacket *pkt)
  function AVPacket (line 981) | static AVPacket *get_packet (struct ffmpeg_data *data)
  function decode_audio (line 1030) | static int decode_audio (AVCodecContext *ctx, AVFrame *frame,
  function decode_packet (line 1091) | static int decode_packet (struct ffmpeg_data *data, AVPacket *pkt,
  type ffmpeg_data (line 1169) | struct ffmpeg_data
  function seek_in_stream (line 1171) | static bool seek_in_stream (struct ffmpeg_data *data, int sec)
  function compute_bitrate (line 1214) | static inline int compute_bitrate (struct sound_params *sound_params,
  function ffmpeg_decode (line 1229) | static int ffmpeg_decode (void *prv_data, char *buf, int buf_len,
  function ffmpeg_seek (line 1298) | static int ffmpeg_seek (void *prv_data, int sec)
  function ffmpeg_close (line 1327) | static void ffmpeg_close (void *prv_data)
  type io_stream (line 1362) | struct io_stream
  type ffmpeg_data (line 1364) | struct ffmpeg_data
  type ffmpeg_data (line 1368) | struct ffmpeg_data
  function ffmpeg_get_bitrate (line 1372) | static int ffmpeg_get_bitrate (void *prv_data)
  function ffmpeg_get_avg_bitrate (line 1379) | static int ffmpeg_get_avg_bitrate (void *prv_data)
  function ffmpeg_get_duration (line 1386) | static int ffmpeg_get_duration (void *prv_data)
  function ffmpeg_our_format_ext (line 1406) | static int ffmpeg_our_format_ext (const char *ext)
  function ffmpeg_our_format_mime (line 1411) | static int ffmpeg_our_format_mime (const char *mime_type)
  function ffmpeg_get_error (line 1419) | static void ffmpeg_get_error (void *prv_data, struct decoder_error *error)
  type decoder (line 1426) | struct decoder
  type decoder (line 1448) | struct decoder

FILE: decoder_plugins/flac/flac.c
  type flac_data (line 37) | struct flac_data
  function pack_pcm_signed (line 63) | static size_t pack_pcm_signed (FLAC__byte *data,
  function FLAC__StreamDecoderWriteStatus (line 112) | static FLAC__StreamDecoderWriteStatus write_cb (
  function metadata_cb (line 130) | static void metadata_cb (
  function error_cb (line 148) | static void error_cb (
  function FLAC__StreamDecoderReadStatus (line 162) | static FLAC__StreamDecoderReadStatus read_cb (
  function FLAC__StreamDecoderSeekStatus (line 187) | static FLAC__StreamDecoderSeekStatus seek_cb (
  function FLAC__StreamDecoderTellStatus (line 198) | static FLAC__StreamDecoderTellStatus tell_cb (
  function FLAC__StreamDecoderLengthStatus (line 209) | static FLAC__StreamDecoderLengthStatus length_cb (
  function FLAC__bool (line 225) | static FLAC__bool eof_cb (
  type flac_data (line 236) | struct flac_data
  type flac_data (line 238) | struct flac_data
  type flac_data (line 238) | struct flac_data
  function flac_close (line 303) | static void flac_close (void *void_data)
  function fill_tag (line 317) | static void fill_tag (FLAC__StreamMetadata_VorbisComment_Entry *comm,
  function get_vorbiscomments (line 359) | static void get_vorbiscomments (const char *filename, struct file_tags *...
  function flac_info (line 404) | static void flac_info (const char *file_name, struct file_tags *info,
  function flac_seek (line 420) | static int flac_seek (void *void_data, int sec)
  function flac_decode (line 440) | static int flac_decode (void *void_data, char *buf, int buf_len,
  function flac_get_bitrate (line 511) | static int flac_get_bitrate (void *void_data)
  function flac_get_avg_bitrate (line 518) | static int flac_get_avg_bitrate (void *void_data)
  function flac_get_duration (line 525) | static int flac_get_duration (void *void_data)
  function flac_get_name (line 536) | static void flac_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function flac_our_format_ext (line 541) | static int flac_our_format_ext (const char *ext)
  function flac_our_format_mime (line 546) | static int flac_our_format_mime (const char *mime)
  function flac_get_error (line 554) | static void flac_get_error (void *prv_data, struct decoder_error *error)
  type decoder (line 561) | struct decoder
  type decoder (line 583) | struct decoder

FILE: decoder_plugins/modplug/modplug.c
  type modplug_data (line 47) | struct modplug_data
  function debugSettings (line 62) | static void debugSettings(void)
  type modplug_data (line 105) | struct modplug_data
  type modplug_data (line 106) | struct modplug_data
  type modplug_data (line 108) | struct modplug_data
  type modplug_data (line 108) | struct modplug_data
  type io_stream (line 114) | struct io_stream
  type modplug_data (line 162) | struct modplug_data
  function modplug_close (line 175) | static void modplug_close (void *void_data)
  function modplug_info (line 188) | static void modplug_info (const char *file_name, struct file_tags *info,
  function modplug_seek (line 209) | static int modplug_seek (void *void_data, int sec)
  function modplug_decode (line 224) | static int modplug_decode (void *void_data, char *buf, int buf_len,
  function modplug_get_bitrate (line 236) | static int modplug_get_bitrate (void *unused ATTR_UNUSED)
  function modplug_get_duration (line 241) | static int modplug_get_duration (void *void_data)
  function modplug_our_format_ext (line 247) | static int modplug_our_format_ext(const char *ext)
  function modplug_get_error (line 281) | static void modplug_get_error (void *prv_data, struct decoder_error *error)
  type decoder (line 288) | struct decoder
  type decoder (line 311) | struct decoder

FILE: decoder_plugins/mp3/mp3.c
  type mp3_data (line 54) | struct mp3_data
  function fill_buff (line 79) | static size_t fill_buff (struct mp3_data *data)
  function __unique_frame (line 124) | int __unique_frame (struct id3_tag *tag, struct id3_frame *frame)
  type id3_tag (line 143) | struct id3_tag
  type id3_frame (line 145) | struct id3_frame
  function count_time_internal (line 187) | static int count_time_internal (struct mp3_data *data)
  type mp3_data (line 325) | struct mp3_data
  type mp3_data (line 328) | struct mp3_data
  type mp3_data (line 330) | struct mp3_data
  type mp3_data (line 330) | struct mp3_data
  type io_stream (line 385) | struct io_stream
  type mp3_data (line 387) | struct mp3_data
  type mp3_data (line 389) | struct mp3_data
  type mp3_data (line 389) | struct mp3_data
  function mp3_close (line 413) | static void mp3_close (void *void_data)
  function count_time (line 429) | static int count_time (const char *file)
  function mp3_info (line 449) | static void mp3_info (const char *file_name, struct file_tags *info,
  function round_sample (line 483) | static inline int32_t round_sample (mad_fixed_t sample)
  function put_output (line 492) | static int put_output (char *buf, int buf_len, struct mad_pcm *pcm,
  function flush_id3_tag (line 536) | static ssize_t flush_id3_tag (struct mp3_data *data)
  function mp3_decode (line 551) | static int mp3_decode (void *void_data, char *buf, int buf_len,
  function mp3_seek (line 626) | static int mp3_seek (void *void_data, int sec)
  function mp3_get_bitrate (line 667) | static int mp3_get_bitrate (void *void_data)
  function mp3_get_avg_bitrate (line 674) | static int mp3_get_avg_bitrate (void *void_data)
  function mp3_get_duration (line 681) | static int mp3_get_duration (void *void_data)
  function mp3_get_name (line 688) | static void mp3_get_name (const char *file, char buf[4])
  function mp3_our_format_ext (line 707) | static int mp3_our_format_ext (const char *ext)
  function mp3_get_error (line 715) | static void mp3_get_error (void *prv_data, struct decoder_error *error)
  type io_stream (line 722) | struct io_stream
  type mp3_data (line 724) | struct mp3_data
  type mp3_data (line 724) | struct mp3_data
  function mp3_our_mime (line 729) | static int mp3_our_mime (const char *mime)
  function mp3_can_decode (line 735) | static int mp3_can_decode (struct io_stream *stream)
  function mp3_init (line 763) | static void mp3_init ()
  function mp3_destroy (line 771) | static void mp3_destroy ()
  type decoder (line 777) | struct decoder
  type decoder (line 799) | struct decoder

FILE: decoder_plugins/mp3/xing.c
  function xing_init (line 36) | void xing_init(struct xing *xing)
  function xing_parse (line 45) | int xing_parse(struct xing *xing, struct mad_bitptr ptr, unsigned int bi...

FILE: decoder_plugins/mp3/xing.h
  type xing (line 26) | struct xing
  type xing (line 43) | struct xing
  type xing (line 47) | struct xing
  type mad_bitptr (line 47) | struct mad_bitptr

FILE: decoder_plugins/musepack/musepack.c
  type musepack_data (line 42) | struct musepack_data
  function mpc_int32_t (line 63) | static mpc_int32_t read_cb (mpc_reader *t, void *buf, mpc_int32_t size)
  function mpc_bool_t (line 85) | static mpc_bool_t seek_cb (mpc_reader *t, mpc_int32_t offset)
  function mpc_int32_t (line 102) | static mpc_int32_t tell_cb (mpc_reader *t)
  function mpc_int32_t (line 119) | static mpc_int32_t get_size_cb (mpc_reader *t)
  function mpc_bool_t (line 136) | static mpc_bool_t canseek_cb (mpc_reader *t)
  function musepack_open_stream_internal (line 148) | static void musepack_open_stream_internal (struct musepack_data *data)
  type musepack_data (line 193) | struct musepack_data
  type musepack_data (line 195) | struct musepack_data
  type musepack_data (line 195) | struct musepack_data
  type io_stream (line 217) | struct io_stream
  type musepack_data (line 219) | struct musepack_data
  type musepack_data (line 221) | struct musepack_data
  type musepack_data (line 221) | struct musepack_data
  function musepack_close (line 231) | static void musepack_close (void *prv_data)
  function musepack_info (line 254) | static void musepack_info (const char *file_name, struct file_tags *info,
  function musepack_seek (line 293) | static int musepack_seek (void *prv_data, int sec)
  function musepack_decode (line 320) | static int musepack_decode (void *prv_data, char *buf, int buf_len,
  function musepack_get_bitrate (line 427) | static int musepack_get_bitrate (void *prv_data)
  function musepack_get_avg_bitrate (line 434) | static int musepack_get_avg_bitrate (void *prv_data)
  function musepack_get_duration (line 441) | static int musepack_get_duration (void *prv_data)
  type io_stream (line 448) | struct io_stream
  type musepack_data (line 450) | struct musepack_data
  type musepack_data (line 450) | struct musepack_data
  function musepack_get_name (line 455) | static void musepack_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function musepack_our_format_ext (line 460) | static int musepack_our_format_ext (const char *ext)
  function musepack_get_error (line 465) | static void musepack_get_error (void *prv_data, struct decoder_error *er...
  type decoder (line 472) | struct decoder
  type decoder (line 494) | struct decoder

FILE: decoder_plugins/sidplay2/sidplay2.cc
  function sidplay2_data (line 48) | static sidplay2_data * make_data()
  function init_database (line 198) | static void init_database()
  type sidplay2_data (line 233) | struct sidplay2_data
  function sidplay2_close (line 327) | void sidplay2_close(void *void_data)
  function sidplay2_get_error (line 344) | void sidplay2_get_error (void *prv_data, struct decoder_error *error)
  function sidplay2_info (line 351) | void sidplay2_info (const char *file_name, struct file_tags *info,
  function sidplay2_seek (line 452) | int sidplay2_seek (void *, int)
  function sidplay2_decode (line 457) | int sidplay2_decode (void *void_data, char *buf, int buf_len,
  function sidplay2_get_bitrate (line 487) | int sidplay2_get_bitrate (void *)
  function sidplay2_get_duration (line 492) | int sidplay2_get_duration (void *void_data)
  function sidplay2_our_format_ext (line 499) | int sidplay2_our_format_ext(const char *ext)
  function init (line 506) | void init()
  function destroy (line 522) | void destroy()
  type decoder (line 540) | struct decoder
  type decoder (line 563) | struct decoder

FILE: decoder_plugins/sidplay2/sidplay2.h
  type sidplay2_data (line 57) | struct sidplay2_data
  type decoder_error (line 82) | struct decoder_error
  type file_tags (line 83) | struct file_tags
  type sound_params (line 87) | struct sound_params

FILE: decoder_plugins/sndfile/sndfile.c
  type sndfile_data (line 41) | struct sndfile_data
  function load_extn_list (line 51) | static void load_extn_list ()
  function sndfile_init (line 94) | static void sndfile_init ()
  function sndfile_destroy (line 99) | static void sndfile_destroy ()
  function is_timing_broken (line 105) | static bool is_timing_broken (int fd, struct sndfile_data *data)
  type sndfile_data (line 143) | struct sndfile_data
  type sndfile_data (line 145) | struct sndfile_data
  type sndfile_data (line 145) | struct sndfile_data
  function sndfile_close (line 186) | static void sndfile_close (void *void_data)
  function sndfile_info (line 197) | static void sndfile_info (const char *file_name, struct file_tags *info,
  function sndfile_seek (line 210) | static int sndfile_seek (void *void_data, int sec)
  function sndfile_decode (line 226) | static int sndfile_decode (void *void_data, char *buf, int buf_len,
  function sndfile_get_bitrate (line 240) | static int sndfile_get_bitrate (void *unused ATTR_UNUSED)
  function sndfile_get_duration (line 245) | static int sndfile_get_duration (void *void_data)
  function sndfile_get_name (line 257) | static void sndfile_get_name (const char *file, char buf[4])
  function sndfile_our_format_ext (line 276) | static int sndfile_our_format_ext (const char *ext)
  function sndfile_get_error (line 281) | static void sndfile_get_error (void *prv_data, struct decoder_error *error)
  type decoder (line 288) | struct decoder
  type decoder (line 310) | struct decoder

FILE: decoder_plugins/speex/speex.c
  type spx_data (line 40) | struct spx_data
  type spx_data (line 68) | struct spx_data
  function read_speex_header (line 123) | static int read_speex_header (struct spx_data *data)
  type spx_data (line 216) | struct spx_data
  type io_stream (line 216) | struct io_stream
  type spx_data (line 218) | struct spx_data
  type spx_data (line 221) | struct spx_data
  type spx_data (line 221) | struct spx_data
  type io_stream (line 248) | struct io_stream
  type spx_data (line 249) | struct spx_data
  type spx_data (line 255) | struct spx_data
  type spx_data (line 255) | struct spx_data
  type io_stream (line 267) | struct io_stream
  function spx_can_decode (line 272) | static int spx_can_decode (struct io_stream *stream)
  function spx_close (line 283) | static void spx_close (void *prv_data)
  function parse_comment (line 311) | static void parse_comment (const char *str, struct file_tags *tags)
  function get_comments (line 325) | static void get_comments (struct spx_data *data, struct file_tags *tags)
  function get_more_data (line 388) | static void get_more_data (struct spx_data *data)
  function count_time (line 398) | static int count_time (struct spx_data *data)
  function spx_info (line 437) | static void spx_info (const char *file_name, struct file_tags *tags,
  function spx_seek (line 459) | static int spx_seek (void *prv_data, int sec)
  function spx_decode (line 543) | static int spx_decode (void *prv_data, char *sound_buf, int nbytes,
  function spx_current_tags (line 627) | static int spx_current_tags (void *prv_data, struct file_tags *tags)
  function spx_get_bitrate (line 635) | static int spx_get_bitrate (void *prv_data)
  function spx_get_duration (line 642) | static int spx_get_duration (void *unused ATTR_UNUSED)
  type io_stream (line 649) | struct io_stream
  type spx_data (line 651) | struct spx_data
  type spx_data (line 651) | struct spx_data
  function spx_get_name (line 656) | static void spx_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function spx_our_format_ext (line 661) | static int spx_our_format_ext (const char *ext)
  function spx_get_error (line 666) | static void spx_get_error (void *prv_data, struct decoder_error *error)
  function spx_our_mime (line 673) | static int spx_our_mime (const char *mime)
  type decoder (line 681) | struct decoder
  type decoder (line 703) | struct decoder

FILE: decoder_plugins/timidity/timidity.c
  type timidity_data (line 37) | struct timidity_data
  type timidity_data (line 44) | struct timidity_data
  type timidity_data (line 45) | struct timidity_data
  type timidity_data (line 47) | struct timidity_data
  type timidity_data (line 47) | struct timidity_data
  type timidity_data (line 74) | struct timidity_data
  function timidity_close (line 91) | static void timidity_close (void *void_data)
  function timidity_info (line 103) | static void timidity_info (const char *file_name, struct file_tags *info,
  function timidity_seek (line 121) | static int timidity_seek (void *void_data, int sec)
  function timidity_decode (line 136) | static int timidity_decode (void *void_data, char *buf, int buf_len,
  function timidity_get_bitrate (line 148) | static int timidity_get_bitrate (void *unused ATTR_UNUSED)
  function timidity_get_duration (line 153) | static int timidity_get_duration (void *void_data)
  function timidity_get_name (line 159) | static void timidity_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function timidity_our_format_ext (line 164) | static int timidity_our_format_ext(const char *ext)
  function timidity_our_format_mime (line 169) | static int timidity_our_format_mime (const char *mime)
  function timidity_get_error (line 175) | static void timidity_get_error (void *prv_data, struct decoder_error *er...
  function timidity_destroy (line 182) | static void timidity_destroy()
  type decoder (line 187) | struct decoder
  type decoder (line 210) | struct decoder

FILE: decoder_plugins/vorbis/vorbis.c
  type vorbis_data (line 57) | struct vorbis_data
  function get_comment_tags (line 73) | static void get_comment_tags (OggVorbis_File *vf, struct file_tags *info)
  function vorbis_tags (line 135) | static void vorbis_tags (const char *file_name, struct file_tags *info,
  function read_cb (line 174) | static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *datas...
  function seek_cb (line 194) | static int seek_cb (void *datasource, ogg_int64_t offset, int whence)
  function close_cb (line 202) | static int close_cb (void *unused ATTR_UNUSED)
  function tell_cb (line 207) | static long tell_cb (void *datasource)
  function vorbis_open_stream_internal (line 212) | static void vorbis_open_stream_internal (struct vorbis_data *data)
  type vorbis_data (line 248) | struct vorbis_data
  type vorbis_data (line 250) | struct vorbis_data
  type vorbis_data (line 250) | struct vorbis_data
  function vorbis_can_decode (line 277) | static int vorbis_can_decode (struct io_stream *stream)
  type io_stream (line 288) | struct io_stream
  type vorbis_data (line 290) | struct vorbis_data
  type vorbis_data (line 292) | struct vorbis_data
  type vorbis_data (line 292) | struct vorbis_data
  function vorbis_close (line 302) | static void vorbis_close (void *prv_data)
  function vorbis_seek (line 317) | static int vorbis_seek (void *prv_data, int sec)
  function vorbis_decode (line 326) | static int vorbis_decode (void *prv_data, char *buf, int buf_len,
  function vorbis_current_tags (line 380) | static int vorbis_current_tags (void *prv_data, struct file_tags *tags)
  function vorbis_get_bitrate (line 394) | static int vorbis_get_bitrate (void *prv_data)
  function vorbis_get_avg_bitrate (line 401) | static int vorbis_get_avg_bitrate (void *prv_data)
  function vorbis_get_duration (line 408) | static int vorbis_get_duration (void *prv_data)
  type io_stream (line 415) | struct io_stream
  type vorbis_data (line 417) | struct vorbis_data
  type vorbis_data (line 417) | struct vorbis_data
  function vorbis_get_name (line 422) | static void vorbis_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function vorbis_our_format_ext (line 427) | static int vorbis_our_format_ext (const char *ext)
  function vorbis_get_error (line 433) | static void vorbis_get_error (void *prv_data, struct decoder_error *error)
  function vorbis_our_mime (line 440) | static int vorbis_our_mime (const char *mime)
  type decoder (line 448) | struct decoder
  type decoder (line 470) | struct decoder

FILE: decoder_plugins/wavpack/wavpack.c
  type wavpack_data (line 38) | struct wavpack_data
  function wav_data_init (line 52) | static void wav_data_init (struct wavpack_data *data)
  type wavpack_data (line 71) | struct wavpack_data
  type wavpack_data (line 72) | struct wavpack_data
  type wavpack_data (line 72) | struct wavpack_data
  function wav_close (line 91) | static void wav_close (void *prv_data)
  function wav_seek (line 104) | static int wav_seek (void *prv_data, int sec)
  function wav_get_bitrate (line 118) | static int wav_get_bitrate (void *prv_data)
  function wav_get_avg_bitrate (line 128) | static int wav_get_avg_bitrate (void *prv_data)
  function wav_get_duration (line 135) | static int wav_get_duration (void *prv_data)
  function wav_get_error (line 141) | static void wav_get_error (void *prv_data, struct decoder_error *error)
  function wav_info (line 147) | static void wav_info (const char *file_name, struct file_tags *info,
  function wav_decode (line 200) | static int wav_decode (void *prv_data, char *buf, int buf_len,
  function wav_our_mime (line 256) | static int wav_our_mime (const char *mime ATTR_UNUSED)
  function wav_get_name (line 267) | static void wav_get_name (const char *unused ATTR_UNUSED, char buf[4])
  function wav_our_format_ext (line 272) | static int wav_our_format_ext(const char *ext)
  type decoder (line 278) | struct decoder
  type decoder (line 300) | struct decoder

FILE: equalizer.c
  type t_biquad (line 66) | typedef struct t_biquad t_biquad;
  type t_biquad (line 68) | struct t_biquad
  type t_eq_setup (line 76) | typedef struct t_eq_setup t_eq_setup;
  type t_eq_setup (line 78) | struct t_eq_setup
  type t_eq_set (line 88) | typedef struct t_eq_set t_eq_set;
  type t_eq_set (line 90) | struct t_eq_set
  type t_eq_set_list (line 99) | typedef struct t_eq_set_list t_eq_set_list;
  type t_eq_set_list (line 101) | struct t_eq_set_list
  type t_active_set (line 107) | typedef struct t_active_set t_active_set;
  type t_active_set (line 109) | struct t_active_set
  type t_eq_settings (line 115) | typedef struct t_eq_settings t_eq_settings;
  type t_eq_settings (line 117) | struct t_eq_settings
  function equalizer_is_active (line 166) | int equalizer_is_active()
  function equalizer_set_active (line 171) | int equalizer_set_active(int active)
  function equalizer_next (line 186) | void equalizer_next()
  function equalizer_prev (line 206) | void equalizer_prev()
  function t_biquad (line 232) | static t_biquad *mk_biquad(float dbgain, float cf, float srate, float bw...
  function apply_biquads (line 296) | static inline void apply_biquads(float *src, float *dst, int channels, i...
  function equalizer_adjust_preamp (line 343) | static void equalizer_adjust_preamp()
  function equalizer_read_config (line 352) | static void equalizer_read_config()
  function equalizer_write_config (line 449) | static void equalizer_write_config()
  function equalizer_init (line 481) | void equalizer_init()
  function equalizer_shutdown (line 512) | void equalizer_shutdown()
  function equalizer_refresh (line 522) | void equalizer_refresh()
  function equalizer_process_buffer (line 693) | void equalizer_process_buffer(char *buf, size_t size, const struct sound...
  function equ_process_buffer_u8 (line 770) | static void equ_process_buffer_u8(uint8_t *buf, size_t samples)
  function equ_process_buffer_s8 (line 794) | static void equ_process_buffer_s8(int8_t *buf, size_t samples)
  function equ_process_buffer_u16 (line 818) | static void equ_process_buffer_u16(uint16_t *buf, size_t samples)
  function equ_process_buffer_s16 (line 842) | static void equ_process_buffer_s16(int16_t *buf, size_t samples)
  function equ_process_buffer_u32 (line 866) | static void equ_process_buffer_u32(uint32_t *buf, size_t samples)
  function equ_process_buffer_s32 (line 890) | static void equ_process_buffer_s32(int32_t *buf, size_t samples)
  function equ_process_buffer_float (line 914) | static void equ_process_buffer_float(float *buf, size_t samples)
  function t_eq_set_list (line 939) | static t_eq_set_list *append_eq_set(t_eq_set *eqs, t_eq_set_list *l)
  function clear_eq_set (line 964) | static void clear_eq_set(t_eq_set_list *l)
  function read_setup (line 982) | static int read_setup(char *name, char *desc, t_eq_setup **sp)
  function read_float (line 1147) | static int read_float(char *s, float *f, char **endp)

FILE: equalizer.h
  type sound_params (line 10) | struct sound_params

FILE: fifo_buf.c
  type fifo_buf (line 24) | struct fifo_buf
  type fifo_buf (line 33) | struct fifo_buf
  type fifo_buf (line 35) | struct fifo_buf
  type fifo_buf (line 39) | struct fifo_buf
  function fifo_buf_free (line 49) | void fifo_buf_free (struct fifo_buf *b)
  function fifo_buf_put (line 57) | size_t fifo_buf_put (struct fifo_buf *b, const char *data, size_t size)
  function fifo_buf_peek (line 90) | size_t fifo_buf_peek (struct fifo_buf *b, char *user_buf, size_t user_bu...
  function fifo_buf_get (line 121) | size_t fifo_buf_get (struct fifo_buf *b, char *user_buf, size_t user_buf...
  function fifo_buf_get_space (line 149) | size_t fifo_buf_get_space (const struct fifo_buf *b)
  function fifo_buf_get_fill (line 158) | size_t fifo_buf_get_fill (const struct fifo_buf *b)
  function fifo_buf_get_size (line 164) | size_t fifo_buf_get_size (const struct fifo_buf *b)
  function fifo_buf_clear (line 170) | void fifo_buf_clear (struct fifo_buf *b)

FILE: fifo_buf.h
  type fifo_buf (line 8) | struct fifo_buf
  type fifo_buf (line 10) | struct fifo_buf
  type fifo_buf (line 11) | struct fifo_buf
  type fifo_buf (line 12) | struct fifo_buf
  type fifo_buf (line 13) | struct fifo_buf
  type fifo_buf (line 14) | struct fifo_buf
  type fifo_buf (line 15) | struct fifo_buf
  type fifo_buf (line 16) | struct fifo_buf
  type fifo_buf (line 17) | struct fifo_buf
  type fifo_buf (line 18) | struct fifo_buf

FILE: files.c
  function files_init (line 53) | void files_init ()
  function files_cleanup (line 72) | void files_cleanup ()
  function is_url (line 85) | inline int is_url (const char *str)
  function is_dir (line 92) | int is_dir (const char *file)
  function can_read_file (line 109) | int can_read_file (const char *file)
  function file_type (line 114) | enum file_type file_type (const char *file)
  function make_file_title (line 168) | void make_file_title (struct plist *plist, const int num,
  function make_tags_title (line 201) | void make_tags_title (struct plist *plist, const int num)
  function switch_titles_file (line 232) | void switch_titles_file (struct plist *plist)
  function switch_titles_tags (line 251) | void switch_titles_tags (struct plist *plist)
  function resolve_path (line 269) | void resolve_path (char *buf, size_t size, const char *file)
  type file_tags (line 333) | struct file_tags
  type file_tags (line 334) | struct file_tags
  type decoder (line 336) | struct decoder
  function read_directory (line 372) | int read_directory (const char *directory, lists_t_strs *dirs,
  function dir_symlink_loop (line 433) | static int dir_symlink_loop (const ino_t inode_no, const ino_t *dir_stack,
  function read_directory_recurr_internal (line 447) | static int read_directory_recurr_internal (const char *directory, struct...
  function read_directory_recurr (line 509) | int read_directory_recurr (const char *directory, struct plist *plist)
  type dirent (line 599) | struct dirent
  function file_exists (line 670) | int file_exists (const char *file)
  function time_t (line 685) | time_t get_mtime (const char *file)
  function is_secure (line 724) | bool is_secure (const char *file)

FILE: files.h
  type plist (line 17) | struct plist
  type plist (line 18) | struct plist
  type file_type (line 21) | enum file_type
  type file_tags (line 28) | struct file_tags
  type file_tags (line 29) | struct file_tags
  type plist (line 30) | struct plist
  type plist (line 31) | struct plist
  type plist (line 32) | struct plist
  type plist (line 33) | struct plist

FILE: interface.c
  type plist (line 59) | struct plist
  type plist (line 60) | struct plist
  type plist (line 61) | struct plist
  type event_queue (line 64) | struct event_queue
  type want_quit (line 70) | enum want_quit
  type file_info (line 85) | struct file_info
  function sig_quit (line 95) | static void sig_quit (int sig LOGIT_ONLY)
  function sig_interrupt (line 101) | static void sig_interrupt (int sig LOGIT_ONLY)
  function sig_winch (line 108) | static void sig_winch (int sig LOGIT_ONLY)
  function user_wants_interrupt (line 115) | int user_wants_interrupt ()
  function clear_interrupt (line 120) | static void clear_interrupt ()
  function send_int_to_srv (line 125) | static void send_int_to_srv (const int num)
  function send_bool_to_srv (line 131) | static void send_bool_to_srv (const bool t)
  function send_str_to_srv (line 137) | static void send_str_to_srv (const char *str)
  function send_item_to_srv (line 143) | static void send_item_to_srv (const struct plist_item *item)
  function get_int_from_srv (line 149) | static int get_int_from_srv ()
  function get_bool_from_srv (line 159) | static bool get_bool_from_srv ()
  type file_tags (line 180) | struct file_tags
  type file_tags (line 182) | struct file_tags
  function get_int_from_srv_noblock (line 191) | static int get_int_from_srv_noblock (int *num)
  type plist_item (line 201) | struct plist_item
  type plist_item (line 203) | struct plist_item
  type tag_ev_response (line 211) | struct tag_ev_response
  type tag_ev_response (line 213) | struct tag_ev_response
  type tag_ev_response (line 215) | struct tag_ev_response
  type tag_ev_response (line 215) | struct tag_ev_response
  type move_ev_data (line 224) | struct move_ev_data
  type move_ev_data (line 226) | struct move_ev_data
  function wait_for_data (line 258) | static void wait_for_data ()
  function get_data_int (line 272) | static int get_data_int ()
  function get_data_bool (line 279) | static bool get_data_bool ()
  type file_tags (line 292) | struct file_tags
  function send_tags_request (line 298) | static int send_tags_request (const char *file, const int tags_sel)
  function send_items_to_clients (line 318) | static void send_items_to_clients (const struct plist *plist)
  function init_playlists (line 329) | static void init_playlists ()
  function file_info_reset (line 343) | static void file_info_reset (struct file_info *f)
  function file_info_cleanup (line 356) | static void file_info_cleanup (struct file_info *f)
  function file_info_block_init (line 371) | static void file_info_block_init (struct file_info *f)
  function file_info_block_reset (line 377) | static void file_info_block_reset (struct file_info *f)
  function file_info_block_mark (line 385) | static void file_info_block_mark (int *marker)
  function sync_bool_option (line 402) | static void sync_bool_option (const char *name)
  function get_server_options (line 414) | static void get_server_options ()
  function get_server_plist_serial (line 421) | static int get_server_plist_serial ()
  function get_mixer_value (line 427) | static int get_mixer_value ()
  function get_state (line 433) | static int get_state ()
  function get_channels (line 439) | static int get_channels ()
  function get_rate (line 445) | static int get_rate ()
  function get_bitrate (line 451) | static int get_bitrate ()
  function get_avg_bitrate (line 457) | static int get_avg_bitrate ()
  function get_curr_time (line 463) | static int get_curr_time ()
  function update_mixer_value (line 475) | static void update_mixer_value ()
  function update_mixer_name (line 483) | static void update_mixer_name ()
  function set_cwd (line 499) | static void set_cwd (const char *path)
  function set_start_dir (line 512) | static void set_start_dir ()
  function read_last_dir (line 524) | static int read_last_dir ()
  function is_subdir (line 543) | static int is_subdir (const char *dir1, const char *dir2)
  function sort_strcmp_func (line 548) | static int sort_strcmp_func (const void *a, const void *b)
  function sort_dirs_func (line 553) | static int sort_dirs_func (const void *a, const void *b)
  function get_tags_setting (line 567) | static int get_tags_setting ()
  function ask_for_tags (line 581) | static int ask_for_tags (const struct plist *plist, const int tags_sel)
  function interface_message (line 605) | static void interface_message (const char *format, ...)
  function update_item_tags (line 620) | static void update_item_tags (struct plist *plist, const int num,
  function sanitise_string (line 651) | static void sanitise_string (char *str)
  function ev_file_tags (line 666) | static void ev_file_tags (const struct tag_ev_response *data)
  function update_ctime (line 723) | static void update_ctime ()
  function update_curr_tags (line 731) | static void update_curr_tags ()
  function follow_curr_file (line 750) | static void follow_curr_file ()
  function update_curr_file (line 765) | static void update_curr_file ()
  function update_rate (line 831) | static void update_rate ()
  function update_channels (line 837) | static void update_channels ()
  function update_bitrate (line 843) | static void update_bitrate ()
  function update_state (line 850) | static void update_state ()
  function event_plist_add (line 871) | static void event_plist_add (const struct plist_item *item)
  function event_queue_add (line 916) | static void event_queue_add (const struct plist_item *item)
  function update_error (line 929) | static void update_error (char *err)
  function forward_playlist (line 935) | static void forward_playlist ()
  function recv_server_plist (line 951) | static int recv_server_plist (struct plist *plist)
  function recv_server_queue (line 986) | static void recv_server_queue (struct plist *queue)
  function clear_playlist (line 1008) | static void clear_playlist ()
  function clear_queue (line 1020) | static void clear_queue ()
  function event_plist_del (line 1031) | static void event_plist_del (char *file)
  function event_queue_del (line 1059) | static void event_queue_del (char *file)
  function swap_playlist_items (line 1083) | static void swap_playlist_items (const char *file1, const char *file2)
  function event_plist_move (line 1093) | static void event_plist_move (const struct move_ev_data *d)
  function event_queue_move (line 1103) | static void event_queue_move (const struct move_ev_data *d)
  function server_event (line 1113) | static void server_event (const int event, void *data)
  function fill_tags (line 1206) | static void fill_tags (struct plist *plist, const int tags_sel,
  function go_to_dir (line 1264) | static int go_to_dir (const char *dir, const int reload)
  function change_srv_plist_serial (line 1332) | static void change_srv_plist_serial ()
  function toggle_menu (line 1349) | static void toggle_menu ()
  function go_to_playlist (line 1367) | static int go_to_playlist (const char *file, const int load_serial,
  function enter_first_dir (line 1417) | static void enter_first_dir ()
  function get_server_playlist (line 1453) | static int get_server_playlist (struct plist *plist)
  function use_server_playlist (line 1474) | static int use_server_playlist ()
  function use_server_queue (line 1485) | static void use_server_queue ()
  function process_dir_arg (line 1497) | static void process_dir_arg (const char *dir)
  function process_plist_arg (line 1505) | static void process_plist_arg (const char *file)
  function process_multiple_args (line 1526) | static void process_multiple_args (lists_t_strs *args)
  function process_args (line 1583) | static void process_args (lists_t_strs *args)
  function load_playlist (line 1613) | static void load_playlist ()
  function do_resize (line 1627) | static void do_resize ()
  function go_dir_up (line 1654) | static void go_dir_up ()
  function get_safe_serial (line 1665) | static int get_safe_serial ()
  function send_playlist (line 1682) | static void send_playlist (struct plist *plist, const int clear)
  function play_it (line 1699) | static void play_it (const char *file)
  function go_file (line 1734) | static void go_file ()
  function switch_pause (line 1757) | static void switch_pause ()
  function set_mixer (line 1771) | static void set_mixer (int val)
  function adjust_mixer (line 1778) | static void adjust_mixer (const int diff)
  function add_dir_plist (line 1784) | static void add_dir_plist ()
  function remove_file_from_playlist (line 1860) | static void remove_file_from_playlist (const char *file)
  function remove_dead_entries_plist (line 1890) | static void remove_dead_entries_plist ()
  function add_file_plist (line 1910) | static void add_file_plist ()
  function queue_toggle_file (line 1968) | static void queue_toggle_file ()
  function toggle_option (line 2007) | static void toggle_option (const char *name)
  function toggle_show_time (line 2015) | static void toggle_show_time ()
  function toggle_show_format (line 2036) | static void toggle_show_format ()
  function reread_dir (line 2050) | static void reread_dir ()
  function cmd_clear_playlist (line 2056) | static void cmd_clear_playlist ()
  function cmd_clear_queue (line 2068) | static void cmd_clear_queue ()
  function go_to_music_dir (line 2073) | static void go_to_music_dir ()
  function entry_key_go_dir (line 2142) | static void entry_key_go_dir (const struct iface_key *k)
  function play_from_url (line 2192) | static void play_from_url (const char *url)
  function entry_key_go_url (line 2239) | static void entry_key_go_url (const struct iface_key *k)
  function add_url_to_plist (line 2264) | static void add_url_to_plist (const char *url)
  function entry_key_add_url (line 2303) | static void entry_key_add_url (const struct iface_key *k)
  function entry_key_search (line 2328) | static void entry_key_search (const struct iface_key *k)
  function save_playlist (line 2360) | static void save_playlist (const char *file, const int save_serial)
  function entry_key_plist_save (line 2373) | static void entry_key_plist_save (const struct iface_key *k)
  function entry_key_plist_overwrite (line 2416) | static void entry_key_plist_overwrite (const struct iface_key *k)
  function entry_key_user_query (line 2437) | static void entry_key_user_query (const struct iface_key *k)
  function entry_key (line 2450) | static void entry_key (const struct iface_key *k)
  function update_iface_menu (line 2480) | static void update_iface_menu (const enum iface_menu menu,
  function switch_read_tags (line 2493) | static void switch_read_tags ()
  function seek (line 2514) | static void seek (const int sec)
  function jump_to (line 2520) | static void jump_to (const int sec)
  function delete_item (line 2526) | static void delete_item ()
  function go_to_playing_file (line 2547) | static void go_to_playing_file ()
  function time_t (line 2577) | static time_t rounded_time ()
  function seek_silent (line 2593) | static void seek_silent (const int sec)
  function move_item (line 2611) | static void move_item (const int direction)
  function do_silent_seek (line 2666) | static void do_silent_seek ()
  function cmd_next (line 2678) | static void cmd_next ()
  function add_themes_to_list (line 2705) | static void add_themes_to_list (lists_t_strs *themes, const char *themes...
  function themes_cmp (line 2742) | static int themes_cmp (const void *a, const void *b)
  function add_themes_to_menu (line 2757) | static int add_themes_to_menu (const char *user_themes,
  function make_theme_menu (line 2783) | static void make_theme_menu ()
  function use_theme (line 2802) | static void use_theme ()
  function theme_menu_key (line 2819) | static void theme_menu_key (const struct iface_key *k)
  function make_sure_tags_exist (line 2844) | static void make_sure_tags_exist (const char *file)
  type file_tags (line 2885) | struct file_tags
  type plist (line 2887) | struct plist
  type plist (line 2908) | struct plist
  type file_tags (line 2931) | struct file_tags
  function run_external_cmd (line 3030) | static void run_external_cmd (char **args, const int arg_num ASSERT_ONLY)
  function exec_custom_command (line 3073) | static void exec_custom_command (const char *option)
  function go_to_fast_dir (line 3117) | static void go_to_fast_dir (const int num)
  function toggle_playlist_full_paths (line 3135) | static void toggle_playlist_full_paths (void)
  function menu_key (line 3150) | static void menu_key (const struct iface_key *k)
  function get_and_handle_event (line 3458) | static void get_and_handle_event ()
  function dequeue_events (line 3471) | static void dequeue_events ()
  function handle_interrupt (line 3486) | static void handle_interrupt ()
  function init_interface (line 3492) | void init_interface (const int sock, const int logging, lists_t_strs *args)
  function interface_loop (line 3593) | void interface_loop ()
  function save_curr_dir (line 3649) | static void save_curr_dir ()
  function save_playlist_in_moc (line 3664) | static void save_playlist_in_moc ()
  function interface_end (line 3674) | void interface_end ()
  function interface_fatal (line 3701) | void interface_fatal (const char *format, ...)
  function interface_error (line 3714) | void interface_error (const char *msg)
  function interface_cmdline_clear_plist (line 3719) | void interface_cmdline_clear_plist (int server_sock)
  function add_recursively (line 3747) | static void add_recursively (struct plist *plist, lists_t_strs *args)
  function interface_cmdline_append (line 3787) | void interface_cmdline_append (int server_sock, lists_t_strs *args)
  function interface_cmdline_play_first (line 3854) | void interface_cmdline_play_first (int server_sock)
  type file_tags (line 3889) | struct file_tags
  type file_tags (line 3892) | struct file_tags
  type tag_ev_response (line 3903) | struct tag_ev_response
  type tag_ev_response (line 3904) | struct tag_ev_response
  function interface_cmdline_file_info (line 3922) | void interface_cmdline_file_info (const int server_sock)
  function interface_cmdline_enqueue (line 4032) | void interface_cmdline_enqueue (int server_sock, lists_t_strs *args)
  function interface_cmdline_playit (line 4055) | void interface_cmdline_playit (int server_sock, lists_t_strs *args)
  function interface_cmdline_seek_by (line 4099) | void interface_cmdline_seek_by (int server_sock, const int seek_by)
  function interface_cmdline_jump_to (line 4106) | void interface_cmdline_jump_to (int server_sock, const int pos)
  function interface_cmdline_jump_to_percent (line 4112) | void interface_cmdline_jump_to_percent (int server_sock, const int percent)
  function interface_cmdline_adj_volume (line 4139) | void interface_cmdline_adj_volume (int server_sock, const char *arg)
  function interface_cmdline_set (line 4151) | void interface_cmdline_set (int server_sock, char *arg, const int val)
  function interface_cmdline_formatted_info (line 4205) | void interface_cmdline_formatted_info (const int server_sock,

FILE: interface.h
  type want_quit (line 12) | enum want_quit {
  type file_tags (line 19) | struct file_tags
  type file_info (line 20) | struct file_info {

FILE: interface_elements.c
  type side_menu_type (line 63) | enum side_menu_type
  type side_menu (line 71) | struct side_menu
  type side_menu_state (line 100) | struct side_menu_state
  type window_params (line 109) | struct window_params
  type main_win_layout (line 115) | struct main_win_layout
  type main_win (line 120) | struct main_win
  type bar (line 137) | struct bar
  type entry_history (line 150) | struct entry_history
  type entry (line 157) | struct entry
  type message_type (line 176) | enum message_type
  type queued_message (line 184) | struct queued_message
  type info_win (line 200) | struct info_win
  function entry_history_init (line 278) | static void entry_history_init (struct entry_history *h)
  function entry_history_add (line 285) | static void entry_history_add (struct entry_history *h,	const char *text)
  function entry_history_replace (line 304) | static void entry_history_replace (struct entry_history *h, int num, con...
  function entry_history_clear (line 317) | static void entry_history_clear (struct entry_history *h)
  function entry_history_nitems (line 329) | static int entry_history_nitems (const struct entry_history *h)
  type entry_history (line 336) | struct entry_history
  function entry_draw (line 346) | static void entry_draw (const struct entry *e, WINDOW *w, const int posx,
  function entry_init (line 386) | static void entry_init (struct entry *e, const enum entry_type type,
  function entry_get_type (line 437) | static enum entry_type entry_get_type (const struct entry *e)
  function entry_set_text_ucs (line 445) | static void entry_set_text_ucs (struct entry *e, const wchar_t *text)
  function entry_set_text (line 464) | static void entry_set_text (struct entry *e, const char *text)
  function entry_add_char (line 477) | static void entry_add_char (struct entry *e, const wchar_t c)
  function entry_del_chars (line 498) | static void entry_del_chars (struct entry *e, int count)
  function entry_back_space (line 525) | static void entry_back_space (struct entry *e)
  function entry_del_char (line 534) | static void entry_del_char (struct entry *e)
  function entry_del_to_start (line 548) | static void entry_del_to_start (struct entry *e)
  function entry_del_to_end (line 557) | static void entry_del_to_end (struct entry *e)
  function entry_curs_left (line 574) | static void entry_curs_left (struct entry *e)
  function entry_curs_right (line 587) | static void entry_curs_right (struct entry *e)
  function entry_end (line 604) | static void entry_end (struct entry *e)
  function entry_home (line 621) | static void entry_home (struct entry *e)
  function entry_resize (line 629) | static void entry_resize (struct entry *e, const int width)
  type entry (line 638) | struct entry
  function entry_set_history_up (line 655) | static void entry_set_history_up (struct entry *e)
  function entry_set_history_down (line 680) | static void entry_set_history_down (struct entry *e)
  function entry_set_file (line 703) | static void entry_set_file (struct entry *e, const char *file)
  type entry (line 713) | struct entry
  function entry_destroy (line 718) | static void entry_destroy (struct entry *e)
  function entry_add_text_to_history (line 728) | static void entry_add_text_to_history (struct entry *e)
  function side_menu_get_menu_height (line 741) | static int side_menu_get_menu_height (const struct side_menu *m)
  function side_menu_init_menu (line 748) | static void side_menu_init_menu (struct side_menu *m)
  function side_menu_init (line 756) | static void side_menu_init (struct side_menu *m, const enum side_menu_ty...
  function side_menu_destroy (line 807) | static void side_menu_destroy (struct side_menu *m)
  function side_menu_set_title (line 827) | static void side_menu_set_title (struct side_menu *m, const char *title)
  function parse_layout_coordinate (line 841) | static bool parse_layout_coordinate (const char *fmt, int *val, const in...
  function parse_layout (line 868) | static bool parse_layout (struct main_win_layout *l, lists_t_strs *fmt)
  function main_win_init (line 953) | static void main_win_init (struct main_win *w, lists_t_strs *layout_fmt)
  function main_win_destroy (line 984) | static void main_win_destroy (struct main_win *w)
  function add_to_menu (line 1030) | static int add_to_menu (struct menu *menu, const struct plist *plist,
  function side_menu_clear (line 1072) | static void side_menu_clear (struct side_menu *m)
  function side_menu_make_list_content (line 1095) | static void side_menu_make_list_content (struct side_menu *m,
  function clear_area (line 1179) | static void clear_area (WINDOW *w, const int posx, const int posy,
  function side_menu_draw_frame (line 1197) | static void side_menu_draw_frame (const struct side_menu *m)
  function side_menu_draw (line 1273) | static void side_menu_draw (const struct side_menu *m, const int active)
  function side_menu_cmd (line 1291) | static void side_menu_cmd (struct side_menu *m, const enum key_cmd cmd)
  function side_menu_curritem_get_type (line 1325) | static enum file_type side_menu_curritem_get_type (const struct side_men...
  type side_menu (line 1342) | struct side_menu
  type menu_item (line 1344) | struct menu_item
  type side_menu (line 1359) | struct side_menu
  type main_win (line 1359) | struct main_win
  type side_menu_type (line 1360) | enum side_menu_type
  type side_menu (line 1367) | struct side_menu
  function side_menu_set_curr_item_title (line 1376) | static void side_menu_set_curr_item_title (struct side_menu *m,
  function update_menu_item (line 1387) | static void update_menu_item (struct menu_item *mi,
  function side_menu_update_item (line 1432) | static int side_menu_update_item (struct side_menu *m,
  function side_menu_unmark_file (line 1467) | static void side_menu_unmark_file (struct side_menu *m)
  function side_menu_mark_file (line 1478) | static void side_menu_mark_file (struct side_menu *m, const char *file)
  function side_menu_add_file (line 1489) | static void side_menu_add_file (struct side_menu *m, const char *file,
  function side_menu_add_plist_item (line 1503) | static int side_menu_add_plist_item (struct side_menu *m,
  function side_menu_is_time_for_all (line 1523) | static int side_menu_is_time_for_all (const struct side_menu *m)
  function side_menu_get_files_time (line 1531) | static int side_menu_get_files_time (const struct side_menu *m)
  function side_menu_update_show_time (line 1539) | static void side_menu_update_show_time (struct side_menu *m)
  function side_menu_update_show_format (line 1549) | static void side_menu_update_show_format (struct side_menu *m)
  function side_menu_get_state (line 1558) | static void side_menu_get_state (const struct side_menu *m,
  function side_menu_set_state (line 1569) | static void side_menu_set_state (struct side_menu *m,
  function side_menu_del_item (line 1580) | static void side_menu_del_item (struct side_menu *m, const char *file)
  function side_menu_set_plist_time (line 1590) | static void side_menu_set_plist_time (struct side_menu *m, const int time,
  function side_menu_filter (line 1604) | static int side_menu_filter (struct side_menu *m, const char *pattern)
  function side_menu_use_main (line 1630) | static void side_menu_use_main (struct side_menu *m)
  function side_menu_make_visible (line 1642) | static void side_menu_make_visible (struct side_menu *m, const char *file)
  function side_menu_swap_items (line 1653) | static void side_menu_swap_items (struct side_menu *m, const char *file1,
  function side_menu_select_file (line 1667) | static void side_menu_select_file (struct side_menu *m, const char *file)
  function side_menu_resize (line 1678) | static void side_menu_resize (struct side_menu *m,
  function main_win_draw_too_small_screen (line 1701) | static void main_win_draw_too_small_screen (const struct main_win *w)
  function main_win_draw_help_screen (line 1716) | static void main_win_draw_help_screen (const struct main_win *w)
  function main_win_draw_lyrics_screen (line 1753) | static void main_win_draw_lyrics_screen (const struct main_win *w)
  function main_win_draw (line 1789) | static void main_win_draw (struct main_win *w)
  function iface_to_side_menu (line 1811) | static enum side_menu_type iface_to_side_menu (const enum iface_menu ifa...
  function main_win_set_dir_content (line 1823) | static void main_win_set_dir_content (struct main_win *w,
  function main_win_set_title (line 1840) | static void main_win_set_title (struct main_win *w,
  function main_win_update_dir_content (line 1854) | static void main_win_update_dir_content (struct main_win *w,
  function main_win_switch_to (line 1874) | static void main_win_switch_to (struct main_win *w,
  function main_win_switch_to_help (line 1895) | static void main_win_switch_to_help (struct main_win *w)
  function main_win_switch_to_lyrics (line 1903) | static void main_win_switch_to_lyrics (struct main_win *w)
  function main_win_create_themes_menu (line 1911) | static void main_win_create_themes_menu (struct main_win *w)
  function main_win_menu_cmd (line 1926) | static void main_win_menu_cmd (struct main_win *w, const enum key_cmd cmd)
  function main_win_curritem_get_type (line 1934) | static enum file_type main_win_curritem_get_type (const struct main_win *w)
  type main_win (line 1941) | struct main_win
  function main_win_in_dir_menu (line 1948) | static int main_win_in_dir_menu (const struct main_win *w)
  function main_win_in_help (line 1955) | static int main_win_in_help (const struct main_win *w)
  function main_win_in_lyrics (line 1962) | static int main_win_in_lyrics (const struct main_win *w)
  function main_win_in_plist_menu (line 1969) | static int main_win_in_plist_menu (const struct main_win *w)
  function main_win_in_theme_menu (line 1976) | static int main_win_in_theme_menu (const struct main_win *w)
  function main_win_set_curr_item_title (line 1983) | static void main_win_set_curr_item_title (struct main_win *w, const char...
  function main_win_update_item (line 1993) | static void main_win_update_item (struct main_win *w,
  function main_win_set_played_file (line 2010) | static void main_win_set_played_file (struct main_win *w, const char *file)
  function main_win_menu_filter (line 2034) | static int main_win_menu_filter (struct main_win *w, const char *pattern)
  function main_win_clear_filter_menu (line 2049) | static void main_win_clear_filter_menu (struct main_win *w)
  function main_win_set_plist_time (line 2057) | static void main_win_set_plist_time (struct main_win *w, const int time,
  function main_win_add_to_plist (line 2068) | static void main_win_add_to_plist (struct main_win *w, const struct plis...
  function main_win_add_file (line 2084) | static void main_win_add_file (struct main_win *w, const char *file,
  function main_win_get_files_time (line 2095) | static int main_win_get_files_time (const struct main_win *w,
  function main_win_is_time_for_all (line 2107) | static int main_win_is_time_for_all (const struct main_win *w,
  function main_win_get_curr_files_time (line 2119) | static int main_win_get_curr_files_time (const struct main_win *w)
  function main_win_is_curr_time_for_all (line 2126) | static int main_win_is_curr_time_for_all (const struct main_win *w)
  function main_win_handle_help_key (line 2133) | static void main_win_handle_help_key (struct main_win *w,
  function main_win_handle_lyrics_key (line 2163) | static void main_win_handle_lyrics_key (struct main_win *w,
  function main_win_swap_plist_items (line 2195) | static void main_win_swap_plist_items (struct main_win *w, const char *f...
  function main_win_use_layout (line 2209) | static void main_win_use_layout (struct main_win *w, lists_t_strs *layou...
  function validate_layouts (line 2228) | static void validate_layouts ()
  function main_win_resize (line 2247) | static void main_win_resize (struct main_win *w)
  function main_win_make_visible (line 2278) | static void main_win_make_visible (struct main_win *w,
  function main_win_update_show_time (line 2291) | static void main_win_update_show_time (struct main_win *w)
  function main_win_select_file (line 2308) | static void main_win_select_file (struct main_win *w, const char *file)
  function main_win_update_show_format (line 2317) | static void main_win_update_show_format (struct main_win *w)
  function main_win_del_plist_item (line 2334) | static void main_win_del_plist_item (struct main_win *w, const char *file)
  function main_win_clear_plist (line 2346) | static void main_win_clear_plist (struct main_win *w)
  function soft_write (line 2358) | static void soft_write (int fd, const void *buf, size_t count)
  function detect_term (line 2368) | static void detect_term ()
  function xterm_set_title (line 2381) | static void xterm_set_title (const int state, const char *title)
  function xterm_clear_title (line 2419) | static void xterm_clear_title ()
  function detect_screen (line 2426) | static void detect_screen ()
  function screen_set_title (line 2442) | static void screen_set_title (const int state, const char *title)
  function screen_clear_title (line 2469) | static void screen_clear_title ()
  function init_lines (line 2480) | static void init_lines ()
  function check_term_size (line 2505) | static void check_term_size (struct main_win *mw, struct info_win *iw)
  function bar_update_title (line 2511) | static void bar_update_title (struct bar *b)
  function bar_set_title (line 2534) | static void bar_set_title (struct bar *b, const char *title)
  function bar_init (line 2546) | static void bar_init (struct bar *b, const int width, const char *title,
  function bar_draw (line 2571) | static void bar_draw (const struct bar *b, WINDOW *win, const int pos_x,
  function bar_set_fill (line 2590) | static void bar_set_fill (struct bar *b, const double fill)
  function bar_resize (line 2601) | static void bar_resize (struct bar *b, const int width)
  type queued_message (line 2623) | struct queued_message
  type message_type (line 2623) | enum message_type
  type queued_message (line 2625) | struct queued_message
  type queued_message (line 2627) | struct queued_message
  type queued_message (line 2627) | struct queued_message
  function queued_message_destroy (line 2639) | static void queued_message_destroy (struct queued_message *msg)
  function set_startup_message (line 2651) | static void set_startup_message (struct info_win *w)
  function info_win_init (line 2673) | static void info_win_init (struct info_win *w)
  function info_win_destroy (line 2723) | static void info_win_destroy (struct info_win *w)
  function info_win_update_curs (line 2738) | static void info_win_update_curs (const struct info_win *w)
  function info_win_set_mixer_name (line 2746) | static void info_win_set_mixer_name (struct info_win *w, const char *name)
  function info_win_draw_status (line 2758) | static void info_win_draw_status (const struct info_win *w)
  function info_win_set_status (line 2771) | static void info_win_set_status (struct info_win *w, const char *msg)
  function info_win_draw_files_in_queue (line 2781) | static void info_win_draw_files_in_queue (const struct info_win *w)
  function info_win_set_files_in_queue (line 2803) | static void info_win_set_files_in_queue (struct info_win *w, const int num)
  function info_win_draw_state (line 2812) | static void info_win_draw_state (const struct info_win *w)
  function info_win_draw_title (line 2841) | static void info_win_draw_title (const struct info_win *w)
  function info_win_set_state (line 2867) | static void info_win_set_state (struct info_win *w, const int state)
  function info_win_draw_time (line 2879) | static void info_win_draw_time (const struct info_win *w)
  function info_win_draw_block (line 2913) | static void info_win_draw_block (const struct info_win *w)
  function info_win_set_curr_time (line 2922) | static void info_win_set_curr_time (struct info_win *w, const int time)
  function info_win_set_total_time (line 2936) | static void info_win_set_total_time (struct info_win *w, const int time)
  function info_win_set_block_title (line 2951) | static void info_win_set_block_title (struct info_win *w)
  function info_win_set_block (line 2986) | static void info_win_set_block (struct info_win *w, const int block_star...
  function info_win_set_played_title (line 2999) | static void info_win_set_played_title (struct info_win *w, const char *t...
  function info_win_draw_rate (line 3017) | static void info_win_draw_rate (const struct info_win *w)
  function info_win_draw_bitrate (line 3029) | static void info_win_draw_bitrate (const struct info_win *w)
  function info_win_set_bitrate (line 3044) | static void info_win_set_bitrate (struct info_win *w, const int bitrate)
  function info_win_set_rate (line 3053) | static void info_win_set_rate (struct info_win *w, const int rate)
  function info_win_set_mixer_value (line 3062) | static void info_win_set_mixer_value (struct info_win *w, const int value)
  function info_win_draw_switch (line 3072) | static void info_win_draw_switch (const struct info_win *w, const int posx,
  function info_win_draw_options_state (line 3087) | static void info_win_draw_options_state (const struct info_win *w)
  function info_win_make_entry (line 3098) | static void info_win_make_entry (struct info_win *w, const enum entry_ty...
  function info_win_display_msg (line 3132) | static void info_win_display_msg (struct info_win *w)
  function info_win_disable_msg (line 3190) | static void info_win_disable_msg (struct info_win *w)
  function info_win_clear_msg (line 3201) | static void info_win_clear_msg (struct info_win *w)
  function info_win_msg (line 3224) | static void info_win_msg (struct info_win *w, const char *msg,
  function iface_win_user_reply (line 3256) | static void iface_win_user_reply (struct info_win *w, const char *reply)
  function info_win_user_history_add (line 3264) | static void info_win_user_history_add (struct info_win *w, const char *t...
  function info_win_set_channels (line 3271) | static void info_win_set_channels (struct info_win *w, const int channels)
  function info_win_in_entry (line 3280) | static int info_win_in_entry (const struct info_win *w)
  function info_win_get_entry_type (line 3287) | static enum entry_type info_win_get_entry_type (const struct info_win *w)
  function info_win_set_option_state (line 3295) | static void info_win_set_option_state (struct info_win *w, const char *n...
  function sec_to_min_plist (line 3317) | static void sec_to_min_plist (char *buff, const int seconds)
  function info_win_draw_files_time (line 3334) | static void info_win_draw_files_time (const struct info_win *w)
  function info_win_set_files_time (line 3352) | static void info_win_set_files_time (struct info_win *w, const int time,
  function info_win_tick (line 3364) | static void info_win_tick (struct info_win *w)
  function info_win_draw_static_elements (line 3370) | static void info_win_draw_static_elements (const struct info_win *w)
  function info_win_draw (line 3411) | static void info_win_draw (const struct info_win *w)
  function info_win_entry_disable (line 3438) | static void info_win_entry_disable (struct info_win *w)
  function info_win_entry_handle_key (line 3453) | static void info_win_entry_handle_key (struct info_win *iw, struct main_...
  function info_win_entry_set_text (line 3541) | static void info_win_entry_set_text (struct info_win *w, const char *text)
  type info_win (line 3551) | struct info_win
  function info_win_entry_history_add (line 3559) | static void info_win_entry_history_add (struct info_win *w)
  function info_win_entry_set_file (line 3567) | static void info_win_entry_set_file (struct info_win *w, const char *file)
  type info_win (line 3576) | struct info_win
  function info_win_resize (line 3585) | static void info_win_resize (struct info_win *w)
  function windows_init (line 3603) | void windows_init ()
  function windows_reset (line 3645) | void windows_reset ()
  function windows_end (line 3661) | void windows_end ()
  function iface_refresh_screen (line 3680) | static void iface_refresh_screen ()
  function iface_set_option_state (line 3695) | void iface_set_option_state (const char *name, const bool value)
  function iface_set_mixer_name (line 3704) | void iface_set_mixer_name (const char *name)
  function iface_set_status (line 3713) | void iface_set_status (const char *msg)
  function iface_set_files_in_queue (line 3724) | void iface_set_files_in_queue (const int num)
  function iface_show_num_files (line 3734) | static void iface_show_num_files (const int num)
  function iface_set_dir_content (line 3744) | void iface_set_dir_content (const enum iface_menu iface_menu,
  function iface_update_attrs (line 3762) | void iface_update_attrs ()
  function iface_update_theme_selection (line 3814) | void iface_update_theme_selection (const char *file)
  function iface_update_dir_content (line 3825) | void iface_update_dir_content (const enum iface_menu iface_menu,
  function iface_update_item (line 3843) | void iface_update_item (const enum iface_menu menu,
  function iface_set_curr_item_title (line 3856) | void iface_set_curr_item_title (const char *title)
  function iface_set_title (line 3865) | void iface_set_title (const enum iface_menu menu, const char *title)
  function iface_get_key (line 3891) | void iface_get_key (struct iface_key *k)
  function iface_key_is_resize (line 3943) | int iface_key_is_resize (const struct iface_key *k)
  function iface_menu_key (line 3949) | void iface_menu_key (const enum key_cmd cmd)
  function iface_curritem_get_type (line 3956) | enum file_type iface_curritem_get_type ()
  function iface_in_dir_menu (line 3962) | int iface_in_dir_menu ()
  function iface_in_plist_menu (line 3968) | int iface_in_plist_menu ()
  function iface_in_theme_menu (line 3974) | int iface_in_theme_menu ()
  function iface_set_curr_time (line 3987) | void iface_set_curr_time (const int time)
  function iface_set_total_time (line 3994) | void iface_set_total_time (const int time)
  function iface_set_block (line 4002) | void iface_set_block (const int block_start, const int block_end)
  function iface_set_state (line 4009) | void iface_set_state (const int state)
  function iface_set_bitrate (line 4016) | void iface_set_bitrate (const int bitrate)
  function iface_set_rate (line 4025) | void iface_set_rate (const int rate)
  function iface_set_channels (line 4034) | void iface_set_channels (const int channels)
  function iface_set_played_file (line 4043) | void iface_set_played_file (const char *file)
  function iface_set_played_file_title (line 4064) | void iface_set_played_file_title (const char *title)
  function iface_tick (line 4074) | void iface_tick ()
  function iface_set_mixer_value (line 4080) | void iface_set_mixer_value (const int value)
  function iface_switch_to_plist (line 4089) | void iface_switch_to_plist ()
  function iface_switch_to_dir (line 4100) | void iface_switch_to_dir ()
  function iface_add_to_plist (line 4111) | void iface_add_to_plist (const struct plist *plist, const int num)
  function iface_error (line 4126) | void iface_error (const char *msg)
  function iface_resize (line 4137) | void iface_resize ()
  function iface_refresh (line 4148) | void iface_refresh ()
  function iface_update_show_time (line 4159) | void iface_update_show_time ()
  function iface_update_show_format (line 4165) | void iface_update_show_format ()
  function iface_clear_plist (line 4171) | void iface_clear_plist ()
  function iface_del_plist_item (line 4177) | void iface_del_plist_item (const char *file)
  function iface_make_entry (line 4188) | void iface_make_entry (const enum entry_type type)
  function iface_get_entry_type (line 4194) | enum entry_type iface_get_entry_type ()
  function iface_in_entry (line 4199) | int iface_in_entry ()
  function iface_entry_handle_key (line 4204) | void iface_entry_handle_key (const struct iface_key *k)
  function iface_entry_set_text (line 4210) | void iface_entry_set_text (const char *text)
  function iface_entry_history_add (line 4224) | void iface_entry_history_add ()
  function iface_entry_disable (line 4229) | void iface_entry_disable ()
  function iface_entry_set_file (line 4237) | void iface_entry_set_file (const char *file)
  function iface_message (line 4250) | void iface_message (const char *msg)
  function iface_disable_message (line 4258) | void iface_disable_message ()
  function iface_user_query (line 4264) | void iface_user_query (const char *msg, const char *prompt,
  function iface_user_reply (line 4273) | void iface_user_reply (const char *reply)
  function iface_user_history_add (line 4279) | void iface_user_history_add (const char *text)
  function iface_plist_set_total_time (line 4284) | void iface_plist_set_total_time (const int time, const int for_all_files)
  function iface_select_file (line 4292) | void iface_select_file (const char *file)
  function iface_in_help (line 4300) | int iface_in_help ()
  function iface_switch_to_help (line 4305) | void iface_switch_to_help ()
  function iface_handle_help_key (line 4311) | void iface_handle_help_key (const struct iface_key *k)
  function iface_in_lyrics (line 4317) | int iface_in_lyrics ()
  function iface_switch_to_lyrics (line 4322) | void iface_switch_to_lyrics ()
  function iface_handle_lyrics_key (line 4328) | void iface_handle_lyrics_key (const struct iface_key *k)
  function iface_toggle_layout (line 4334) | void iface_toggle_layout ()
  function iface_toggle_percent (line 4354) | void iface_toggle_percent ()
  function iface_swap_plist_items (line 4362) | void iface_swap_plist_items (const char *file1, const char *file2)
  function iface_make_visible (line 4369) | void iface_make_visible (const enum iface_menu menu, const char *file)
  function iface_switch_to_theme_menu (line 4379) | void iface_switch_to_theme_menu ()
  function iface_add_file (line 4387) | void iface_add_file (const char *file, const char *title,
  function iface_temporary_exit (line 4398) | void iface_temporary_exit ()
  function iface_restore (line 4404) | void iface_restore ()
  function iface_load_lyrics (line 4411) | void iface_load_lyrics (const char *file)
  function update_queue_position (line 4419) | static void update_queue_position (struct plist *playlist,
  function iface_update_queue_positions (line 4444) | void iface_update_queue_positions (const struct plist *queue,
  function iface_clear_queue_positions (line 4469) | void iface_clear_queue_positions (const struct plist *queue,
  function iface_update_queue_position_last (line 4488) | void iface_update_queue_position_last (const struct plist *queue,

FILE: interface_elements.h
  type iface_menu (line 28) | enum iface_menu
  type entry_type (line 36) | enum entry_type
  type iface_key (line 47) | struct iface_key
  type iface_menu (line 68) | enum iface_menu
  type plist (line 69) | struct plist
  type iface_menu (line 72) | enum iface_menu
  type plist (line 73) | struct plist
  type iface_key (line 77) | struct iface_key
  type iface_key (line 78) | struct iface_key
  type key_cmd (line 79) | enum key_cmd
  type file_type (line 80) | enum file_type
  type iface_menu (line 85) | enum iface_menu
  type plist (line 85) | struct plist
  type plist (line 101) | struct plist
  type entry_type (line 109) | enum entry_type
  type entry_type (line 111) | enum entry_type
  type iface_key (line 112) | struct iface_key
  type iface_menu (line 125) | enum iface_menu
  type iface_key (line 129) | struct iface_key
  type iface_key (line 132) | struct iface_key
  type iface_menu (line 136) | enum iface_menu
  type file_type (line 139) | enum file_type
  type plist (line 143) | struct plist
  type plist (line 144) | struct plist
  type plist (line 144) | struct plist
  type plist (line 146) | struct plist
  type plist (line 147) | struct plist
  type plist (line 147) | struct plist
  type plist (line 148) | struct plist
  type plist (line 149) | struct plist
  type plist (line 149) | struct plist

FILE: io.c
  type io_stream (line 54) | struct io_stream
  function io_read_mmap (line 81) | static ssize_t io_read_mmap (struct io_stream *s, const int dont_move,
  function io_read_fd (line 124) | static ssize_t io_read_fd (struct io_stream *s, const int dont_move, voi...
  function io_internal_read (line 142) | static ssize_t io_internal_read (struct io_stream *s, const int dont_move,
  function off_t (line 174) | static off_t io_seek_mmap (struct io_stream *s, const off_t where)
  function off_t (line 180) | static off_t io_seek_fd (struct io_stream *s, const off_t where)
  function off_t (line 185) | static off_t io_seek_buffered (struct io_stream *s, const off_t where)
  function off_t (line 216) | static off_t io_seek_unbuffered (struct io_stream *s, const off_t where)
  function off_t (line 238) | off_t io_seek (struct io_stream *s, off_t offset, int whence)
  function io_wake_up (line 283) | static void io_wake_up (struct io_stream *s CURL_ONLY)
  function io_abort (line 292) | void io_abort (struct io_stream *s)
  function io_close (line 309) | void io_close (struct io_stream *s)
  type io_stream (line 384) | struct io_stream
  type io_stream (line 384) | struct io_stream
  function io_open_file (line 476) | static void io_open_file (struct io_stream *s, const char *file)
  type io_stream (line 516) | struct io_stream
  type io_stream (line 519) | struct io_stream
  type io_stream (line 523) | struct io_stream
  function io_ok_nolock (line 569) | static int io_ok_nolock (struct io_stream *s)
  function io_ok (line 575) | int io_ok (struct io_stream *s)
  function io_peek_internal (line 588) | static ssize_t io_peek_internal (struct io_stream *s, void *buf, size_t ...
  function io_prebuffer (line 615) | void io_prebuffer (struct io_stream *s, const size_t to_fill)
  function io_read_buffered (line 630) | static ssize_t io_read_buffered (struct io_stream *s, void *buf, size_t ...
  function io_read_unbuffered (line 661) | static ssize_t io_read_unbuffered (struct io_stream *s, const int dont_m...
  function io_read (line 681) | ssize_t io_read (struct io_stream *s, void *buf, size_t count)
  function io_peek (line 704) | ssize_t io_peek (struct io_stream *s, void *buf, size_t count)
  type io_stream (line 722) | struct io_stream
  function off_t (line 741) | off_t io_file_size (const struct io_stream *s)
  function off_t (line 749) | off_t io_tell (struct io_stream *s)
  function io_eof (line 769) | int io_eof (struct io_stream *s)
  function io_init (line 783) | void io_init ()
  function io_cleanup (line 790) | void io_cleanup ()
  type io_stream (line 800) | struct io_stream
  type io_stream (line 810) | struct io_stream
  type io_stream (line 822) | struct io_stream
  function io_set_metadata_title (line 834) | void io_set_metadata_title (struct io_stream *s, const char *title)
  function io_set_metadata_url (line 844) | void io_set_metadata_url (struct io_stream *s, const char *url)
  function io_set_buf_fill_callback (line 856) | void io_set_buf_fill_callback (struct io_stream *s,
  function io_seekable (line 869) | int io_seekable (const struct io_stream *s)

FILE: io.h
  type io_source (line 17) | enum io_source
  type io_stream_curl (line 25) | struct io_stream_curl
  type io_stream (line 51) | struct io_stream
  type io_stream (line 53) | struct io_stream
  type io_stream (line 56) | struct io_stream
  type io_stream (line 101) | struct io_stream
  type io_stream (line 102) | struct io_stream
  type io_stream (line 103) | struct io_stream
  type io_stream (line 104) | struct io_stream
  type io_stream (line 105) | struct io_stream
  type io_stream (line 106) | struct io_stream
  type io_stream (line 107) | struct io_stream
  type io_stream (line 108) | struct io_stream
  type io_stream (line 109) | struct io_stream
  type io_stream (line 110) | struct io_stream
  type io_stream (line 113) | struct io_stream
  type io_stream (line 114) | struct io_stream
  type io_stream (line 115) | struct io_stream
  type io_stream (line 116) | struct io_stream
  type io_stream (line 117) | struct io_stream
  type io_stream (line 118) | struct io_stream
  type io_stream (line 119) | struct io_stream
  type io_stream (line 120) | struct io_stream
  type io_stream (line 121) | struct io_stream
  type io_stream (line 123) | struct io_stream

FILE: io_curl.c
  function io_curl_init (line 38) | void io_curl_init ()
  function io_curl_cleanup (line 50) | void io_curl_cleanup ()
  function write_cb (line 55) | static size_t write_cb (void *data, size_t size, size_t nmemb,
  function header_cb (line 70) | static size_t header_cb (void *data, size_t size, size_t nmemb,
  function debug_cb (line 152) | static int debug_cb (CURL *unused1 ATTR_UNUSED, curl_infotype i,
  function check_curl_stream (line 190) | static int check_curl_stream (struct io_stream *s)
  function io_curl_open (line 215) | void io_curl_open (struct io_stream *s, const char *url)
  function io_curl_close (line 289) | void io_curl_close (struct io_stream *s)
  function curl_read_internal (line 322) | static int curl_read_internal (struct io_stream *s)
  function read_from_buffer (line 410) | static size_t read_from_buffer (struct io_stream *s, char *buf, size_t c...
  function parse_icy_string (line 438) | static void parse_icy_string (struct io_stream *s, const char *str)
  function parse_icy_metadata (line 502) | static void parse_icy_metadata (struct io_stream *s, const char *packet,
  function read_icy_metadata (line 523) | static int read_icy_metadata (struct io_stream *s)
  function io_curl_read (line 565) | ssize_t io_curl_read (struct io_stream *s, char *buf, size_t count)
  function io_curl_strerror (line 605) | void io_curl_strerror (struct io_stream *s)
  function io_curl_wake_up (line 620) | void io_curl_wake_up (struct io_stream *s)

FILE: io_curl.h
  type io_stream (line 12) | struct io_stream
  type io_stream (line 13) | struct io_stream
  type io_stream (line 14) | struct io_stream
  type io_stream (line 15) | struct io_stream
  type io_stream (line 16) | struct io_stream

FILE: jack.c
  function process_cb (line 49) | static int process_cb(jack_nframes_t nframes, void *unused ATTR_UNUSED)
  function update_sample_rate_cb (line 111) | static int update_sample_rate_cb(jack_nframes_t new_rate,
  function error_cb (line 119) | static void error_cb (const char *msg)
  function shutdown_cb (line 124) | static void shutdown_cb (void *unused ATTR_UNUSED)
  function moc_jack_init (line 129) | static int moc_jack_init (struct output_driver_caps *caps)
  function moc_jack_open (line 209) | static int moc_jack_open (struct sound_params *sound_params)
  function moc_jack_close (line 229) | static void moc_jack_close ()
  function moc_jack_play (line 235) | static int moc_jack_play (const char *buff, const size_t size)
  function moc_jack_read_mixer (line 299) | static int moc_jack_read_mixer ()
  function moc_jack_set_mixer (line 304) | static void moc_jack_set_mixer (int vol)
  function moc_jack_get_buff_fill (line 311) | static int moc_jack_get_buff_fill ()
  function moc_jack_reset (line 319) | static int moc_jack_reset ()
  function moc_jack_shutdown (line 326) | static void moc_jack_shutdown(){
  function moc_jack_get_rate (line 335) | static int moc_jack_get_rate ()
  function moc_jack_toggle_mixer_channel (line 345) | static void moc_jack_toggle_mixer_channel ()
  function moc_jack_funcs (line 349) | void moc_jack_funcs (struct hw_funcs *funcs)

FILE: jack.h
  type hw_funcs (line 8) | struct hw_funcs

FILE: keys.c
  type command (line 38) | struct command
  type command (line 49) | struct command
  type special_keys (line 836) | struct special_keys
  function get_key_cmd (line 880) | enum key_cmd get_key_cmd (const enum key_context context,
  function keymap_parse_error (line 928) | static void keymap_parse_error (const int line, const char *msg)
  function parse_key (line 935) | static int parse_key (const char *symbol)
  function clear_default_key (line 980) | static void clear_default_key (int key)
  function clear_default_keys (line 1007) | static void clear_default_keys (size_t cmd_ix)
  function add_key (line 1017) | static void add_key (const int line_num, size_t cmd_ix, const char *key_...
  function find_command_name (line 1044) | static size_t find_command_name (const char *command)
  function load_key_map (line 1057) | static void load_key_map (const char *file_name)
  function compare_keys (line 1143) | static void compare_keys (struct command *cmd1, struct command *cmd2)
  function check_keys (line 1161) | static void check_keys ()
  function make_help (line 1197) | static void make_help ()
  function keys_init (line 1220) | void keys_init ()
  function keys_cleanup (line 1233) | void keys_cleanup ()
  function find_command_cmd (line 1250) | static size_t find_command_cmd (const enum key_cmd cmd)
  function is_help_still_h (line 1263) | bool is_help_still_h ()

FILE: keys.h
  type key_cmd (line 8) | enum key_cmd
  type key_context (line 113) | enum key_context
  type iface_key (line 127) | struct iface_key
  type key_cmd (line 128) | enum key_cmd
  type key_context (line 128) | enum key_context
  type iface_key (line 128) | struct iface_key

FILE: lists.c
  type lists_strs (line 25) | struct lists_strs {
  function lists_t_strs (line 32) | lists_t_strs *lists_strs_new (int reserve)
  function lists_strs_clear (line 47) | void lists_strs_clear (lists_t_strs *list)
  function lists_strs_free (line 59) | void lists_strs_free (lists_t_strs *list)
  function lists_strs_size (line 69) | int lists_strs_size (const lists_t_strs *list)
  function lists_strs_capacity (line 77) | int lists_strs_capacity (const lists_t_strs *list)
  function lists_strs_empty (line 85) | bool lists_strs_empty (const lists_t_strs *list)
  function lists_strs_sort (line 102) | void lists_strs_sort (lists_t_strs *list, lists_t_compare *compare)
  function lists_strs_reverse (line 111) | void lists_strs_reverse (lists_t_strs *list)
  function lists_strs_push (line 128) | void lists_strs_push (lists_t_strs *list, char *s)
  function lists_strs_append (line 175) | void lists_strs_append (lists_t_strs *list, const char *s)
  function lists_strs_remove (line 187) | void lists_strs_remove (lists_t_strs *list)
  function lists_strs_replace (line 200) | void lists_strs_replace (lists_t_strs *list, int index, char *s)
  function lists_strs_split (line 215) | int lists_strs_split (lists_t_strs *list, const char *s, const char *delim)
  function lists_strs_tokenise (line 239) | int lists_strs_tokenise (lists_t_strs *list, const char *s)
  function lists_strs_load (line 326) | int lists_strs_load (lists_t_strs *list, const char **saved)
  function lists_strs_find (line 343) | int lists_strs_find (lists_t_strs *list, const char *sought)
  function lists_strs_exists (line 359) | bool lists_strs_exists (lists_t_strs *list, const char *sought)

FILE: lists.h
  type lists_t_strs (line 10) | typedef struct lists_strs lists_t_strs;

FILE: log.c
  function log_signal (line 66) | void log_signal (int sig)
  function flush_log (line 78) | static inline void flush_log (void)
  function locked_logit (line 91) | static void locked_logit (const char *file, const int line,
  function log_signals_raised (line 144) | static void log_signals_raised (void)
  function internal_logit (line 160) | void internal_logit (const char *file LOGIT_ONLY,
  function log_init_stream (line 208) | void log_init_stream (FILE *f LOGIT_ONLY, const char *fn LOGIT_ONLY)
  function log_circular_start (line 250) | void log_circular_start ()
  function locked_circular_reset (line 275) | static inline void locked_circular_reset ()
  function log_circular_reset (line 283) | void log_circular_reset ()
  function log_circular_log (line 300) | void log_circular_log ()
  function log_circular_stop (line 333) | void log_circular_stop ()
  function log_close (line 351) | void log_close ()

FILE: lyrics.c
  function lists_t_strs (line 31) | lists_t_strs *lyrics_lines_get (void)
  function lyrics_lines_set (line 37) | void lyrics_lines_set (lists_t_strs *lines)
  function lists_t_strs (line 47) | lists_t_strs *lyrics_load_file (const char *filename)
  function lyrics_autoload (line 84) | void lyrics_autoload (const char *filename)
  function lists_t_strs (line 145) | static lists_t_strs *centre_style (lists_t_strs *lines, int unused1 ATTR...
  function lyrics_use_formatter (line 171) | void lyrics_use_formatter (lyrics_t_formatter formatter,
  function lists_t_strs (line 191) | lists_t_strs *lyrics_format (int height, int width)
  function lyrics_cleanup (line 238) | void lyrics_cleanup (void)

FILE: lyrics.h
  type lists_t_strs (line 8) | typedef lists_t_strs *lyrics_t_formatter (lists_t_strs *lines, int heigh...

FILE: main.c
  type parameters (line 60) | struct parameters
  function server_connect (line 93) | static int server_connect ()
  function ping_server (line 118) | static int ping_server (int sock)
  function check_moc_dir (line 131) | static void check_moc_dir ()
  function start_moc (line 155) | static void start_moc (const struct parameters *params, lists_t_strs *args)
  function server_command (line 230) | static void server_command (struct parameters *params, lists_t_strs *args)
  function show_version (line 315) | static void show_version ()
  function show_banner (line 376) | static void show_banner ()
  function show_usage (line 388) | static void show_usage (poptContext ctx)
  function show_help (line 396) | static void show_help (poptContext ctx)
  function show_args (line 412) | static void show_args ()
  function show_misc_cb (line 432) | static void show_misc_cb (poptContext ctx,
  type parameters (line 472) | struct parameters
  type poptOption (line 474) | struct poptOption
  type poptOption (line 508) | struct poptOption
  type poptOption (line 555) | struct poptOption
  type poptOption (line 569) | struct poptOption
  function read_mocp_poptrc (line 578) | static void read_mocp_poptrc (poptContext ctx, const char *env_poptrc)
  function check_popt_secure (line 606) | static void check_popt_secure ()
  function read_default_poptrc (line 622) | static void read_default_poptrc (poptContext ctx)
  function read_popt_config (line 647) | static void read_popt_config (poptContext ctx)
  function prepend_mocp_opts (line 659) | static void prepend_mocp_opts (poptContext ctx)
  type poptOption (line 681) | struct poptOption
  function is_autohelp (line 686) | static inline bool is_autohelp (const struct poptOption *opt)
  function is_autoalias (line 694) | static inline bool is_autoalias (const struct poptOption *opt)
  function is_tableend (line 702) | static inline bool is_tableend (const struct poptOption *opt)
  type poptOption (line 713) | struct poptOption
  type poptOption (line 713) | struct poptOption
  type poptOption (line 716) | struct poptOption
  type poptOption (line 722) | struct poptOption
  type poptOption (line 734) | struct poptOption
  function free_popt_clone (line 770) | void free_popt_clone (struct poptOption *opts)
  type poptOption (line 786) | struct poptOption
  type poptOption (line 786) | struct poptOption
  type poptOption (line 792) | struct poptOption
  type poptOption (line 830) | struct poptOption
  type poptOption (line 847) | struct poptOption
  function override_config_option (line 907) | static void override_config_option (const char *arg, lists_t_strs *defer...
  function get_num_param (line 964) | static long get_num_param (const char *p,const char ** last)
  function process_options (line 979) | static void process_options (poptContext ctx, lists_t_strs *deferred)
  function lists_t_strs (line 1067) | static lists_t_strs *process_command_line (lists_t_strs *deferred)
  function process_deferred_overrides (line 1094) | static void process_deferred_overrides (lists_t_strs *deferred)
  function log_environment_variables (line 1130) | static void log_environment_variables ()
  function log_command_line (line 1146) | static void log_command_line ()
  function log_popt_command_line (line 1164) | static void log_popt_command_line ()
  function main (line 1177) | int main (int argc, const char *argv[])

FILE: md5.c
  function md5_init_ctx (line 76) | void
  function set_uint32 (line 91) | static inline void
  type md5_ctx (line 100) | struct md5_ctx
  type md5_ctx (line 114) | struct md5_ctx
  function md5_stream (line 140) | int
  type md5_ctx (line 217) | struct md5_ctx
  function md5_process_bytes (line 230) | void
  function md5_process_block (line 310) | void

FILE: md5.h
  type md5_ctx (line 64) | struct md5_ctx
  type md5_ctx (line 83) | struct md5_ctx
  type md5_ctx (line 90) | struct md5_ctx
  type md5_ctx (line 97) | struct md5_ctx
  type md5_ctx (line 103) | struct md5_ctx
  type md5_ctx (line 109) | struct md5_ctx

FILE: menu.c
  function draw_item (line 29) | static void draw_item (const struct menu *menu, const struct menu_item *mi,
  function menu_draw (line 126) | void menu_draw (const struct menu *menu, const int active)
  function menu_set_cursor (line 172) | void menu_set_cursor (const struct menu *m)
  function rb_compare (line 180) | static int rb_compare (const void *a, const void *b,
  function rb_fname_compare (line 189) | static int rb_fname_compare (const void *key, const void *data,
  type menu (line 199) | struct menu
  type menu (line 202) | struct menu
  type menu (line 210) | struct menu
  type menu (line 210) | struct menu
  type menu_item (line 236) | struct menu_item
  type menu (line 236) | struct menu
  type file_type (line 237) | enum file_type
  type menu_item (line 239) | struct menu_item
  type menu_item (line 244) | struct menu_item
  type menu_item (line 244) | struct menu_item
  type menu_item (line 282) | struct menu_item
  type menu (line 282) | struct menu
  type menu_item (line 283) | struct menu_item
  type menu_item (line 285) | struct menu_item
  type menu_item (line 303) | struct menu_item
  type menu_item (line 303) | struct menu_item
  type menu_item (line 309) | struct menu_item
  function menu_update_size (line 329) | void menu_update_size (struct menu *menu, const int posx, const int posy,
  function menu_item_free (line 349) | static void menu_item_free (struct menu_item *mi)
  function menu_free (line 361) | void menu_free (struct menu *menu)
  function menu_driver (line 380) | void menu_driver (struct menu *menu, const enum menu_request req)
  type menu_item (line 443) | struct menu_item
  type menu (line 443) | struct menu
  function make_item_visible (line 450) | static void make_item_visible (struct menu *menu, struct menu_item *mi)
  function menu_setcurritem (line 471) | static void menu_setcurritem (struct menu *menu, struct menu_item *mi)
  function menu_setcurritem_title (line 481) | void menu_setcurritem_title (struct menu *menu, const char *title)
  type menu_item (line 494) | struct menu_item
  type menu (line 494) | struct menu
  type menu_item (line 497) | struct menu_item
  function menu_set_state (line 508) | void menu_set_state (struct menu *menu, const struct menu_state *st)
  function menu_set_items_numbering (line 519) | void menu_set_items_numbering (struct menu *menu, const int number)
  function menu_get_state (line 526) | void menu_get_state (const struct menu *menu, struct menu_state *st)
  function menu_unmark_item (line 534) | void menu_unmark_item (struct menu *menu)
  type menu (line 541) | struct menu
  type menu (line 541) | struct menu
  type menu (line 543) | struct menu
  type menu_item (line 544) | struct menu_item
  function menu_item_set_attr_normal (line 568) | void menu_item_set_attr_normal (struct menu_item *mi, const int attr)
  function menu_item_set_attr_sel (line 575) | void menu_item_set_attr_sel (struct menu_item *mi, const int attr)
  function menu_item_set_attr_sel_marked (line 582) | void menu_item_set_attr_sel_marked (struct menu_item *mi, const int attr)
  function menu_item_set_attr_marked (line 589) | void menu_item_set_attr_marked (struct menu_item *mi, const int attr)
  function menu_item_set_time (line 596) | void menu_item_set_time (struct menu_item *mi, const char *time)
  function menu_item_set_format (line 605) | void menu_item_set_format (struct menu_item *mi, const char *format)
  function menu_item_set_queue_pos (line 617) | void menu_item_set_queue_pos (struct menu_item *mi, const int pos)
  function menu_set_show_time (line 624) | void menu_set_show_time (struct menu *menu, const int t)
  function menu_set_show_format (line 631) | void menu_set_show_format (struct menu *menu, const bool t)
  function menu_set_info_attr_normal (line 638) | void menu_set_info_attr_normal (struct menu *menu, const int attr)
  function menu_set_info_attr_sel (line 645) | void menu_set_info_attr_sel (struct menu *menu, const int attr)
  function menu_set_info_attr_marked (line 652) | void menu_set_info_attr_marked (struct menu *menu, const int attr)
  function menu_set_info_attr_sel_marked (line 659) | void menu_set_info_attr_sel_marked (struct menu *menu, const int attr)
  function menu_item_get_type (line 666) | enum file_type menu_item_get_type (const struct menu_item *mi)
  type menu_item (line 673) | struct menu_item
  function menu_item_set_title (line 680) | void menu_item_set_title (struct menu_item *mi, const char *title)
  function menu_nitems (line 689) | int menu_nitems (const struct menu *menu)
  type menu_item (line 696) | struct menu_item
  type menu (line 696) | struct menu
  type rb_node (line 698) | struct rb_node
  type menu_item (line 707) | struct menu_item
  function menu_mark_item (line 710) | void menu_mark_item (struct menu *menu, const char *file)
  function menu_renumber_items (line 722) | static void menu_renumber_items (struct menu *menu)
  function menu_delete (line 735) | static void menu_delete (struct menu *menu, struct menu_item *mi)
  function menu_del_item (line 766) | void menu_del_item (struct menu *menu, const char *fname)
  function menu_item_set_align (line 779) | void menu_item_set_align (struct menu_item *mi, const enum menu_align al...
  function menu_setcurritem_file (line 786) | void menu_setcurritem_file (struct menu *menu, const char *file)
  function menu_is_visible (line 798) | int menu_is_visible (const struct menu *menu, const struct menu_item *mi)
  function menu_items_swap (line 810) | static void menu_items_swap (struct menu *menu, struct menu_item *mi1,
  function menu_swap_items (line 876) | void menu_swap_items (struct menu *menu, const char *file1, const char *...
  function menu_make_visible (line 894) | void menu_make_visible (struct menu *menu, const char *file)

FILE: menu.h
  type menu_request (line 23) | enum menu_request
  type menu_align (line 33) | enum menu_align
  type menu_item (line 42) | struct menu_item
  type menu (line 67) | struct menu
  type menu_state (line 99) | struct menu_state
  type menu (line 105) | struct menu
  type menu_item (line 107) | struct menu_item
  type menu (line 107) | struct menu
  type file_type (line 108) | enum file_type
  type menu_item (line 110) | struct menu_item
  type menu_item (line 111) | struct menu_item
  type menu_item (line 112) | struct menu_item
  type menu_item (line 113) | struct menu_item
  type menu_item (line 115) | struct menu_item
  type menu_item (line 116) | struct menu_item
  type menu_item (line 117) | struct menu_item
  type menu (line 119) | struct menu
  type menu (line 120) | struct menu
  type menu_request (line 120) | enum menu_request
  type menu (line 121) | struct menu
  type menu (line 122) | struct menu
  type menu (line 123) | struct menu
  type menu (line 124) | struct menu
  type menu (line 125) | struct menu
  type menu_state (line 125) | struct menu_state
  type menu (line 126) | struct menu
  type menu_state (line 126) | struct menu_state
  type menu (line 127) | struct menu
  type menu (line 129) | struct menu
  type menu (line 130) | struct menu
  type menu (line 130) | struct menu
  type menu (line 131) | struct menu
  type menu (line 132) | struct menu
  type menu (line 133) | struct menu
  type menu (line 134) | struct menu
  type menu (line 135) | struct menu
  type menu (line 136) | struct menu
  type menu (line 137) | struct menu
  type file_type (line 138) | enum file_type
  type menu_item (line 138) | struct menu_item
  type menu_item (line 139) | struct menu_item
  type menu_item (line 140) | struct menu_item
  type menu (line 140) | struct menu
  type menu_item (line 141) | struct menu_item
  type menu (line 142) | struct menu
  type menu_item (line 143) | struct menu_item
  type menu (line 143) | struct menu
  type menu (line 144) | struct menu
  type menu_item (line 145) | struct menu_item
  type menu_align (line 145) | enum menu_align
  type menu (line 146) | struct menu
  type menu_item (line 146) | struct menu_item
  type menu (line 147) | struct menu
  type menu (line 148) | struct menu
  type menu (line 149) | struct menu

FILE: null_out.c
  type sound_params (line 23) | struct sound_params
  function null_open (line 25) | static int null_open (struct sound_params *sound_params)
  function null_close (line 31) | static void null_close ()
  function null_play (line 36) | static int null_play (const char *unused ATTR_UNUSED, const size_t size)
  function null_read_mixer (line 42) | static int null_read_mixer ()
  function null_set_mixer (line 47) | static void null_set_mixer (int unused ATTR_UNUSED)
  function null_get_buff_fill (line 51) | static int null_get_buff_fill ()
  function null_reset (line 56) | static int null_reset ()
  function null_init (line 61) | static int null_init (struct output_driver_caps *caps)
  function null_get_rate (line 70) | static int null_get_rate ()
  function null_toggle_mixer_channel (line 75) | static void null_toggle_mixer_channel ()
  function null_funcs (line 84) | void null_funcs (struct hw_funcs *funcs)

FILE: null_out.h
  type hw_funcs (line 8) | struct hw_funcs

FILE: options.c
  type option (line 48) | struct option
  type option (line 61) | struct option
  function hash (line 66) | static unsigned int hash (const char * str)
  function find_option (line 77) | static int find_option (const char *name, enum option_type type)
  function find_free (line 106) | static int find_free (unsigned int h)
  function check_range (line 127) | static int check_range (int opt, ...)
  function check_discrete (line 176) | static int check_discrete (int opt, ...)
  function check_length (line 222) | static int check_length (int opt, ...)
  function check_function (line 247) | static int check_function (int opt, ...)
  function check_true (line 274) | static int check_true (int unused ATTR_UNUSED, ...)
  function init_option (line 281) | static int init_option (const char *name, enum option_type type)
  function add_int (line 305) | static void add_int (const char *name, const int value, options_t_check ...
  function add_bool (line 325) | static void add_bool (const char *name, const bool value)
  function add_str (line 335) | static void add_str (const char *name, const char *value, options_t_chec...
  function add_symb (line 361) | static void add_symb (const char *name, const char *value, const int cou...
  function add_list (line 391) | static void add_list (const char *name, const char *value, options_t_che...
  function options_set_int (line 418) | void options_set_int (const char *name, const int value)
  function options_set_bool (line 428) | void options_set_bool (const char *name, const bool value)
  function options_set_symb (line 438) | void options_set_symb (const char *name, const char *value)
  function options_set_str (line 456) | void options_set_str (const char *name, const char *value)
  function options_set_list (line 469) | void options_set_list (const char *name, const char *value, bool append)
  function options_set_pair (line 484) | bool options_set_pair (const char *name, const char *value, bool append)
  function options_ignore_config (line 537) | void options_ignore_config (const char *name)
  function options_init (line 555) | void options_init ()
  function options_check_int (line 755) | int options_check_int (const char *name, const int val)
  function options_check_bool (line 769) | int options_check_bool (const char *name, const bool val)
  function options_check_str (line 782) | int options_check_str (const char *name, const char *val)
  function options_check_symb (line 793) | int options_check_symb (const char *name, const char *val)
  function options_check_list (line 804) | int options_check_list (const char *name, const char *val)
  function options_was_defaulted (line 832) | int options_was_defaulted (const char *name)
  function set_option (line 974) | static bool set_option (const char *name, const char *value_in, bool app...
  function sanity_check (line 1015) | static void sanity_check ()
  function options_parse (line 1022) | void options_parse (const char *config_file)
  function options_free (line 1155) | void options_free ()
  function options_get_int (line 1186) | int options_get_int (const char *name)
  function options_get_bool (line 1196) | bool options_get_bool (const char *name)
  function lists_t_strs (line 1226) | lists_t_strs *options_get_list (const char *name)
  function options_get_type (line 1236) | enum option_type options_get_type (const char *name)

FILE: options.h
  type option_type (line 10) | enum option_type
  type option_type (line 42) | enum option_type

FILE: oss.c
  type sound_params (line 54) | struct sound_params
  function open_dev (line 67) | static int open_dev ()
  function set_capabilities (line 82) | static int set_capabilities (struct output_driver_caps *caps)
  function oss_mixer_name_to_channel (line 187) | static int oss_mixer_name_to_channel (const char *name)
  function oss_init (line 199) | static int oss_init (struct output_driver_caps *caps)
  function oss_shutdown (line 238) | static void oss_shutdown ()
  function oss_close (line 248) | static void oss_close ()
  function oss_set_params (line 263) | static int oss_set_params ()
  function oss_open (line 338) | static int oss_open (struct sound_params *sound_params)
  function oss_play (line 356) | static int oss_play (const char *buff, const size_t size)
  function oss_get_buff_fill (line 404) | static int oss_get_buff_fill ()
  function oss_reset (line 420) | static int oss_reset ()
  function oss_toggle_mixer_channel (line 441) | static void oss_toggle_mixer_channel ()
  function oss_get_rate (line 462) | static int oss_get_rate ()
  function oss_funcs (line 467) | void oss_funcs (struct hw_funcs *funcs)

FILE: oss.h
  type hw_funcs (line 10) | struct hw_funcs

FILE: out_buf.c
  type out_buf (line 41) | struct out_buf
  function set_realtime_prio (line 78) | static void set_realtime_prio ()
  type out_buf (line 100) | struct out_buf
  type out_buf (line 100) | struct out_buf
  type out_buf (line 224) | struct out_buf
  type out_buf (line 227) | struct out_buf
  type out_buf (line 231) | struct out_buf
  function out_buf_free (line 260) | void out_buf_free (struct out_buf *buf)
  function out_buf_put (line 302) | int out_buf_put (struct out_buf *buf, const char *data, int size)
  function out_buf_pause (line 339) | void out_buf_pause (struct out_buf *buf)
  function out_buf_unpause (line 347) | void out_buf_unpause (struct out_buf *buf)
  function out_buf_stop (line 357) | void out_buf_stop (struct out_buf *buf)
  function out_buf_reset (line 374) | void out_buf_reset (struct out_buf *buf)
  function out_buf_time_set (line 387) | void out_buf_time_set (struct out_buf *buf, const float time)
  function out_buf_time_get (line 399) | int out_buf_time_get (struct out_buf *buf)
  function out_buf_set_free_callback (line 411) | void out_buf_set_free_callback (struct out_buf *buf,
  function out_buf_get_free (line 421) | int out_buf_get_free (struct out_buf *buf)
  function out_buf_get_fill (line 434) | int out_buf_get_fill (struct out_buf *buf)
  function out_buf_wait (line 450) | void out_buf_wait (struct out_buf *buf)

FILE: out_buf.h
  type out_buf (line 12) | struct out_buf
  type out_buf (line 14) | struct out_buf
  type out_buf (line 15) | struct out_buf
  type out_buf (line 16) | struct out_buf
  type out_buf (line 17) | struct out_buf
  type out_buf (line 18) | struct out_buf
  type out_buf (line 19) | struct out_buf
  type out_buf (line 20) | struct out_buf
  type out_buf (line 21) | struct out_buf
  type out_buf (line 22) | struct out_buf
  type out_buf (line 23) | struct out_buf
  type out_buf (line 25) | struct out_buf
  type out_buf (line 26) | struct out_buf
  type out_buf (line 27) | struct out_buf

FILE: player.c
  type request (line 40) | enum request
  type bitrate_list_node (line 49) | struct bitrate_list_node
  type bitrate_list (line 59) | struct bitrate_list
  type md5_data (line 66) | struct md5_data {
  type precache (line 72) | struct precache
  type precache (line 87) | struct precache
  type request (line 93) | enum request
  type file_tags (line 104) | struct file_tags
  type io_stream (line 110) | struct io_stream
  type bitrate_list (line 115) | struct bitrate_list
  function bitrate_list_init (line 117) | static void bitrate_list_init (struct bitrate_list *b)
  function bitrate_list_empty (line 126) | static void bitrate_list_empty (struct bitrate_list *b)
  function bitrate_list_destroy (line 147) | static void bitrate_list_destroy (struct bitrate_list *b)
  function bitrate_list_add (line 160) | static void bitrate_list_add (struct bitrate_list *b, const int time,
  function bitrate_list_get (line 196) | static int bitrate_list_get (struct bitrate_list *b, const int time)
  function update_time (line 224) | static void update_time ()
  type precache (line 238) | struct precache
  type precache (line 238) | struct precache
  type sound_params (line 240) | struct sound_params
  type decoder_error (line 241) | struct decoder_error
  function start_precache (line 323) | static void start_precache (struct precache *precache, const char *file)
  function precache_wait (line 341) | static void precache_wait (struct precache *precache)
  function precache_reset (line 358) | static void precache_reset (struct precache *precache)
  function player_init (line 369) | void player_init ()
  function show_tags (line 376) | static void show_tags (const struct file_tags *tags DEBUG_ONLY)
  function update_tags (line 385) | static void update_tags (const struct decoder *f, void *decoder_data,
  function buf_free_cb (line 429) | static void buf_free_cb ()
  function decode_loop (line 440) | static void decode_loop (const struct decoder *f, void *decoder_data,
  function log_md5_sum (line 635) | static void log_md5_sum (const char *file, struct sound_params sound_par...
  function play_file (line 685) | static void play_file (const char *file, const struct decoder *f,
  function play_stream (line 798) | static void play_stream (const struct decoder *f, struct out_buf *out_buf)
  function fill_cb (line 832) | static void fill_cb (struct io_stream *unused1 ATTR_UNUSED, size_t fill,
  function player (line 846) | void player (const char *file, const char *next_file, struct out_buf *ou...
  function player_cleanup (line 906) | void player_cleanup ()
  function player_reset (line 927) | void player_reset ()
  function player_stop (line 932) | void player_stop ()
  function player_seek (line 949) | void player_seek (const int sec)
  function player_jump_to (line 963) | void player_jump_to (const int sec)
  function player_pause (line 975) | void player_pause ()
  function player_unpause (line 983) | void player_unpause ()
  type file_tags (line 993) | struct file_tags
  type file_tags (line 995) | struct file_tags

FILE: player.h
  type out_buf (line 13) | struct out_buf
  type file_tags (line 19) | struct file_tags

FILE: playlist.c
  function tags_free (line 41) | void tags_free (struct file_tags *tags)
  function tags_clear (line 55) | void tags_clear (struct file_tags *tags)
  function tags_copy (line 74) | void tags_copy (struct file_tags *dst, const struct file_tags *src)
  type file_tags (line 93) | struct file_tags
  type file_tags (line 95) | struct file_tags
  type file_tags (line 97) | struct file_tags
  type file_tags (line 97) | struct file_tags
  type file_tags (line 108) | struct file_tags
  type file_tags (line 108) | struct file_tags
  type file_tags (line 110) | struct file_tags
  function rb_compare (line 120) | static int rb_compare (const void *a, const void *b, const void *adata)
  function rb_fname_compare (line 129) | static int rb_fname_compare (const void *key, const void *data,
  function plist_deleted (line 140) | inline int plist_deleted (const struct plist *plist, const int num)
  function plist_init (line 148) | void plist_init (struct plist *plist)
  type plist_item (line 162) | struct plist_item
  type plist_item (line 164) | struct plist_item
  type plist_item (line 166) | struct plist_item
  type plist_item (line 166) | struct plist_item
  function plist_add (line 180) | int plist_add (struct plist *plist, const char *file_name)
  function plist_item_copy (line 214) | void plist_item_copy (struct plist_item *dst, const struct plist_item *src)
  type plist (line 237) | struct plist
  function plist_next (line 254) | int plist_next (struct plist *plist, int num)
  function plist_prev (line 271) | int plist_prev (struct plist *plist, int num)
  function plist_free_item_fields (line 284) | void plist_free_item_fields (struct plist_item *item)
  function plist_clear (line 305) | void plist_clear (struct plist *plist)
  function plist_free (line 325) | void plist_free (struct plist *plist)
  function plist_sort_fname (line 337) | void plist_sort_fname (struct plist *plist)
  function plist_find_fname (line 374) | int plist_find_fname (struct plist *plist, const char *file)
  function plist_find_del_fname (line 393) | int plist_find_del_fname (const struct plist *plist, const char *file)
  type plist (line 416) | struct plist
  type file_tags (line 438) | struct file_tags
  function check_zero (line 461) | static inline void check_zero (const char *x)
  function do_title_expn (line 468) | static void do_title_expn (char *dest, int size, const char *fmt,
  type file_tags (line 576) | struct file_tags
  type file_tags (line 585) | struct file_tags
  function plist_add_from_item (line 591) | int plist_add_from_item (struct plist *plist, const struct plist_item *i...
  function plist_delete (line 605) | void plist_delete (struct plist *plist, const int num)
  function plist_count (line 635) | int plist_count (const struct plist *plist)
  function plist_set_title_tags (line 643) | void plist_set_title_tags (struct plist *plist, const int num,
  function plist_set_title_file (line 654) | void plist_set_title_file (struct plist *plist, const int num,
  function plist_set_file (line 674) | void plist_set_file (struct plist *plist, const int num, const char *file)
  function plist_cat (line 691) | void plist_cat (struct plist *a, struct plist *b)
  function plist_set_item_time (line 710) | void plist_set_item_time (struct plist *plist, const int num, const int ...
  function get_item_time (line 740) | int get_item_time (const struct plist *plist, const int i)
  function plist_total_time (line 755) | int plist_total_time (const struct plist *plist, int *all_files)
  function plist_swap (line 763) | static void plist_swap (struct plist *plist, const int a, const int b)
  function plist_shuffle (line 779) | void plist_shuffle (struct plist *plist)
  function plist_swap_first_fname (line 793) | void plist_swap_first_fname (struct plist *plist, const char *fname)
  function plist_set_serial (line 811) | void plist_set_serial (struct plist *plist, const int serial)
  function plist_get_serial (line 816) | int plist_get_serial (const struct plist *plist)
  function plist_last (line 823) | int plist_last (const struct plist *plist)
  function plist_file_type (line 835) | enum file_type plist_file_type (const struct plist *plist, const int num)
  function plist_remove_common_items (line 844) | void plist_remove_common_items (struct plist *a, struct plist *b)
  function plist_discard_tags (line 862) | void plist_discard_tags (struct plist *plist)
  function plist_set_tags (line 878) | void plist_set_tags (struct plist *plist, const int num,
  type file_tags (line 907) | struct file_tags
  type plist (line 907) | struct plist
  function plist_swap_files (line 919) | void plist_swap_files (struct plist *plist, const char *file1,
  function plist_get_position (line 944) | int plist_get_position (const struct plist *plist, int num)

FILE: playlist.h
  type tags_select (line 13) | enum tags_select
  type file_tags (line 19) | struct file_tags
  type file_type (line 29) | enum file_type
  type plist_item (line 39) | struct plist_item
  type plist (line 51) | struct plist
  type plist (line 64) | struct plist
  type plist (line 65) | struct plist
  type plist (line 66) | struct plist
  type plist_item (line 66) | struct plist_item
  type plist (line 67) | struct plist
  type plist (line 68) | struct plist
  type plist (line 69) | struct plist
  type plist (line 70) | struct plist
  type plist (line 71) | struct plist
  type plist (line 72) | struct plist
  type plist (line 73) | struct plist
  type plist (line 74) | struct plist
  type file_tags (line 75) | struct file_tags
  type file_tags (line 76) | struct file_tags
  type file_tags (line 77) | struct file_tags
  type file_tags (line 77) | struct file_tags
  type file_tags (line 78) | struct file_tags
  type file_tags (line 78) | struct file_tags
  type file_tags (line 79) | struct file_tags
  type file_tags (line 80) | struct file_tags
  type file_tags (line 81) | struct file_tags
  type plist (line 82) | struct plist
  type plist (line 83) | struct plist
  type plist (line 85) | struct plist
  type plist (line 87) | struct plist
  type plist (line 88) | struct plist
  type plist (line 89) | struct plist
  type plist (line 89) | struct plist
  type plist_item (line 90) | struct plist_item
  type plist (line 91) | struct plist
  type plist (line 92) | struct plist
  type plist (line 93) | struct plist
  type plist (line 94) | struct plist
  type plist (line 95) | struct plist
  type plist_item (line 96) | struct plist_item
  type plist_item (line 97) | struct plist_item
  type plist (line 98) | struct plist
  type plist (line 99) | struct plist
  type plist (line 100) | struct plist
  type plist (line 101) | struct plist
  type plist (line 102) | struct plist
  type plist_item (line 104) | struct plist_item
  type plist_item (line 104) | struct plist_item
  type file_type (line 105) | enum file_type
  type plist (line 105) | struct plist
  type plist (line 106) | struct plist
  type plist (line 106) | struct plist
  type plist (line 107) | struct plist
  type plist (line 108) | struct plist
  type file_tags (line 109) | struct file_tags
  type file_tags (line 110) | struct file_tags
  type plist (line 110) | struct plist
  type plist (line 111) | struct plist
  type plist (line 113) | struct plist

FILE: playlist_file.c
  function is_plist_file (line 37) | int is_plist_file (const char *name)
  function make_path (line 47) | static void make_path (char *buf, size_t buf_size, const char *cwd, char...
  function strip_string (line 64) | static void strip_string (char *str)
  function plist_load_m3u (line 80) | static int plist_load_m3u (struct plist *plist, const char *fname,
  function is_blank_line (line 190) | static int is_blank_line (const char *l)
  function plist_load_pls (line 292) | static int plist_load_pls (struct plist *plist, const char *fname,
  function plist_load (line 378) | int plist_load (struct plist *plist, const char *fname, const char *cwd,
  function plist_save (line 402) | int plist_save (struct plist *plist, const char *fname, const int save_s...

FILE: playlist_file.h
  type plist (line 8) | struct plist
  type plist (line 10) | struct plist

FILE: protocol.c
  type packet_buf (line 55) | struct packet_buf
  function get_int (line 74) | int get_int (int sock, int *i)
  function get_int_noblock (line 86) | enum noblock_io_status get_int_noblock (int sock, int *i)
  function send_int (line 106) | int send_int (int sock, int i)
  function get_long (line 119) | static int get_long (int sock, long *i)
  function send_long (line 133) | static int send_long (int sock, long i)
  function send_str (line 181) | int send_str (int sock, const char *str)
  function get_time (line 196) | int get_time (int sock, time_t *i)
  function send_time (line 208) | int send_time (int sock, time_t i)
  type packet_buf (line 219) | struct packet_buf
  type packet_buf (line 221) | struct packet_buf
  type packet_buf (line 223) | struct packet_buf
  type packet_buf (line 223) | struct packet_buf
  function packet_buf_free (line 231) | static void packet_buf_free (struct packet_buf *b)
  function packet_buf_add_space (line 240) | static void packet_buf_add_space (struct packet_buf *b, const size_t len)
  function packet_buf_add_int (line 251) | static void packet_buf_add_int (struct packet_buf *b, const int n)
  function packet_buf_add_str (line 261) | static void packet_buf_add_str (struct packet_buf *b, const char *str)
  function packet_buf_add_time (line 277) | static void packet_buf_add_time (struct packet_buf *b, const time_t n)
  function packet_buf_add_tags (line 287) | void packet_buf_add_tags (struct packet_buf *b, const struct file_tags *...
  function packet_buf_add_item (line 312) | void packet_buf_add_item (struct packet_buf *b, const struct plist_item ...
  function send_all (line 321) | static int send_all (int sock, const char *buf, const size_t size)
  function send_item (line 340) | int send_item (int sock, const struct plist_item *item)
  type file_tags (line 364) | struct file_tags
  type file_tags (line 366) | struct file_tags
  function send_tags (line 422) | int send_tags (int sock, const struct file_tags *tags)
  type plist_item (line 440) | struct plist_item
  type plist_item (line 442) | struct plist_item
  type move_ev_data (line 489) | struct move_ev_data
  type move_ev_data (line 491) | struct move_ev_data
  type move_ev_data (line 493) | struct move_ev_data
  type move_ev_data (line 493) | struct move_ev_data
  function event_push (line 512) | void event_push (struct event_queue *q, const int event, void *data)
  function event_pop (line 538) | void event_pop (struct event_queue *q)
  type event (line 556) | struct event
  type event_queue (line 556) | struct event_queue
  function free_tag_ev_data (line 563) | void free_tag_ev_data (struct tag_ev_response *d)
  function free_move_ev_data (line 572) | void free_move_ev_data (struct move_ev_data *m)
  type move_ev_data (line 583) | struct move_ev_data
  type move_ev_data (line 583) | struct move_ev_data
  type move_ev_data (line 585) | struct move_ev_data
  type move_ev_data (line 591) | struct move_ev_data
  type move_ev_data (line 591) | struct move_ev_data
  function free_event_data (line 599) | void free_event_data (const int type, void *data)
  function event_queue_free (line 617) | void event_queue_free (struct event_queue *q)
  function event_queue_init (line 629) | void event_queue_init (struct event_queue *q)
  type event (line 640) | struct event
  type event_queue (line 640) | struct event_queue
  type event (line 642) | struct event
  function event_queue_empty (line 657) | int event_queue_empty (const struct event_queue *q)
  type packet_buf (line 665) | struct packet_buf
  type event (line 665) | struct event
  type packet_buf (line 667) | struct packet_buf
  type tag_ev_response (line 687) | struct tag_ev_response
  type move_ev_data (line 696) | struct move_ev_data
  type move_ev_data (line 700) | struct move_ev_data
  function event_send_noblock (line 713) | enum noblock_io_status event_send_noblock (int sock, struct event_queue *q)

FILE: protocol.h
  type event (line 10) | struct event
  type event_queue (line 17) | struct event_queue
  type tag_ev_response (line 24) | struct tag_ev_response
  type move_ev_data (line 31) | struct move_ev_data
  type noblock_io_status (line 39) | enum noblock_io_status
  type noblock_io_status (line 152) | enum noblock_io_status
  type plist_item (line 158) | struct plist_item
  type plist_item (line 159) | struct plist_item
  type file_tags (line 160) | struct file_tags
  type file_tags (line 161) | struct file_tags
  type event_queue (line 163) | struct event_queue
  type event_queue (line 164) | struct event_queue
  type event (line 166) | struct event
  type event_queue (line 166) | struct event_queue
  type event_queue (line 167) | struct event_queue
  type event_queue (line 168) | struct event_queue
  type event_queue (line 169) | struct event_queue
  type noblock_io_status (line 170) | enum noblock_io_status
  type event_queue (line 170) | struct event_queue
  type tag_ev_response (line 171) | struct tag_ev_response
  type move_ev_data (line 172) | struct move_ev_data
  type move_ev_data (line 173) | struct move_ev_data
  type move_ev_data (line 173) | struct move_ev_data
  type move_ev_data (line 174) | struct move_ev_data

FILE: rbtree.c
  type rb_color (line 25) | enum rb_color { RB_RED, RB_BLACK }
  type rb_node (line 27) | struct rb_node
  type rb_tree (line 36) | struct rb_tree
  type rb_node (line 51) | struct rb_node
  function rb_left_rotate (line 53) | static void rb_left_rotate (struct rb_node **root, struct rb_node *x)
  function rb_right_rotate (line 77) | static void rb_right_rotate (struct rb_node **root, struct rb_node *x)
  function rb_insert_fixup (line 101) | static void rb_insert_fixup (struct rb_node **root, struct rb_node *z)
  function rb_delete_fixup (line 148) | static void rb_delete_fixup (struct rb_node **root, struct rb_node *x,
  function rb_insert (line 222) | void rb_insert (struct rb_tree *t, void *data)
  type rb_node (line 264) | struct rb_node
  type rb_tree (line 264) | struct rb_tree
  type rb_node (line 266) | struct rb_node
  function rb_is_null (line 288) | int rb_is_null (const struct rb_node *n)
  type rb_node (line 293) | struct rb_node
  function rb_set_data (line 298) | void rb_set_data (struct rb_node *n, const void *data)
  type rb_node (line 303) | struct rb_node
  type rb_node (line 303) | struct rb_node
  type rb_node (line 314) | struct rb_node
  type rb_tree (line 314) | struct rb_tree
  type rb_node (line 322) | struct rb_node
  type rb_node (line 322) | struct rb_node
  type rb_node (line 324) | struct rb_node
  function rb_delete (line 338) | void rb_delete (struct rb_tree *t, const void *key)
  type rb_tree (line 384) | struct rb_tree
  type rb_tree (line 388) | struct rb_tree
  function rb_destroy (line 403) | static void rb_destroy (struct rb_node *n)
  function rb_tree_clear (line 412) | void rb_tree_clear (struct rb_tree *t)
  function rb_tree_free (line 425) | void rb_tree_free (struct rb_tree *t)

FILE: rbtree.h
  type rb_tree (line 11) | struct rb_tree
  type rb_node (line 12) | struct rb_node
  type rb_tree (line 15) | struct rb_tree
  type rb_tree (line 18) | struct rb_tree
  type rb_tree (line 19) | struct rb_tree
  type rb_tree (line 22) | struct rb_tree
  type rb_node (line 23) | struct rb_node
  type rb_node (line 23) | struct rb_node
  type rb_node (line 24) | struct rb_node
  type rb_tree (line 24) | struct rb_tree
  type rb_node (line 25) | struct rb_node
  type rb_node (line 26) | struct rb_node
  type rb_node (line 27) | struct rb_node
  type rb_node (line 28) | struct rb_node
  type rb_tree (line 28) | struct rb_tree
  type rb_tree (line 29) | struct rb_tree

FILE: rcc.c
  function rcc_init (line 54) | void rcc_init ()
  function rcc_cleanup (line 72) | void rcc_cleanup ()

FILE: server.c
  type client (line 54) | struct client
  type client (line 66) | struct client
  type tags_cache (line 93) | struct tags_cache
  function write_pid_file (line 97) | static void write_pid_file ()
  function pid_t (line 109) | static pid_t check_pid_file ()
  function sig_chld (line 127) | static void sig_chld (int sig LOGIT_ONLY)
  function sig_exit (line 141) | static void sig_exit (int sig)
  function clients_init (line 152) | static void clients_init ()
  function clients_cleanup (line 162) | static void clients_cleanup ()
  function add_client (line 175) | static int add_client (int sock)
  function locking_client (line 199) | static int locking_client ()
  function client_lock (line 210) | static int client_lock (struct client *cli)
  function is_locking (line 225) | static int is_locking (const struct client *cli)
  function client_unlock (line 231) | static int client_unlock (struct client *cli)
  function client_index (line 244) | static int client_index (const struct client *cli)
  function del_client (line 254) | static void del_client (struct client *cli)
  function valid_pid (line 264) | static int valid_pid (const pid_t pid)
  function wake_up_server (line 269) | static void wake_up_server ()
  function redirect_output (line 279) | static void redirect_output (FILE *stream)
  function log_process_stack_size (line 292) | static void log_process_stack_size ()
  function log_pthread_stack_size (line 304) | static void log_pthread_stack_size ()
  function run_extern_cmd (line 324) | static void run_extern_cmd (const char *event)
  function server_init (line 355) | void server_init (int debugging, int foreground)
  function send_data_int (line 442) | static int send_data_int (const struct client *cli, const int data)
  function send_data_bool (line 453) | static int send_data_bool (const struct client *cli, const bool data)
  function send_data_str (line 465) | static int send_data_str (const struct client *cli, const char *str) {
  function add_event (line 472) | static void add_event (struct client *cli, const int event, void *data)
  function on_song_change (line 479) | static void on_song_change ()
  function is_plist_event (line 604) | static inline bool is_plist_event (const int event)
  function add_event_all (line 619) | static void add_event_all (const int event, const void *data)
  function flush_events (line 676) | static int flush_events (struct client *cli)
  function send_events (line 691) | static void send_events (fd_set *fds)
  function server_shutdown (line 707) | static void server_shutdown ()
  function busy (line 724) | static void busy (int sock)
  function req_list_add (line 732) | static int req_list_add (struct client *cli)
  function req_queue_add (line 749) | static int req_queue_add (const struct client *cli)
  function req_play (line 784) | static int req_play (struct client *cli)
  function req_seek (line 799) | static int req_seek (struct client *cli)
  function req_jump_to (line 813) | static int req_jump_to (struct client *cli)
  function server_error (line 826) | void server_error (const char *file, int line, const char *function,
  function send_sname (line 834) | static int send_sname (struct client *cli)
  function valid_sync_option (line 847) | static int valid_sync_option (const char *name)
  function send_option (line 856) | static int send_option (struct client *cli)
  function get_set_option (line 881) | static int get_set_option (struct client *cli)
  function set_mixer (line 906) | static int set_mixer (struct client *cli)
  function delete_item (line 918) | static int delete_item (struct client *cli)
  function req_queue_del (line 932) | static int req_queue_del (const struct client *cli)
  function find_sending_plist (line 950) | static int find_sending_plist ()
  function get_client_plist (line 961) | static int get_client_plist (struct client *cli)
  function find_cli_requesting_plist (line 992) | static int find_cli_requesting_plist ()
  function req_send_plist (line 1004) | static int req_send_plist (struct client *cli)
  function req_send_queue (line 1076) | static int req_send_queue (struct client *cli)
  function plist_sync_cmd (line 1120) | static int plist_sync_cmd (struct client *cli, const int cmd)
  function req_plist_get_serial (line 1172) | static int req_plist_get_serial (struct client *cli)
  function req_plist_set_serial (line 1180) | static int req_plist_set_serial (struct client *cli)
  function gen_serial (line 1199) | static int gen_serial (const struct client *cli)
  function send_serial (line 1221) | static int send_serial (struct client *cli)
  function req_get_tags (line 1231) | static int req_get_tags (struct client *cli)
  function req_get_mixer_channel_name (line 1256) | int req_get_mixer_channel_name (struct client *cli)
  function req_toggle_mixer_channel (line 1269) | void req_toggle_mixer_channel ()
  function req_toggle_softmixer (line 1276) | void req_toggle_softmixer ()
  function update_eq_name (line 1282) | void update_eq_name()
  function req_toggle_equalizer (line 1311) | void req_toggle_equalizer ()
  function req_equalizer_refresh (line 1318) | void req_equalizer_refresh()
  function req_equalizer_prev (line 1327) | void req_equalizer_prev()
  function req_equalizer_next (line 1334) | void req_equalizer_next()
  function req_toggle_make_mono (line 1341) | void req_toggle_make_mono()
  function get_file_tags (line 1353) | static int get_file_tags (const int cli_id)
  function abort_tags_requests (line 1371) | static int abort_tags_requests (const int cli_id)
  function req_list_move (line 1385) | static int req_list_move (struct client *cli)
  function req_queue_move (line 1406) | static int req_queue_move (const struct client *cli)
  function handle_command (line 1431) | static void handle_command (const int client_id)
  function add_clients_fds (line 1660) | static void add_clients_fds (fd_set *read, fd_set *write)
  function max_fd (line 1677) | static int max_fd (int max)
  function handle_clients (line 1691) | static void handle_clients (fd_set *fds)
  function close_clients (line 1709) | static void close_clients ()
  function server_loop (line 1722) | void server_loop ()
  function set_info_bitrate (line 1795) | void set_info_bitrate (const int bitrate)
  function set_info_channels (line 1801) | void set_info_channels (const int channels)
  function set_info_rate (line 1807) | void set_info_rate (const int rate)
  function set_info_avg_bitrate (line 1813) | void set_info_avg_bitrate (const int avg_bitrate)
  function state_change (line 1820) | void state_change ()
  function ctime_change (line 1825) | void ctime_change ()
  function tags_change (line 1830) | void tags_change ()
  function status_msg (line 1835) | void status_msg (const char *msg)
  function tags_response (line 1840) | void tags_response (const int client_id, const char *file,
  function ev_audio_start (line 1860) | void ev_audio_start ()
  function ev_audio_stop (line 1865) | void ev_audio_stop ()
  function server_queue_pop (line 1875) | void server_queue_pop (const char *filename)

FILE: server.h
  type file_tags (line 25) | struct file_tags

FILE: sndio_out.c
  type sio_hdl (line 31) | struct sio_hdl
  type sound_params (line 33) | struct sound_params
  function volume_cb (line 37) | static void volume_cb (void *unused ATTR_UNUSED, unsigned int vol)
  function sndio_init (line 42) | static int sndio_init (struct output_driver_caps *caps)
  function sndio_shutdown (line 53) | static void sndio_shutdown ()
  function sndio_open (line 60) | static int sndio_open (struct sound_params *sound_params)
  function sndio_play (line 98) | static int sndio_play (const char *buff, const size_t size)
  function sndio_close (line 111) | static void sndio_close ()
  function sndio_read_mixer (line 120) | static int sndio_read_mixer ()
  function sndio_set_mixer (line 125) | static void sndio_set_mixer (int vol)
  function sndio_get_buff_fill (line 131) | static int sndio_get_buff_fill ()
  function sndio_reset (line 141) | static int sndio_reset ()
  function sndio_get_rate (line 151) | static int sndio_get_rate ()
  function sndio_toggle_mixer_channel (line 158) | static void sndio_toggle_mixer_channel ()
  function sndio_funcs (line 168) | void sndio_funcs (struct hw_funcs *funcs)

FILE: sndio_out.h
  type hw_funcs (line 10) | struct hw_funcs

FILE: softmixer.c
  function softmixer_init (line 52) | void softmixer_init()
  function softmixer_shutdown (line 62) | void softmixer_shutdown()
  function softmixer_set_value (line 69) | void softmixer_set_value(const int val)
  function softmixer_get_value (line 77) | int softmixer_get_value()
  function softmixer_set_active (line 82) | void softmixer_set_active(int act)
  function softmixer_is_active (line 90) | int softmixer_is_active()
  function softmixer_set_mono (line 95) | void softmixer_set_mono(int mono)
  function softmixer_is_mono (line 103) | int softmixer_is_mono()
  function softmixer_read_config (line 125) | static void softmixer_read_config()
  function softmixer_write_config (line 235) | static void softmixer_write_config()
  function softmixer_process_buffer (line 257) | void softmixer_process_buffer(char *buf, size_t size, const struct sound...
  function process_buffer_u8 (line 353) | static void process_buffer_u8(uint8_t *buf, size_t samples)
  function process_buffer_s8 (line 371) | static void process_buffer_s8(int8_t *buf, size_t samples)
  function process_buffer_u16 (line 387) | static void process_buffer_u16(uint16_t *buf, size_t samples)
  function process_buffer_s16 (line 405) | static void process_buffer_s16(int16_t *buf, size_t samples)
  function process_buffer_u32 (line 421) | static void process_buffer_u32(uint32_t *buf, size_t samples)
  function process_buffer_s32 (line 439) | static void process_buffer_s32(int32_t *buf, size_t samples)
  function process_buffer_float (line 455) | static void process_buffer_float(float *buf, size_t samples)
  function mix_mono_u8 (line 471) | static void mix_mono_u8(uint8_t *buf, int channels, size_t samples)
  function mix_mono_s8 (line 499) | static void mix_mono_s8(int8_t *buf, int channels, size_t samples)
  function mix_mono_u16 (line 527) | static void mix_mono_u16(uint16_t *buf, int channels, size_t samples)
  function mix_mono_s16 (line 555) | static void mix_mono_s16(int16_t *buf, int channels, size_t samples)
  function mix_mono_u32 (line 583) | static void mix_mono_u32(uint32_t *buf, int channels, size_t samples)
  function mix_mono_s32 (line 611) | static void mix_mono_s32(int32_t *buf, int channels, size_t samples)
  function mix_mono_float (line 639) | static void mix_mono_float(float *buf, int channels, size_t samples)

FILE: softmixer.h
  type sound_params (line 37) | struct sound_params

FILE: tags_cache.c
  type u_char (line 30) | typedef unsigned char u_char;
  type u_short (line 31) | typedef unsigned short u_short;
  type u_int (line 32) | typedef unsigned int u_int;
  type u_long (line 33) | typedef unsigned long int u_long;
  type request_queue_node (line 79) | struct request_queue_node
  type request_queue (line 86) | struct request_queue
  type tags_cache (line 92) | struct tags_cache
  type cache_record (line 113) | struct cache_record
  function request_queue_init (line 135) | static void request_queue_init (struct request_queue *q)
  function request_queue_clear (line 143) | static void request_queue_clear (struct request_queue *q)
  function request_queue_clear_up_to (line 160) | static void request_queue_clear_up_to (struct request_queue *q,
  function request_queue_add (line 183) | static void request_queue_add (struct request_queue *q, const char *file,
  function request_queue_empty (line 207) | static int request_queue_empty (const struct request_queue *q)
  type request_queue (line 216) | struct request_queue
  type request_queue_node (line 218) | struct request_queue_node
  function strlen_null (line 239) | static size_t strlen_null (const char *s)
  type cache_record (line 246) | struct cache_record
  function cache_record_deserialize (line 307) | static int cache_record_deserialize (struct cache_record *rec,
  type tags_cache (line 384) | struct tags_cache
  type tags_cache (line 392) | struct tags_cache
  function tags_cache_remove_rec (line 428) | static void tags_cache_remove_rec (struct tags_cache *c, const char *fname)
  function tags_cache_gc (line 450) | static void tags_cache_gc (struct tags_cache *c)
  function tags_cache_sync (line 523) | static void tags_cache_sync (struct tags_cache *c)
  function tags_cache_add (line 540) | static void tags_cache_add (struct tags_cache *c, const char *file,
  type file_tags (line 578) | struct file_tags
  type file_tags (line 579) | struct file_tags
  type tags_cache (line 604) | struct tags_cache
  type file_tags (line 609) | struct file_tags
  type cache_record (line 621) | struct cache_record
  type file_tags (line 653) | struct file_tags
  type tags_cache (line 653) | struct tags_cache
  type file_tags (line 656) | struct file_tags
  type file_tags (line 664) | struct file_tags
  type tags_cache (line 684) | struct tags_cache
  type tags_cache (line 692) | struct tags_cache
  type tags_cache (line 737) | struct tags_cache
  type tags_cache (line 740) | struct tags_cache
  type tags_cache (line 742) | struct tags_cache
  type tags_cache (line 742) | struct tags_cache
  function tags_cache_free (line 771) | void tags_cache_free (struct tags_cache *c)
  type tags_cache (line 826) | struct tags_cache
  type cache_record (line 831) | struct cache_record
  function tags_cache_add_request (line 863) | void tags_cache_add_request (struct tags_cache *c, const char *file,
  function tags_cache_clear_queue (line 887) | void tags_cache_clear_queue (struct tags_cache *c, int client_id)
  function tags_cache_clear_up_to (line 900) | void tags_cache_clear_up_to (struct tags_cache *c, const char *file,
  function db_err_cb (line 915) | static void db_err_cb (const DB_ENV *unused ATTR_UNUSED, const char *err...
  function db_msg_cb (line 928) | static void db_msg_cb (const DB_ENV *unused ATTR_UNUSED, const char *msg)
  function db_panic_cb (line 937) | static void db_panic_cb (DB_ENV *unused ATTR_UNUSED, int errval)
  function purge_directory (line 945) | static int purge_directory (const char *dir_path)
  function cache_version_matches (line 1046) | static int cache_version_matches (const char *cache_dir)
  function write_cache_version (line 1098) | static void write_cache_version (const char *cache_dir)
  function prepare_cache_dir (line 1127) | static int prepare_cache_dir (const char *cache_dir)
  function tags_cache_load (line 1151) | void tags_cache_load (struct tags_cache *c DB_ONLY,
  type file_tags (line 1245) | struct file_tags
  type tags_cache (line 1245) | struct tags_cache
  type file_tags (line 1248) | struct file_tags

FILE: tags_cache.h
  type file_tags (line 8) | struct file_tags
  type tags_cache (line 9) | struct tags_cache
  type tags_cache (line 12) | struct tags_cache
  type tags_cache (line 13) | struct tags_cache
  type tags_cache (line 16) | struct tags_cache
  type tags_cache (line 17) | struct tags_cache
  type tags_cache (line 21) | struct tags_cache
  type tags_cache (line 22) | struct tags_cache
  type file_tags (line 24) | struct file_tags
  type tags_cache (line 24) | struct tags_cache

FILE: themes.c
  function make_color (line 59) | static void make_color (const enum color_index index, const short foregr...
  function set_default_colors (line 73) | static void set_default_colors ()
  function set_bw_colors (line 118) | static void set_bw_colors ()
  function theme_parse_error (line 157) | static void theme_parse_error (const int line, const char *msg)
  function find_color_element_name (line 163) | static enum color_index find_color_element_name (const char *name)
  function find_color_name (line 219) | static short find_color_name (const char *name)
  function new_colordef (line 247) | static int new_colordef (const int line_num, const char *name, const sho...
  function parse_theme_element (line 305) | static int parse_theme_element (const int line_num, const char *name,
  function parse_rgb_color_value (line 395) | static short parse_rgb_color_value (const int line_num,
  function parse_theme_colordef (line 427) | static int parse_theme_colordef (const int line_num,
  function parse_theme_line (line 467) | static int parse_theme_line (const int line_num, char *line,
  function load_color_theme (line 485) | static int load_color_theme (const char *name, const int errors_are_fatal)
  function reset_colors_table (line 510) | static void reset_colors_table ()
  function theme_init (line 519) | void theme_init (bool has_xterm)
  function get_color (line 548) | int get_color (const enum color_index index)
  function themes_switch_theme (line 553) | void themes_switch_theme (const char *file)

FILE: themes.h
  type color_index (line 8) | enum color_index
  type color_index (line 50) | enum color_index

FILE: utf8.c
  function xwaddstr (line 130) | int xwaddstr (WINDOW *win, const char *str)
  function xmbstowcs (line 150) | static size_t xmbstowcs (wchar_t *dest, const char *src, size_t len,
  function xwaddnstr (line 206) | int xwaddnstr (WINDOW *win, const char *str, const int n)
  function xmvwaddstr (line 255) | int xmvwaddstr (WINDOW *win, const int y, const int x, const char *str)
  function xmvwaddnstr (line 271) | int xmvwaddnstr (WINDOW *win, const int y, const int x, const char *str,
  function xwprintw (line 288) | int xwprintw (WINDOW *win, const char *fmt, ...)
  function iconv_cleanup (line 312) | static void iconv_cleanup ()
  function utf8_init (line 319) | void utf8_init ()
  function utf8_cleanup (line 356) | void utf8_cleanup ()
  function strwidth (line 364) | size_t strwidth (const char *s)
Condensed preview — 158 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,468K chars).
[
  {
    "path": "AUTHORS",
    "chars": 33,
    "preview": "Damian Pietras <daper@daper.net>\n"
  },
  {
    "path": "COPYING",
    "chars": 17987,
    "preview": "\t\t    GNU GENERAL PUBLIC LICENSE\n\t\t       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc."
  },
  {
    "path": "ChangeLog",
    "chars": 19,
    "preview": "See the NEWS file.\n"
  },
  {
    "path": "Doxyfile",
    "chars": 4711,
    "preview": "PROJECT_NAME           = MOC\nPROJECT_NUMBER         = 2.6-alpha3\nOUTPUT_DIRECTORY       = technical_docs\nCREATE_SUBDIRS "
  },
  {
    "path": "INSTALL",
    "chars": 15578,
    "preview": "Installation Instructions\n*************************\n\nCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,"
  },
  {
    "path": "Makefile.am",
    "chars": 2248,
    "preview": "ACLOCAL_AMFLAGS = -I m4\nSUBDIRS = themes decoder_plugins\nAM_CPPFLAGS = -DSYSTEM_THEMES_DIR=\\\"$(pkgdatadir)/themes\\\" \\\n\t "
  },
  {
    "path": "NEWS",
    "chars": 37989,
    "preview": "   [Note that all relevant maintenance applied to the stable version has\n    also been applied to the development versio"
  },
  {
    "path": "README",
    "chars": 15702,
    "preview": "                                 MOC\n                      m u s i c  o n  c o n s o l e\n\n                          http"
  },
  {
    "path": "README.md",
    "chars": 16830,
    "preview": "# MOC: Music on Console\n\n  http://moc.daper.net\n\n![Screenshot](themes/transparent-background_screenshot_thumb.png?raw=tr"
  },
  {
    "path": "README_equalizer",
    "chars": 6911,
    "preview": "Preamble\n---\nThis document is meant to give you an overview on the idea of having a\nparametric equalizer for sound enhan"
  },
  {
    "path": "THANKS",
    "chars": 7937,
    "preview": "Thanks to all people who have helped us make MOC better, suggesting\nchanges or notifing about bugs:\n\nAlexis Ballier:\n\t* "
  },
  {
    "path": "TODO",
    "chars": 6415,
    "preview": "This file does not list all bugs which:\n\n- are known but rarely encountered,\n- are not visible to the user,\n- are progra"
  },
  {
    "path": "alsa.c",
    "chars": 19699,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "alsa.h",
    "chars": 150,
    "preview": "#ifndef ALSA_H\n#define ALSA_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid alsa_funcs (struct hw_funcs *funcs);\n\n#ifdef"
  },
  {
    "path": "audio.c",
    "chars": 28451,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004-2006 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "audio.h",
    "chars": 7906,
    "preview": "#ifndef AUDIO_H\n#define AUDIO_H\n\n#include <stdlib.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Sound formats.\n *\n * S"
  },
  {
    "path": "audio_conversion.c",
    "chars": 18334,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "audio_conversion.h",
    "chars": 909,
    "preview": "#ifndef AUDIO_CONVERSION_H\n#define AUDIO_CONVERSION_H\n\n#ifdef HAVE_STDINT_H\n# include <stdint.h>\n#endif\n\n#include <sys/t"
  },
  {
    "path": "common.c",
    "chars": 9414,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "common.h",
    "chars": 4725,
    "preview": "/*\n * The purpose of this header is to provide common functions and macros\n * used throughout MOC code.  It also provide"
  },
  {
    "path": "compat.c",
    "chars": 1221,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "compat.h",
    "chars": 1614,
    "preview": "/*\n * The purpose of this header is to provide functions and macros which\n * MOC code expects but which are missing or b"
  },
  {
    "path": "compiler.h",
    "chars": 1350,
    "preview": "/*\n * The purpose of this header is to configure the compiler and system\n * headers the way we want them to be.  It shou"
  },
  {
    "path": "config.example.in",
    "chars": 28676,
    "preview": "# This is a configuration file for the MOC player.  It should be named\n# 'config' and placed in the ~/.moc directory.  A"
  },
  {
    "path": "config.rpath",
    "chars": 18442,
    "preview": "#! /bin/sh\n# Output a system dependent set of variables, describing how to set the\n# run time search path of shared libr"
  },
  {
    "path": "configure.in",
    "chars": 15675,
    "preview": "AC_INIT([Music On Console],[2.6-alpha3],[mocmaint@daper.net],[moc],\n                           [http://moc.daper.net/])\n"
  },
  {
    "path": "decoder.c",
    "chars": 18572,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "decoder.h",
    "chars": 10500,
    "preview": "#ifndef DECODER_H\n#define DECODER_H\n\n#include \"audio.h\"\n#include \"playlist.h\"\n#include \"io.h\"\n\n#ifdef __cplusplus\nextern"
  },
  {
    "path": "decoder_plugins/Makefile.am",
    "chars": 550,
    "preview": "SUBDIRS =\n\nif BUILD_mp3\n    SUBDIRS += mp3\nendif\n\nif BUILD_aac\n    SUBDIRS += aac\nendif\n\nif BUILD_musepack\n    SUBDIRS +"
  },
  {
    "path": "decoder_plugins/aac/Makefile.am",
    "chars": 272,
    "preview": "lib_LTLIBRARIES = libaac_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibaac_decoder_la_LDFLAGS = @PLUGIN_LDFL"
  },
  {
    "path": "decoder_plugins/aac/aac.c",
    "chars": 14309,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005, 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free sof"
  },
  {
    "path": "decoder_plugins/aac/aac.m4",
    "chars": 701,
    "preview": "dnl libfaad2 (aac)\n\nAC_ARG_WITH(aac, AS_HELP_STRING([--without-aac],\n                                [Compile without AA"
  },
  {
    "path": "decoder_plugins/decoders.m4",
    "chars": 977,
    "preview": "DECODER_PLUGIN_DIR=decoder_plugins\nAC_SUBST([DECODER_PLUGIN_DIR])\n\ndnl libid3tag (with zlib)\nAC_CHECK_LIB(z, gzopen, [HA"
  },
  {
    "path": "decoder_plugins/ffmpeg/Makefile.am",
    "chars": 346,
    "preview": "lib_LTLIBRARIES = libffmpeg_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibffmpeg_decoder_la_LDFLAGS = @PLUGI"
  },
  {
    "path": "decoder_plugins/ffmpeg/ffmpeg.c",
    "chars": 34648,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005, 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free sof"
  },
  {
    "path": "decoder_plugins/ffmpeg/ffmpeg.m4",
    "chars": 2526,
    "preview": "dnl ffmpeg/libav\n\nAC_ARG_WITH(ffmpeg, AS_HELP_STRING([--without-ffmpeg],\n                                   [Compile wit"
  },
  {
    "path": "decoder_plugins/flac/Makefile.am",
    "chars": 269,
    "preview": "lib_LTLIBRARIES = libflac_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibflac_decoder_la_CFLAGS = $(LIBFLAC_C"
  },
  {
    "path": "decoder_plugins/flac/flac.c",
    "chars": 14524,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "decoder_plugins/flac/flac.m4",
    "chars": 455,
    "preview": "dnl FLAC\n\nAC_ARG_WITH(flac, AS_HELP_STRING([--without-flac],\n                                 [Compile without FLAC supp"
  },
  {
    "path": "decoder_plugins/modplug/Makefile.am",
    "chars": 287,
    "preview": "lib_LTLIBRARIES = libmodplug_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibmodplug_decoder_la_LDFLAGS = @PLU"
  },
  {
    "path": "decoder_plugins/modplug/modplug.c",
    "chars": 9488,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * libmodplug-plugin Copyright (C"
  },
  {
    "path": "decoder_plugins/modplug/modplug.m4",
    "chars": 490,
    "preview": "dnl libmodplug\n\nAC_ARG_WITH(modplug, AS_HELP_STRING([--without-modplug],\n                                    [Compile wi"
  },
  {
    "path": "decoder_plugins/mp3/Makefile.am",
    "chars": 274,
    "preview": "lib_LTLIBRARIES = libmp3_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibmp3_decoder_la_LDFLAGS = @PLUGIN_LDFL"
  },
  {
    "path": "decoder_plugins/mp3/mp3.c",
    "chars": 18255,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2002 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "decoder_plugins/mp3/mp3.m4",
    "chars": 491,
    "preview": "dnl libmad (mp3)\n\nAC_ARG_WITH(mp3, AS_HELP_STRING([--without-mp3],\n                                [Compile without mp3 "
  },
  {
    "path": "decoder_plugins/mp3/xing.c",
    "chars": 2071,
    "preview": "/*\n * mad - MPEG audio decoder\n * Copyright (C) 2000-2001 Robert Leslie\n *\n * This program is free software; you can red"
  },
  {
    "path": "decoder_plugins/mp3/xing.h",
    "chars": 1419,
    "preview": "/*\n * mad - MPEG audio decoder\n * Copyright (C) 2000-2001 Robert Leslie\n *\n * This program is free software; you can red"
  },
  {
    "path": "decoder_plugins/musepack/Makefile.am",
    "chars": 333,
    "preview": "lib_LTLIBRARIES = libmusepack_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibmusepack_decoder_la_LDFLAGS = @P"
  },
  {
    "path": "decoder_plugins/musepack/musepack.c",
    "chars": 11224,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "decoder_plugins/musepack/musepack.m4",
    "chars": 1763,
    "preview": "dnl libmpcdec\n\nAC_ARG_WITH(musepack, AS_HELP_STRING([--without-musepack],\n                                     [Compile "
  },
  {
    "path": "decoder_plugins/sidplay2/Makefile.am",
    "chars": 451,
    "preview": "lib_LTLIBRARIES = libsidplay2_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibsidplay2_decoder_la_LDFLAGS = @P"
  },
  {
    "path": "decoder_plugins/sidplay2/sidplay2.cc",
    "chars": 11748,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * libsidplay2-plugin Copyright ("
  },
  {
    "path": "decoder_plugins/sidplay2/sidplay2.h",
    "chars": 2381,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * libsidplay2-plugin Copyright ("
  },
  {
    "path": "decoder_plugins/sidplay2/sidplay2.m4",
    "chars": 1343,
    "preview": "dnl libsidplay2\n\nAC_ARG_WITH(sidplay2, AS_HELP_STRING([--without-sidplay2],\n                                     [Compil"
  },
  {
    "path": "decoder_plugins/sndfile/Makefile.am",
    "chars": 287,
    "preview": "lib_LTLIBRARIES = libsndfile_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibsndfile_decoder_la_LDFLAGS = @PLU"
  },
  {
    "path": "decoder_plugins/sndfile/sndfile.c",
    "chars": 7672,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "decoder_plugins/sndfile/sndfile.m4",
    "chars": 489,
    "preview": "dnl libsndfile\n\nAC_ARG_WITH(sndfile, AS_HELP_STRING([--without-sndfile],\n                                    [Compile wi"
  },
  {
    "path": "decoder_plugins/speex/Makefile.am",
    "chars": 271,
    "preview": "lib_LTLIBRARIES = libspeex_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibspeex_decoder_la_LDFLAGS = @PLUGIN_"
  },
  {
    "path": "decoder_plugins/speex/speex.c",
    "chars": 15931,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "decoder_plugins/speex/speex.m4",
    "chars": 469,
    "preview": "dnl speex\n\nAC_ARG_WITH(speex, AS_HELP_STRING([--without-speex],\n                                  [Compile without speex"
  },
  {
    "path": "decoder_plugins/timidity/Makefile.am",
    "chars": 295,
    "preview": "lib_LTLIBRARIES = libtimidity_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibtimidity_decoder_la_LDFLAGS = @P"
  },
  {
    "path": "decoder_plugins/timidity/timidity.c",
    "chars": 5542,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * libTiMidity-plugin Copyright ("
  },
  {
    "path": "decoder_plugins/timidity/timidity.m4",
    "chars": 507,
    "preview": "dnl libtimidity\n\nAC_ARG_WITH(timidity, AS_HELP_STRING([--without-timidity],\n                                     [Compil"
  },
  {
    "path": "decoder_plugins/vorbis/Makefile.am",
    "chars": 287,
    "preview": "lib_LTLIBRARIES = libvorbis_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibvorbis_decoder_la_LDFLAGS = @PLUGI"
  },
  {
    "path": "decoder_plugins/vorbis/vorbis.c",
    "chars": 10931,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2002 - 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "decoder_plugins/vorbis/vorbis.m4",
    "chars": 887,
    "preview": "dnl vorbis\n\nAC_ARG_WITH(vorbis, AS_HELP_STRING([--without-vorbis],\n                                   [Compile without O"
  },
  {
    "path": "decoder_plugins/wavpack/Makefile.am",
    "chars": 287,
    "preview": "lib_LTLIBRARIES = libwavpack_decoder.la\nlibdir = $(plugindir)/$(DECODER_PLUGIN_DIR)\nlibwavpack_decoder_la_LDFLAGS = @PLU"
  },
  {
    "path": "decoder_plugins/wavpack/wavpack.c",
    "chars": 7312,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * libwavpack-plugin Copyright (C"
  },
  {
    "path": "decoder_plugins/wavpack/wavpack.m4",
    "chars": 477,
    "preview": "dnl wavpack\n\nAC_ARG_WITH(wavpack, AS_HELP_STRING([--without-wavpack],\n                                    [Compile witho"
  },
  {
    "path": "doxy_pages/decoder_api.doxy",
    "chars": 8860,
    "preview": "/** \\page decoder_api Decoder API\n\n\\section decoder_api_introduction Introduction\n\nThis document is intended to make it "
  },
  {
    "path": "doxy_pages/main_page.doxy",
    "chars": 648,
    "preview": "/** \\mainpage Internal API documentation\n\n\\author Damian Pietras <daper (at) daper (dot) net>\n\n\\section introduction Int"
  },
  {
    "path": "doxy_pages/sound_output_driver_api.doxy",
    "chars": 331,
    "preview": "/** \\page sound_output_driver_api Sound output driver API\n\n\\section sound_output_driver_api_introduction Introduction\n\nT"
  },
  {
    "path": "equalizer.c",
    "chars": 23811,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004-2008 Damian Pietras <daper@daper.net>\n *\n * Equalizer-extension Copyr"
  },
  {
    "path": "equalizer.h",
    "chars": 435,
    "preview": "#ifndef EQUALIZER_H\n#define EQUALIZER_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid equalizer_init();\nvoid equalizer_s"
  },
  {
    "path": "fifo_buf.c",
    "chars": 3662,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "fifo_buf.h",
    "chars": 662,
    "preview": "#ifndef FIFO_BUF_H\n#define FIFO_BUF_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct fifo_buf;\n\nstruct fifo_buf *fifo_b"
  },
  {
    "path": "files.c",
    "chars": 16264,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "files.h",
    "chars": 1289,
    "preview": "#ifndef FILES_H\n#define FILES_H\n\n#include <stdio.h>\n#include \"lists.h\"\n#include \"playlist.h\"\n\n#ifdef __cplusplus\nextern "
  },
  {
    "path": "interface.c",
    "chars": 98843,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "interface.h",
    "chars": 1724,
    "preview": "\n#ifndef INTERFACE_H\n#define INTERFACE_H\n\n#include \"lists.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* The desired sta"
  },
  {
    "path": "interface_elements.c",
    "chars": 106341,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "interface_elements.h",
    "chars": 4880,
    "preview": "#ifndef INTERFACE_ELEMENTS_H\n#define INTERFACE_ELEMENTS_H\n\n#if defined HAVE_NCURSESW_CURSES_H\n# include <ncursesw/curses"
  },
  {
    "path": "io.c",
    "chars": 17734,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "io.h",
    "chars": 3915,
    "preview": "#ifndef IO_H\n#define IO_H\n\n#include <sys/types.h>\n#include <pthread.h>\n#ifdef HAVE_CURL\n# include <sys/socket.h>     /* "
  },
  {
    "path": "io_curl.c",
    "chars": 14970,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "io_curl.h",
    "chars": 436,
    "preview": "#ifndef IO_CURL_H\n#define IO_CURL_H\n\n#include \"io.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid io_curl_init ();\nvoid"
  },
  {
    "path": "jack.c",
    "chars": 9103,
    "preview": "/* Jack plugin for moc by Alex Norman <alex@neisis.net> 2005\n * moc by Copyright (C) 2004 Damian Pietras <daper@daper.ne"
  },
  {
    "path": "jack.h",
    "chars": 154,
    "preview": "#ifndef JACK_H\n#define JACK_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid moc_jack_funcs (struct hw_funcs *funcs);\n\n#i"
  },
  {
    "path": "keymap.example",
    "chars": 5698,
    "preview": "# This is the example keymap file for MOC.  You can define your own key\n# bindings for MOC commands by creating your own"
  },
  {
    "path": "keys.c",
    "chars": 21933,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "keys.h",
    "chars": 2756,
    "preview": "#ifndef KEYS_H\n#define KEYS_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nenum key_cmd\n{\n\tKEY_CMD_QUIT_CLIENT,\n\tKEY_CMD_GO,"
  },
  {
    "path": "lists.c",
    "chars": 8226,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2009 Damian Pietras <daper@daper.net> and John Fitzgerald\n *\n * This progr"
  },
  {
    "path": "lists.h",
    "chars": 1719,
    "preview": "#ifndef LISTS_H\n#define LISTS_H\n\n#include \"common.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct lists_strs "
  },
  {
    "path": "log.c",
    "chars": 7405,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "log.h",
    "chars": 1454,
    "preview": "#ifndef LOG_H\n#define LOG_H\n\n#include <stdio.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Suppress overly-enthusiastic"
  },
  {
    "path": "lyrics.c",
    "chars": 5545,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2008-2009 Geraud Le Falher and John Fitzgerald\n *\n * This program is free "
  },
  {
    "path": "lyrics.h",
    "chars": 599,
    "preview": "#ifndef  LYRICS_H\n#define  LYRICS_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef lists_t_strs *lyrics_t_formatter (l"
  },
  {
    "path": "m4/ax_c___attribute__.m4",
    "chars": 2551,
    "preview": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_cflags_gcc_option.m4",
    "chars": 6763,
    "preview": "dnl @synopsis AX_CFLAGS_GCC_OPTION (optionflag [,[shellvar][,[A][,[NA]]])\ndnl\ndnl AX_CFLAGS_GCC_OPTION(-fvomit-frame) wo"
  },
  {
    "path": "m4/ax_compare_version.m4",
    "chars": 6570,
    "preview": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_gcc_func_attribute.m4",
    "chars": 7533,
    "preview": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "m4/ax_gcc_var_attribute.m4",
    "chars": 4624,
    "preview": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-a"
  },
  {
    "path": "m4/ax_path_bdb.m4",
    "chars": 21065,
    "preview": "# ===========================================================================\n#        http://www.gnu.org/software/autoc"
  },
  {
    "path": "m4/ax_pthread.m4",
    "chars": 13758,
    "preview": "# ===========================================================================\n#        http://www.gnu.org/software/autoc"
  },
  {
    "path": "m4/ax_require_defined.m4",
    "chars": 1217,
    "preview": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-"
  },
  {
    "path": "m4/ax_with_curses.m4",
    "chars": 27923,
    "preview": "# ===========================================================================\n#      http://www.gnu.org/software/autocon"
  },
  {
    "path": "main.c",
    "chars": 31984,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004-2005 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "md5.c",
    "chars": 15461,
    "preview": "/* -*- buffer-read-only: t -*- vi: set ro: */\n/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n/* Functions to compute MD5 me"
  },
  {
    "path": "md5.h",
    "chars": 4309,
    "preview": "/* -*- buffer-read-only: t -*- vi: set ro: */\n/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n/* Declaration of functions an"
  },
  {
    "path": "menu.c",
    "chars": 19944,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2002 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "menu.h",
    "chars": 4799,
    "preview": "#ifndef MENU_H\n#define MENU_H\n\n#if defined HAVE_NCURSESW_CURSES_H\n# include <ncursesw/curses.h>\n#elif defined HAVE_NCURS"
  },
  {
    "path": "mocp.1",
    "chars": 14736,
    "preview": ".\\\" Start example.\n.de EX\n.  nr mE \\\\n(.f\n.  nf\n.  nh\n.  ft CW\n..\n.\n.\\\" End example.\n.de EE\n.  ft \\\\n(mE\n.  fi\n.  hy \\\\n"
  },
  {
    "path": "null_out.c",
    "chars": 1822,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "null_out.h",
    "chars": 158,
    "preview": "#ifndef NULL_OUT_H\n#define NULL_OUT_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid null_funcs (struct hw_funcs *funcs);"
  },
  {
    "path": "options.c",
    "chars": 33653,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "options.h",
    "chars": 1422,
    "preview": "#ifndef OPTIONS_H\n#define OPTIONS_H\n\n#include \"lists.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nenum option_type\n{\n\tOPT"
  },
  {
    "path": "oss.c",
    "chars": 10405,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2003 - 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "oss.h",
    "chars": 167,
    "preview": "#ifndef OSS_H\n#define OSS_H\n\n#include \"audio.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid oss_funcs (struct hw_funcs"
  },
  {
    "path": "out_buf.c",
    "chars": 10388,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004,2005 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "out_buf.h",
    "chars": 827,
    "preview": "#ifndef BUF_H\n#define BUF_H\n\n#include \"fifo_buf.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void out_buf_free_ca"
  },
  {
    "path": "player.c",
    "chars": 24721,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004-2005 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "player.h",
    "chars": 496,
    "preview": "#ifndef PLAYER_H\n#define PLAYER_H\n\n#include \"out_buf.h\"\n#include \"io.h\"\n#include \"playlist.h\"\n\n#ifdef __cplusplus\nextern"
  },
  {
    "path": "playlist.c",
    "chars": 21076,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004,2005 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "playlist.h",
    "chars": 4044,
    "preview": "#ifndef PLAYLIST_H\n#define PLAYLIST_H\n\n#include <sys/types.h>\n\n#include \"rbtree.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#end"
  },
  {
    "path": "playlist_file.c",
    "chars": 10266,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "playlist_file.h",
    "chars": 342,
    "preview": "#ifndef PLAYLIST_FILE_H\n#define PLAYLIST_FILE_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nint plist_load (struct plist *p"
  },
  {
    "path": "protocol.c",
    "chars": 16275,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2003 - 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "protocol.h",
    "chars": 7302,
    "preview": "#ifndef PROTOCOL_H\n#define PROTOCOL_H\n\n#include \"playlist.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct event\n{\n\tin"
  },
  {
    "path": "rbtree.c",
    "chars": 7876,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free software;"
  },
  {
    "path": "rbtree.h",
    "chars": 994,
    "preview": "#ifndef RBTREE_H\n#define RBTREE_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef int rb_t_compare (const void *, const"
  },
  {
    "path": "rcc.c",
    "chars": 1494,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005,2011 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "rcc.h",
    "chars": 174,
    "preview": "#ifndef RCC_H\n#define RCC_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nchar *rcc_reencode (char *);\nvoid rcc_init ();\nvoid"
  },
  {
    "path": "server.c",
    "chars": 40079,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2003 - 2005 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "server.h",
    "chars": 793,
    "preview": "#ifndef SERVER_H\n#define SERVER_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"playlist.h\"\n\n#define CLIENTS_MAX\t10"
  },
  {
    "path": "sndio_out.c",
    "chars": 3857,
    "preview": "/*\n * MOC - music on console\n *\n * SNDIO sound driver for MOC by Alexander Polakov.\n * Copyright (C) 2011 Alexander Pola"
  },
  {
    "path": "sndio_out.h",
    "chars": 181,
    "preview": "#ifndef SNDIO_OUT_H\n#define SNDIO_OUT_H\n\n#include \"audio.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid sndio_funcs (s"
  },
  {
    "path": "softmixer.c",
    "chars": 13293,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004-2008 Damian Pietras <daper@daper.net>\n *\n * Softmixer-extension Copyr"
  },
  {
    "path": "softmixer.h",
    "chars": 910,
    "preview": "#ifndef SOFTMIXER_H\n#define SOFTMIXER_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define SOFTMIXER_MIN 0\n/* Allow amplif"
  },
  {
    "path": "tags_cache.c",
    "chars": 28888,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005, 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free sof"
  },
  {
    "path": "tags_cache.h",
    "chars": 919,
    "preview": "#ifndef TAGS_CACHE_H\n#define TAGS_CACHE_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct file_tags;\nstruct tags_cache;\n"
  },
  {
    "path": "themes/Makefile.am",
    "chars": 274,
    "preview": "themesdir = $(pkgdatadir)/themes\nthemes_DATA = transparent-background \\\n\t      example_theme \\\n\t      nightly_theme \\\n\t "
  },
  {
    "path": "themes/black_theme",
    "chars": 1092,
    "preview": "# Black theme by Arn <arn.alduomacil@gmail.com>\n\nbackground\t\t\t\t= white\t\tblack\nframe\t\t\t\t\t= white\t\tblack\nwindow_title\t\t\t= "
  },
  {
    "path": "themes/darkdot_theme",
    "chars": 1065,
    "preview": "# Theme to match the 'darkdot' vim theme, by David Lazar (david_bv|at|yahoo|com)\n\nbackground\t\t= default\tdefault\nframe\t\t\t"
  },
  {
    "path": "themes/example_theme",
    "chars": 5004,
    "preview": "# Example color theme for MOC.\n# You can use a theme by copying it to ~/.moc/themes directory and using\n# Theme config o"
  },
  {
    "path": "themes/green_theme",
    "chars": 1019,
    "preview": "# green theme by Jacek Lehmann\n# best viewed on shaded or black terminal\n\nbackground\t\t= default\tdefault\nframe\t\t\t= black\t"
  },
  {
    "path": "themes/moca_theme",
    "chars": 1038,
    "preview": "#\n# Theme: moca\n# Author: Nicola Vitale <nivit@email.it>\n#\nbackground\t\t= white\t\tblack\nframe\t\t\t= white\t\tblack\nwindow_titl"
  },
  {
    "path": "themes/nightly_theme",
    "chars": 1444,
    "preview": "# Author: Wim Speekenbrink <w.speek@wanadoo.nl>\n\nbackground          = blue      black\nframe               = blue      b"
  },
  {
    "path": "themes/red_theme",
    "chars": 991,
    "preview": "# rednblack theme by yyz\n# works good on a light term\n\n#property\t\tfg\tbg\tfx\nbackground =\t\tdefault\tdefault\nframe =\t\t\tblack"
  },
  {
    "path": "themes/transparent-background",
    "chars": 1064,
    "preview": "# Transparent background theme by Marcin Michałowski\n\nbackground\t\t= default\t\tdefault\nframe\t\t\t= white\t\tdefault\nwindow_tit"
  },
  {
    "path": "themes/variant_red_theme",
    "chars": 1067,
    "preview": "# Variant Red Theme by centralkidede\n\nbackground\t\t= default\tdefault\nframe\t\t\t= white\t\tdefault\nwindow_title\t\t= white\t\tdefa"
  },
  {
    "path": "themes/yellow_red_theme",
    "chars": 1136,
    "preview": "# Yellow/Red theme - mostly Yellow. By Morten Grunnet Buhl\n# Doesn't work on terminals when underline is not supported ("
  },
  {
    "path": "themes.c",
    "chars": 16304,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2004 - 2006 Damian Pietras <daper@daper.net>\n *\n * This program is free so"
  },
  {
    "path": "themes.h",
    "chars": 1079,
    "preview": "#ifndef THEMES_H\n#define THEMES_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nenum color_index\n{\n\tCLR_BACKGROUND,\n\tCLR_FRAM"
  },
  {
    "path": "tools/README",
    "chars": 1602,
    "preview": "                            MOC TOOLS DIRECTORY\n\n\n1. Introduction\n\nThis directory contains debugging and testing tools w"
  },
  {
    "path": "tools/maketests.sh",
    "chars": 4746,
    "preview": "#!/bin/bash\n\n#\n# MOC - music on console\n# Copyright (C) 2004-2005 Damian Pietras <daper@daper.net>\n#\n# maketests.sh Copy"
  },
  {
    "path": "tools/md5check.sh",
    "chars": 8334,
    "preview": "#!/bin/bash\n\n#\n# MOC - music on console\n# Copyright (C) 2004-2005 Damian Pietras <daper@daper.net>\n#\n# md5check.sh Copyr"
  },
  {
    "path": "utf8.c",
    "chars": 8157,
    "preview": "/*\n * MOC - music on console\n * Copyright (C) 2005,2006 Damian Pietras <daper@daper.net>\n *\n * This program is free soft"
  },
  {
    "path": "utf8.h",
    "chars": 1139,
    "preview": "#ifndef UTF8_H\n#define UTF8_H\n\n#if defined HAVE_NCURSESW_CURSES_H\n# include <ncursesw/curses.h>\n#elif defined HAVE_NCURS"
  }
]

About this extraction

This page contains the full source code of the jonsafari/mocp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 158 files (1.3 MB), approximately 388.1k tokens, and a symbol index with 2096 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!