Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/disorder * 'master' of git.distorted.org.uk:~mdw/publish/public-git/disorder: disobedience/control.c: Force internal event when buttons are frobbed. configure.ac: Use Automake `silent-rules' by default. doc/disorder_protocol.5.in: Document `sofar' field in track-info line.
disobedience/control.c: Force internal event when buttons are frobbed. This fixes a bug leftover from fe0a1c48c648f683b3691132fb2b12b01d1ace32. The obvious symptom is that the currently-playing track's progress indication goes screwy when you use the pause button in the same DisObedience instance. (Other DisObediences work correctly, and all of them work fine if you use some other mechanism to frob the pause status.) The bug is caused because the preemptive state update introduced in the previous fix suppresses the internal event which used to raised once the server acknowledged the state change. Fix this by explicitly raising the relevant event.
lib/addr.c, etc.: Return plain addresses from `netaddress_resolve'. Instead of a list of `struct addrinfo' structures, return a vector of `struct resolved', each of which just contains a socket address and length. This is sufficient for all of the existing callers (which have been changed to cope), and means that we don't need any awful hacks because they're easy to free.
disobedience/control.c: Handle state-change toggles better. If you click a toggle icon, say the `pause' button, then: Gtk immediately toggles the state of the icon, but doesn't change the corresponding menu item. Instead, a state change is reported through the log connection which causes us to update the menu (and the icon, though that's already in the right state so you don't notice). (Of course, this just works the other way around if you use the menu item or keyboard accelerator instead.) There are a couple of problems with this, with more or less the same fix. * If the connection to the server is very slow, then there's a lag between clicking the icon, or pressing the accelerator, and the rest of the UI updating. This is unfortunate. * If something goes wrong, then the icon is left in the wrong state, and nothing will correct it. The fix is as follows: * When toggling the state of something, we immediately (a) adjust our internal idea of what the state /ought/ to be, and (b) force an update of the icon (and associated menu item). This solves the problem of the associated UI element lagging. * On a server error, we immediately change the state back again and force another icon update. * That leaves the RTP connection option (which was my original motivation for all of this). There's no server feedback for this control. Instead, we periodically check whether the RTP player process is listening for connections. An event is signalled if this state /changes/, and this event is used to set the icon and menu-item state. So, again, if we force our internal idea of the RTP process state to match the icon, but the player doesn't start up properly, then the next time we check, we find that the player isn't responding, signal the event, and then we fix the icon state.
clients/disorder.c: Remove the short forms for undocumented options. Also, somewhat sneakily, move the internal names for these options out of the way of my future plans. The affected options are `-N' (`--no-per-user-config'), `-u' (`--user') and `-p' (`--password'). As far as I can make out, `--user' and `--password' are only intended to be used during testing, and only the long forms are given; and `--no-per-user-config' isn't actually used at all.
lib/configuration.c, lib/home.c: Introduce environment variables. The places where DisOrder looks for configuration can now be overridden using environment variables. * `$DISORDER_CONFIG' is the master configuration file -- defaults to `PKGCONFDIR/config', where `PKGCONFDIR' is set at compile time (e.g., `/etc/disorder'. * `$DISORDER_PRIVCONFIG' is the private configuration file -- defaults to `$DISORDER_CONFIG.private'. * `$DISORDER_HOME' is the user's `profile directory' for DisOrder things -- defaults to `$HOME/.disorder' on Unix, or `%APPDATA%/DisOrder' (i.e., in the roaming profile directory) on Windows. * `$DISORDER_USERCONFIG' is the user's configuration file -- defaults to `$DISORDER_HOME/passwd'. * `$DISORDER_USERCONFIG_SYS' is the per-user system configuration file -- defaults to `$DISORDER_CONFIG.USERNAME'. The primary motivation for all of this is to make it easier to run clients -- particularly Disobedience and its `disorder-playrtp' inferiors -- against multiple servers simultaneously. Setting configuration on the command line works rather badly for clients, since that overrides the /system/ configuration, which the user can't edit anyway -- the client programs still read `$HOME/passwd' unconditionally. This is clearly a bug, but changing the behaviour now is a bad idea; besides, changing `-c' (or introducing a new option) to override the `passwd' file, doesn't actually help much unless Disobedience in turn passes the necessary option on to `disorder-playrtp'. Environment variables solve all of these problems much more simply.
lib/home.c: Introduce functions for building pathmames in home directories. Split the home-directory logic of `config_userconf' into its own file. Arrange to only calculate the home directory once. Most invasively, use this new functionality in place of looking up `$HOME' and building pathnames by hand. This change doesn't add much functionality, but it does add a little. Most notably, $ unset HOME; disobedience doesn't segfault any more. More subtly, the logic for finding one's home directory is now consistent. On Windows, we still use `%APPDATA%'; on Unix, we now /always/ use `$HOME' first, and then fall back to `getpwuid(getuid)->pw_dir' if that's unset. Previously, the configuration reader would ignore `$HOME' and use the password database, while Disobedience used `$HOME' exclusively and crashed if it was unset. This is all obviously silly.
server/*.c: Don't try reading per-user configuration. This can't end well.
lib/configuration.c, etc.: Remove arguments from `config_userconf'. Nobody ever did anything with the HOME argument at all. Passing in PW might have been slightly valuable, but configuration is only retrieved infrequently. Besides, this is the start of a sequence of changes to how configuration files are found.
lib/configuration.c, lib/uaudio-rtp.c: Allow tweaking MTU-discovery. Apparently under some circumstances, Linux tries to do path MTU discovery with RTP transmissions, so it (a) sets DF on outgoing packets and then (b) ignores the `fragmentation-needed' errors coming back! This option attempts to work around this foolishness. Configuration is accepted on all platforms for portability's sake, but is only effective on Linux.
lib/configuration.c, lib/uaudio-rtp.c: Allow configuring payload size. This is useful in unicast (or multicast-routing?) situations where packets will traverse networks with unusually small MTU.