Commit Graph

110 Commits

Author SHA1 Message Date
Max Kellermann
8074b82653 conf: detect duplicate parameters in config_add_block_param()
Moved the check from config_get_block_param().  Detect the duplicate
parameter when it's added, not when it's queried.
2009-06-25 08:41:09 +02:00
Max Kellermann
5d583c9b2d conf: make get_bool() return a bool
Instead of returning an artificial three-state integer, return a
"success" value and put the boolean value into a "bool" pointer.
That's a little bit more overhead, but an API which looks more
natural.
2009-06-25 08:40:02 +02:00
Max Kellermann
093e900d44 conf: moved code from get_bool() to string_array_contains() 2009-06-25 08:39:53 +02:00
Max Kellermann
8965b66ce4 conf: register configuration options statically
Initialize the config_entries array at compile time.  This is not only
faster, but also smaller.
2009-06-25 08:39:44 +02:00
Max Kellermann
146add67c2 conf: removed config_add_param()
This function is unused.
2009-06-25 08:39:01 +02:00
Max Kellermann
34e9a0a960 conf: replace "mask" bit field with two "bool" variables
Due to padding, this takes the same amount of memory.
2009-06-25 08:38:51 +02:00
Max Kellermann
b1e95b1fa8 volume: removed support for legacy mixer configuration
The top-level "mixer_device" and "mixer_control" options have been
deprecated by MPD 0.15, and it's safe to remove them in MPD 0.16.
2009-06-25 08:37:51 +02:00
Daniel Seuthe
4ffd9bce5a Preamp for missing replay-gain 2009-06-25 08:36:35 +02:00
Max Kellermann
70d7c79546 conf: make config_param.num_block_params unsigned 2009-06-03 06:55:09 +02:00
Max Kellermann
ddc2694419 conf: eliminated CamelCase
Renamed all remaining CamelCase functions.
2009-06-03 06:55:04 +02:00
Max Kellermann
b2924405ae conf: use g_ascii_strcasecmp() instead of strcasecmp()
strcasecmp() is locale dependent, making it a bad choice for internal
string comparisons.
2009-04-28 09:32:09 +02:00
Avuton Olrich
6405db931b conf: config_param_free() not necessary for export. 2009-03-30 19:21:41 +02:00
Avuton Olrich
0aee49bdf8 all: Update copyright header.
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Max Kellermann
cfb350f4f0 input: pass config_param to input_plugin.init()
Allow input plugins to configure with an "input" block in mpd.conf.
Also allow the user to disable a plugin completely.
2009-03-02 23:08:17 +01:00
Max Kellermann
eac2da635d added G_LOG_DOMAIN macros to several libraries
Define the GLib logging domain in the following libraries: conf,
daemon, event_pipe, log.
2009-02-19 09:24:59 +01:00
Max Kellermann
11e680d640 conf: log the effective configuration file name
For better debugging aid when something goes wrong, log the name of
the effective configuration file.
2009-02-19 08:35:22 +01:00
Max Kellermann
6cfacc778c decoder_list: added configuration block "decoder"
The "decoder" configuration block may contain the configuration of one
decoder plugin.
2009-02-15 18:35:19 +01:00
Max Kellermann
cb1f2e0c01 conf: added config_add_param()
The function config_add_param() allows adding new configuration
parameters.
2009-01-25 17:37:45 +01:00
Max Kellermann
3635c93acb conf: allow param==NULL
Return the default value in the conf_get_block_*() functions when
param==NULL was passed.

This simplifies a lot of code, because all initialization can be done
in one code path, regardless whether configuration is present.
2009-01-25 16:04:03 +01:00
Max Kellermann
5f77910097 conf: const pointers in block get functions
All config_get_block_*() functions should accept constant config_param
pointers.
2009-01-25 16:03:49 +01:00
Max Kellermann
f11eb14c8a conf: added config_get_positive()
This convenience function parses a configuration value into a positive
integer.  It aborts if parsing fails.
2009-01-21 08:46:59 +01:00
Max Kellermann
145ab84d51 sticker: new library for storing dynamic information about songs
"Stickers" are pieces of information attached to existing MPD objects
(e.g. song files, directories, albums).  Clients can create arbitrary
name/value pairs.  MPD itself does not assume any special meaning in
them.
2009-01-19 18:51:57 +01:00
Max Kellermann
65f2386b39 conf: added config_get_block_unsigned()
Eliminate some more getBlockParam() invocations.
2009-01-18 19:45:51 +01:00
Max Kellermann
a531a1e650 conf: added config_get_block_string()
This replaces lots of getBlockParam() invocations.
2009-01-18 19:37:27 +01:00
Max Kellermann
70c6cc33f0 conf: removed parseConfigFilePath()
Use config_get_path() instead in mapper.c.
2009-01-18 18:59:10 +01:00
Max Kellermann
9c6b2a32f5 conf: added config_get_path()
config_get_path() is an simpler interface than parseConfigFilePath().
2009-01-18 17:54:46 +01:00
Max Kellermann
0b29a22c08 conf: replaced getConfigParamValue() with config_get_string()
Don't return a writable pointer.
2009-01-17 20:23:58 +01:00
Max Kellermann
7acc62366c conf: replaced getBoolBlockParam() with config_get_block_bool()
No "force" parameter, pass a default value instead.
2009-01-17 20:23:56 +01:00
Max Kellermann
a1a97cc048 conf: use config_get_bool() instead of getBoolConfigParam() 2009-01-17 20:23:33 +01:00
Max Kellermann
4d472c265e conf: no CamelCase, part I
Renamed functions, types, variables.
2009-01-17 20:23:27 +01:00
Viliam Mateicka
d357f58542 removing mixer_reconfigure memmory leak, fixing configure of alsa and oss mixer (passing parameters) 2009-01-11 17:13:01 +01:00
Max Kellermann
206611e280 conf: use GLib instead of utils.h 2009-01-03 14:53:34 +01:00
Max Kellermann
e943b9bf13 conf: use GLib's GSList library
Use GLib's singly-linked list library instead of our custom one.
2009-01-02 18:40:43 +01:00
Viliam Mateicka
dd9af72a74 exporting functions 2008-12-31 15:10:53 +01:00
Max Kellermann
95b3430f52 removed os_compat.h
Only include headers which are really needed.  os_compat.h aimed to
make MPD easily portable, but was never actually made portable.
2008-12-29 17:28:32 +01:00
Max Kellermann
1914e11466 conf: use GLib instead of utils.h/log.h 2008-12-28 19:54:49 +01:00
Max Kellermann
859aac7242 utils: removed myFgets()
Replaced myFgets() with fgets() + g_strchomp().
2008-12-28 19:54:49 +01:00
Avuton Olrich
e75e40085f Remove obsolete http_buffer* stuff that went away with the new curl backend. 2008-12-20 22:16:02 -08:00
Raphaël Rigo
5b089f85fd update: added options which control symlink behaviour
The configuration options "follow_outside_symlinks" and
"follow_inside_symlinks" let the user control whether MPD should
follow symbolic links in the music directory.

