natural-harmonia-gropius / input-event

Enhanced input.conf for mpv-player. with better, conflict-free, low-latency event mechanism.
MIT License
51 stars 5 forks source link

Support property-expansion for command #21

Closed natural-harmonia-gropius closed 2 years ago

natural-harmonia-gropius commented 2 years ago

Syntax: property-expansion

Example:

input.conf

set output TRC to be the same as input.

set target-trc ${video-params/gamma}

ternary operators like.

set target-trc ${?video-params/gamma==pq:hlg}${!video-params/gamma==pq:bt.1886}

evafast like speedup.

SPACE           cycle pause                                                                 #@click
SPACE           no-osd set speed 1; set pause no                                            #@press
SPACE           ignore                                                                      #@release
SPACE           no-osd add speed ${?speed==4.00:0}${!speed==4.00:0.1}; show-text ${speed}   #@repeat

TODO:

zhongfly commented 2 years ago

第二点: command_invert里用分号分隔也会有类似问题,命令是set title "example; 6666; 7777"就会分割错误变成{'set title "example','666','777"'}处理第2,3个元素时local property = subs[prefix == "" and 2 or 3]应该就会报错