Commit graph

32 commits

Author SHA1 Message Date
Daniel Eklöf
e85e3e8ced
module/mpd: increase tag count in tag set
96d2d057e0
added a new tag, ‘volume’, but didn’t bump the tag count.

This meant the last tag in the set, ‘elapsed’ was never seen by
anybody, and not free:d when the tag set was free:d.
2021-01-04 20:01:46 +01:00
optimus-prime
96d2d057e0 module/mpd: add volume tag 2020-12-03 00:43:47 +05:30
Daniel Eklöf
8a7e07af28
module/mpd: don’t overload enum mpd_state
We overloaded enum mpd_state to add an “offline” state. Don’t do
this. We can detect the offline state by checking if our connection
object is NULL.

Closes #16
2020-11-09 20:27:42 +01:00
Daniel Eklöf
0e3bded42d
module/mpd: thrd_success isn't necessarily 0 2020-05-03 14:25:17 +02:00
Daniel Eklöf
86522d653d
modules: move 'content' and 'anchors' to MODULE_COMMON_ATTRS
All modules implement these. The only one that differs is the i3
module. It still implements them, but 'content' uses an internal
verifier function.
2020-01-24 21:08:39 +01:00
Daniel Eklöf
1534e00236
module/mpd: don't try to strdup() NULL strings 2019-07-08 15:06:24 +02:00
Daniel Eklöf
27a47a96ed module/mpd: check return value of write()
Fixes building with -D_FORTIFY_SOURCE=2
2019-05-04 11:28:25 +02:00
Daniel Eklöf
b6e61f9c7e modules: use calloc() instead of malloc()
In cases where it makes sense, use calloc() instead of malloc():

* When allocating large objects with many members, many for which
  NULL/0 is a good default value.
* Arrays etc where we explicitly initialize to NULL anyway.
2019-02-09 11:11:31 +01:00
Daniel Eklöf
ae5029826b cmake: break out bar stuff to separate CMakeLists.txt 2019-02-07 12:06:16 +01:00
Daniel Eklöf
a831490462 modules: fix strncpy calls to ensure strings are NULL-terminated 2019-02-06 18:10:06 +01:00
Daniel Eklöf
f37dfbc727 module/mpd: free strdup:ed path string 2019-01-29 20:58:55 +01:00
Daniel Eklöf
452c4b6015 plugins: export a const function pointer interface struct 2019-01-26 18:32:04 +01:00
Daniel Eklöf
d86c9914e5 module/mpd: silence overflow warning 2019-01-20 11:35:20 +01:00
Daniel Eklöf
e6745f55dd module/mpd: socket may already exist, but not be connectable 2019-01-19 17:00:08 +01:00
Daniel Eklöf
cecd5d3e6f module/mpd: use inotify, when possible, to watch for MPD socket creation
When we're connecting to a unix domain socket, use inotify to watch
for it's creation, instead of trying to re-connect over and over
again.
2019-01-19 13:49:58 +01:00
Daniel Eklöf
0d591fe5a1 allow plugins to be compiled into the f00bar main binary 2019-01-14 20:57:03 +01:00
Daniel Eklöf
4a26664d8d particles: remove config-verify.h from particle.h 2019-01-13 17:41:39 +01:00
Daniel Eklöf
bc62843c91 modules: get rid of struct module_info
Since this struct only contained function pointers, make all modules
export those functions directly.

The plugin manager now defines a module interface struct, and fills it
it by dlsym:ing the functions that used to be in module_info.
2019-01-13 17:09:11 +01:00
Daniel Eklöf
76d135e257 module: remove module_run_context
Store abort_fd directly in the module struct instead. This then allows
us to pass the module pointer as-is to the modules' run functions.
2019-01-13 15:34:59 +01:00
Daniel Eklöf
acdeff3b6e module: remove ready_fd
All modules are expected to handle a call to content() after having
been instantiated.

I.e. modules *cannot* even expect run() to have started running.
2019-01-13 15:25:39 +01:00
Daniel Eklöf
a425378576 config: allow font/foreground attributes on modules too
Previously we allowed it on the bar, and on all particles. Now we also
allow it on all modules.

This allows us to specify a "default" font/foreground on a per-module
basis, having it applied to all the modules particles.
2019-01-13 14:24:44 +01:00
Daniel Eklöf
8dc278aaf2 config: pass a struct with inheritable values
For now, font and foreground color
2019-01-13 14:13:14 +01:00
Daniel Eklöf
9944a8f972 modules: don't assume module content is a dictionary
This is done by having each module implement a top-level verifier
function.
2019-01-13 11:54:57 +01:00
Daniel Eklöf
71515e4079 config: conf_verify_dict() now assumes attr list is NULL-terminated 2019-01-13 11:37:05 +01:00
Daniel Eklöf
ec4a47e5db modules: rename module_info -> plugin_info
This is the same name used by particles.
2019-01-13 11:18:32 +01:00
Daniel Eklöf
42104db1ca modules: move files back to a common directory (again) 2019-01-12 21:24:20 +01:00
Daniel Eklöf
8809cbb481 Put each module in its own subdirectory 2019-01-12 11:19:57 +01:00
Daniel Eklöf
e54e19e2c4 module/mpd: expose repeat/random/consume state 2019-01-11 20:10:36 +01:00
Daniel Eklöf
45e5f11fea modules: remove "connected to " prefix from info logs 2019-01-02 18:14:49 +01:00
Daniel Eklöf
500aebe9ef module/mpd: free connection object when failing to connect 2018-12-30 14:04:40 +01:00
Daniel Eklöf
07d6564e79 module/mpd: raise connection retry interval from 1s -> 10s 2018-12-30 12:40:58 +01:00
Daniel Eklöf
b7e7ad522f remove module subfolders 2018-12-29 22:18:08 +01:00
Renamed from modules/mpd/mpd.c (Browse further)