[mk: converted variables to "bool"; moved configuration to
update_global_init()]
2008-11-28 10:57:39 +01:00
Max Kellermann
bd0653f440 conf: added config_get_bool()
In contrast to, getBoolConfigParam(), config_get_bool() properly
returns a "bool" value.  In case of "unset", it returns the default
value provided by the caller.
2008-11-27 19:19:34 +01:00
Max Kellermann
6fbdc721d9 fix -Wconst warnings
[ew: cleaned up the dirty union hack a bit]
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-02-05 10:17:33 +00:00
Eric Wong
cb8f1af3bd Cleanup #includes of standard system headers and put them in one place
This will make refactoring features easier, especially now that
pthreads support and larger refactorings are on the horizon.

Hopefully, this will make porting to other platforms (even
non-UNIX-like ones for masochists) easier, too.

os_compat.h will house all the #includes for system headers
considered to be the "core" of MPD.  Headers for optional
features will be left to individual source files.

git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03 07:29:49 +00:00
Eric Wong
b79f6b882a Merge branches/ew r7104
thread-safety work in preparation for rewrite to use pthreads

Expect no regressions against trunk (r7078), possibly minor
performance improvements in update (due to fewer heap
allocations), but increased stack usage.

Applied the following patches:

* maxpath_str for reentrancy (temporary fix, reverted)
* path: start working on thread-safe variants of these methods
* Re-entrancy work on path/character-set conversions
* directory.c: exploreDirectory() use reentrant functions here
* directory/update: more use of reentrant functions + cleanups
* string_toupper: a strdup-less version of strDupToUpper
* get_song_url: a static-variable-free version of getSongUrl()
* Use reentrant/thread-safe get_song_url everywhere
* replace rmp2amp with the reentrant version, rmp2amp_r
* Get rid of the non-reentrant/non-thread-safe rpp2app, too.
* buffer2array: assert strdup() returns a usable value in unit tests
* replace utf8ToFsCharset and fsCharsetToUtf8 with thread-safe variants
* fix storing playlists w/o absolute paths
* parent_path(), a reentrant version of parentPath()
* parentPath => parent_path for reentrancy and thread-safety
* allow "make test" to automatically run embedded unit tests
* remove convStrDup() and maxpath_str()
* use MPD_PATH_MAX everywhere instead of MAXPATHLEN
* path: get rid of appendSlash, pfx_path and just use pfx_dir
* get_song_url: fix the ability to play songs in the top-level music_directory

git-svn-id: https://svn.musicpd.org/mpd/trunk@7106 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-12-28 02:56:25 +00:00
Eric Wong
34f3abd357 conf.c: remove extra semi-colon here, too
git-svn-id: https://svn.musicpd.org/mpd/trunk@6874 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-10 07:15:58 +00:00
Eric Wong
4a2122eaf4 conf: improved boolean config parameter handling from -ke
the force flag will issue FATAL() if an invalid value is
specified

git-svn-id: https://svn.musicpd.org/mpd/trunk@6857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-05 23:59:33 +00:00
J. Alexander Treuman
c734c13b5c Adding parsePath and making parseConfigFilePath use it.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6622 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-13 15:27:09 +00:00
Patrik Weiskircher
d67737bc64 allow zeroconf to be disabled.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6467 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 18:08:51 +00:00
J. Alexander Treuman
bba444524e Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a single
call to FATAL().

git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:15:54 +00:00
Avuton Olrich
a061da8fb5 The massive copyright update
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05 03:22:33 +00:00
Avuton Olrich
79ef8ba248 Add libsamplerate support, old resampling is still an option, but this sounds much better for those who need it and don't want to use pulseaudio. Reviewed by shank/avuton.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5316 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-02 03:51:07 +00:00