Commit Graph

244 Commits

Author SHA1 Message Date
Max Kellermann
334bd73792 lib/icu/Collate: fall back to strcoll() instead of strcasecmp() 2015-06-23 13:26:45 +02:00
Max Kellermann
7b575f61d0 Main: notify systemd when MPD is ready 2015-03-21 14:27:54 +01:00
Max Kellermann
1c3f5517fa config/Option: convert to strictly-typed enum 2015-01-21 23:30:00 +01:00
Max Kellermann
fe85fa3bea ConfigData: move struct config_param to Param.hxx 2015-01-21 21:23:02 +01:00
Max Kellermann
712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann
5cbc319e96 configure.ac: require GLib 2.32 (if enabled)
Since version 2.32, g_thread_init() is deprecated and a no-op.  Let's
upgrade that (optional) dependency so we can remove all those
g_thread_init() calls.
2014-12-05 00:21:48 +01:00
Max Kellermann
563db580ae fs/Charset: add DeinitFSCharset() 2014-11-29 23:47:48 +01:00
Max Kellermann
fd2c6b8a4b fs/Charset: return Error on SetFSCharset() failure
Don't abort the process, let the caller decide instead.
2014-11-29 23:36:44 +01:00
Max Kellermann
ed001e0cfb configure.ac: add option "--disable-daemon" 2014-11-20 20:38:37 +01:00
Misty De Meo
134cb6a017 Main: fix compilation on OS X using non-Apple compilers
Commit d42c0f1dc5 added an OS X-specific
method of calling mpd_main_after_fork(), which uses Grand Central
Dispatch. Since this uses a block literal, it breaks compilation on
compilers which don't support the block extension, e.g. non-Apple
compilers. This affects users on older OS X releases with GCD (which
depend on older Clang releases, or Apple GCCs, which don't support the
C++11 features MPD needs); or which don't support GCD at all (10.5 and
lower).

This patch changes the #ifdef so that the non-GCD code is used
as it was on OS X before this patch if blocks aren't available, via
checking __BLOCKS__ macro.
2014-11-11 06:22:24 +01:00
NanoTech
d42c0f1dc5 Main: run the OS X native event loop after forking 2014-10-31 15:03:53 +01:00
NanoTech
6ad1e4d99a Revert "Main: run the OS X native event loop"
This reverts commit f0be48ff90
(except for the NEWS entry).

