Removing chatty logging
[watersofshiloah] / src / stream.py
index 5ae4313..d584b65 100644 (file)
@@ -68,7 +68,7 @@ class GSTStream(gobject.GObject):
        def set_file(self, uri):
                if self._uri != file:
                        self._invalidate_cache()
-               if self.playing:
+               if self.state != self.STATE_STOP:
                        self.stop()
 
                self._uri = uri
@@ -98,6 +98,7 @@ class GSTStream(gobject.GObject):
                _moduleLogger.info("Stopped")
                self.emit("state-change", self.STATE_STOP)
 
+       @property
        def elapsed(self):
                try:
                        self._elapsed = self._player.query_position(self._timeFormat, None)[0]
@@ -105,6 +106,7 @@ class GSTStream(gobject.GObject):
                        pass
                return self._elapsed
 
+       @property
        def duration(self):
                try:
                        self._duration = self._player.query_duration(self._timeFormat, None)[0]
@@ -113,7 +115,6 @@ class GSTStream(gobject.GObject):
                return self._duration
 
        def seek_time(self, ns):
-               _moduleLogger.debug("Seeking to: %s", ns)
                self._elapsed = ns
                self._player.seek_simple(self._timeFormat, self._seekFlag, ns)