Commit Graph

11256 Commits

Author SHA1 Message Date
Max Kellermann
5271e81ebe SongFilter: new extensible filter syntax
Will allow more complex fitler expression, such as negation (#89).
2018-07-24 23:05:36 +02:00
Max Kellermann
efb2051b30 SongFilter: add ToExpression() 2018-07-24 23:04:44 +02:00
Max Kellermann
a2b24cb5a2 SongFilter: pass std::string&& to Item constructor 2018-07-24 23:03:35 +02:00
Max Kellermann
a54f9ede2e SongFilter: use std::list::emplace_back() 2018-07-24 23:03:33 +02:00
Max Kellermann
7f1b134137 SongFilter: basic support for negated items
Not yet wired to the protocol.
2018-07-21 11:20:50 +02:00
Max Kellermann
b34fd905c8 SongFilter: simplify Parse() loop
Consume the ConstBuffer instead of iterating it.  This will allow
adding more complex parsers.
2018-07-21 07:36:42 +02:00
Max Kellermann
821f77325c SongFilter: Parse() throws exception on error 2018-07-21 07:24:42 +02:00
Max Kellermann
bd8cf7c53d SongFilter: make internal Parse() overload private 2018-07-21 07:21:27 +02:00
Max Kellermann
88c19c21ee SongFilter: remove obsolete prototype 2018-07-21 07:15:43 +02:00
Max Kellermann
40ec819330 SongFilter: make a few methods private 2018-07-21 07:15:09 +02:00
Max Kellermann
34dbd03be1 SongFilter: convert "tag" to "unsigned"
Having this as one-byte integer actually adds overhead and saves no
memory due to padding.
2018-07-21 07:04:01 +02:00
Max Kellermann
b98263e86f fs/io/OutputStream: relicense under BSD-2 2018-07-19 14:02:37 +02:00
Max Kellermann
f30265a9ee config/File: support wildcards in "include" 2018-07-18 17:28:30 +02:00
Max Kellermann
fcbcec6856 fs/List: new library exporting ListWildcard() 2018-07-18 17:18:38 +02:00
Max Kellermann
b778fb38a9 util/StringAPI: add raw strcmp() wrapper 2018-07-18 17:18:34 +02:00
Max Kellermann
32290d5eb8 fs/Path: add method ToUTF8Throw() 2018-07-18 16:51:29 +02:00
Max Kellermann
f87265a4d5 fs/AllocatedPath: divert some methods to class Path
Eliminate duplicate code.
2018-07-18 16:51:29 +02:00
Max Kellermann
6448b31b11 util/StringAPI: add strpbrk() wrapper 2018-07-18 16:51:29 +02:00
Max Kellermann
998227cffc fs/CheckFile: remove variable path_utf8 2018-07-18 16:51:29 +02:00
Max Kellermann
09f743dc1a config/File: add directive "include_optional" 2018-07-18 13:10:36 +02:00
Max Kellermann
035f986a91 config/File: support absolute paths in "include" 2018-07-18 13:09:04 +02:00
Max Kellermann
b168a9d469 fs/Traits: add Apply() 2018-07-18 13:06:07 +02:00
Max Kellermann
2b1d6ad396 fs/{,Allocated}Path: add typedef Traits 2018-07-18 13:05:23 +02:00
Max Kellermann
06c2aef3c7 config/File: fix typo in comment 2018-07-18 12:39:39 +02:00
Max Kellermann
d06ef76e58 config/File: implement the "include" directive
This is an experimental draft.  More needs to be done.
2018-07-18 11:27:41 +02:00
Max Kellermann
57729683b6 config/Data: pass new items by rvalue reference 2018-07-18 11:21:59 +02:00
Max Kellermann
9ff2606bb8 config/Data: use std::forward_list to manage params and blocks 2018-07-18 11:03:19 +02:00
Max Kellermann
fd80683ade decoder/mad: make "gapless_mp3_playback" a block option
Remove another dependency on the config/Global library.
2018-07-18 10:50:09 +02:00
Max Kellermann
49efb6071c config/Migrate: library to migrate deprecated settings 2018-07-18 10:25:02 +02:00
Max Kellermann
8df98932b1 config/Data: add methods AddParam(), AddBlock() 2018-07-18 10:17:45 +02:00
Max Kellermann
95481dda86 config/Global: remove unused function config_get_param() 2018-07-17 23:42:20 +02:00
Max Kellermann
113141bf2a StateFileConfig: add attribute "restore_paused" 2018-07-17 23:40:14 +02:00
Max Kellermann
bcc1e51097 StateFile: add struct StateFileConfig 2018-07-17 23:27:50 +02:00
Max Kellermann
e8a7c6cee3 config/Global: remove unused function config_get_block() 2018-07-17 23:14:47 +02:00
Max Kellermann
0c8ffa1ac3 output/MultipleOutputs: use struct ConfigData 2018-07-17 23:13:35 +02:00
Max Kellermann
4f678aa244 neighbor/Glue: use struct ConfigData 2018-07-17 23:11:33 +02:00
Max Kellermann
3a4a430f6c fs/Config: use struct ConfigData 2018-07-17 23:09:56 +02:00
Max Kellermann
36db40b224 client/Global: use struct ConfigData 2018-07-17 23:07:50 +02:00
Max Kellermann
426b9672cf db/Configured: use struct ConfigData 2018-07-17 23:06:17 +02:00
Max Kellermann
4d80419982 pcm/ConfiguredResampler: use struct ConfigData 2018-07-17 23:04:26 +02:00
Max Kellermann
3983caa2c8 Listen: use struct ConfigData 2018-07-17 23:02:53 +02:00
Max Kellermann
0b4e0b7bcb LogInit: use struct ConfigData 2018-07-17 23:02:06 +02:00
Max Kellermann
a9b8d5ecb6 Permission: use struct ConfigData 2018-07-17 23:00:42 +02:00
Max Kellermann
60b2338091 config/Global: remove unused function config_get_path() 2018-07-17 22:59:09 +02:00
Max Kellermann
d2594c6380 storage/Configured: use struct ConfigData 2018-07-17 22:57:08 +02:00
Max Kellermann
667daab056 config/Global: remove unused function config_get_unsigned() 2018-07-17 22:56:14 +02:00
Max Kellermann
2fc0a738ce Main: use struct ConfigData 2018-07-17 22:54:16 +02:00
Max Kellermann
86c531b37d config/Data: move std::chrono parsers from Global.hxx 2018-07-17 22:53:17 +02:00
Max Kellermann
a5b14a2ea7 Main: add local ConfigData reference 2018-07-17 22:48:43 +02:00
Max Kellermann
bf582bd969 ZeroconfGlue: use struct ConfigData 2018-07-17 22:44:16 +02:00
Max Kellermann
ad866f7a7d db/update/Config: use struct ConfigData 2018-07-17 22:41:28 +02:00
Max Kellermann
338a6f2a96 db/update/Walk: move UpdateConfig initialization to class UpdateService 2018-07-17 22:39:52 +02:00
Max Kellermann
c3aa53cc97 db/update/Walk: move configuration to struct UpdateConfig 2018-07-17 22:36:37 +02:00
Max Kellermann
24a86dce21 tag/Config: use struct ConfigData 2018-07-17 22:34:11 +02:00
Max Kellermann
0209bc4ba7 ReplayGainGlobal: use struct ConfigData 2018-07-17 22:32:56 +02:00
Max Kellermann
dd57b81989 PlaylistFile: use struct ConfigData 2018-07-17 22:31:33 +02:00
Max Kellermann
ffe6819966 config/Global: move value parser code to struct ConfigData 2018-07-17 22:28:08 +02:00
Max Kellermann
8af75c78f8 config/{Global,Block}: throw exception on parser error 2018-07-17 22:23:04 +02:00
Max Kellermann
696add259b config/Global: remove unused function config_find_block() 2018-07-17 22:15:10 +02:00
Max Kellermann
61a119b607 playlist/Registry: use struct ConfigData 2018-07-17 22:10:32 +02:00
Max Kellermann
0ff0aca2e2 input/Init: use struct ConfigData 2018-07-17 22:05:27 +02:00
Max Kellermann
7b02c0224c filter/LoadChain: use struct ConfigData 2018-07-17 22:05:24 +02:00
Max Kellermann
57d77cc8a0 decoder/List: use struct ConfigData 2018-07-17 22:05:21 +02:00
Max Kellermann
9fe0585056 config/Global: add GetGlobalConfig() 2018-07-17 22:05:20 +02:00
Max Kellermann
8c366f0774 config/Data: automatic initialization 2018-07-17 22:05:18 +02:00
Max Kellermann
edb44a536a util/PrintException: new utility class 2018-07-17 21:58:07 +02:00
Max Kellermann
eeaaea802a config/Data: FindBlock() throws on error 2018-07-17 21:18:18 +02:00
Max Kellermann
15c36baefd config/Data: add method FindBlock() 2018-07-17 21:16:20 +02:00
Max Kellermann
33deb84aa1 config/Data: make getters const 2018-07-17 21:16:11 +02:00
Max Kellermann
b211d31a64 config/Data: add getter methods 2018-07-17 21:11:52 +02:00
Max Kellermann
5b192beaa5 config/Global: remove ConfigBlock::SetUsed() call, let caller do that
This fixes an old bug which caused the "unused" warnings to be
unreliable; only the first block in the list was marked as being
"used", no matter if it was really used, and the rest was never marked
as "used", suppressing all warnings for them.
2018-07-17 21:08:41 +02:00
Max Kellermann
ef38330d74 config/Block: add method SetUsed() 2018-07-17 21:06:15 +02:00
Max Kellermann
987b60ae73 config/Block: make "used" mutable 2018-07-17 21:05:55 +02:00
Max Kellermann
7db0f7c4da config/Param: remove unused "used" flag 2018-07-17 20:44:07 +02:00
Max Kellermann
a4eeaff63f config/File: move duplicate code to ExpectValueAndEnd() 2018-07-17 20:28:50 +02:00
Max Kellermann
7807ddae57 config/Param: allow moving the value 2018-07-17 20:27:52 +02:00
Max Kellermann
566af6827e config/Param: inline the constructor 2018-07-17 20:27:49 +02:00
Max Kellermann
bf046d895e config/Param: use C++11 initializers 2018-07-17 20:27:47 +02:00
Max Kellermann
af33a9f4b8 config/Block: allow moving name and value 2018-07-17 20:27:46 +02:00
Max Kellermann
e9a4570891 config/Block: use C++11 initializers 2018-07-17 20:16:19 +02:00
Max Kellermann
99d5b61698 fs/Path: add operator/(Path,Path)
Modeled after std::filesystem::operator/() from C++17.
2018-07-17 18:33:32 +02:00
Max Kellermann
79e89eb23b CommandLine: use constexpr Path instead of macros 2018-07-17 17:02:49 +02:00
Max Kellermann
d13a64455c config/File: use nested exception to annotate file name and line number 2018-07-16 20:00:29 +02:00
Max Kellermann
816603fd9a config/Config*: rename files, drop "Config" prefix 2018-07-16 19:50:07 +02:00
Max Kellermann
bf5f12a51f Merge branch 'patch-4' of git://github.com/Wang-Yue/MPD 2018-07-16 18:59:17 +02:00
Yue Wang
866821765a
use uint_least32_t instead of long for timeout 2018-07-16 09:42:04 -07:00
Max Kellermann
c457d8e442 Merge branch 'can' of git://github.com/Wang-Yue/MPD 2018-07-16 18:14:04 +02:00
Yue Wang
c58dffa685 Implement Cancel() for OSXOutputPlugin 2018-07-16 09:06:07 -07:00
Max Kellermann
ba41690063 output/Interface: add method ChangeAudioFormat()
This is just the API design; there is no implementation yet, and no
caller.
2018-07-16 11:46:33 +02:00
Max Kellermann
86a37d0ed6 Main, pcm/SampleFormat, command/Error: remove obsolete GCC version checks 2018-07-16 11:04:05 +02:00
Max Kellermann
2fb5dbe62b output/alsa: use spsc_queue::reset()
This method was added in Boost 1.58.
2018-07-16 11:04:01 +02:00
Max Kellermann
9c6b52ccee Permission: add special permissions for local sockets
Closes #296
2018-07-15 22:27:35 +02:00
Yue Wang
79937c9495
Support timed_wait in microseconds level
Some Audio plugin (such as ALSA, and soon CoreAudio) already support microsecond level buffer time. However, current interval less than 1000 microseconds will cause a bug that the code treated as 0 ms.
2018-07-15 13:22:53 -07:00
Max Kellermann
8aa2c57413 client: pass permission mask to constructor
Prepare for per-listener permissions.
2018-07-15 21:51:33 +02:00
Max Kellermann
524a7f4560 Listen: simplify code flow in listen_global_init() 2018-07-15 21:35:35 +02:00
Max Kellermann
56bfff5a57 event/ServerSocket: add method IsEmpty() 2018-07-15 21:35:35 +02:00
Yue Wang
1d30df9b15
Update OSXOutputPlugin.cxx
some device seems to have issue with setting kAudioDevicePropertyVolumeScalar  with kAudioObjectPropertyElementMaster. Use AudioToolbox 's kAudioHardwareServiceDeviceProperty_VirtualMasterVolume instead. 

Ideally, we should get the steoro channels first, and set the kAudioDevicePropertyVolumeScalar for each channel, which is doable as presented in https://github.com/cmus/cmus/blob/master/op/coreaudio.c. I will do a follow up PR after refactor PR.
2018-07-13 22:27:24 -07:00
Yue Wang
ef84e5c8fa
further guard dop code by if (dop_enabled) 2018-07-13 16:36:29 -07:00
Yue Wang
6d2a30b860
Update OSXOutputPlugin.cxx
1 sec for pause is too long. we wait for the same amount of time as when ring buffer is not available for writing.
2018-07-13 16:14:59 -07:00
Yue Wang
9e0fa8e9ec
Fix a copy and paste from diff bug. 2018-07-13 15:53:51 -07:00
Yue Wang
5e8e038811
Enclose pcm_export into the ENABLE_DSD guard. 2018-07-13 15:31:48 -07:00
Yue Wang
e61a804b80
Simplify audio format assignment code 2018-07-13 15:09:11 -07:00
Yue Wang
40a1ebee29
Enable OSX output plugin to set hardware sample rate and bit depth at the same time
This PR will fix #271.

special thanks to @coroner21 who contributed a nice way to score hardware supported format in #292

Also, The DSD related code are all guarded with ENABLE_DSD  flag.
2018-07-13 12:48:43 -07:00
Max Kellermann
d4ce9c0df2 system/FileDescriptor: no-op implementation of *CloseOnExec() on Windows
Fixes the NFS client build, closes #305.
2018-07-13 18:16:39 +02:00
Yue Wang
680fdb0338
enable macOS to use Hardware Mixer
- Update the mixer to set on device property instead of audio unit property. When user choose "hardware" as mixer type, they will be able to change the hardware device volume instead of the software (AudioUnit) volume. 
- We don't use square root scale in volume calculation as previous code did. This will make the volume level in line with system volume meter --- That is, MPD will have the same percentage volume reading compared to System Setting (Either in "System Preference" or in "Audio Midi Setup" app)
2018-07-10 15:51:32 -07:00
Max Kellermann
727078f65d decoder/flac: call TagHandler::OnAudioFormat() 2018-07-07 14:43:21 +02:00
Max Kellermann
d7f770ce73 decoder/flac: move flac_sample_format() to FlacAudioFormat.hxx 2018-07-07 14:40:02 +02:00
Max Kellermann
e1ddb63054 lib/xiph/FlacStreamMetadata: move code to Scan(FLAC__StreamMetadata_StreamInfo) 2018-07-07 14:33:53 +02:00
Max Kellermann
24b14c5aa5 decoder/flac: rename FlacMetadata.cxx to FlacStreamMetadata.cxx 2018-07-07 14:29:49 +02:00
Max Kellermann
2e116c9e28 lib/xiph/FlacMetadataChain: un-inline Read(InputStream) 2018-07-07 14:22:22 +02:00
Max Kellermann
37897d1550 decoder/flac: move class FlacMetadataChain to separate source 2018-07-07 14:18:00 +02:00
Max Kellermann
b153591790 decoder/flac: move FlacIOHandle.?xx to lib/xiph/ 2018-07-07 14:17:03 +02:00
Max Kellermann
ee5653338d decoder/flac: fix comment typo 2018-07-07 14:11:28 +02:00
Max Kellermann
032f47c0b0 lib/xiph/FlacMetadataIterator: disallow copying 2018-07-07 14:08:41 +02:00
Max Kellermann
1f4e4dd9b3 lib/xiph/FlacMetadataIterator: reuse default constructor 2018-07-07 14:08:18 +02:00
Max Kellermann
d43218ed16 lib/xiph/FlacMetadataIterator: proper CamelCase 2018-07-07 14:07:48 +02:00
Max Kellermann
3d43e4e954 decoder/flac: move class FLACMetadataIterator to separate source 2018-07-07 14:04:37 +02:00
Max Kellermann
b0d587ded7 decoder/flac: pass FLAC__Metadata_Chain* to FLACMetadataIterator ctor 2018-07-07 14:04:06 +02:00
Max Kellermann
1245b4a49f decoder/wavpack: merge duplicate code into Scan() 2018-07-07 13:54:02 +02:00
Max Kellermann
d4ce6049c9 decoder/wavpack: call TagHandler::OnAudioFormat() 2018-07-07 13:52:58 +02:00
Max Kellermann
c236a85c13 decoder/wavpack: add CheckAudioFormat(WavpackContext) 2018-07-07 13:48:49 +02:00
Max Kellermann
9cf43eef67 decoder/wildmidi: call TagHandler::OnAudioFormat() 2018-07-07 13:43:29 +02:00
Max Kellermann
ed6d0aa548 decoder/wildmidi: convert WILDMIDI_SAMPLE_RATE to AudioFormat 2018-07-07 13:36:18 +02:00
Max Kellermann
3d27fffc50 decoder/opus: call TagHandler::OnAudioFormat() 2018-07-07 13:34:32 +02:00
Max Kellermann
de0ee26432 decoder/sndfile: call TagHandler::OnAudioFormat() 2018-07-07 13:29:39 +02:00
Max Kellermann
45cccbce59 decoder/sndfile: use AtScopeExit()
Fixes memory leaks.
2018-07-07 13:27:26 +02:00
Max Kellermann
479de9c7cb decoder/sndfile: add CheckAudioFormat(SF_INFO) 2018-07-07 13:26:39 +02:00
Max Kellermann
60821232b9 decoder/audiofile: allocate AFvirtualfile with malloc()
afCloseFile() uses free(), so we need to use malloc().
2018-07-07 13:25:01 +02:00
Max Kellermann
9b4156a282 decoder/audiofile: add "noexcept" 2018-07-07 13:21:27 +02:00
Max Kellermann
89b1e27d2e decoder/audiofile: merge duplicate code into CheckAudioFormat(AFfilehandle) 2018-07-07 13:21:09 +02:00
Max Kellermann
1dcaf8f76a decoder/audiofile: call TagHandler::OnAudioFormat() 2018-07-07 13:18:06 +02:00
Max Kellermann
18508d1919 decoder/audiofile: merge audiofile_get_duration() into audiofile_scan_stream() 2018-07-07 13:16:38 +02:00
Max Kellermann
9f77d568e2 decoder/mad: call TagHandler::OnAudioFormat() 2018-07-07 13:10:39 +02:00
Max Kellermann
0d0569b9af decoder/mad: merge mad_decoder_total_file_time() into mad_decoder_scan_stream() 2018-07-07 13:09:23 +02:00
Max Kellermann
0f18e7baf9 decoder/mpg123: call TagHandler::OnAudioFormat() 2018-07-07 13:08:06 +02:00
Max Kellermann
d8b03d4927 decoder/ffmpeg: call TagHandler::OnAudioFormat() 2018-07-07 13:02:08 +02:00
Max Kellermann
72b6c09a73 db/simple: add an AudioFormat to each Song 2018-07-06 22:49:02 +02:00
Max Kellermann
c05bca6f2c tag/Handler: implement FullTagHandler::OnAudioFormat() 2018-07-06 22:46:03 +02:00
Max Kellermann
73c95d1fb2 TagFile: rename exported functions, use CamelCase
And specify whether generic tags are being scanned.
2018-07-06 22:33:35 +02:00
Max Kellermann
2c30e16371 db/simple/Song: remove obsolete comment 2018-07-06 21:50:53 +02:00
Max Kellermann
72437ca9e2 db/simple/Song: use C++11 initializers 2018-07-06 21:49:52 +02:00
Max Kellermann
a72d1200fb require GCC 6
Meanwhile, GCC 5 fails to compile MPD due to incomplete C++14
implementation.
2018-07-06 19:44:32 +02:00
Max Kellermann
9a29d02e7e Merge branch 'v0.20.x' 2018-07-06 19:43:01 +02:00
Max Kellermann
6f3c0d0a60 AudioFormat: include cleanup 2018-07-06 19:35:31 +02:00
Max Kellermann
466625f7ad input/curl: use new class HttpStatusError
This way, IsFileNotFound() can detect status 404.
2018-07-06 19:26:11 +02:00
Max Kellermann
b8259e604a db/update/{Walk,ExcludeList}: use InputStream to read .mpdignore
Supports .mpdignore on NFS/SMB and others (closes #290).
2018-07-06 19:19:04 +02:00
Max Kellermann
86e2075c63 lib/nfs/Connection: use new class NfsClientError
Allows callers to extract the NFS error code.
2018-07-06 19:17:34 +02:00
Max Kellermann
30900b2fe2 input/Error: new library providing IsFileNotFound() 2018-07-06 19:16:01 +02:00
Max Kellermann
fd7ae7ea4c input/Domain: remove obsolete variable 2018-07-06 19:13:53 +02:00
Max Kellermann
60d5bf0240 util/StringFormat: new utility library 2018-07-06 19:07:02 +02:00