Commit Graph

7258 Commits

Author SHA1 Message Date
Max Kellermann
db69ceade6 db/LightSong: make "real_uri" a pointer
Reduce overhead.  LightSong can always point to the "real" allocated
string.
2014-02-04 00:38:52 +01:00
Max Kellermann
b9c248e7e7 PlaylistFile: use class SongLoader 2014-02-03 23:50:19 +01:00
Max Kellermann
d533b59ee3 PlaylistFile: switch spl_append_uri() arguments
Playlist file name first, to be consistent with the other functions in
this library.
2014-02-03 23:33:25 +01:00
Max Kellermann
5ad2980d69 QueueSave: use class SongLoader 2014-02-03 23:32:31 +01:00
Max Kellermann
ca36ac2ba1 SongLoader: new class that merges duplicate code
There was quite a lot of duplicate code for loading DetachedSong
objects, with different semantics for "securely" loading local files.
2014-02-03 23:32:10 +01:00
Max Kellermann
ba675d6a55 FileCommands: use PathTraitsUTF8::IsAbsolute() 2014-02-03 23:31:28 +01:00
Max Kellermann
e4c5a4f61b PlaylistSave: remove redundant backslash conversion
This is already being done by FixSeparators(), called from
PathToUTF8().
2014-02-03 23:15:57 +01:00
Max Kellermann
a8e52ad89f ClientFile: move client_allow_file() into the Client class 2014-02-02 13:59:07 +01:00
Max Kellermann
8cf4fb53aa Playlist: pass Database to DatabaseModified()
Don't use global variable.
2014-02-01 00:45:58 +01:00
Max Kellermann
1769ae54e4 Partition: disable DatabaseModified() if not ENABLE_DATABASE 2014-02-01 00:44:41 +01:00
Max Kellermann
e545679265 Main: don't measure DatabaseGlobalDeinit() time
Useless information.
2014-02-01 00:39:42 +01:00
Max Kellermann
981080500b Stats: pass Database reference around
Call GetDatabase() only once.
2014-02-01 00:38:57 +01:00
Max Kellermann
636d28b784 Stats: remove obsolete "simple" plugin special case
The proxy plugin has now implemented the "idle" event listener.
2014-02-01 00:37:01 +01:00
Max Kellermann
188783ac1a Stats: return false if update has failed 2014-02-01 00:36:36 +01:00
Max Kellermann
ff650d50a2 Mapper: assert that Song::parent is not nullptr 2014-01-31 23:14:13 +01:00
Max Kellermann
78689645dc db/update/Archive: delete archive from database on error 2014-01-31 22:24:28 +01:00
Max Kellermann
26970579b8 db/update/Editor: add locking method variants 2014-01-31 22:17:49 +01:00
Max Kellermann
04b4f53488 db/update: convert runtime check to assertion 2014-01-31 21:59:35 +01:00
Max Kellermann
c310941f69 fs/AllocatedPath: add conversion constructor from Path 2014-01-30 23:36:57 +01:00
Max Kellermann
c02f146791 fs/DirectoryReader: GetEntry() returns Path, not AllocatedPath
Reduce overhead, don't duplicate the string.
2014-01-30 22:20:57 +01:00
Max Kellermann
a631200cca update/Walk: declare std::string at assignment
Reduce overhead.
2014-01-30 22:19:56 +01:00
Max Kellermann
6207a3f999 PlaylistFile: narrow LoadPlaylistFileInfo() API to accept Path 2014-01-30 22:17:35 +01:00
Max Kellermann
0bd01824f6 fs/AllocatedPath: add Build() overlays with Path arguments 2014-01-30 22:15:13 +01:00
Max Kellermann
4465e2c46b db: add compile-time option to disable database 2014-01-30 20:39:40 +01:00
Max Kellermann
34b309b99a OtherCommands: merge duplicate code from handle_update(), handle_rescan() 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
d5b017407d ExcludeList: move to db/update/ 2014-01-30 10:11:12 +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
a137f817f5 db/Directory: move isRootDirectory() to Uri.hxx
Decouple command/OtherCommands.cxx from the "simple" database plugin.
2014-01-29 18:05:33 +01:00
Max Kellermann
ff87145537 sticker: don't use classes Directory and Song
Don't depend on the "simple" database plugin.  This fixes an assertion
failure / crash and allows using stickers with other plugins.
2014-01-29 17:45:07 +01:00
Max Kellermann
667481c371 OutputThread: move more functions into the AudioOutput class 2014-01-29 09:26:11 +01:00
Max Kellermann
af71605769 output: rename "chunk" to "current_chunk" 2014-01-29 09:23:57 +01:00
Max Kellermann
4657a3bd0f output: move functions into the AudioOutput struct 2014-01-29 08:10:46 +01:00
Max Kellermann
cb7366f472 AudioOutput: make "plugin" a reference 2014-01-29 08:10:36 +01:00
Max Kellermann
bf803e241f AudioOutput: pass plugin to constructor
Make it "const".
2014-01-29 08:10:18 +01:00
Max Kellermann
5b3aa45e58 CommandLine: remove junk from string literal 2014-01-29 08:09:48 +01:00
Max Kellermann
c4403c523f AudioOutput: add constructor and destructor 2014-01-28 12:37:58 +01:00
Max Kellermann
07b89b2bad ConfigTemplates: rename "AudioOutput" back to "audio_output"
sed gone horribly wrong.  D'oh!
2014-01-28 12:37:58 +01:00
Max Kellermann
68b79f97f3 output: rename source files 2014-01-28 11:42:54 +01:00
Max Kellermann
815d72065c output: rename struct audio_output to AudioOutput 2014-01-28 11:34:09 +01:00
Max Kellermann
e0dc721324 OutputPlugin: rename struct audio_output_plugin to AudioOutputPlugin 2014-01-28 11:33:15 +01:00
Max Kellermann
2f873edc9c thread/Name: implementation for Mac OS X
pthread_setname_np() doesn't have the "thread" argument on OS X.
2014-01-28 11:33:15 +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
5273900b0e neighbor/smbclient: add splice_after() fallback for gcc 4.6 2014-01-27 14:59:15 +01:00
Max Kellermann
f548a966f5 Playlist{Info,Vector}: move to db/ 2014-01-27 11:05:21 +01:00
Max Kellermann
30fadaed7f Merge branch 'v0.18.x' 2014-01-27 10:33:42 +01:00
Max Kellermann
2b10ecfa37 IcyMetadataParser: more robust tag parser
Allow semicolons and single quotes in the stream title.  This is not
part of any specification, but found in real life.
2014-01-27 10:08:21 +01:00
Max Kellermann
0b3fbdba87 neighbor/upnp: UPnP media server discovery 2014-01-26 15:51:33 +01:00
Max Kellermann
3dad837ca6 db/upnp: remove sleep(2) call
This call was unnecessary.  It is a bad idea anyway to block the MPD
process for some arbitrary amount of time.
2014-01-26 15:50:30 +01:00
Max Kellermann
d7e78059b0 upnp: initialize the client handle only once
Eliminate class LibUPnP and move the code to ClientInit.cxx.  Its
initialization function can be called multiple times, but
UpnpRegisterClient() is called at most once.
2014-01-26 15:43:23 +01:00
Max Kellermann
01f7abfc63 upnp: move library initialization to Init.cxx
Allow calling UpnpGlobalInit() multiple times.
2014-01-26 15:23:26 +01:00
Max Kellermann
e57e89b9d5 upnp/discovery: use a plain UpnpClient_Handle instead of class LibUPnP 2014-01-26 15:22:33 +01:00
Max Kellermann
bcc1f93370 upnp: add class UpnpCallback
Each Upnp*Async() call passes a new cookie pointer, and the cookie
passed to UpnpRegisterClient() appears to be ignored.  Using this
interface is a more elegant approach than having one single "handler"
function.
2014-01-26 15:04:56 +01:00
Max Kellermann
b161d72326 CueParser: don't "move" the filename
This invalidated the std::string instance, and thus broke the CUE
parser (commit 322b061632).
2014-01-26 14:58:23 +01:00
Max Kellermann
66c013682f upnp: remove obsolete global variable "theLib" 2014-01-26 13:54:48 +01:00
Max Kellermann
9f3ba737d6 upnp/Discovery: add listener interface 2014-01-26 13:41:40 +01:00
Max Kellermann
f86f5ad224 db/upnp: move generic code to lib/upnp/ 2014-01-26 13:41:40 +01:00
Max Kellermann
8b6b3ff28a neighbor/Glue: fix rollback range 2014-01-26 13:41:40 +01:00
Max Kellermann
4a3dc2cea2 db/upnp: rename variables 2014-01-26 13:08:52 +01:00
Max Kellermann
bd0cfffe23 neighbor/Info: add constructor 2014-01-26 13:07:53 +01:00
Max Kellermann
642be502c0 NeighborCommands: convert assertion to runtime check 2014-01-26 01:17:49 +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
e847788569 lib/smbclient/Init: return empty username/password
This appears to be the right thing to do when we want anonymous login.
2014-01-26 00:08:50 +01:00
Max Kellermann
86ca5b3f16 input/smbclient: move code to lib/smbclient/Init.cxx 2014-01-25 23:29:42 +01:00
Max Kellermann
9b1fbdbca6 ConfigGlobal: add config_find_block()
Merge duplicate code.
2014-01-24 16:55:17 +01:00
Max Kellermann
97391fd4b9 DespotifyUtils, Expat: move to lib/ 2014-01-24 16:44:36 +01:00
Max Kellermann
68eda78704 Mixer*: move to mixer/ 2014-01-24 16:44:32 +01:00
Max Kellermann
7c52a1c04b Filter*: move to filter/ 2014-01-24 16:43:57 +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
eef7ba48dd Win32Main: move to win32/ 2014-01-24 16:37:32 +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
129eb178eb Queue*: move to queue/ 2014-01-24 00:17:50 +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
655ad34414 Encoder*: move to src/encoder
.. and move the plugins to src/encoder/plugins/.
2014-01-23 23:09:14 +01:00
Max Kellermann
b8e382b011 db/upnp/Discovery: use std::list instead of std::map
There will only be very few items, and that does not justify the bloat
of std::map.
2014-01-23 22:35:22 +01:00
Max Kellermann
c9af358e4b db/upnp/Discovery: move code to LockAdd(), LockRemove() 2014-01-23 22:35:22 +01:00
Max Kellermann
3afcfe3330 db/upnp/Discovery: un-inline the destructor 2014-01-23 22:35:22 +01:00
Max Kellermann
53a13e8bc6 DetachedSong: un-inline the destructor
Reduce bloat.
2014-01-23 21:22:52 +01:00
Max Kellermann
f3f5e2e162 db/upnp: un-inline a few destructors
Reduce bloat.
2014-01-23 21:17:40 +01:00
Max Kellermann
ec41d849bb thread/Name: set thread names
For debugging.
2014-01-23 10:07:14 +01:00
Max Kellermann
1d547fe273 thread/Util: set the SCHED_RESET_ON_FORK flag in SetThreadRealtime() 2014-01-23 09:14:09 +01:00
Max Kellermann
b52d8fbebe db/upnp: strict vpath checks for the "root" directory 2014-01-23 00:40:39 +01:00
Max Kellermann
b61a2c722c db/upnp: move code to VisitObject() 2014-01-23 00:28:27 +01:00
Max Kellermann
c455d2c1de db/upnp: merge two PathTraitsUTF8::Build() calls 2014-01-23 00:25:08 +01:00
Max Kellermann
77070f5ab9 db/upnp: move code to VisitItem() 2014-01-23 00:17:38 +01:00
Max Kellermann
8d5f7160ac db/upnp: fix subdirectory paths in "listallinfo"
Add missing server name prefix.
2014-01-23 00:07:35 +01:00
Max Kellermann
b167ce2913 base_uri 2014-01-23 00:06:17 +01:00
Max Kellermann
3ac15ca8d1 db/upnp: pass char* to visitSong()
Don't use std::string, reduce bloat.
2014-01-23 00:06:03 +01:00
Max Kellermann
f703d4fc3e db/upnp: call VisitDirectory on servers, even in recursive mode 2014-01-22 23:52:08 +01:00
Max Kellermann
77c461fed7 db/upnp: make several methods "const" 2014-01-22 23:50:33 +01:00
Max Kellermann
a89c21b06a db/upnp: inline Configure() 2014-01-22 23:30:53 +01:00
Max Kellermann
b74aa6b14c db/upnp: don't duplicate song data for VisitSong
Not necessary because we control the LightSong's life cycle.
2014-01-22 23:28:23 +01:00
Max Kellermann
0c4a791111 db/upnp: emplace/move in csvToStrings() 2014-01-22 23:21:23 +01:00
Max Kellermann
1feedd4d9c db/upnp: require an empty token list in csvToStrings() 2014-01-22 23:21:14 +01:00
Max Kellermann
0ec1808956 db/proxy: simplify csvToStrings() 2014-01-22 23:17:42 +01:00
Max Kellermann
546e7cafa4 db/proxy: merge redundant string::push_back() calls 2014-01-22 23:13:24 +01:00
Max Kellermann
d9926a1c21 db/upnp: use PathTraitsUTF8::Build() 2014-01-22 23:10:00 +01:00
Max Kellermann
e50969e31c db/proxy: fix for libmpdclient < 2.9 2014-01-22 23:09:36 +01:00
Max Kellermann
a6d9998e1d db/proxy: copy "Last-Modified" from remote directories 2014-01-22 23:07:21 +01:00
Max Kellermann
a42f9e4ee3 LightDirectory: new struct replacing Directory in the DB API 2014-01-22 23:01:32 +01:00
Max Kellermann
f16db6cd80 DatabasePrint: don't print zero mtime
Zero means "unknown".
2014-01-22 23:01:32 +01:00
Max Kellermann
4943606f4a db/upnp: append characters instead of single-character strings 2014-01-22 21:55:58 +01:00
Max Kellermann
87629dda81 db/upnp: use string::push_back() instead of string::append() 2014-01-22 21:55:08 +01:00
Max Kellermann
71928b473e db/upnp/Discovery: unlock mutex before deleting DiscoveredTask 2014-01-22 21:48:33 +01:00
Max Kellermann
a0bee9fa0a db/upnp/Discovery: eliminate two strlen() calls 2014-01-22 21:47:34 +01:00
Max Kellermann
0defd927f3 db/upnp: use std::list instead of std::set for SearchCapabilities
Reduce bloat.  We never used the set lookup.
2014-01-22 21:41:05 +01:00
Max Kellermann
6c41e8f63f db/upnp: check offset<total at end of loop 2014-01-22 21:37:21 +01:00
Max Kellermann
fa67a4e956 db/upnp: break when zero objects have been returned 2014-01-22 21:37:19 +01:00
Max Kellermann
bf9352fb26 db/upnp: free responses manually 2014-01-22 21:33:54 +01:00
Max Kellermann
7573d4e1ba db/upnp: break when count==0
Make this non-fatal.  Just stop reading more objects.
2014-01-22 21:33:19 +01:00
Max Kellermann
bfb483898f db/upnp: use ParseUnsigned() instead of atoi() 2014-01-22 21:11:04 +01:00
Max Kellermann
f363788d76 db/upnp: pass unsigned integers to readDirSlice() 2014-01-22 20:57:10 +01:00
Max Kellermann
714056f157 db/upnp: inline ContentDirectoryService::readDirSlice() 2014-01-22 20:42:36 +01:00
Max Kellermann
1abc96fa27 db/upnp: remove special case for "*"
Passing this to csvToStrings() will do the same.
2014-01-22 20:37:17 +01:00
Max Kellermann
0fa98479ad db/upnp: obtain char* from ixmlwrap::getFirstElementValue()
Fixes crash when there's no SearchCaps element.
2014-01-22 20:26:33 +01:00
Max Kellermann
02f2171010 db/upnp/Util: pass char* to csvToStrings() 2014-01-22 20:24:55 +01:00
Max Kellermann
a5e7d0a90f db/upnp: require an empty input capability set 2014-01-22 20:21:01 +01:00
Max Kellermann
9fb5134f64 db/upnp/Util: handle absolute URI paths properly in caturl()
Fixes problems with some UPnP servers.
2014-01-22 19:38:07 +01:00
Max Kellermann
9aeb23dfe9 db/upnp/Util: use string::back(), string::front() 2014-01-22 19:38:02 +01:00
Max Kellermann
e59d8c9378 db/upnp/Device: clear the "value" pointer on unknown element
Avoid appending to an obsolete string object.
2014-01-22 19:38:02 +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
9747cc9e58 db/upnp/Device: replace std::vector with a std::string pointer 2014-01-22 09:55:51 +01:00
Max Kellermann
7b44dea4b1 db/upnp/Device: remove unused UPnPService attributes 2014-01-22 09:51:26 +01:00
Max Kellermann
18aea922e9 db/upnp/Directory: "emplace" items into the vector 2014-01-22 09:43:49 +01:00
Max Kellermann
7d194aceb6 db/upnp/Device: emplace/move the UPnPService into the vector
Reduce overhead.
2014-01-22 09:42:46 +01:00
Max Kellermann
2722b8a3df db/upnp/Util: "emplace" items into the list
Reduce overhead.
2014-01-22 09:40:38 +01:00
Max Kellermann
fd754ff8f8 db/upnp/Directory: replace std::vector with a simple enum
Reduce bloat.
2014-01-22 09:32:11 +01:00
Max Kellermann
b7738e7af3 db/upnp/Directory: join all CDATA nodes for tag values
Expat can call CharacterData() multiple times if the CDATA contains
entity references.  We need to collect all of them in one large
string.
2014-01-22 08:44:35 +01:00
Max Kellermann
99bebabac9 db/upnp/Directory: make "m_dir" private 2014-01-22 08:44:20 +01:00
Max Kellermann
0ed48b364a db/upnp: merge duplicate branches in Namei() 2014-01-21 23:42:02 +01:00
Max Kellermann
b38b8b9c18 db/upnp: simplify Namei() 2014-01-21 23:37:27 +01:00
Max Kellermann
5434856136 db/upnp: use std::list instead of std::vector
Reduce overhead.
2014-01-21 23:33:28 +01:00
Max Kellermann
aa1eb2f40d db/upnp: use iterator in Namei() 2014-01-21 23:32:42 +01:00
Max Kellermann
7260d7883c db/upnp: move "objid" declaration down
Don't allocate the object when it's not needed.
2014-01-21 23:10:30 +01:00
Max Kellermann
154250f551 db/upnp: eliminate redundant Namei() parameter "oobjid"
The caller should better obtain the object id from the returned
UPnPDirObject instance.
2014-01-21 23:07:33 +01:00
Max Kellermann
3e4fb92cfb db/upnp: remove redundant objid.empty() check from VisitServer()
If Namei() succeeds, the object id is guaranteed to be set.
2014-01-21 23:07:06 +01:00
Max Kellermann
0da713e278 db/upnp: use std::move() to extract server name
Reduce runtime overhead.
2014-01-21 22:57:54 +01:00
Max Kellermann
94cb1545b3 db/upnp: use vector::front() instead of [0] 2014-01-21 22:57:16 +01:00
Max Kellermann
411527a240 db/upnp: don't use stringToTokens() in ParseDuration()
Reduce bloat.
2014-01-21 22:52:12 +01:00