X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.lua;h=0f3ce72ad9ed050ab0b8fddccf1364367bb82afb;hb=4a300e3cab7b1b1ef5a32e1f4a7ec319c48e95e5;hp=df9e9c7d85e5f993550226d977410645c07fb9a0;hpb=7dbde8f649c62301a91142e7fd1bf555a6389bfd;p=nageru diff --git a/theme.lua b/theme.lua index df9e9c7..0f3ce72 100644 --- a/theme.lua +++ b/theme.lua @@ -269,7 +269,10 @@ end -- there's no signal. function get_channel_resolution(signal_num) res = last_resolution[signal_num] - if (not res) or res.height <= 0 then + if (not res) or not res.is_connected then + return "disconnected" + end + if res.height <= 0 then return "no signal" end if not res.has_signal then @@ -320,9 +323,11 @@ end -- API ENTRY POINT -- Returns, given a channel number, which signal it corresponds to (starting from 0). --- Should return -1 if the channel does not correspond to a simple signal. --- (The information is used for whether right-click on the channel should bring up --- an input selector or not.) +-- Should return -1 if the channel does not correspond to a simple signal +-- (one connected to a capture card, or a video input). The information is used for +-- whether right-click on the channel should bring up a context menu or not, +-- typically containing an input selector, resolution menu etc. +-- -- Called once for each channel, at the start of the program. -- Will never be called for live (0) or preview (1). function channel_signal(channel) @@ -558,6 +563,7 @@ function get_chain(num, t, width, height, signals) width = signals:get_width(signal_num), height = signals:get_height(signal_num), interlaced = signals:get_interlaced(signal_num), + is_connected = signals:get_is_connected(signal_num), has_signal = signals:get_has_signal(signal_num), frame_rate_nom = signals:get_frame_rate_nom(signal_num), frame_rate_den = signals:get_frame_rate_den(signal_num)