├── .gitignore ├── AUTHORS ├── Android.mk ├── Android_SRC_FILES.mk ├── COPYING ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── UPGRADING ├── autogen.sh ├── config.h ├── configure.ac ├── doc ├── developer.xml ├── doxygen.conf.in ├── mpd.1 ├── mpd.conf.5 ├── mpdconf.example ├── protocol.xml └── user.xml ├── m4 ├── ax_append_compile_flags.m4 ├── ax_append_flag.m4 ├── ax_check_compile_flag.m4 ├── faad.m4 ├── libwrap.m4 ├── mpd_auto.m4 ├── pkg.m4 ├── pretty_print.m4 └── ucred.m4 ├── mpd.service.in ├── scripts ├── check_config_h.rb ├── makedist.sh ├── mpd-indent.sh └── test.sh ├── src ├── AudioCompress │ ├── compress.c │ ├── compress.h │ └── config.h ├── ack.h ├── aiff.c ├── aiff.h ├── ape.c ├── ape.h ├── archive │ ├── bz2_archive_plugin.c │ ├── bz2_archive_plugin.h │ ├── iso9660_archive_plugin.c │ ├── iso9660_archive_plugin.h │ ├── zzip_archive_plugin.c │ └── zzip_archive_plugin.h ├── archive_api.c ├── archive_api.h ├── archive_internal.h ├── archive_list.c ├── archive_list.h ├── archive_plugin.c ├── archive_plugin.h ├── audio_check.c ├── audio_check.h ├── audio_config.c ├── audio_config.h ├── audio_format.c ├── audio_format.h ├── audio_parser.c ├── audio_parser.h ├── buffer.c ├── buffer.h ├── check.h ├── chunk.c ├── chunk.h ├── client.c ├── client.h ├── client_event.c ├── client_expire.c ├── client_file.c ├── client_file.h ├── client_global.c ├── client_idle.c ├── client_idle.h ├── client_internal.h ├── client_list.c ├── client_message.c ├── client_message.h ├── client_new.c ├── client_process.c ├── client_read.c ├── client_subscribe.c ├── client_subscribe.h ├── client_write.c ├── clock.c ├── clock.h ├── cmdline.c ├── cmdline.h ├── command.c ├── command.h ├── conf.c ├── conf.h ├── crossfade.c ├── crossfade.h ├── cue │ ├── cue_parser.c │ └── cue_parser.h ├── daemon.c ├── daemon.h ├── database.c ├── database.h ├── db │ ├── simple_db_plugin.c │ └── simple_db_plugin.h ├── dbUtils.c ├── dbUtils.h ├── db_error.h ├── db_internal.h ├── db_lock.c ├── db_lock.h ├── db_plugin.h ├── db_print.c ├── db_print.h ├── db_save.c ├── db_save.h ├── db_selection.h ├── db_visitor.h ├── decoder │ ├── _flac_common.c │ ├── _flac_common.h │ ├── _ogg_common.c │ ├── _ogg_common.h │ ├── audiofile_decoder_plugin.c │ ├── dsdiff_decoder_plugin.c │ ├── dsdiff_decoder_plugin.h │ ├── dsdlib.c │ ├── dsdlib.h │ ├── dsf_decoder_plugin.c │ ├── dsf_decoder_plugin.h │ ├── faad_decoder_plugin.c │ ├── ffmpeg_decoder_plugin.c │ ├── ffmpeg_metadata.c │ ├── ffmpeg_metadata.h │ ├── flac_compat.h │ ├── flac_decoder_plugin.c │ ├── flac_metadata.c │ ├── flac_metadata.h │ ├── flac_pcm.c │ ├── flac_pcm.h │ ├── fluidsynth_decoder_plugin.c │ ├── gme_decoder_plugin.c │ ├── mad_decoder_plugin.c │ ├── mikmod_decoder_plugin.c │ ├── modplug_decoder_plugin.c │ ├── mp4ff_decoder_plugin.c │ ├── mpcdec_decoder_plugin.c │ ├── mpg123_decoder_plugin.c │ ├── pcm_decoder_plugin.c │ ├── pcm_decoder_plugin.h │ ├── sidplay_decoder_plugin.cxx │ ├── sndfile_decoder_plugin.c │ ├── vorbis_comments.c │ ├── vorbis_comments.h │ ├── vorbis_decoder_plugin.c │ ├── wavpack_decoder_plugin.c │ └── wildmidi_decoder_plugin.c ├── decoder_api.c ├── decoder_api.h ├── decoder_buffer.c ├── decoder_buffer.h ├── decoder_command.h ├── decoder_control.c ├── decoder_control.h ├── decoder_internal.c ├── decoder_internal.h ├── decoder_list.c ├── decoder_list.h ├── decoder_plugin.c ├── decoder_plugin.h ├── decoder_print.c ├── decoder_print.h ├── decoder_thread.c ├── decoder_thread.h ├── despotify_utils.c ├── despotify_utils.h ├── directory.c ├── directory.h ├── directory_save.c ├── directory_save.h ├── dsd2pcm │ ├── dsd2pcm.c │ ├── dsd2pcm.h │ ├── dsd2pcm.hpp │ ├── info.txt │ ├── main.cpp │ ├── noiseshape.c │ ├── noiseshape.h │ └── noiseshape.hpp ├── dummy.cxx ├── encoder │ ├── flac_encoder.c │ ├── lame_encoder.c │ ├── null_encoder.c │ ├── twolame_encoder.c │ ├── vorbis_encoder.c │ └── wave_encoder.c ├── encoder_api.h ├── encoder_list.c ├── encoder_list.h ├── encoder_plugin.h ├── event_pipe.c ├── event_pipe.h ├── exclude.c ├── exclude.h ├── fd_util.c ├── fd_util.h ├── fifo_buffer.c ├── fifo_buffer.h ├── filter │ ├── autoconvert_filter_plugin.c │ ├── autoconvert_filter_plugin.h │ ├── chain_filter_plugin.c │ ├── chain_filter_plugin.h │ ├── convert_filter_plugin.c │ ├── convert_filter_plugin.h │ ├── normalize_filter_plugin.c │ ├── null_filter_plugin.c │ ├── replay_gain_filter_plugin.c │ ├── replay_gain_filter_plugin.h │ ├── route_filter_plugin.c │ ├── volume_filter_plugin.c │ └── volume_filter_plugin.h ├── filter_config.c ├── filter_config.h ├── filter_internal.h ├── filter_plugin.c ├── filter_plugin.h ├── filter_registry.c ├── filter_registry.h ├── gcc.h ├── glib_compat.h ├── glib_socket.h ├── growing_fifo.c ├── growing_fifo.h ├── icy_metadata.c ├── icy_metadata.h ├── icy_server.c ├── icy_server.h ├── idle.c ├── idle.h ├── inotify_queue.c ├── inotify_queue.h ├── inotify_source.c ├── inotify_source.h ├── inotify_update.c ├── inotify_update.h ├── input │ ├── archive_input_plugin.c │ ├── archive_input_plugin.h │ ├── cdio_paranoia_input_plugin.c │ ├── cdio_paranoia_input_plugin.h │ ├── curl_input_plugin.c │ ├── curl_input_plugin.h │ ├── despotify_input_plugin.c │ ├── despotify_input_plugin.h │ ├── ffmpeg_input_plugin.c │ ├── ffmpeg_input_plugin.h │ ├── file_input_plugin.c │ ├── file_input_plugin.h │ ├── mms_input_plugin.c │ ├── mms_input_plugin.h │ ├── rewind_input_plugin.c │ ├── rewind_input_plugin.h │ ├── soup_input_plugin.c │ └── soup_input_plugin.h ├── input_init.c ├── input_init.h ├── input_internal.c ├── input_internal.h ├── input_plugin.h ├── input_registry.c ├── input_registry.h ├── input_stream.c ├── input_stream.h ├── io_thread.c ├── io_thread.h ├── libmpd.c ├── listen.c ├── listen.h ├── locate.c ├── locate.h ├── log.c ├── log.h ├── ls.c ├── ls.h ├── main.c ├── main.h ├── main_win32.c ├── mapper.c ├── mapper.h ├── mixer │ ├── alsa_mixer_plugin.c │ ├── audiotrack_mixer_plugin.c │ ├── opensles_android_mixer_plugin.c │ ├── oss_mixer_plugin.c │ ├── pulse_mixer_plugin.c │ ├── pulse_mixer_plugin.h │ ├── roar_mixer_plugin.c │ ├── software_mixer_plugin.c │ ├── software_mixer_plugin.h │ └── winmm_mixer_plugin.c ├── mixer_all.c ├── mixer_all.h ├── mixer_api.c ├── mixer_api.h ├── mixer_control.c ├── mixer_control.h ├── mixer_list.h ├── mixer_plugin.h ├── mixer_type.c ├── mixer_type.h ├── mpd_error.h ├── notify.c ├── notify.h ├── open.h ├── output │ ├── alsa_output_plugin.c │ ├── alsa_output_plugin.h │ ├── android_audio.h │ ├── ao_output_plugin.c │ ├── ao_output_plugin.h │ ├── audiotrack_output_plugin.c │ ├── audiotrack_output_plugin.h │ ├── ffado_output_plugin.c │ ├── ffado_output_plugin.h │ ├── fifo_output_plugin.c │ ├── fifo_output_plugin.h │ ├── httpd_client.c │ ├── httpd_client.h │ ├── httpd_internal.h │ ├── httpd_output_plugin.c │ ├── httpd_output_plugin.h │ ├── jack_output_plugin.c │ ├── jack_output_plugin.h │ ├── mvp_output_plugin.c │ ├── mvp_output_plugin.h │ ├── null_output_plugin.c │ ├── null_output_plugin.h │ ├── openal_output_plugin.c │ ├── openal_output_plugin.h │ ├── opensles_android_output_plugin.c │ ├── opensles_android_output_plugin.h │ ├── oss_output_plugin.c │ ├── oss_output_plugin.h │ ├── osx_output_plugin.c │ ├── osx_output_plugin.h │ ├── pipe_output_plugin.c │ ├── pipe_output_plugin.h │ ├── pulse_output_plugin.c │ ├── pulse_output_plugin.h │ ├── recorder_output_plugin.c │ ├── recorder_output_plugin.h │ ├── roar_output_plugin.c │ ├── roar_output_plugin.h │ ├── shout_output_plugin.c │ ├── shout_output_plugin.h │ ├── solaris_output_plugin.c │ ├── solaris_output_plugin.h │ ├── winmm_output_plugin.c │ └── winmm_output_plugin.h ├── output_all.c ├── output_all.h ├── output_api.h ├── output_command.c ├── output_command.h ├── output_control.c ├── output_control.h ├── output_finish.c ├── output_init.c ├── output_internal.h ├── output_list.c ├── output_list.h ├── output_plugin.c ├── output_plugin.h ├── output_print.c ├── output_print.h ├── output_state.c ├── output_state.h ├── output_thread.c ├── output_thread.h ├── page.c ├── page.h ├── path.c ├── path.h ├── pcm_buffer.c ├── pcm_buffer.h ├── pcm_channels.c ├── pcm_channels.h ├── pcm_convert.c ├── pcm_convert.h ├── pcm_dither.c ├── pcm_dither.h ├── pcm_dsd.c ├── pcm_dsd.h ├── pcm_dsd_usb.c ├── pcm_dsd_usb.h ├── pcm_export.c ├── pcm_export.h ├── pcm_format.c ├── pcm_format.h ├── pcm_mix.c ├── pcm_mix.h ├── pcm_pack.c ├── pcm_pack.h ├── pcm_prng.h ├── pcm_resample.c ├── pcm_resample.h ├── pcm_resample_fallback.c ├── pcm_resample_internal.h ├── pcm_resample_libsamplerate.c ├── pcm_utils.h ├── pcm_volume.c ├── pcm_volume.h ├── permission.c ├── permission.h ├── pipe.c ├── pipe.h ├── player_control.c ├── player_control.h ├── player_thread.c ├── player_thread.h ├── playlist.c ├── playlist.h ├── playlist │ ├── asx_playlist_plugin.c │ ├── asx_playlist_plugin.h │ ├── cue_playlist_plugin.c │ ├── cue_playlist_plugin.h │ ├── despotify_playlist_plugin.c │ ├── despotify_playlist_plugin.h │ ├── embcue_playlist_plugin.c │ ├── embcue_playlist_plugin.h │ ├── extm3u_playlist_plugin.c │ ├── extm3u_playlist_plugin.h │ ├── lastfm_playlist_plugin.c │ ├── lastfm_playlist_plugin.h │ ├── m3u_playlist_plugin.c │ ├── m3u_playlist_plugin.h │ ├── pls_playlist_plugin.c │ ├── pls_playlist_plugin.h │ ├── rss_playlist_plugin.c │ ├── rss_playlist_plugin.h │ ├── soundcloud_playlist_plugin.c │ ├── soundcloud_playlist_plugin.h │ ├── xspf_playlist_plugin.c │ └── xspf_playlist_plugin.h ├── playlist_any.c ├── playlist_any.h ├── playlist_control.c ├── playlist_database.c ├── playlist_database.h ├── playlist_edit.c ├── playlist_error.h ├── playlist_global.c ├── playlist_internal.h ├── playlist_list.c ├── playlist_list.h ├── playlist_mapper.c ├── playlist_mapper.h ├── playlist_plugin.h ├── playlist_print.c ├── playlist_print.h ├── playlist_queue.c ├── playlist_queue.h ├── playlist_save.c ├── playlist_save.h ├── playlist_song.c ├── playlist_song.h ├── playlist_state.c ├── playlist_state.h ├── playlist_vector.c ├── playlist_vector.h ├── poison.h ├── protocol │ ├── argparser.c │ ├── argparser.h │ ├── result.c │ └── result.h ├── queue.c ├── queue.h ├── queue_print.c ├── queue_print.h ├── queue_save.c ├── queue_save.h ├── refcount.h ├── replay_gain_ape.c ├── replay_gain_ape.h ├── replay_gain_config.c ├── replay_gain_config.h ├── replay_gain_info.c ├── replay_gain_info.h ├── resolver.c ├── resolver.h ├── riff.c ├── riff.h ├── server_socket.c ├── server_socket.h ├── sig_handlers.c ├── sig_handlers.h ├── socket_util.c ├── socket_util.h ├── song.c ├── song.h ├── song_print.c ├── song_print.h ├── song_save.c ├── song_save.h ├── song_sort.c ├── song_sort.h ├── song_sticker.c ├── song_sticker.h ├── song_update.c ├── state_file.c ├── state_file.h ├── stats.c ├── stats.h ├── sticker.c ├── sticker.h ├── sticker_print.c ├── sticker_print.h ├── stored_playlist.c ├── stored_playlist.h ├── string_util.c ├── string_util.h ├── strset.c ├── strset.h ├── tag.c ├── tag.h ├── tag_ape.c ├── tag_ape.h ├── tag_file.c ├── tag_file.h ├── tag_handler.c ├── tag_handler.h ├── tag_id3.c ├── tag_id3.h ├── tag_internal.h ├── tag_pool.c ├── tag_pool.h ├── tag_print.c ├── tag_print.h ├── tag_rva2.c ├── tag_rva2.h ├── tag_save.c ├── tag_save.h ├── tag_table.h ├── text_file.c ├── text_file.h ├── text_input_stream.c ├── text_input_stream.h ├── timer.c ├── timer.h ├── tokenizer.c ├── tokenizer.h ├── update.c ├── update.h ├── update_archive.c ├── update_archive.h ├── update_container.c ├── update_container.h ├── update_db.c ├── update_db.h ├── update_internal.h ├── update_io.c ├── update_io.h ├── update_queue.c ├── update_queue.h ├── update_remove.c ├── update_remove.h ├── update_song.c ├── update_song.h ├── update_walk.c ├── update_walk.h ├── uri.c ├── uri.h ├── util │ ├── bit_reverse.c │ ├── bit_reverse.h │ ├── byte_reverse.c │ ├── byte_reverse.h │ ├── list.h │ ├── list_sort.c │ └── list_sort.h ├── utils.c ├── utils.h ├── volume.c ├── volume.h ├── win │ ├── mpd.ico │ └── mpd_win32_rc.rc.in ├── zeroconf-avahi.c ├── zeroconf-bonjour.c ├── zeroconf-internal.h ├── zeroconf.c └── zeroconf.h ├── test ├── dump_playlist.c ├── dump_rva2.c ├── dump_text_file.c ├── read_conf.c ├── read_mixer.c ├── read_tags.c ├── run_convert.c ├── run_decoder.c ├── run_encoder.c ├── run_filter.c ├── run_inotify.c ├── run_input.c ├── run_normalize.c ├── run_output.c ├── run_resolver.c ├── run_tcp_connect.c ├── signals.c ├── signals.h ├── software_volume.c ├── stdbin.h ├── test_archive_bzip2.sh ├── test_archive_iso9660.sh ├── test_archive_zzip.sh ├── test_byte_reverse.c ├── test_pcm_all.h ├── test_pcm_channels.c ├── test_pcm_dither.c ├── test_pcm_main.c ├── test_pcm_pack.c ├── test_pcm_volume.c ├── test_queue_priority.c └── test_vorbis_encoder.c └── valgrind.suppressions /.gitignore: -------------------------------------------------------------------------------- 1 | *.Plo 2 | *.Po 3 | *.a 4 | *.d 5 | *.la 6 | *.lo 7 | *.o 8 | .deps 9 | .dirstamp 10 | Makefile 11 | Makefile.in 12 | aclocal.m4 13 | autom4te.cache 14 | compile 15 | config.guess 16 | config.h.in 17 | config.log 18 | config.mk 19 | config.status 20 | config.sub 21 | config_detected.h 22 | config_detected.mk 23 | configure 24 | configure.lineno 25 | depcomp 26 | depmode 27 | install-sh 28 | libtool 29 | ltmain.sh 30 | missing 31 | mkinstalldirs 32 | mpd 33 | mpd.exe 34 | mpd.service 35 | stamp-h1 36 | tags 37 | *~ 38 | .#* 39 | .stgit* 40 | src/dsd2pcm/dsd2pcm 41 | src/win/mpd_win32_rc.rc 42 | doc/doxygen.conf 43 | doc/protocol.html 44 | doc/protocol 45 | doc/user 46 | doc/developer 47 | doc/sticker 48 | doc/api 49 | test/software_volume 50 | test/run_convert 51 | test/run_decoder 52 | test/read_tags 53 | test/run_filter 54 | test/run_encoder 55 | test/run_output 56 | test/read_conf 57 | test/run_input 58 | test/read_mixer 59 | test/dump_playlist 60 | test/run_normalize 61 | test/tmp 62 | test/run_inotify 63 | test/test_queue_priority 64 | test/run_ntp_server 65 | test/run_resolver 66 | test/run_tcp_connect 67 | test/test_pcm 68 | test/dump_rva2 69 | test/dump_text_file 70 | test/test_byte_reverse 71 | test/test_vorbis_encoder 72 | 73 | /*.tar.gz 74 | /*.tar.bz2 75 | /*.tar.xz 76 | /mpd-*/ 77 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Current Developers 2 | ------------------ 3 | 4 | Avuton Olrich 5 | release manager 6 | 7 | Max Kellermann 8 | lead developer 9 | 10 | Laszlo Ashin 11 | WavPack support 12 | 13 | Viliam Mateicka 14 | FFmpeg support, mixer and archive API 15 | 16 | Eric Wollesen 17 | encoder API, shout output 18 | 19 | Thomas Jansen 20 | multithreading tweaks, miscellaneous 21 | 22 | Romain Bignon 23 | playlist manipulation 24 | 25 | David Guibert 26 | PulseAudio mixer 27 | 28 | Jochen Keil 29 | CUE sheet support 30 | 31 | Jeffrey Middleton 32 | playlist manipulation 33 | 34 | Sean McNamara 35 | WIN32 compatibility 36 | 37 | 38 | Former Developers 39 | ----------------- 40 | 41 | Warren Dukes 42 | former lead developer and project founder 43 | 44 | Niklas Hofer 45 | 'next' and 'previous' patch 46 | 47 | Jim Ramsay 48 | Zerconf/avahi support 49 | 50 | Guus Sliepen 51 | libsamplerate code 52 | 53 | J. Alexander Treuman 54 | general, MP3, ID3, PulseAudio, format conversion, stored playlists 55 | AudioCompress, much much more... 56 | 57 | Eric Wong 58 | former lead developer 59 | 60 | José Anarch 61 | JACK plugin 62 | 63 | Patrik Weiskircher 64 | Stored playlist commands 65 | 66 | Nick Welch 67 | Sighandlers 68 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | include $(LOCAL_PATH)/Android_SRC_FILES.mk 6 | 7 | LOCAL_C_INCLUDES += \ 8 | $(LOCAL_PATH) \ 9 | $(LOCAL_PATH)/src \ 10 | $(GLIB_PATH) \ 11 | $(LIBAV_PATH) \ 12 | $(LIBAV_PATH)/Android_config \ 13 | $(YAJL_PATH) \ 14 | $(CURL_PATH)/include \ 15 | $(ANDROID_LIBS_PATH)/headers/sqlite 16 | 17 | LOCAL_CFLAGS := \ 18 | -std=gnu99 -DSYSTEM_CONFIG_FILE_LOCATION="\"/data/data/be.deadba.ampd/files/mpd.conf\"" 19 | 20 | LOCAL_MODULE := libmpd 21 | 22 | LOCAL_SHARED_LIBRARIES := avutil avformat avcodec iconv glib gthread yajl curl 23 | 24 | LOCAL_LDLIBS := -L$(LOCAL_PATH)/../android-libs/$(TARGET_ARCH) 25 | LOCAL_LDLIBS += -lsqlite -lz -llog 26 | 27 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) 28 | LOCAL_ARM_NEON:= true 29 | endif 30 | 31 | include $(BUILD_SHARED_LIBRARY) 32 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | Music Player Daemon (MPD) 3 | http://www.musicpd.org 4 | 5 | A daemon for playing music of various formats. Music is played through the 6 | server's audio device. The daemon stores info about all available music, 7 | and this info can be easily searched and retrieved. Player control, info 8 | retrieval, and playlist management can all be managed remotely. 9 | 10 | For basic installation information see the INSTALL file. 11 | 12 | MPD is released under the GNU General Public License version 2, which is 13 | distributed in the COPYING file. 14 | 15 | You should have received a copy of the GNU General Public License along with 16 | this program. If not, see . 17 | 18 | -------------------------------------------------------------------------------- /doc/mpd.1: -------------------------------------------------------------------------------- 1 | .TH "Music Player Daemon" 1 2 | .SH NAME 3 | MPD \- A daemon for playing music 4 | .SH SYNOPSIS 5 | .B mpd 6 | .RI [ options ] 7 | .RI [ CONF_FILE ] 8 | .SH DESCRIPTION 9 | MPD is a daemon for playing music. Music is played through the configured 10 | audio output(s) (which are generally local, but can be remote). The daemon 11 | stores info about all available music, and this info can be easily searched and 12 | retrieved. Player control, info retrieval, and playlist management can all be 13 | managed remotely. 14 | 15 | MPD searches for a config file in \fB~/.mpdconf\fP then \fB/etc/mpd.conf\fP or 16 | uses CONF_FILE. 17 | 18 | Read more about MPD at <\fBhttp://www.musicpd.org/\fP>. 19 | .SH OPTIONS 20 | .TP 21 | .BI \-\-help 22 | Output a brief help message. 23 | .TP 24 | .BI \-\-kill 25 | Kill the currently running mpd session. The pid_file parameter must be 26 | specified in the config file for this to work. 27 | .TP 28 | .BI \-\-no\-daemon 29 | Don't detach from console. 30 | .TP 31 | .BI \-\-stderr 32 | Print messages stderr. 33 | .TP 34 | .BI \-\-verbose 35 | Verbose logging. 36 | .TP 37 | .BI \-\-version 38 | Print version information. 39 | .SH FILES 40 | .TP 41 | .BI ~/.mpdconf 42 | User configuration file. 43 | .TP 44 | .BI /etc/mpd.conf 45 | Global configuration file. 46 | .SH SEE ALSO 47 | mpd.conf(5), mpc(1) 48 | .SH BUGS 49 | If you find a bug, please report it at 50 | .br 51 | <\fBhttp://www.musicpd.org/mantis/bug_report_page.php\fP>. 52 | .SH AUTHORS 53 | Warren Dukes 54 | 55 | Special thanks to all the people that provided feedback and patches. 56 | -------------------------------------------------------------------------------- /m4/libwrap.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Usage: 3 | dnl AC_CHECK_LIBWRAP([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 4 | dnl 5 | 6 | AC_DEFUN([AC_CHECK_LIBWRAP],[ 7 | AC_CHECK_HEADERS([tcpd.h], 8 | AC_CHECK_LIB([wrap], [request_init], 9 | [LIBWRAP_CFLAGS="" 10 | LIBWRAP_LDFLAGS="-lwrap" 11 | $1], 12 | $2), 13 | $2) 14 | ]) 15 | -------------------------------------------------------------------------------- /m4/pretty_print.m4: -------------------------------------------------------------------------------- 1 | AC_DEFUN([results], [ 2 | dnl This is a hack to allow "with" names, otherwise "enable". 3 | num=`expr $1 : 'with'` 4 | if test "$num" != "0"; then 5 | var="`echo '$'$1`" 6 | else 7 | var="`echo '$'enable_$1`" 8 | fi 9 | 10 | printf '(' 11 | if eval "test x$var = xyes"; then 12 | printf '+' 13 | elif test -n "$3" && eval "test x$var = x$3"; then 14 | printf '+' 15 | else 16 | printf '-' 17 | fi 18 | printf '%s) ' "$2" 19 | ]) 20 | -------------------------------------------------------------------------------- /m4/ucred.m4: -------------------------------------------------------------------------------- 1 | # Check if "struct ucred" is available. If not, try harder with 2 | # _GNU_SOURCE. 3 | # 4 | # Author: Max Kellermann 5 | 6 | AC_DEFUN([STRUCT_UCRED],[ 7 | AC_MSG_CHECKING([for struct ucred]) 8 | AC_CACHE_VAL(mpd_cv_have_struct_ucred, [ 9 | AC_TRY_COMPILE([#include ], 10 | [struct ucred cred;], 11 | mpd_cv_have_struct_ucred=yes, 12 | mpd_cv_have_struct_ucred=no) 13 | if test x$mpd_cv_have_struct_ucred = xno; then 14 | # glibc 2.8 forces _GNU_SOURCE on us 15 | AC_TRY_COMPILE( 16 | [#define _GNU_SOURCE 17 | #include ], 18 | [struct ucred cred;], 19 | mpd_cv_have_struct_ucred=yes, 20 | mpd_cv_have_struct_ucred=no) 21 | if test x$mpd_cv_have_struct_ucred = xyes; then 22 | # :( 23 | CFLAGS="$CFLAGS -D_GNU_SOURCE" 24 | fi 25 | fi 26 | ]) 27 | 28 | AC_MSG_RESULT($mpd_cv_have_struct_ucred) 29 | if test x$mpd_cv_have_struct_ucred = xyes; then 30 | AC_DEFINE(HAVE_STRUCT_UCRED, 1, [Define if struct ucred is present from sys/socket.h]) 31 | fi 32 | ]) 33 | -------------------------------------------------------------------------------- /mpd.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Music Player Daemon 3 | After=network.target sound.target 4 | 5 | [Service] 6 | ExecStart=@prefix@/bin/mpd --no-daemon 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | -------------------------------------------------------------------------------- /scripts/check_config_h.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # This script verifies that every source includes config.h first. 4 | # This is very important for consistent Large File Support. 5 | # 6 | 7 | def check_file(file) 8 | first = true 9 | file.each_line do |line| 10 | if line =~ /^\#include\s+(\S+)/ then 11 | if $1 == '"config.h"' 12 | unless first 13 | puts "#{file.path}: config.h included too late" 14 | end 15 | else 16 | if first 17 | puts "#{file.path}: config.h missing" 18 | end 19 | end 20 | first = false 21 | end 22 | end 23 | end 24 | 25 | def check_path(path) 26 | File.open(path) do |file| 27 | check_file(file) 28 | end 29 | end 30 | 31 | if ARGV.empty? 32 | Dir["src/*.c"].each do |path| 33 | check_path(path) 34 | end 35 | 36 | Dir["src/*/*.c"].each do |path| 37 | check_path(path) 38 | end 39 | 40 | Dir["test/*.c"].each do |path| 41 | check_path(path) 42 | end 43 | else 44 | ARGV.each do |path| 45 | check_path(path) 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /scripts/makedist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PWD=`pwd` 3 | 4 | ## If we're not in the scripts directory 5 | ## assume the base directory. 6 | if test "`basename $PWD`" = "scripts"; then 7 | cd ../ 8 | else 9 | MYOLDPWD=`pwd` 10 | cd `dirname $0`/../ 11 | fi 12 | 13 | if test -e Makefile 14 | then 15 | make distclean 16 | fi 17 | ./autogen.sh 18 | make 19 | make dist 20 | 21 | if test "`basename $PWD`" = "scripts"; then 22 | cd contrib/ 23 | else 24 | cd $MYOLDPWD 25 | fi 26 | -------------------------------------------------------------------------------- /scripts/mpd-indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cdw -cd0 -c0 -cp0 "$@" 3 | 4 | # there doesn't seem to be an indent switch for this, but this 5 | # forces goto labels to the left-most column, without indentation 6 | perl -i -p -e 's/^\s+(\w+):/$1:/g unless /^\s+default:/' "$@" 7 | -------------------------------------------------------------------------------- /src/AudioCompress/compress.h: -------------------------------------------------------------------------------- 1 | /*! compress.h 2 | * interface to audio compression 3 | * 4 | * (c)2007 busybee (http://beesbuzz.biz/) 5 | * Licensed under the terms of the LGPL. See the file COPYING for details. 6 | */ 7 | 8 | #ifndef COMPRESS_H 9 | #define COMPRESS_H 10 | 11 | #include 12 | 13 | //! Configuration values for the compressor object 14 | struct CompressorConfig { 15 | int target; 16 | int maxgain; 17 | int smooth; 18 | }; 19 | 20 | struct Compressor; 21 | 22 | //! Create a new compressor (use history value of 0 for default) 23 | struct Compressor *Compressor_new(unsigned int history); 24 | 25 | //! Delete a compressor 26 | void Compressor_delete(struct Compressor *); 27 | 28 | //! Set the history length 29 | void Compressor_setHistory(struct Compressor *, unsigned int history); 30 | 31 | //! Get the configuration for a compressor 32 | struct CompressorConfig *Compressor_getConfig(struct Compressor *); 33 | 34 | //! Process 16-bit signed data 35 | void Compressor_Process_int16(struct Compressor *, int16_t *data, unsigned int count); 36 | 37 | //! TODO: Compressor_Process_int32, Compressor_Process_float, others as needed 38 | 39 | //! TODO: functions for getting at the peak/gain/clip history buffers (for monitoring) 40 | #endif 41 | -------------------------------------------------------------------------------- /src/AudioCompress/config.h: -------------------------------------------------------------------------------- 1 | /* config.h 2 | ** Default values for the configuration, and also a few random debug things 3 | */ 4 | 5 | #ifndef AC_CONFIG_H 6 | #define AC_CONFIG_H 7 | 8 | /*** Version information ***/ 9 | #define ACVERSION "2.0" 10 | 11 | /*** Default configuration stuff ***/ 12 | #define TARGET 16384 /*!< Target level (on a scale of 0-32767) */ 13 | 14 | #define GAINMAX 32 /*!< The maximum amount to amplify by */ 15 | #define GAINSMOOTH 8 /*!< How much inertia ramping has*/ 16 | #define BUCKETS 400 /*!< How long of a history to use by default */ 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /src/ack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ACK_H 21 | #define MPD_ACK_H 22 | 23 | #include 24 | 25 | enum ack { 26 | ACK_ERROR_NOT_LIST = 1, 27 | ACK_ERROR_ARG = 2, 28 | ACK_ERROR_PASSWORD = 3, 29 | ACK_ERROR_PERMISSION = 4, 30 | ACK_ERROR_UNKNOWN = 5, 31 | 32 | ACK_ERROR_NO_EXIST = 50, 33 | ACK_ERROR_PLAYLIST_MAX = 51, 34 | ACK_ERROR_SYSTEM = 52, 35 | ACK_ERROR_PLAYLIST_LOAD = 53, 36 | ACK_ERROR_UPDATE_ALREADY = 54, 37 | ACK_ERROR_PLAYER_SYNC = 55, 38 | ACK_ERROR_EXIST = 56, 39 | }; 40 | 41 | /** 42 | * Quark for GError.domain; the code is an enum #ack. 43 | */ 44 | G_GNUC_CONST 45 | static inline GQuark 46 | ack_quark(void) 47 | { 48 | return g_quark_from_static_string("ack"); 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/aiff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * A parser for the AIFF file format. 23 | */ 24 | 25 | #ifndef MPD_AIFF_H 26 | #define MPD_AIFF_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | /** 33 | * Seeks the AIFF file to the ID3 chunk. 34 | * 35 | * @return the size of the ID3 chunk on success, or 0 if this is not a 36 | * AIFF file or no ID3 chunk was found 37 | */ 38 | size_t 39 | aiff_seek_id3(FILE *file); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/ape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_APE_H 21 | #define MPD_APE_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | 28 | typedef bool (*tag_ape_callback_t)(unsigned long flags, const char *key, 29 | const char *value, size_t value_length, 30 | void *ctx); 31 | 32 | /** 33 | * Scans the APE tag values from a file. 34 | * 35 | * @param path_fs the path of the file in filesystem encoding 36 | * @return false if the file could not be opened or if no APE tag is 37 | * present 38 | */ 39 | bool 40 | tag_ape_scan(const char *path_fs, tag_ape_callback_t callback, void *ctx); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/archive/bz2_archive_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ARCHIVE_BZ2_H 21 | #define MPD_ARCHIVE_BZ2_H 22 | 23 | extern const struct archive_plugin bz2_archive_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/archive/iso9660_archive_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ARCHIVE_ISO9660_H 21 | #define MPD_ARCHIVE_ISO9660_H 22 | 23 | extern const struct archive_plugin iso9660_archive_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/archive/zzip_archive_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ARCHIVE_ZZIP_H 21 | #define MPD_ARCHIVE_ZZIP_H 22 | 23 | extern const struct archive_plugin zzip_archive_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/archive_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ARCHIVE_API_H 21 | #define MPD_ARCHIVE_API_H 22 | 23 | /* 24 | * This is the public API which is used by archive plugins to 25 | * provide transparent archive decompression layer for mpd 26 | * 27 | */ 28 | 29 | #include "archive_internal.h" 30 | #include "archive_plugin.h" 31 | #include "input_stream.h" 32 | 33 | #include 34 | 35 | bool archive_lookup(char *pathname, char **archive, char **inpath, char **suffix); 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /src/archive_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ARCHIVE_INTERNAL_H 21 | #define MPD_ARCHIVE_INTERNAL_H 22 | 23 | struct archive_file { 24 | const struct archive_plugin *plugin; 25 | }; 26 | 27 | static inline void 28 | archive_file_init(struct archive_file *archive_file, 29 | const struct archive_plugin *plugin) 30 | { 31 | archive_file->plugin = plugin; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/audio_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_AUDIO_CONFIG_H 21 | #define MPD_AUDIO_CONFIG_H 22 | 23 | #include 24 | 25 | struct audio_format; 26 | 27 | void getOutputAudioFormat(const struct audio_format *inFormat, 28 | struct audio_format *outFormat); 29 | 30 | /* make sure initPlayerData is called before this function!! */ 31 | void initAudioConfig(void); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "client_internal.h" 22 | 23 | bool client_is_expired(const struct client *client) 24 | { 25 | return client->channel == NULL; 26 | } 27 | 28 | int client_get_uid(const struct client *client) 29 | { 30 | return client->uid; 31 | } 32 | 33 | unsigned client_get_permission(const struct client *client) 34 | { 35 | return client->permission; 36 | } 37 | 38 | void client_set_permission(struct client *client, unsigned permission) 39 | { 40 | client->permission = permission; 41 | } 42 | -------------------------------------------------------------------------------- /src/client_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_CLIENT_FILE_H 21 | #define MPD_CLIENT_FILE_H 22 | 23 | #include 24 | #include 25 | 26 | struct client; 27 | 28 | /** 29 | * Is this client allowed to use the specified local file? 30 | * 31 | * Note that this function is vulnerable to timing/symlink attacks. 32 | * We cannot fix this as long as there are plugins that open a file by 33 | * its name, and not by file descriptor / callbacks. 34 | * 35 | * @param path_fs the absolute path name in filesystem encoding 36 | * @return true if access is allowed 37 | */ 38 | bool 39 | client_allow_file(const struct client *client, const char *path_fs, 40 | GError **error_r); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/client_idle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_CLIENT_IDLE_H 21 | #define MPD_CLIENT_IDLE_H 22 | 23 | #include 24 | 25 | struct client; 26 | 27 | void 28 | client_idle_add(struct client *client, unsigned flags); 29 | 30 | /** 31 | * Adds the specified idle flags to all clients and immediately sends 32 | * notifications to all waiting clients. 33 | */ 34 | void 35 | client_manager_idle_add(unsigned flags); 36 | 37 | /** 38 | * Checks whether the client has pending idle flags. If yes, they are 39 | * sent immediately and "true" is returned". If no, it puts the 40 | * client into waiting mode and returns false. 41 | */ 42 | bool 43 | client_idle_wait(struct client *client, unsigned flags); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_CLOCK_H 21 | #define MPD_CLOCK_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | /** 28 | * Returns the value of a monotonic clock in milliseconds. 29 | */ 30 | G_GNUC_PURE 31 | unsigned 32 | monotonic_clock_ms(void); 33 | 34 | /** 35 | * Returns the value of a monotonic clock in microseconds. 36 | */ 37 | G_GNUC_PURE 38 | uint64_t 39 | monotonic_clock_us(void); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef CMDLINE_H 21 | #define CMDLINE_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | struct options { 28 | gboolean kill; 29 | gboolean daemon; 30 | gboolean log_stderr; 31 | gboolean verbose; 32 | }; 33 | 34 | bool 35 | parse_cmdline(int argc, char **argv, struct options *options, 36 | GError **error_r); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_COMMAND_H 21 | #define MPD_COMMAND_H 22 | 23 | #include "ack.h" 24 | 25 | #include 26 | #include 27 | 28 | enum command_return { 29 | COMMAND_RETURN_ERROR = -1, 30 | COMMAND_RETURN_OK = 0, 31 | COMMAND_RETURN_KILL = 10, 32 | COMMAND_RETURN_CLOSE = 20, 33 | }; 34 | 35 | struct client; 36 | 37 | void command_init(void); 38 | 39 | void command_finish(void); 40 | 41 | enum command_return 42 | command_process(struct client *client, unsigned num, char *line); 43 | 44 | void command_success(struct client *client); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/db/simple_db_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SIMPLE_DB_PLUGIN_H 21 | #define MPD_SIMPLE_DB_PLUGIN_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | extern const struct db_plugin simple_db_plugin; 28 | 29 | struct db; 30 | 31 | G_GNUC_PURE 32 | struct directory * 33 | simple_db_get_root(struct db *db); 34 | 35 | bool 36 | simple_db_save(struct db *db, GError **error_r); 37 | 38 | G_GNUC_PURE 39 | time_t 40 | simple_db_get_mtime(const struct db *db); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/db_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DB_ERROR_H 21 | #define MPD_DB_ERROR_H 22 | 23 | #include 24 | 25 | enum db_error { 26 | /** 27 | * The database is disabled, i.e. none is configured in this 28 | * MPD instance. 29 | */ 30 | DB_DISABLED, 31 | 32 | DB_NOT_FOUND, 33 | }; 34 | 35 | /** 36 | * Quark for GError.domain; the code is an enum #db_error. 37 | */ 38 | G_GNUC_CONST 39 | static inline GQuark 40 | db_quark(void) 41 | { 42 | return g_quark_from_static_string("db"); 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/db_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DB_INTERNAL_H 21 | #define MPD_DB_INTERNAL_H 22 | 23 | #include "db_plugin.h" 24 | 25 | #include 26 | 27 | static inline void 28 | db_base_init(struct db *db, const struct db_plugin *plugin) 29 | { 30 | assert(plugin != NULL); 31 | 32 | db->plugin = plugin; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/db_lock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "db_lock.h" 22 | #include "gcc.h" 23 | 24 | #if GCC_CHECK_VERSION(4, 2) 25 | /* workaround for a warning caused by G_STATIC_MUTEX_INIT */ 26 | #pragma GCC diagnostic ignored "-Wmissing-field-initializers" 27 | #endif 28 | 29 | GStaticMutex db_mutex = G_STATIC_MUTEX_INIT; 30 | 31 | #ifndef NDEBUG 32 | GThread *db_mutex_holder; 33 | #endif 34 | -------------------------------------------------------------------------------- /src/db_save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DB_SAVE_H 21 | #define MPD_DB_SAVE_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | struct directory; 28 | 29 | void 30 | db_save_internal(FILE *file, const struct directory *root); 31 | 32 | bool 33 | db_load_internal(FILE *file, struct directory *root, GError **error); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/decoder/_ogg_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Common functions used for Ogg data streams (Ogg-Vorbis and OggFLAC) 22 | */ 23 | 24 | #ifndef MPD_OGG_COMMON_H 25 | #define MPD_OGG_COMMON_H 26 | 27 | #include "decoder_api.h" 28 | 29 | typedef enum _ogg_stream_type { VORBIS, FLAC } ogg_stream_type; 30 | 31 | ogg_stream_type ogg_stream_type_detect(struct input_stream *inStream); 32 | 33 | #endif /* _OGG_COMMON_H */ 34 | -------------------------------------------------------------------------------- /src/decoder/dsdiff_decoder_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_DSDIFF_H 21 | #define MPD_DECODER_DSDIFF_H 22 | 23 | extern const struct decoder_plugin dsdiff_decoder_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/decoder/dsdlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_DSDLIB_H 21 | #define MPD_DECODER_DSDLIB_H 22 | 23 | struct dsdlib_id { 24 | char value[4]; 25 | }; 26 | 27 | bool 28 | dsdlib_id_equals(const struct dsdlib_id *id, const char *s); 29 | 30 | bool 31 | dsdlib_read(struct decoder *decoder, struct input_stream *is, 32 | void *data, size_t length); 33 | 34 | bool 35 | dsdlib_skip_to(struct decoder *decoder, struct input_stream *is, 36 | goffset offset); 37 | 38 | bool 39 | dsdlib_skip(struct decoder *decoder, struct input_stream *is, 40 | goffset delta); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/decoder/dsf_decoder_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_DSF_H 21 | #define MPD_DECODER_DSF_H 22 | 23 | extern const struct decoder_plugin dsf_decoder_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/decoder/ffmpeg_metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_FFMPEG_METADATA_H 21 | #define MPD_FFMPEG_METADATA_H 22 | 23 | #include 24 | #include 25 | #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0) 26 | #include 27 | #endif 28 | 29 | #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,1,0) 30 | #define AVDictionary AVMetadata 31 | #define AVDictionaryEntry AVMetadataTag 32 | #define av_dict_get av_metadata_get 33 | #endif 34 | 35 | struct tag_handler; 36 | 37 | void 38 | ffmpeg_scan_dictionary(AVDictionary *dict, 39 | const struct tag_handler *handler, void *handler_ctx); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/decoder/flac_pcm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_FLAC_PCM_H 21 | #define MPD_FLAC_PCM_H 22 | 23 | #include "audio_format.h" 24 | 25 | #include 26 | 27 | void 28 | flac_convert(void *dest, 29 | unsigned int num_channels, enum sample_format sample_format, 30 | const FLAC__int32 *const buf[], 31 | unsigned int position, unsigned int end); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/decoder/pcm_decoder_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * Not really a decoder; this plugin forwards its input data "as-is". 23 | * 24 | * It was written only to support the "cdio_paranoia" input plugin, 25 | * which does not need a decoder. 26 | */ 27 | 28 | #ifndef MPD_DECODER_PCM_H 29 | #define MPD_DECODER_PCM_H 30 | 31 | extern const struct decoder_plugin pcm_decoder_plugin; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/decoder/vorbis_comments.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_VORBIS_COMMENTS_H 21 | #define MPD_VORBIS_COMMENTS_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct replay_gain_info; 28 | struct tag_handler; 29 | 30 | bool 31 | vorbis_comments_to_replay_gain(struct replay_gain_info *rgi, char **comments); 32 | 33 | void 34 | vorbis_comments_scan(char **comments, 35 | const struct tag_handler *handler, void *handler_ctx); 36 | 37 | struct tag * 38 | vorbis_comments_to_tag(char **comments); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/decoder_command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_COMMAND_H 21 | #define MPD_DECODER_COMMAND_H 22 | 23 | enum decoder_command { 24 | DECODE_COMMAND_NONE = 0, 25 | DECODE_COMMAND_START, 26 | DECODE_COMMAND_STOP, 27 | DECODE_COMMAND_SEEK 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/decoder_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_PRINT_H 21 | #define MPD_DECODER_PRINT_H 22 | 23 | struct client; 24 | 25 | void 26 | decoder_list_print(struct client *client); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/decoder_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DECODER_THREAD_H 21 | #define MPD_DECODER_THREAD_H 22 | 23 | struct decoder_control; 24 | 25 | void 26 | decoder_thread_start(struct decoder_control *dc); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/directory_save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_DIRECTORY_SAVE_H 21 | #define MPD_DIRECTORY_SAVE_H 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | struct directory; 29 | 30 | void 31 | directory_save(FILE *fp, const struct directory *directory); 32 | 33 | bool 34 | directory_load(FILE *fp, struct directory *directory, 35 | GString *buffer, GError **error); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/dsd2pcm/dsd2pcm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DSD2PCM_HXX_INCLUDED 2 | #define DSD2PCM_HXX_INCLUDED 3 | 4 | #include 5 | #include 6 | #include "dsd2pcm.h" 7 | 8 | /** 9 | * C++ PImpl Wrapper for the dsd2pcm C library 10 | */ 11 | 12 | class dxd 13 | { 14 | dsd2pcm_ctx *handle; 15 | public: 16 | dxd() : handle(dsd2pcm_init()) 17 | { if (!handle) throw std::runtime_error("wtf?!"); } 18 | 19 | dxd(dxd const& x) : handle(dsd2pcm_clone(x.handle)) 20 | { if (!handle) throw std::runtime_error("wtf?!"); } 21 | 22 | ~dxd() { dsd2pcm_destroy(handle); } 23 | 24 | friend void swap(dxd & a, dxd & b) 25 | { std::swap(a.handle,b.handle); } 26 | 27 | dxd& operator=(dxd x) 28 | { swap(*this,x); return *this; } 29 | 30 | void translate(size_t samples, 31 | const unsigned char *src, ptrdiff_t src_stride, 32 | bool lsbitfirst, 33 | float *dst, ptrdiff_t dst_stride) 34 | { 35 | dsd2pcm_translate(handle,samples,src,src_stride, 36 | lsbitfirst,dst,dst_stride); 37 | } 38 | }; 39 | 40 | #endif // DSD2PCM_HXX_INCLUDED 41 | 42 | -------------------------------------------------------------------------------- /src/dsd2pcm/info.txt: -------------------------------------------------------------------------------- 1 | You downloaded the source code for "dsd2pcm" which is a simple little 2 | "filter" program, that takes a DSD data stream on stdin and converts 3 | it to a PCM stream (352.8 kHz, either 16 or 24 bits) and writes it to 4 | stdout. The code is split into three modules: 5 | 6 | (1) dsd2pcm 7 | 8 | This is where the 8:1 decimation magic happens. It's an 9 | implementation of a symmetric 96-taps FIR lowpass filter 10 | optimized for DSD inputs. If you feed this converter with 11 | DSD64 you get a PCM stream at 352.8 kHz and floating point 12 | samples. This module is independent and can be reused. 13 | 14 | (2) noiseshape 15 | 16 | A module for applying generic noise shaping filters. It's 17 | used for the 16-bit output mode in "main" to preserve the 18 | dynamic range. This module is independent and can be reused. 19 | 20 | (3) main.cpp (file contains the main function and handles I/O) 21 | 22 | The first two modules are pure C for maximum portability. In addition, 23 | there are C++ wrapper headers for convenient use of these modules in 24 | C++. The main application is a C++ application and makes use of the 25 | C++ headers to access the functionality of the first two modules. 26 | 27 | 28 | Under Linux this program is easily compiled by typing 29 | 30 | g++ *.c *.cpp -O3 -o dsd2pcm 31 | 32 | provided you have GCC installed. That's why I didn't bother writing 33 | any makefiles. :-p 34 | 35 | 36 | Cheers! 37 | SG 38 | 39 | -------------------------------------------------------------------------------- /src/dsd2pcm/noiseshape.h: -------------------------------------------------------------------------------- 1 | #ifndef NOISE_SHAPE_H_INCLUDED 2 | #define NOISE_SHAPE_H_INCLUDED 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | typedef struct noise_shape_ctx_s { 9 | int sos_count; /* number of second order sections */ 10 | const float *bbaa; /* filter coefficients, owned by user */ 11 | float *t1, *t2; /* filter state, owned by ns library */ 12 | } noise_shape_ctx; 13 | 14 | /** 15 | * initializes a noise_shaper context 16 | * returns an error code or 0 17 | */ 18 | extern int noise_shape_init( 19 | noise_shape_ctx *ctx, 20 | int sos_count, 21 | const float *coeffs); 22 | 23 | /** 24 | * destroys a noise_shaper context 25 | */ 26 | extern void noise_shape_destroy( 27 | noise_shape_ctx *ctx); 28 | 29 | /** 30 | * initializes a noise_shaper context so that its state 31 | * is a copy of a given context 32 | * returns an error code or 0 33 | */ 34 | extern int noise_shape_clone( 35 | const noise_shape_ctx *from, noise_shape_ctx *to); 36 | 37 | /** 38 | * computes the next "noise shaping sample". Note: This call 39 | * alters the internal state. xxx_get and xxx_update must be 40 | * called in an alternating manner. 41 | */ 42 | extern float noise_shape_get( 43 | noise_shape_ctx *ctx); 44 | 45 | /** 46 | * updates the noise shaper's state with the 47 | * last quantization error 48 | */ 49 | extern void noise_shape_update( 50 | noise_shape_ctx *ctx, float qerror); 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif 55 | 56 | #endif /* NOISE_SHAPE_H_INCLUDED */ 57 | 58 | -------------------------------------------------------------------------------- /src/dsd2pcm/noiseshape.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NOISE_SHAPE_HXX_INCLUDED 2 | #define NOISE_SHAPE_HXX_INCLUDED 3 | 4 | #include 5 | #include "noiseshape.h" 6 | 7 | /** 8 | * C++ wrapper for the noiseshape C library 9 | */ 10 | 11 | class noise_shaper 12 | { 13 | noise_shape_ctx ctx; 14 | public: 15 | noise_shaper(int sos_count, const float *bbaa) 16 | { 17 | if (noise_shape_init(&ctx,sos_count,bbaa)) 18 | throw std::runtime_error("noise shaper initialization failed"); 19 | } 20 | 21 | noise_shaper(noise_shaper const& x) 22 | { 23 | if (noise_shape_clone(&x.ctx,&ctx)) 24 | throw std::runtime_error("noise shaper initialization failed"); 25 | } 26 | 27 | ~noise_shaper() 28 | { noise_shape_destroy(&ctx); } 29 | 30 | noise_shaper& operator=(noise_shaper const& x) 31 | { 32 | if (this != &x) { 33 | noise_shape_destroy(&ctx); 34 | if (noise_shape_clone(&x.ctx,&ctx)) 35 | throw std::runtime_error("noise shaper initialization failed"); 36 | } 37 | return *this; 38 | } 39 | 40 | float get() { return noise_shape_get(&ctx); } 41 | 42 | void update(float error) { noise_shape_update(&ctx,error); } 43 | }; 44 | 45 | #endif /* NOISE_SHAPE_HXX_INCLUDED */ 46 | 47 | -------------------------------------------------------------------------------- /src/dummy.cxx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Just a dummy C++ file that is linked to work around an automake 22 | * bug: automake uses CXXLD when at least one source is C++, but when 23 | * you link a static library with a C++ source, it uses CCLD. This 24 | * causes linker problems (undefined reference to 'operator 25 | * delete(void*)'), because CCLD does not link with libstdc++. 26 | * 27 | * By linking with this empty C++ source, automake decides to use 28 | * CXXLD. 29 | * 30 | */ 31 | -------------------------------------------------------------------------------- /src/encoder_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * This header is included by encoder plugins. 22 | * 23 | */ 24 | 25 | #ifndef MPD_ENCODER_API_H 26 | #define MPD_ENCODER_API_H 27 | 28 | #include "encoder_plugin.h" 29 | #include "audio_format.h" 30 | #include "tag.h" 31 | #include "conf.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/exclude.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * The .mpdignore backend code. 22 | * 23 | */ 24 | 25 | #ifndef MPD_EXCLUDE_H 26 | #define MPD_EXCLUDE_H 27 | 28 | #include 29 | 30 | #include 31 | 32 | /** 33 | * Loads and parses a .mpdignore file. 34 | */ 35 | GSList * 36 | exclude_list_load(const char *path_fs); 37 | 38 | /** 39 | * Frees a list returned by exclude_list_load(). 40 | */ 41 | void 42 | exclude_list_free(GSList *list); 43 | 44 | /** 45 | * Checks whether one of the patterns in the .mpdignore file matches 46 | * the specified file name. 47 | */ 48 | bool 49 | exclude_list_check(GSList *list, const char *name_fs); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/filter/autoconvert_filter_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef AUTOCONVERT_FILTER_PLUGIN_H 21 | #define AUTOCONVERT_FILTER_PLUGIN_H 22 | 23 | struct filter; 24 | 25 | /** 26 | * Creates a new "autoconvert" filter. When opened, it ensures that 27 | * the input audio format isn't changed. If the underlying filter 28 | * requests a different format, it automatically creates a 29 | * convert_filter. 30 | */ 31 | struct filter * 32 | autoconvert_filter_new(struct filter *filter); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/filter/convert_filter_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef CONVERT_FILTER_PLUGIN_H 21 | #define CONVERT_FILTER_PLUGIN_H 22 | 23 | struct filter; 24 | struct audio_format; 25 | 26 | /** 27 | * Sets the output audio format for the specified filter. You must 28 | * call this after the filter has been opened. Since this audio 29 | * format switch is a violation of the filter API, this filter must be 30 | * the last in a chain. 31 | */ 32 | void 33 | convert_filter_set(struct filter *filter, 34 | const struct audio_format *out_audio_format); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/filter/volume_filter_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef VOLUME_FILTER_PLUGIN_H 21 | #define VOLUME_FILTER_PLUGIN_H 22 | 23 | struct filter; 24 | 25 | unsigned 26 | volume_filter_get(const struct filter *filter); 27 | 28 | void 29 | volume_filter_set(struct filter *filter, unsigned volume); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/filter_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * Internal stuff for the filter core and filter plugins. 23 | */ 24 | 25 | #ifndef MPD_FILTER_INTERNAL_H 26 | #define MPD_FILTER_INTERNAL_H 27 | 28 | struct filter { 29 | const struct filter_plugin *plugin; 30 | }; 31 | 32 | static inline void 33 | filter_init(struct filter *filter, const struct filter_plugin *plugin) 34 | { 35 | filter->plugin = plugin; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/filter_registry.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "filter_registry.h" 22 | #include "filter_plugin.h" 23 | 24 | #include 25 | #include 26 | 27 | const struct filter_plugin *const filter_plugins[] = { 28 | &null_filter_plugin, 29 | &route_filter_plugin, 30 | &normalize_filter_plugin, 31 | &volume_filter_plugin, 32 | &replay_gain_filter_plugin, 33 | NULL, 34 | }; 35 | 36 | const struct filter_plugin * 37 | filter_plugin_by_name(const char *name) 38 | { 39 | for (unsigned i = 0; filter_plugins[i] != NULL; ++i) 40 | if (strcmp(filter_plugins[i]->name, name) == 0) 41 | return filter_plugins[i]; 42 | 43 | return NULL; 44 | } 45 | -------------------------------------------------------------------------------- /src/glib_socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_GLIB_SOCKET_H 21 | #define MPD_GLIB_SOCKET_H 22 | 23 | #include 24 | 25 | /** 26 | * Portable wrapper for g_io_channel_unix_new() or 27 | * g_io_channel_win32_new_socket(). 28 | */ 29 | G_GNUC_MALLOC 30 | static inline GIOChannel * 31 | g_io_channel_new_socket(int fd) 32 | { 33 | #ifdef G_OS_WIN32 34 | return g_io_channel_win32_new_socket(fd); 35 | #else 36 | return g_io_channel_unix_new(fd); 37 | #endif 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/icy_server.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef ICY_SERVER_H 21 | #define ICY_SERVER_H 22 | 23 | #include "page.h" 24 | #include "tag.h" 25 | 26 | #include 27 | 28 | char* 29 | icy_server_metadata_header(const char *name, 30 | const char *genre, const char *url, 31 | const char *content_type, int metaint); 32 | 33 | struct page* 34 | icy_server_metadata_page(const struct tag *tag, ...); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/inotify_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INOTIFY_QUEUE_H 21 | #define MPD_INOTIFY_QUEUE_H 22 | 23 | void 24 | mpd_inotify_queue_init(void); 25 | 26 | void 27 | mpd_inotify_queue_finish(void); 28 | 29 | void 30 | mpd_inotify_enqueue(char *uri_utf8); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/inotify_update.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INOTIFY_UPDATE_H 21 | #define MPD_INOTIFY_UPDATE_H 22 | 23 | #include "check.h" 24 | 25 | #ifdef HAVE_INOTIFY_INIT 26 | 27 | void 28 | mpd_inotify_init(unsigned max_depth); 29 | 30 | void 31 | mpd_inotify_finish(void); 32 | 33 | #else /* !HAVE_INOTIFY_INIT */ 34 | 35 | static inline void 36 | mpd_inotify_init(G_GNUC_UNUSED unsigned max_depth) 37 | { 38 | } 39 | 40 | static inline void 41 | mpd_inotify_finish(void) 42 | { 43 | } 44 | 45 | #endif /* !HAVE_INOTIFY_INIT */ 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/input/archive_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_ARCHIVE_H 21 | #define MPD_INPUT_ARCHIVE_H 22 | 23 | extern const struct input_plugin input_plugin_archive; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/input/cdio_paranoia_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_CDIO_PARANOIA_INPUT_PLUGIN_H 21 | #define MPD_CDIO_PARANOIA_INPUT_PLUGIN_H 22 | 23 | /** 24 | * An input plugin based on libcdio_paranoia library. 25 | */ 26 | extern const struct input_plugin input_plugin_cdio_paranoia; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/input/curl_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_CURL_H 21 | #define MPD_INPUT_CURL_H 22 | 23 | struct input_stream; 24 | 25 | extern const struct input_plugin input_plugin_curl; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/input/despotify_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef INPUT_DESPOTIFY_H 21 | #define INPUT_DESPOTIFY_H 22 | 23 | extern const struct input_plugin input_plugin_despotify; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/input/ffmpeg_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_FFMPEG_INPUT_PLUGIN_H 21 | #define MPD_FFMPEG_INPUT_PLUGIN_H 22 | 23 | /** 24 | * An input plugin based on libavformat's "avio" library. 25 | */ 26 | extern const struct input_plugin input_plugin_ffmpeg; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/input/file_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_FILE_H 21 | #define MPD_INPUT_FILE_H 22 | 23 | extern const struct input_plugin input_plugin_file; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/input/mms_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef INPUT_MMS_H 21 | #define INPUT_MMS_H 22 | 23 | extern const struct input_plugin input_plugin_mms; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/input/rewind_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * A wrapper for an input_stream object which allows cheap buffered 23 | * rewinding. This is useful while detecting the stream codec (let 24 | * each decoder plugin peek a portion from the stream). 25 | */ 26 | 27 | #ifndef MPD_INPUT_REWIND_H 28 | #define MPD_INPUT_REWIND_H 29 | 30 | #include "check.h" 31 | 32 | struct input_stream; 33 | 34 | struct input_stream * 35 | input_rewind_open(struct input_stream *is); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/input/soup_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_SOUP_H 21 | #define MPD_INPUT_SOUP_H 22 | 23 | extern const struct input_plugin input_plugin_soup; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/input_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_INIT_H 21 | #define MPD_INPUT_INIT_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | 28 | /** 29 | * Initializes this library and all input_stream implementations. 30 | * 31 | * @param error_r location to store the error occurring, or NULL to 32 | * ignore errors 33 | */ 34 | bool 35 | input_stream_global_init(GError **error_r); 36 | 37 | /** 38 | * Deinitializes this library and all input_stream implementations. 39 | */ 40 | void input_stream_global_finish(void); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/input_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_INPUT_INTERNAL_H 21 | #define MPD_INPUT_INTERNAL_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct input_stream; 28 | struct input_plugin; 29 | 30 | void 31 | input_stream_init(struct input_stream *is, const struct input_plugin *plugin, 32 | const char *uri, GMutex *mutex, GCond *cond); 33 | 34 | void 35 | input_stream_deinit(struct input_stream *is); 36 | 37 | void 38 | input_stream_signal_client(struct input_stream *is); 39 | 40 | void 41 | input_stream_set_ready(struct input_stream *is); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/listen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_LISTEN_H 21 | #define MPD_LISTEN_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | extern int listen_port; 28 | 29 | bool 30 | listen_global_init(GError **error_r); 31 | 32 | void listen_global_finish(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/mixer/pulse_mixer_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PULSE_MIXER_PLUGIN_H 21 | #define MPD_PULSE_MIXER_PLUGIN_H 22 | 23 | #include 24 | 25 | struct pulse_mixer; 26 | struct pa_context; 27 | struct pa_stream; 28 | 29 | void 30 | pulse_mixer_on_connect(struct pulse_mixer *pm, struct pa_context *context); 31 | 32 | void 33 | pulse_mixer_on_disconnect(struct pulse_mixer *pm); 34 | 35 | void 36 | pulse_mixer_on_change(struct pulse_mixer *pm, 37 | struct pa_context *context, struct pa_stream *stream); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/mixer/software_mixer_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef SOFTWARE_MIXER_PLUGIN_H 21 | #define SOFTWARE_MIXER_PLUGIN_H 22 | 23 | struct mixer; 24 | struct filter; 25 | 26 | /** 27 | * Returns the (volume) filter associated with this mixer. All users 28 | * of this mixer plugin should install this filter. 29 | */ 30 | struct filter * 31 | software_mixer_get_filter(struct mixer *mixer); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/mixer_api.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "mixer_api.h" 22 | 23 | #undef G_LOG_DOMAIN 24 | #define G_LOG_DOMAIN "mixer" 25 | 26 | void 27 | mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin) 28 | { 29 | mixer->plugin = plugin; 30 | mixer->mutex = g_mutex_new(); 31 | mixer->open = false; 32 | mixer->failed = false; 33 | } 34 | -------------------------------------------------------------------------------- /src/mixer_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_MIXER_H 21 | #define MPD_MIXER_H 22 | 23 | #include "mixer_plugin.h" 24 | #include "mixer_list.h" 25 | 26 | #include 27 | 28 | struct mixer { 29 | const struct mixer_plugin *plugin; 30 | 31 | /** 32 | * This mutex protects all of the mixer struct, including its 33 | * implementation, so plugins don't have to deal with that. 34 | */ 35 | GMutex *mutex; 36 | 37 | /** 38 | * Is the mixer device currently open? 39 | */ 40 | bool open; 41 | 42 | /** 43 | * Has this mixer failed, and should not be reopened 44 | * automatically? 45 | */ 46 | bool failed; 47 | }; 48 | 49 | void 50 | mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/mixer_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * This header provides "extern" declarations for all mixer plugins. 23 | */ 24 | 25 | #ifndef MPD_MIXER_LIST_H 26 | #define MPD_MIXER_LIST_H 27 | 28 | extern const struct mixer_plugin software_mixer_plugin; 29 | extern const struct mixer_plugin alsa_mixer_plugin; 30 | extern const struct mixer_plugin oss_mixer_plugin; 31 | extern const struct mixer_plugin roar_mixer_plugin; 32 | extern const struct mixer_plugin pulse_mixer_plugin; 33 | extern const struct mixer_plugin winmm_mixer_plugin; 34 | extern const struct mixer_plugin opensles_android_mixer_plugin; 35 | extern const struct mixer_plugin audiotrack_mixer_plugin; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/mixer_type.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "mixer_type.h" 22 | 23 | #include 24 | #include 25 | 26 | enum mixer_type 27 | mixer_type_parse(const char *input) 28 | { 29 | assert(input != NULL); 30 | 31 | if (strcmp(input, "none") == 0 || strcmp(input, "disabled") == 0) 32 | return MIXER_TYPE_NONE; 33 | else if (strcmp(input, "hardware") == 0) 34 | return MIXER_TYPE_HARDWARE; 35 | else if (strcmp(input, "software") == 0) 36 | return MIXER_TYPE_SOFTWARE; 37 | else 38 | return MIXER_TYPE_UNKNOWN; 39 | } 40 | -------------------------------------------------------------------------------- /src/mixer_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_MIXER_TYPE_H 21 | #define MPD_MIXER_TYPE_H 22 | 23 | enum mixer_type { 24 | /** parser error */ 25 | MIXER_TYPE_UNKNOWN, 26 | 27 | /** mixer disabled */ 28 | MIXER_TYPE_NONE, 29 | 30 | /** software mixer with pcm_volume() */ 31 | MIXER_TYPE_SOFTWARE, 32 | 33 | /** hardware mixer (output's plugin) */ 34 | MIXER_TYPE_HARDWARE, 35 | }; 36 | 37 | /** 38 | * Parses a "mixer_type" setting from the configuration file. 39 | * 40 | * @param input the configured string value; must not be NULL 41 | * @return a #mixer_type value; MIXER_TYPE_UNKNOWN means #input could 42 | * not be parsed 43 | */ 44 | enum mixer_type 45 | mixer_type_parse(const char *input); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/mpd_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ERROR_H 21 | #define MPD_ERROR_H 22 | 23 | #include 24 | 25 | /* This macro is used as an intermediate step to a proper error handling 26 | * using GError in mpd. It is used for unrecoverable error conditions 27 | * and exits immediately. The long-term goal is to replace this macro by 28 | * proper error handling. */ 29 | 30 | #define MPD_ERROR(...) \ 31 | do { \ 32 | g_critical(__VA_ARGS__); \ 33 | exit(EXIT_FAILURE); \ 34 | } while(0) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/open.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * Portability macros for opening files. 23 | */ 24 | 25 | #ifndef MPD_OPEN_H 26 | #define MPD_OPEN_H 27 | 28 | #include 29 | 30 | /* On Windows, files are opened in "text" mode by default, and the C 31 | library will mangle data being read/written; this must be switched 32 | off by specifying the proprietary "O_BINARY" flag. That sucks! */ 33 | #ifndef O_BINARY 34 | #ifdef _O_BINARY 35 | #define O_BINARY _O_BINARY 36 | #else 37 | #define O_BINARY 0 38 | #endif 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/output/alsa_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ALSA_OUTPUT_PLUGIN_H 21 | #define MPD_ALSA_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin alsa_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/ao_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_AO_OUTPUT_PLUGIN_H 21 | #define MPD_AO_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin ao_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/audiotrack_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Thomas Guillem 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ANDROID_OUTPUT_PLUGIN_H 21 | #define MPD_ANDROID_OUTPUT_PLUGIN_H 22 | 23 | #include 24 | 25 | struct audiotrack_output; 26 | struct audiotrack_mixer; 27 | extern const struct audio_output_plugin audiotrack_output_plugin; 28 | 29 | int audiotrack_set_volume(struct audiotrack_output *ao, unsigned volume); 30 | int audiotrack_get_volume(struct audiotrack_output *ao); 31 | int audiotrack_set_mixer(struct audiotrack_output *ao, struct audiotrack_mixer *am); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/output/ffado_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_FFADO_OUTPUT_PLUGIN_H 21 | #define MPD_FFADO_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin ffado_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/fifo_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_FIFO_OUTPUT_PLUGIN_H 21 | #define MPD_FIFO_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin fifo_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/httpd_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_HTTPD_OUTPUT_PLUGIN_H 21 | #define MPD_HTTPD_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin httpd_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/jack_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_JACK_OUTPUT_PLUGIN_H 21 | #define MPD_JACK_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin jack_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/mvp_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_MVP_OUTPUT_PLUGIN_H 21 | #define MPD_MVP_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin mvp_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/null_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_NULL_OUTPUT_PLUGIN_H 21 | #define MPD_NULL_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin null_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/openal_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OPENAL_OUTPUT_PLUGIN_H 21 | #define MPD_OPENAL_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin openal_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/opensles_android_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Thomas Guillem 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OPENSLES_ANDROID_OUTPUT_PLUGIN_H 21 | #define MPD_OPENSLES_ANDROID_OUTPUT_PLUGIN_H 22 | 23 | #include 24 | 25 | extern const struct audio_output_plugin opensles_android_output_plugin; 26 | 27 | struct opensles_android_output; 28 | struct opensles_android_mixer; 29 | 30 | int opensles_android_set_volume(struct opensles_android_output *ao, unsigned volume); 31 | int opensles_android_get_volume(struct opensles_android_output *ao); 32 | int opensles_android_set_mixer(struct opensles_android_output *ao, struct opensles_android_mixer *am); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/output/oss_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OSS_OUTPUT_PLUGIN_H 21 | #define MPD_OSS_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin oss_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/osx_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OSX_OUTPUT_PLUGIN_H 21 | #define MPD_OSX_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin osx_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/pipe_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PIPE_OUTPUT_PLUGIN_H 21 | #define MPD_PIPE_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin pipe_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/recorder_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_RECORDER_OUTPUT_PLUGIN_H 21 | #define MPD_RECORDER_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin recorder_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/roar_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ROAR_OUTPUT_PLUGIN_H 21 | #define MPD_ROAR_OUTPUT_PLUGIN_H 22 | 23 | #include 24 | 25 | struct roar; 26 | 27 | extern const struct audio_output_plugin roar_output_plugin; 28 | 29 | int 30 | roar_output_get_volume(struct roar *roar); 31 | 32 | bool 33 | roar_output_set_volume(struct roar *roar, unsigned volume); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/output/shout_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SHOUT_OUTPUT_PLUGIN_H 21 | #define MPD_SHOUT_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin shout_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/solaris_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SOLARIS_OUTPUT_PLUGIN_H 21 | #define MPD_SOLARIS_OUTPUT_PLUGIN_H 22 | 23 | extern const struct audio_output_plugin solaris_output_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/output/winmm_output_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_WINMM_OUTPUT_PLUGIN_H 21 | #define MPD_WINMM_OUTPUT_PLUGIN_H 22 | 23 | #include "check.h" 24 | 25 | #ifdef ENABLE_WINMM_OUTPUT 26 | 27 | #include 28 | 29 | struct winmm_output; 30 | 31 | extern const struct audio_output_plugin winmm_output_plugin; 32 | 33 | HWAVEOUT winmm_output_get_handle(struct winmm_output*); 34 | 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/output_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OUTPUT_API_H 21 | #define MPD_OUTPUT_API_H 22 | 23 | #include "output_plugin.h" 24 | #include "output_internal.h" 25 | #include "audio_format.h" 26 | #include "tag.h" 27 | #include "conf.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/output_command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Glue functions for controlling the audio outputs over the MPD 22 | * protocol. These functions perform extra validation on all 23 | * parameters, because they might be from an untrusted source. 24 | * 25 | */ 26 | 27 | #ifndef OUTPUT_COMMAND_H 28 | #define OUTPUT_COMMAND_H 29 | 30 | #include 31 | 32 | /** 33 | * Enables an audio output. Returns false if the specified output 34 | * does not exist. 35 | */ 36 | bool 37 | audio_output_enable_index(unsigned idx); 38 | 39 | /** 40 | * Disables an audio output. Returns false if the specified output 41 | * does not exist. 42 | */ 43 | bool 44 | audio_output_disable_index(unsigned idx); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/output_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OUTPUT_LIST_H 21 | #define MPD_OUTPUT_LIST_H 22 | 23 | extern const struct audio_output_plugin *const audio_output_plugins[]; 24 | 25 | const struct audio_output_plugin * 26 | audio_output_plugin_get(const char *name); 27 | 28 | #define audio_output_plugins_for_each(plugin) \ 29 | for (const struct audio_output_plugin *plugin, \ 30 | *const*output_plugin_iterator = &audio_output_plugins[0]; \ 31 | (plugin = *output_plugin_iterator) != NULL; ++output_plugin_iterator) 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/output_print.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Protocol specific code for the audio output library. 22 | * 23 | */ 24 | 25 | #include "config.h" 26 | #include "output_print.h" 27 | #include "output_internal.h" 28 | #include "output_all.h" 29 | #include "client.h" 30 | 31 | void 32 | printAudioDevices(struct client *client) 33 | { 34 | unsigned n = audio_output_count(); 35 | 36 | for (unsigned i = 0; i < n; ++i) { 37 | const struct audio_output *ao = audio_output_get(i); 38 | 39 | client_printf(client, 40 | "outputid: %i\n" 41 | "outputname: %s\n" 42 | "outputenabled: %i\n", 43 | i, ao->name, ao->enabled); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/output_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Protocol specific code for the audio output library. 22 | * 23 | */ 24 | 25 | #ifndef OUTPUT_PRINT_H 26 | #define OUTPUT_PRINT_H 27 | 28 | struct client; 29 | 30 | void 31 | printAudioDevices(struct client *client); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/output_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * Saving and loading the audio output states to/from the state file. 22 | * 23 | */ 24 | 25 | #ifndef OUTPUT_STATE_H 26 | #define OUTPUT_STATE_H 27 | 28 | #include 29 | #include 30 | 31 | bool 32 | audio_output_state_read(const char *line); 33 | 34 | void 35 | audio_output_state_save(FILE *fp); 36 | 37 | /** 38 | * Generates a version number for the current state of the audio 39 | * outputs. This is used by timer_save_state_file() to determine 40 | * whether the state has changed and the state file should be saved. 41 | */ 42 | unsigned 43 | audio_output_state_get_version(void); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/output_thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_OUTPUT_THREAD_H 21 | #define MPD_OUTPUT_THREAD_H 22 | 23 | struct audio_output; 24 | 25 | void audio_output_thread_start(struct audio_output *ao); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/pcm_dither.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PCM_DITHER_H 21 | #define MPD_PCM_DITHER_H 22 | 23 | #include 24 | 25 | struct pcm_dither { 26 | int32_t error[3]; 27 | int32_t random; 28 | }; 29 | 30 | static inline void 31 | pcm_dither_24_init(struct pcm_dither *dither) 32 | { 33 | dither->error[0] = dither->error[1] = dither->error[2] = 0; 34 | dither->random = 0; 35 | } 36 | 37 | void 38 | pcm_dither_24_to_16(struct pcm_dither *dither, 39 | int16_t *dest, const int32_t *src, const int32_t *src_end); 40 | 41 | void 42 | pcm_dither_32_to_16(struct pcm_dither *dither, 43 | int16_t *dest, const int32_t *src, const int32_t *src_end); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/pcm_dsd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PCM_DSD_H 21 | #define MPD_PCM_DSD_H 22 | 23 | #include "check.h" 24 | #include "pcm_buffer.h" 25 | 26 | #include 27 | #include 28 | 29 | /** 30 | * Wrapper for the dsd2pcm library. 31 | */ 32 | struct pcm_dsd { 33 | struct pcm_buffer buffer; 34 | 35 | struct dsd2pcm_ctx_s *dsd2pcm[32]; 36 | }; 37 | 38 | void 39 | pcm_dsd_init(struct pcm_dsd *dsd); 40 | 41 | void 42 | pcm_dsd_deinit(struct pcm_dsd *dsd); 43 | 44 | void 45 | pcm_dsd_reset(struct pcm_dsd *dsd); 46 | 47 | const float * 48 | pcm_dsd_to_float(struct pcm_dsd *dsd, unsigned channels, bool lsbfirst, 49 | const uint8_t *src, size_t src_size, 50 | size_t *dest_size_r); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/pcm_dsd_usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PCM_DSD_USB_H 21 | #define MPD_PCM_DSD_USB_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | struct pcm_buffer; 30 | 31 | /** 32 | * Pack DSD 1 bit samples into (padded) 24 bit PCM samples for 33 | * playback over USB, according to the proposed standard by 34 | * dCS and others: 35 | * http://www.sonore.us/DoP_openStandard_1v1.pdf 36 | */ 37 | const uint32_t * 38 | pcm_dsd_to_usb(struct pcm_buffer *buffer, unsigned channels, 39 | const uint8_t *src, size_t src_size, 40 | size_t *dest_size_r); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/pcm_prng.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef PCM_PRNG_H 21 | #define PCM_PRNG_H 22 | 23 | /** 24 | * A very simple linear congruential PRNG. It's good enough for PCM 25 | * dithering. 26 | */ 27 | static unsigned long 28 | pcm_prng(unsigned long state) 29 | { 30 | return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/permission.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PERMISSION_H 21 | #define MPD_PERMISSION_H 22 | 23 | #define PERMISSION_NONE 0 24 | #define PERMISSION_READ 1 25 | #define PERMISSION_ADD 2 26 | #define PERMISSION_CONTROL 4 27 | #define PERMISSION_ADMIN 8 28 | 29 | 30 | int getPermissionFromPassword(char const* password, unsigned* permission); 31 | 32 | void finishPermissions(void); 33 | 34 | unsigned getDefaultPermissions(void); 35 | 36 | void initPermissions(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/playlist/asx_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_ASX_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_ASX_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin asx_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/cue_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_CUE_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_CUE_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin cue_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/despotify_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_DESPOTIFY_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_DESPOTIFY_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin despotify_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/embcue_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_EMBCUE_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_EMBCUE_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin embcue_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/extm3u_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_EXTM3U_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_EXTM3U_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin extm3u_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/lastfm_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_LASTFM_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_LASTFM_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin lastfm_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/m3u_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_M3U_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_M3U_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin m3u_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/pls_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_PLS_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_PLS_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin pls_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/rss_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_RSS_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_RSS_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin rss_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/soundcloud_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_SOUNDCLOUD_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_SOUNDCLOUD_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin soundcloud_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist/xspf_playlist_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_XSPF_PLAYLIST_PLUGIN_H 21 | #define MPD_PLAYLIST_XSPF_PLAYLIST_PLUGIN_H 22 | 23 | extern const struct playlist_plugin xspf_playlist_plugin; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/playlist_any.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_ANY_H 21 | #define MPD_PLAYLIST_ANY_H 22 | 23 | #include 24 | 25 | struct playlist_provider; 26 | struct input_stream; 27 | 28 | /** 29 | * Opens a playlist from the specified URI, which can be either an 30 | * absolute remote URI (with a scheme) or a relative path to the 31 | * music orplaylist directory. 32 | * 33 | * @param is_r on success, an input_stream object may be returned 34 | * here, which must be closed after the playlist_provider object is 35 | * freed 36 | */ 37 | struct playlist_provider * 38 | playlist_open_any(const char *uri, GMutex *mutex, GCond *cond, 39 | struct input_stream **is_r); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/playlist_database.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_DATABASE_H 21 | #define MPD_PLAYLIST_DATABASE_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #define PLAYLIST_META_BEGIN "playlist_begin: " 30 | 31 | struct list_head; 32 | 33 | void 34 | playlist_vector_save(FILE *fp, const struct list_head *pv); 35 | 36 | bool 37 | playlist_metadata_load(FILE *fp, struct list_head *pv, const char *name, 38 | GString *buffer, GError **error_r); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/playlist_mapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_MAPPER_H 21 | #define MPD_PLAYLIST_MAPPER_H 22 | 23 | #include 24 | 25 | struct input_stream; 26 | 27 | /** 28 | * Opens a playlist from an URI relative to the playlist or music 29 | * directory. 30 | * 31 | * @param is_r on success, an input_stream object may be returned 32 | * here, which must be closed after the playlist_provider object is 33 | * freed 34 | */ 35 | struct playlist_provider * 36 | playlist_mapper_open(const char *uri, GMutex *mutex, GCond *cond, 37 | struct input_stream **is_r); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/playlist_song.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PLAYLIST_SONG_H 21 | #define MPD_PLAYLIST_SONG_H 22 | 23 | #include 24 | 25 | /** 26 | * Verifies the song, returns NULL if it is unsafe. Translate the 27 | * song to a new song object within the database, if it is a local 28 | * file. The old song object is freed. 29 | * 30 | * @param secure if true, then local files are only allowed if they 31 | * are relative to base_uri 32 | */ 33 | struct song * 34 | playlist_check_translate_song(struct song *song, const char *base_uri, 35 | bool secure); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/protocol/result.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_PROTOCOL_RESULT_H 21 | #define MPD_PROTOCOL_RESULT_H 22 | 23 | #include "check.h" 24 | #include "ack.h" 25 | 26 | #include 27 | 28 | struct client; 29 | 30 | extern const char *current_command; 31 | extern int command_list_num; 32 | 33 | void 34 | command_success(struct client *client); 35 | 36 | void 37 | command_error_v(struct client *client, enum ack error, 38 | const char *fmt, va_list args); 39 | 40 | G_GNUC_PRINTF(3, 4) 41 | void 42 | command_error(struct client *client, enum ack error, const char *fmt, ...); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/queue_save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * This library saves the queue into the state file, and also loads it 22 | * back into memory. 23 | */ 24 | 25 | #ifndef QUEUE_SAVE_H 26 | #define QUEUE_SAVE_H 27 | 28 | #include 29 | #include 30 | 31 | struct queue; 32 | 33 | void 34 | queue_save(FILE *fp, const struct queue *queue); 35 | 36 | /** 37 | * Loads one song from the state file and appends it to the queue. 38 | */ 39 | void 40 | queue_load_song(FILE *fp, GString *buffer, const char *line, 41 | struct queue *queue); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/replay_gain_ape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_REPLAY_GAIN_APE_H 21 | #define MPD_REPLAY_GAIN_APE_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct replay_gain_info; 28 | 29 | bool 30 | replay_gain_ape_read(const char *path_fs, struct replay_gain_info *info); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/riff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /** \file 21 | * 22 | * A parser for the RIFF file format (e.g. WAV). 23 | */ 24 | 25 | #ifndef MPD_RIFF_H 26 | #define MPD_RIFF_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | /** 33 | * Seeks the RIFF file to the ID3 chunk. 34 | * 35 | * @return the size of the ID3 chunk on success, or 0 if this is not a 36 | * RIFF file or no ID3 chunk was found 37 | */ 38 | size_t 39 | riff_seek_id3(FILE *file); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/sig_handlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SIG_HANDLERS_H 21 | #define MPD_SIG_HANDLERS_H 22 | 23 | void initSigHandlers(void); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/song_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SONG_PRINT_H 21 | #define MPD_SONG_PRINT_H 22 | 23 | struct client; 24 | struct song; 25 | struct songvec; 26 | 27 | void 28 | song_print_info(struct client *client, struct song *song); 29 | 30 | void 31 | song_print_uri(struct client *client, struct song *song); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/song_save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SONG_SAVE_H 21 | #define MPD_SONG_SAVE_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | #define SONG_BEGIN "song_begin: " 28 | 29 | struct song; 30 | struct directory; 31 | 32 | void 33 | song_save(FILE *fp, const struct song *song); 34 | 35 | /** 36 | * Loads a song from the input file. Reading stops after the 37 | * "song_end" line. 38 | * 39 | * @param error_r location to store the error occurring, or NULL to 40 | * ignore errors 41 | * @return true on success, false on error 42 | */ 43 | struct song * 44 | song_load(FILE *fp, struct directory *parent, const char *uri, 45 | GString *buffer, GError **error_r); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/song_sort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SONG_SORT_H 21 | #define MPD_SONG_SORT_H 22 | 23 | struct list_head; 24 | 25 | void 26 | song_list_sort(struct list_head *songs); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/state_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_STATE_FILE_H 21 | #define MPD_STATE_FILE_H 22 | 23 | struct player_control; 24 | 25 | void 26 | state_file_init(const char *path, struct player_control *pc); 27 | 28 | void 29 | state_file_finish(struct player_control *pc); 30 | 31 | void write_state_file(void); 32 | 33 | #endif /* STATE_FILE_H */ 34 | -------------------------------------------------------------------------------- /src/sticker_print.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "sticker_print.h" 22 | #include "sticker.h" 23 | #include "client.h" 24 | 25 | void 26 | sticker_print_value(struct client *client, 27 | const char *name, const char *value) 28 | { 29 | client_printf(client, "sticker: %s=%s\n", name, value); 30 | } 31 | 32 | static void 33 | print_sticker_cb(const char *name, const char *value, gpointer data) 34 | { 35 | struct client *client = data; 36 | 37 | sticker_print_value(client, name, value); 38 | } 39 | 40 | void 41 | sticker_print(struct client *client, const struct sticker *sticker) 42 | { 43 | sticker_foreach(sticker, print_sticker_cb, client); 44 | } 45 | -------------------------------------------------------------------------------- /src/sticker_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_STICKER_PRINT_H 21 | #define MPD_STICKER_PRINT_H 22 | 23 | struct sticker; 24 | struct client; 25 | 26 | /** 27 | * Sends one sticker value to the client. 28 | */ 29 | void 30 | sticker_print_value(struct client *client, 31 | const char *name, const char *value); 32 | 33 | /** 34 | * Sends all sticker values to the client. 35 | */ 36 | void 37 | sticker_print(struct client *client, const struct sticker *sticker); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/string_util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "string_util.h" 22 | 23 | #include 24 | 25 | #include 26 | 27 | const char * 28 | strchug_fast_c(const char *p) 29 | { 30 | while (*p != 0 && g_ascii_isspace(*p)) 31 | ++p; 32 | 33 | return p; 34 | } 35 | 36 | bool 37 | string_array_contains(const char *const* haystack, const char *needle) 38 | { 39 | assert(haystack != NULL); 40 | assert(needle != NULL); 41 | 42 | for (; *haystack != NULL; ++haystack) 43 | if (g_ascii_strcasecmp(*haystack, needle) == 0) 44 | return true; 45 | 46 | return false; 47 | } 48 | -------------------------------------------------------------------------------- /src/tag_ape.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_APE_H 21 | #define MPD_TAG_APE_H 22 | 23 | #include "tag_table.h" 24 | 25 | #include 26 | 27 | struct tag_handler; 28 | 29 | extern const struct tag_table ape_tags[]; 30 | 31 | /** 32 | * Scan the APE tags of a file. 33 | * 34 | * @param path_fs the path of the file in filesystem encoding 35 | */ 36 | bool 37 | tag_ape_scan2(const char *path_fs, 38 | const struct tag_handler *handler, void *handler_ctx); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/tag_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_FILE_H 21 | #define MPD_TAG_FILE_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct tag_handler; 28 | 29 | /** 30 | * Scan the tags of a song file. Invokes matching decoder plugins, 31 | * but does not invoke the special "APE" and "ID3" scanners. 32 | */ 33 | bool 34 | tag_file_scan(const char *path_fs, 35 | const struct tag_handler *handler, void *handler_ctx); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/tag_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_INTERNAL_H 21 | #define MPD_TAG_INTERNAL_H 22 | 23 | #include "tag.h" 24 | 25 | #include 26 | 27 | extern bool ignore_tag_items[TAG_NUM_OF_ITEM_TYPES]; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/tag_pool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_POOL_H 21 | #define MPD_TAG_POOL_H 22 | 23 | #include "tag.h" 24 | 25 | #include 26 | 27 | extern GMutex *tag_pool_lock; 28 | 29 | struct tag_item; 30 | 31 | void tag_pool_init(void); 32 | 33 | void tag_pool_deinit(void); 34 | 35 | struct tag_item * 36 | tag_pool_get_item(enum tag_type type, const char *value, size_t length); 37 | 38 | struct tag_item *tag_pool_dup_item(struct tag_item *item); 39 | 40 | void tag_pool_put_item(struct tag_item *item); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/tag_print.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_PRINT_H 21 | #define MPD_TAG_PRINT_H 22 | 23 | struct tag; 24 | struct client; 25 | 26 | void tag_print_types(struct client *client); 27 | 28 | void tag_print(struct client *client, const struct tag *tag); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/tag_rva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_RVA2_H 21 | #define MPD_TAG_RVA2_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct id3_tag; 28 | struct replay_gain_info; 29 | 30 | /** 31 | * Parse the RVA2 tag, and fill the #replay_gain_info struct. This is 32 | * used by decoder plugins with ID3 support. 33 | * 34 | * @return true on success 35 | */ 36 | bool 37 | tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/tag_save.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "config.h" 21 | #include "tag_save.h" 22 | #include "tag.h" 23 | #include "tag_internal.h" 24 | #include "song.h" 25 | 26 | void tag_save(FILE *file, const struct tag *tag) 27 | { 28 | if (tag->time >= 0) 29 | fprintf(file, SONG_TIME "%i\n", tag->time); 30 | 31 | if (tag->has_playlist) 32 | fprintf(file, "Playlist: yes\n"); 33 | 34 | for (unsigned i = 0; i < tag->num_items; i++) 35 | fprintf(file, "%s: %s\n", 36 | tag_item_names[tag->items[i]->type], 37 | tag->items[i]->value); 38 | } 39 | -------------------------------------------------------------------------------- /src/tag_save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TAG_SAVE_H 21 | #define MPD_TAG_SAVE_H 22 | 23 | #include 24 | 25 | struct tag; 26 | 27 | void tag_save(FILE *file, const struct tag *tag); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/text_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TEXT_FILE_H 21 | #define MPD_TEXT_FILE_H 22 | 23 | #include 24 | 25 | #include 26 | 27 | /** 28 | * Reads a line from the input file, and strips trailing space. There 29 | * is a reasonable maximum line length, only to prevent denial of 30 | * service. 31 | * 32 | * @param file the source file, opened in text mode 33 | * @param buffer an allocator for the buffer 34 | * @return a pointer to the line, or NULL on end-of-file or error 35 | */ 36 | char * 37 | read_text_line(FILE *file, GString *buffer); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TIMER_H 21 | #define MPD_TIMER_H 22 | 23 | #include 24 | 25 | struct audio_format; 26 | 27 | struct timer { 28 | uint64_t time; 29 | int started; 30 | int rate; 31 | }; 32 | 33 | struct timer *timer_new(const struct audio_format *af); 34 | 35 | void timer_free(struct timer *timer); 36 | 37 | void timer_start(struct timer *timer); 38 | 39 | void timer_reset(struct timer *timer); 40 | 41 | void timer_add(struct timer *timer, int size); 42 | 43 | /** 44 | * Returns the number of milliseconds to sleep to get back to sync. 45 | */ 46 | unsigned 47 | timer_delay(const struct timer *timer); 48 | 49 | void timer_sync(struct timer *timer); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/update.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_H 21 | #define MPD_UPDATE_H 22 | 23 | #include 24 | 25 | void update_global_init(void); 26 | 27 | void update_global_finish(void); 28 | 29 | unsigned 30 | isUpdatingDB(void); 31 | 32 | /** 33 | * Add this path to the database update queue. 34 | * 35 | * @param path a path to update; if NULL or an empty string, 36 | * the whole music directory is updated 37 | * @return the job id, or 0 on error 38 | */ 39 | unsigned 40 | update_enqueue(const char *path, bool discard); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/update_container.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_CONTAINER_H 21 | #define MPD_UPDATE_CONTAINER_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | 28 | struct directory; 29 | struct decoder_plugin; 30 | 31 | bool 32 | update_container_file(struct directory *directory, 33 | const char *name, 34 | const struct stat *st, 35 | const struct decoder_plugin *plugin); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/update_db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_DB_H 21 | #define MPD_UPDATE_DB_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | struct directory; 28 | struct song; 29 | 30 | /** 31 | * Caller must lock the #db_mutex. 32 | */ 33 | void 34 | delete_song(struct directory *parent, struct song *song); 35 | 36 | /** 37 | * Recursively free a directory and all its contents. 38 | * 39 | * Caller must lock the #db_mutex. 40 | */ 41 | void 42 | delete_directory(struct directory *directory); 43 | 44 | /** 45 | * Caller must NOT lock the #db_mutex. 46 | * 47 | * @return true if the database was modified 48 | */ 49 | bool 50 | delete_name_in(struct directory *parent, const char *name); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/update_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_INTERNAL_H 21 | #define MPD_UPDATE_INTERNAL_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | extern bool walk_discard; 28 | extern bool modified; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/update_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_QUEUE_H 21 | #define MPD_UPDATE_QUEUE_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | unsigned 28 | update_queue_push(const char *path, bool discard, unsigned base); 29 | 30 | char * 31 | update_queue_shift(bool *discard_r); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/update_remove.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_REMOVE_H 21 | #define MPD_UPDATE_REMOVE_H 22 | 23 | #include "check.h" 24 | 25 | struct song; 26 | 27 | void 28 | update_remove_global_init(void); 29 | 30 | void 31 | update_remove_global_finish(void); 32 | 33 | /** 34 | * Sends a signal to the main thread which will in turn remove the 35 | * song: from the sticker database and from the playlist. This 36 | * serialized access is implemented to avoid excessive locking. 37 | */ 38 | void 39 | update_remove_song(const struct song *song); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/update_song.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_SONG_H 21 | #define MPD_UPDATE_SONG_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | #include 27 | 28 | struct directory; 29 | 30 | bool 31 | update_song_file(struct directory *directory, 32 | const char *name, const char *suffix, 33 | const struct stat *st); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/update_walk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UPDATE_WALK_H 21 | #define MPD_UPDATE_WALK_H 22 | 23 | #include "check.h" 24 | 25 | #include 26 | 27 | void 28 | update_walk_global_init(void); 29 | 30 | void 31 | update_walk_global_finish(void); 32 | 33 | /** 34 | * Returns true if the database was modified. 35 | */ 36 | bool 37 | update_walk(const char *path, bool discard); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/util/bit_reverse.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #include "bit_reverse.h" 21 | 22 | /** 23 | * @see http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable 24 | */ 25 | const uint8_t bit_reverse_table[256] = 26 | { 27 | #define R2(n) n, n + 2*64, n + 1*64, n + 3*64 28 | #define R4(n) R2(n), R2(n + 2*16), R2(n + 1*16), R2(n + 3*16) 29 | #define R6(n) R4(n), R4(n + 2*4 ), R4(n + 1*4 ), R4(n + 3*4 ) 30 | R6(0), R6(2), R6(1), R6(3) 31 | }; 32 | -------------------------------------------------------------------------------- /src/util/bit_reverse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_BIT_REVERSE_H 21 | #define MPD_BIT_REVERSE_H 22 | 23 | #include 24 | #include 25 | 26 | extern const uint8_t bit_reverse_table[256]; 27 | 28 | G_GNUC_CONST 29 | static inline uint8_t 30 | bit_reverse(uint8_t x) 31 | { 32 | return bit_reverse_table[x]; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/util/list_sort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2012 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* 21 | * This code was imported from the Linux kernel. 22 | * 23 | */ 24 | 25 | #ifndef _LINUX_LIST_SORT_H 26 | #define _LINUX_LIST_SORT_H 27 | 28 | struct list_head; 29 | 30 | void list_sort(void *priv, struct list_head *head, 31 | int (*cmp)(void *priv, struct list_head *a, 32 | struct list_head *b)); 33 | #endif 34 | -------------------------------------------------------------------------------- /src/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_UTILS_H 21 | #define MPD_UTILS_H 22 | 23 | #include 24 | #include 25 | 26 | #ifndef assert_static 27 | /* Compile time assertion developed by Ralf Holly */ 28 | /* http://pera-software.com/articles/compile-time-assertions.pdf */ 29 | #define assert_static(e) \ 30 | do { \ 31 | enum { assert_static__ = 1/(e) }; \ 32 | } while (0) 33 | #endif /* !assert_static */ 34 | 35 | char * 36 | parsePath(const char *path, GError **error_r); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/volume.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_VOLUME_H 21 | #define MPD_VOLUME_H 22 | 23 | #include 24 | #include 25 | 26 | void volume_init(void); 27 | 28 | void volume_finish(void); 29 | 30 | int volume_level_get(void); 31 | 32 | bool volume_level_change(unsigned volume); 33 | 34 | bool 35 | read_sw_volume_state(const char *line); 36 | 37 | void save_sw_volume_state(FILE *fp); 38 | 39 | /** 40 | * Generates a hash number for the current state of the software 41 | * volume control. This is used by timer_save_state_file() to 42 | * determine whether the state has changed and the state file should 43 | * be saved. 44 | */ 45 | unsigned 46 | sw_volume_state_get_hash(void); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/win/mpd.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tguillem/android-mpd/8dc248f111dbbfb952431e93f6ab6d00c80a0906/src/win/mpd.ico -------------------------------------------------------------------------------- /src/win/mpd_win32_rc.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define VERSION_NUMBER @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@ 4 | #define VERSION_NUMBER_STR "@VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,@VERSION_EXTRA@" 5 | 6 | MPD_ICON ICON "@top_srcdir@/src/win/mpd.ico" 7 | 8 | 1 VERSIONINFO 9 | FILETYPE VFT_APP 10 | FILEOS VOS__WINDOWS32 11 | PRODUCTVERSION VERSION_NUMBER 12 | 13 | FILEVERSION VERSION_NUMBER 14 | BEGIN 15 | BLOCK "StringFileInfo" 16 | BEGIN 17 | BLOCK "040904B0" 18 | BEGIN 19 | VALUE "CompanyName", "Music Player Daemon Project" 20 | VALUE "ProductName", "Music Player Daemon" 21 | VALUE "ProductVersion", VERSION_NUMBER_STR 22 | VALUE "InternalName", "mpd" 23 | VALUE "OriginalFilename", "mpd.exe" 24 | VALUE "FileVersion", "@VERSION@" 25 | VALUE "FileDescription", "Music Player Daemon @VERSION@" 26 | VALUE "LegalCopyright", "Copyright \251 The Music Player Daemon Project" 27 | END 28 | END 29 | 30 | BLOCK "VarFileInfo" 31 | BEGIN 32 | VALUE "Translation", 0x409, 1200 33 | END 34 | END 35 | -------------------------------------------------------------------------------- /src/zeroconf-internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef ZEROCONF_INTERNAL_H 21 | #define ZEROCONF_INTERNAL_H 22 | 23 | /* The dns-sd service type qualifier to publish */ 24 | #define SERVICE_TYPE "_mpd._tcp" 25 | 26 | void init_avahi(const char *service_name); 27 | 28 | void avahi_finish(void); 29 | 30 | void init_zeroconf_osx(const char *service_name); 31 | 32 | void bonjour_finish(void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/zeroconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_ZEROCONF_H 21 | #define MPD_ZEROCONF_H 22 | 23 | #include "check.h" 24 | 25 | #ifdef HAVE_ZEROCONF 26 | 27 | void initZeroconf(void); 28 | void finishZeroconf(void); 29 | 30 | #else /* ! HAVE_ZEROCONF */ 31 | 32 | static void initZeroconf(void) { } 33 | static void finishZeroconf(void) { } 34 | 35 | #endif /* ! HAVE_ZEROCONF */ 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /test/signals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_SIGNALS_H 21 | #define MPD_SIGNALS_H 22 | 23 | void 24 | on_quit(void); 25 | 26 | void 27 | signals_init(void); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /test/stdbin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_STDBIN_H 21 | #define MPD_STDBIN_H 22 | 23 | #ifdef WIN32 24 | #include 25 | /** set binary mode on stdin/stdout */ 26 | int _CRT_fmode = _O_BINARY; 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /test/test_archive_bzip2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=configure 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.bz2" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | bzip2 -c "$SRC" >"$DST" 10 | ./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" - 11 | -------------------------------------------------------------------------------- /test/test_archive_iso9660.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=configure 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.iso" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | mkisofs -quiet -l -o "$DST" "$SRC" 10 | ./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" - 11 | -------------------------------------------------------------------------------- /test/test_archive_zzip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | SRC_BASE=configure 4 | SRC="$(dirname $0)/../${SRC_BASE}" 5 | DST="$(pwd)/test/tmp/${SRC_BASE}.zip" 6 | 7 | mkdir -p test/tmp 8 | rm -f "$DST" 9 | zip --quiet --junk-paths "$DST" "$SRC" 10 | ./test/run_input "$DST/${SRC_BASE}" |diff "$SRC" - 11 | -------------------------------------------------------------------------------- /test/test_pcm_all.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2011 The Music Player Daemon Project 3 | * http://www.musicpd.org 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along 16 | * with this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef MPD_TEST_PCM_ALL_H 21 | #define MPD_TEST_PCM_ALL_H 22 | 23 | void 24 | test_pcm_dither_24(void); 25 | 26 | void 27 | test_pcm_dither_32(void); 28 | 29 | void 30 | test_pcm_pack_24(void); 31 | 32 | void 33 | test_pcm_unpack_24(void); 34 | 35 | void 36 | test_pcm_channels_16(void); 37 | 38 | void 39 | test_pcm_channels_32(void); 40 | 41 | void 42 | test_pcm_volume_8(void); 43 | 44 | void 45 | test_pcm_volume_16(void); 46 | 47 | void 48 | test_pcm_volume_24(void); 49 | 50 | void 51 | test_pcm_volume_32(void); 52 | 53 | void 54 | test_pcm_volume_float(void); 55 | 56 | #endif 57 | --------------------------------------------------------------------------------