If libdispatch (GCD) is used before forking, it
can't safely be used again after forking.
2014-10-31 15:03:46 +01:00
nanotech
f0be48ff90 Main: run the OS X native event loop 2014-10-10 19:51:44 +02:00
Max Kellermann
3d2558bde6 StoragePlugin: pass EventLoop to constructor 2014-10-09 07:45:25 +02:00
Thomas Guillem
74fcbb382f android/Bridge: add shutdown()
Break the mainloop and terminate run call.
2014-09-16 18:25:45 +02:00
Max Kellermann
42af040fbd StateFile: configurable interval 2014-08-24 13:24:20 +02:00
Max Kellermann
6e84a03a35 PlayerThread: rename player_create() to StartPlayerThread() 2014-08-16 10:33:19 +02:00
Max Kellermann
82ecebb393 Main: don't require mpd.conf on Android
Don't fail to start if mpd.conf does not exist; just use default
values.
2014-07-30 10:22:22 +02:00
Max Kellermann
dfcb572985 Main: delete the Storage instance on shutdown 2014-06-10 23:21:09 +02:00
Max Kellermann
37b3190752 lib/icu: add IcuInit(), IcuFinish() 2014-06-10 23:21:09 +02:00
Max Kellermann
d77c83f4ba Main: auto-configure state file on Android 2014-03-02 00:35:37 +01:00
Max Kellermann
8cf3ac200b Main: use getExternalStorageDirectory() for locating mpd.conf 2014-03-02 00:24:31 +01:00
Max Kellermann
b8f1850bba db/Configured: store database file in cache directory
Add class Context which wraps the Android/Java Context class and add a
JNI wrapper for method Context.getCacheDir().
2014-03-01 22:20:28 +01:00
Max Kellermann
14168eadb2 Main: inline mpd_main() on Android 2014-03-01 19:09:31 +01:00
Max Kellermann
58771fc41c Android: obtain music directory from Environment.getExternalStoragePublicDirectory() 2014-03-01 18:48:20 +01:00
Max Kellermann
1e06c66c77 java: new helper library for the Android port 2014-03-01 18:48:20 +01:00
Max Kellermann
c73771e3ce Main: load mpd.conf from /sdcard/ on Android
Hard-coded path.  Will be replaced soon.
2014-03-01 18:48:20 +01:00
Max Kellermann
e9a85aa4e4 db/simple: mount points
A SimpleDatabase instance can now "mount" other Database instances at
certain locations.  This is used to use a new SimpleDatabase instance
for each storage mount (issued with the "mount" protocol command).
Each such instance has its own database file, stored in the directory
that is specified with the "cache_directory" option.
2014-02-27 20:49:13 +01:00
Max Kellermann
681e012fb5 db/update: cancel the update on shutdown 2014-02-27 16:58:35 +01:00
Max Kellermann
4d73e4d605 db/simple: create dedicated directory 2014-02-26 09:17:41 +01:00
Max Kellermann
33fc3af775 SongSort, ...: use libicu instead of GLib's g_utf8_*() 2014-02-24 20:39:37 +01:00
Max Kellermann
bfae92e307 Main: use INT_MAX instead of G_MAXUINT 2014-02-24 18:57:03 +01:00
Max Kellermann
4dcf0b8ae0 first Android release
Finally, MPD runs on Android.  For some small value of "runs".  Very
much work left, too much to describe.
2014-02-22 01:39:08 +01:00
Max Kellermann
3d4689756c Main: disable command-line parser and signal handlers on Android 2014-02-22 00:18:46 +01:00
Max Kellermann
04ba433ca6 Main: initialize Partition before Listener
Fixes nullptr dereference (regression by commit df5f9f4a).
2014-02-20 00:04:23 +01:00
Max Kellermann
df5f9f4a15 Listen: add Partition reference 2014-02-19 23:43:36 +01:00
Max Kellermann
150443b014 DatabasePlugin: add FLAG_REQUIRE_STORAGE
Ignore the storage configuration if FLAG_REQUIRE_STORAGE is not set in
the DatabasePlugin.
2014-02-19 23:24:17 +01:00
Max Kellermann
85b8675e7a db/Interface: add attribute "plugin"
The new method IsPlugin() replaces the "is_simple" flag.
2014-02-19 23:17:21 +01:00
Max Kellermann
8d6fedf817 Mixer: add class MixerListener
Use a listener interface instead of GlobalEvents.
2014-02-19 21:40:14 +01:00
Max Kellermann
0053cd0d0d Main: disable inotify check without database
Fix build failure.
2014-02-18 21:47:01 +01:00
Max Kellermann
91729437a0 Main: initialize Database before Storage 2014-02-17 22:14:00 +01:00
Max Kellermann
3af7af0b8f Main: move code to InitDatabaseAndStorage() 2014-02-17 22:13:53 +01:00
Max Kellermann
de160bb2d1 Main: move code to db/Configured.cxx 2014-02-17 22:13:53 +01:00
Max Kellermann
ff62b6742b Main: check if database exists before attempting to close it
Fixes nullptr dereference.
2014-02-17 22:13:53 +01:00
Max Kellermann
6da0af94df db/DatabaseSimple: remove obsolete header 2014-02-17 20:44:03 +01:00
Max Kellermann
a9fefcf600 Main: wrap the Storage instance in CompositeStorage 2014-02-09 11:07:08 +01:00
Max Kellermann
37b6899660 Main: move code to storage/Configured.cxx 2014-02-09 08:09:47 +01:00
Max Kellermann
3fdc678aae Main: support arbitrary storage plugins 2014-02-08 00:04:29 +01:00
Max Kellermann
be081929f4 storage/local: remove utf8 path from constructor
Build the UTF-8 version of the path automatically in the constructor.
2014-02-07 23:41:06 +01:00
Max Kellermann
b0b086d473 Main: move storage initialization to InitStorage() 2014-02-07 23:37:39 +01:00
Max Kellermann
6798af52b6 Mapper: obtain music directory from Storage
Eliminate duplicate variable.
2014-02-07 23:34:29 +01:00
Max Kellermann
4d5ebafa6d Main: check the music directory
Move call from Mapper.cxx.
2014-02-07 23:29:20 +01:00
Max Kellermann
c45f205593 Main: chop separators from music directory
Move call from Mapper.cxx.
2014-02-07 23:13:24 +01:00
Max Kellermann
4b010df99e Main: create Storage instance in glue_mapper_init()
Don't use the obsolete Mapper library to create it.
2014-02-07 22:54:18 +01:00
Max Kellermann
5e4dd4be9c Main: allow playlist directory without music directory 2014-02-07 22:39:17 +01:00
Max Kellermann
f947274626 InotifyUpdate: use class Storage instead of Mapper.cxx 2014-02-07 22:30:40 +01:00
Max Kellermann
b2e3fdef0f storage/local: hide the class declarations
Hide inside CreateLocalStorage().
2014-02-07 01:11:52 +01:00
Max Kellermann
c8c3f20840 storage/local: move to src/storage/plugins/ 2014-02-05 19:26:21 +01:00
Max Kellermann
4c995eb498 db/UpdateWalk: move LocalStorage to Instance
Keep only a reference.
2014-02-05 17:58:13 +01:00
Max Kellermann
243c4e1e83 Main: remove unused global variable "main_thread" 2014-02-05 17:04:16 +01:00
Max Kellermann
d380db25be Instance: add attribute "event_loop"
Replaces global variable "main_loop".
2014-02-05 00:09:36 +01:00
Max Kellermann
e8938b1069 MixerPlugin: add EventLoop& init() parameter 2014-02-05 00:02:02 +01:00
Max Kellermann
4a28333039 event/Loop: remove the dummy constructor argument 2014-02-05 00:00:03 +01:00
Max Kellermann
eec6d09959 db/update/Service: use DatabaseListener instead of Instance
Don't use the global variable "instance".
2014-02-04 18:54:54 +01:00
Max Kellermann
cf6281a5a7 Instance: add Database attribute
Move from db/DatabaseGlue.cxx, eliminating global variable.
2014-02-04 11:22:33 +01:00
Max Kellermann
f00710a57e Main: create UpdateService instance in glue_db_init_and_load() 2014-02-04 11:22:32 +01:00
Max Kellermann
d76b6f878e db/update/Service: add SimpleDatabase reference
Don't use the global variables from the DatabaseSimple library.
2014-02-04 09:05:32 +01:00
Max Kellermann
e545679265 Main: don't measure DatabaseGlobalDeinit() time
Useless information.
2014-02-01 00:39:42 +01:00
Max Kellermann
4465e2c46b db: add compile-time option to disable database 2014-01-30 20:39:40 +01:00
Max Kellermann
c6725884bc db/update: convert to OO API
Move global variables into the new classes.  That may allow multiple
update threads for multiple databases one day.
2014-01-30 18:47:05 +01:00
Max Kellermann
a31738f6f1 Main, OutputThread: increase kernel timer slack (Linux)
Allows the kernel to combine timer wakeups with other processes,
reducing power usage.
2014-01-30 18:43:40 +01:00
Max Kellermann
4b044bd8e1 InotifyUpdate: pass EventLoop to mpd_inotify_init() 2014-01-29 18:36:32 +01:00
Max Kellermann
aeaf64b467 Listen: pass EventLoop to listen_global_init()
Don't use global variables.
2014-01-29 18:32:28 +01:00
Max Kellermann
f5a923b9d1 OutputAll: convert to class, move instance to class Partition
Another big chunk of code for multi-player support.
2014-01-28 09:20:53 +01:00
Max Kellermann
5c4a42caa0 neighbor: new subsystem to detect file servers on the local network
This commit adds the NeighborPlugin API which can be used to detect
nearby file servers that can be used by input plugins.  This list of
servers is exported using the new "listneighbors" command.  The idle
even "neighbor" notifies interested clients when a new neighbor is
found or an existing one is lost.

