summaryrefslogtreecommitdiff
path: root/src/obswebsocket.cr
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2022-11-24 19:35:07 -0800
committerJoe Rayhawk <jrayhawk@fairlystable.org>2022-11-24 19:35:07 -0800
commit1a5f65e4affcc0c517e2b50c08bc9ca8a6deaae1 (patch)
tree22e2f0914ad4cf698a16a31f5130ca5b8e2305d9 /src/obswebsocket.cr
parent10f02081101a1375b6cad64419e8fa320f64fab1 (diff)
downloadcrystal-obs-websocket-1a5f65e4affcc0c517e2b50c08bc9ca8a6deaae1.tar.gz
crystal-obs-websocket-1a5f65e4affcc0c517e2b50c08bc9ca8a6deaae1.zip
Events: support filter state updates
Diffstat (limited to 'src/obswebsocket.cr')
-rw-r--r--src/obswebsocket.cr20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/obswebsocket.cr b/src/obswebsocket.cr
index e4a1509..5f19008 100644
--- a/src/obswebsocket.cr
+++ b/src/obswebsocket.cr
@@ -351,13 +351,21 @@ module OBS
raise SourceMissingException.new( "SourceFilterEnableStateChanged: missing source #{ edata["sourceName"].as_s}" )
end
when "SourceFilterListReindexed"
- # FIXME
+ edata = d["eventData"]
+ self.sources[edata["sourceName"].as_s].filters.deletecache()
+ # This could probably be made more efficient using the eventData
when "SourceFilterCreated"
- # FIXME
+ edata = d["eventData"]
+ self.sources[edata["sourceName"].as_s].filters.deletecache()
+ # This could probably be made more efficient using the eventData
when "SourceFilterRemoved"
- # FIXME
+ edata = d["eventData"]
+ self.sources[edata["sourceName"].as_s].filters.deletecache()
+ # This could probably be made more efficient using the eventData
when "SourceFilterNameChanged"
- # FIXME
+ edata = d["eventData"]
+ self.sources[edata["sourceName"].as_s].filters.deletecache()
+ # This could probably be made more efficient using the eventData
when "StreamStateChanged"
when "RecordStateChanged"
when "ReplayBufferStateChanged"
@@ -1058,6 +1066,10 @@ module OBS
@filters_by_name.empty? && populate
@filters_by_name
end
+ def deletecache()
+ @filters_by_name = Hash( String, OBS::SourceFilter ).new
+ @filters_by_index = Array( String ).new
+ end
end
class SourceFilter