def _play_cast_(self): if os.path.exists(configf): print(colors.warning(":::Threading::: Configuration file exists.")) print(colors.warning(":::Threading::: Using defaults set there.")) config.read(configf) backend = ConfigSectionMap("settings")["backend"] print(":::Threading backend::: %s." % backend) else: backend = mkchromecast.__init__.backend global cast if backend == "node": stream() else: try: reload(mkchromecast.audio) except NameError: from imp import reload reload(mkchromecast.audio) mkchromecast.audio.main() if platform == "Linux": # We create the sink only if it is not available if check_sink() is False and adevice is None: create_sink() start = Casting() start.initialize_cast() try: start.get_devices() start.play_cast() cast = start.cast # Let's change inputs at the end to avoid muting sound too early. # For Linux it does not matter given that user has to select sink # in pulse audio. Therefore the sooner it is available, the # better. if platform == "Darwin": inputdev() outputdev() self.pcastready.emit("_play_cast_ success") except AttributeError: self.pcastready.emit("_play_cast_ failed") self.pcastfinished.emit()
def _play_cast_(self): if os.path.exists(configf): print(colors.warning(':::Threading::: Configuration file exists.')) print(colors.warning(':::Threading::: Using defaults set there.')) config.read(configf) backend = ConfigSectionMap('settings')['backend'] print(':::Threading backend::: %s.' % backend) else: backend = mkchromecast.__init__.backend global cast if backend == 'node': stream() else: try: reload(mkchromecast.audio) except NameError: from imp import reload reload(mkchromecast.audio) mkchromecast.audio.main() if platform == 'Linux': # We create the sink only if it is not available if check_sink() is False and adevice is None: create_sink() start = Casting() start.initialize_cast() try: start.get_devices() start.play_cast() cast = start.cast # Let's change inputs at the end to avoid muting sound too early. # For Linux it does not matter given that user has to select sink # in pulse audio. Therefore the sooner it is available, the # better. if platform == 'Darwin': inputdev() outputdev() self.pcastready.emit('_play_cast_ success') except AttributeError: self.pcastready.emit('_play_cast_ failed') self.pcastfinished.emit()
def recasting(): start = Casting() start.initialize_cast() start.get_devices() start.play_cast() return