There's a lot missing currently: protocol&user documentation, and a
way to "mount" remote servers into the music database.  Obviously,
some code from the UPnP database plugin can be moved to a neighbor
plugin.
2014-01-26 00:10:05 +01:00
Max Kellermann
68eda78704 Mixer*: move to mixer/ 2014-01-24 16:44:32 +01:00
Max Kellermann
9d34fc394c Database*: move to db/ 2014-01-24 16:38:44 +01:00
Max Kellermann
973c9872f9 Sticker*: move to sticker/ 2014-01-24 16:38:15 +01:00
Max Kellermann
299ff2b23f move daemonization code to unix/ 2014-01-24 16:37:21 +01:00
Max Kellermann
f8bfea8bae Input*: move to input/ 2014-01-24 16:33:33 +01:00
Max Kellermann
e199c33c6e Client*: move to client/ 2014-01-24 00:26:53 +01:00
Max Kellermann
08296cd66d Update*: move to update/ 2014-01-24 00:24:43 +01:00
Max Kellermann
197b503f3e Config*: move to config/ 2014-01-24 00:20:01 +01:00
Max Kellermann
6b70f5e490 Zeroconf*: move to zeroconf/ 2014-01-24 00:14:54 +01:00
Max Kellermann
4aa6d39fd8 archive/*: move to archive/plugins/ 2014-01-24 00:09:37 +01:00
Max Kellermann
51adaf2c47 decoder/*: move to decoder/plugins/ 2014-01-24 00:02:24 +01:00
Max Kellermann
ea5b901bcc output/*: move to output/plugins/ 2014-01-23 23:49:50 +01:00
Max Kellermann
f1f19841bd playlist/*: move to playlist/plugins/ 2014-01-23 23:30:12 +01:00
Max Kellermann
0616667688 Main: glue_mapper_init() returns true if GetUserMusicDir() fails
Not a fatal error.  Fixes assertion failure.
2014-01-22 16:28:19 +01:00
Max Kellermann
be47320a05 Daemon: fork as early as possible
Keep the parent process around until MPD has finished initializing.

This is important for libraries that are allergic to fork(), such as
libupnp.
2014-01-18 12:42:30 +01:00
Max Kellermann
3a6da7c594 Main: make variables more local 2014-01-18 11:34:13 +01:00
Max Kellermann
9909a80d6a Main: eliminate variable "success" 2014-01-18 11:20:20 +01:00
Max Kellermann
4f83c60296 copyright year 2014 2014-01-13 22:31:55 +01:00
Max Kellermann
114df1f137 DatabasePlugin: add interface DatabaseListener
Allow database plugins to announce that they have been modified.
2014-01-11 01:01:54 +01:00
Max Kellermann
d5dfe7d457 configure.ac: add option "--disable-glib"
Allows building without GLib.  This fails to compile currently,
because GLib is still used in the MPD core.
2013-12-15 18:43:12 +01:00
Denis Krjuchkov
e42637226f Main: use standard directory API 2013-12-08 17:25:19 +06:00
Max Kellermann
1a002eb23d PcmConvert: add pcm_convert_global_init()
Wrapper for pcm_resample_global_init(), just in case other PCM
libraries need initialization, too.
2013-11-29 11:00:57 +01:00
Max Kellermann
f90abe9530 include cleanup using iwyu 2013-11-28 11:50:54 +01:00
Denis Krjuchkov
957d187ae4 Main.cxx: initialize winsock before creating IO thread
Otherwise sockets can't be created during IO thread initialization.
2013-11-26 18:10:18 +06:00
Max Kellermann
51de8fd10a Volume, Output: use new class PeriodClock instead of GTimer 2013-11-25 22:09:46 +01:00