Skip to content
Snippets Groups Projects

Plot horizon distance from ranking statistics

Merged ChiWai Chan requested to merge plot_psd_horizon into master
1 unresolved thread
2 files
+ 23
23
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 11
3
@@ -42,9 +42,7 @@ import pluggy
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstAudio', '1.0')
from gi.repository import GObject
from gi.repository import Gst
from gi.repository import GstAudio
from gi.repository import GObject, Gst, GstAudio
from lal import LIGOTimeGPS
@@ -232,6 +230,16 @@ class Stream:
if self.pipeline.set_state(state) == Gst.StateChangeReturn.FAILURE:
raise RuntimeError(f"pipeline failed to enter {state.value_name}")
def get_element_by_name(self, name):
return self.pipeline.get_by_name(name)
def post_message(self, msg_name, timestamp=None):
s = Gst.Structure.new_empty(msg_name)
message = Gst.Message.new_application(self.pipeline, s)
if timestamp:
message.timestamp = timestamp
self.pipeline.get_bus().post(message)
def __getitem__(self, key):
return self.__class__(
name=self.name,
Loading