Commit graph

14 commits

Author SHA1 Message Date
Leonardo Gibrowski Faé
2b103b7acd Implement conditions on tag
A condition is formed by:
    <tag> <op> <value>

<tag> is the normal yambar tag. <op> is one of '==', '!=', '<', '<=', '>', or
'>='. <value> is what you wish to compare it to.

'boolean' tags must be used directly. They falsehood is matched with '~':

    <tag>
    ~<tag>

Finally, to match an empty string, one must use ' "" ':
    <tag> <op> ""
2022-04-23 17:13:24 -03:00
Daniel Eklöf
c79ffbe057
Add support binding on-click handlers to other buttons than LEFT
One can now bind the left/middle/right mouse buttons to on-click. In
fact, you can have all three buttons bound to different handlers for
the same particle. The new syntax is

    on-click:
        left: <command>
        middle: <command>
        right: <command>

Leaving one out is the same thing as not mapping it at
all. Furthermore,

    on-click: <command>

is still valid, and is a shorthand for

    on-click:
        left: <commsnd>
2021-07-01 17:15:53 +02:00
Daniel Eklöf
1cce649f06 Reduce header intra-dependencies 2019-01-13 19:42:16 +01:00
Daniel Eklöf
ab67d036ae tags: break out string formatting from particle/string 2018-12-29 17:03:41 +01:00
Daniel Eklöf
b0f0a1e942 tag: add realtime unit MSECS (milliseconds) 2018-12-28 14:05:02 +01:00
Daniel Eklöf
13cc11e200 tag: refresh_in() *must* use the realtime unit 2018-12-28 14:04:35 +01:00
Daniel Eklöf
20b3299afd tag: add a refresh_in() interface function
E.g. particles may use this to force a refresh after a certain amount
of time.

Note that it can only be used with 'realtime' tags.
2018-12-28 12:43:02 +01:00
Daniel Eklöf
904f9ff8e1 tag: all tag constructors must now be passed a module 'owner' 2018-12-28 12:40:41 +01:00
Daniel Eklöf
025c6991a3 tag: add a new variant of int tags, with a realtime unit property
The idea is, consumers of a tag, can check the realtime property, and
if set to something other than TAG_REALTIME_NONE, schedule a realtime
update.

For example, it could be used to track song progress.
2018-12-27 11:43:27 +01:00
Daniel Eklöf
2218bd1583 tag: allow integer tags to have a minimum and maximum value 2018-12-16 15:58:40 +01:00
Daniel Eklöf
1712362da9 tag: add as_int(), as_bool() and as_float() 2018-11-18 11:11:50 +01:00
Daniel Eklöf
44a2dbb201 tag: rename tag.value() -> tag.as_string() 2018-11-18 11:02:21 +01:00
Daniel Eklöf
12e9304612 tag: add a boolean tag 2018-11-18 11:00:01 +01:00
Daniel Eklöf
8bf8a398b9 initial commit: wip 2018-11-17 11:30:33 +01:00