Playback command request.
12397
def command(cmd):
    """"""
    message = create(protobuf.SEND_COMMAND_MESSAGE)
    send_command = message.inner()
    send_command.command = cmd
    return message
78786
def play_response(self, request):
        
        for index, response in self._responses(request):
            if self.play_counts[index] == 0:
                self.play_counts[index] += 1
                return response
        # The cassette doesn't contain the request asked for.
        raise UnhandledHTTPRequestError(
            "The cassette (%r) doesn't contain the request (%r) asked for"
            % (self._path, request)
        )
896790
def _play(self):
        
        while True:
            if self._buffered:
                self._source.push(self._buffer.get())
1144257
def do_command(self, words):
        """"""
        self.output = ''
        self._do_command(words)
        return self.output
321983
function initReplay() {
  const replayOption = ['record', 'replay'].find(opt => program[opt] === true)
  if (replayOption) process.env.REPLAY = replayOption

  process.env.REPLAY =
    replayOption || (process.env.REPLAY ? process.env.REPLAY : 'bloody')

  if (process.env.REPLAY !== 'bloody') require('replay')
}
1293876
def do_speak(self, args):
        """"""
        words = []
        for word in args.words:
            if args.piglatin:
                word = '%s%say' % (word[1:], word[0])
            if args.shout:
                word = word.upper()
            words.append(word)

        repetitions = args.repeat or 1

        color_on = ''
        if args.fg:
            color_on += FG_COLORS[args.fg]
        if args.bg:
            color_on += BG_COLORS[args.bg]
        color_off = Fore.RESET + Back.RESET

        for i in range(min(repetitions, self.maxrepeats)):
            # .poutput handles newlines, and accommodates output redirection too
            self.poutput(color_on + ' '.join(words) + color_off)
112211
def poll_command_request(self):
        
        try:
            message = self.rpc.recv(zmq.NOBLOCK)
        except zmq.ZMQError as exc:
            if exc.errno == zmq.EAGAIN:
                return
            else:
                raise

        _logger.debug("Received command %s", message)
        segments = _unpack(message)
        action, params = segments[0], segments[1:]
        _logger.debug("Adding %s, %s to the request queue", action, params)
        self._command = _Command(action, params)
23453
def play(self):
        """"""
        if self.state == STATE_PAUSED:
            self._player.set_state(Gst.State.PLAYING)
            self.state = STATE_PLAYING
951587
def cmd_playtune(self, args):
        ''''''
        if len(args) < 1:
            print("Usage: playtune TUNE")
            return
        tune = args[0]
        str1 = tune[0:30]
        str2 = tune[30:]
        if sys.version_info.major >= 3 and not isinstance(str1, bytes):
            str1 = bytes(str1, "ascii")
        if sys.version_info.major >= 3 and not isinstance(str2, bytes):
            str2 = bytes(str2, "ascii")
        self.master.mav.play_tune_send(self.settings.target_system,
                                       self.settings.target_component,
                                       str1, str2)
545560
def do_media(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever subcommand function was selected
            func(self, args)
        else:
            # No subcommand was provided, so call help
            self.do_help('media')
305054
def play(media_to_play = "playlist", options = {})
      start_the_machine
      check_for_playback_status

      media = case true
              when media_to_play.is_a?(Media) then media_to_play
              when media_to_play == "playlist" && playlist.any?
                playlist.next
              else Media.new(media_to_play)
              end

      content = {
        "Content-Location" => media,
        "Start-Position" => options.fetch(:time, 0.0)
      }

      data = content.map { |k, v| "#{k}: #{v}" }.join("\r\n")

      response = persistent.async.post("/play", data + "\r\n", {
        "Content-Type" => "text/parameters"
      })

      timers.reset
    end
722261
def command(state, args):
    """"""

    args = parser.parse_args(args[1:])
    where_queries = []
    params = {}
    if args.watching or args.available:
        where_queries.append('regexp IS NOT NULL')
    if args.query:
        where_queries.append('title LIKE :title')
        params['title'] = _compile_sql_query(args.query)
    if not where_queries:
        print('Must include at least one filter.')
        return
    where_query = ' AND '.join(where_queries)
    logger.debug('Search where %s with params %s', where_query, params)

    results = list()
    all_files = [
        filename for filename in _find_files(state.config['anime'].getpath('watchdir'))
        if _is_video(filename)
    ]
    for anime in query.select.select(state.db, where_query, params):
        logger.debug('For anime %s with regexp %s', anime.aid, anime.regexp)
        if anime.regexp is not None:
            anime_files = AnimeFiles(anime.regexp, all_files)
            logger.debug('Found files %s', anime_files.filenames)
            query.files.cache_files(state.db, anime.aid, anime_files)
            available = anime_files.available_string(anime.watched_episodes)
        else:
            available = ''
        if not args.available or available:
            results.append((
                anime.aid, anime.title, anime.type,
                '{}/{}'.format(anime.watched_episodes, anime.episodecount),
                'yes' if anime.complete else '',
                available,
            ))
    state.results['db'].set(results)
    state.results['db'].print()
1097508
def _public(self, command, **params):
        """"""
        params['command'] = command
        response = self.session.get(self._public_url, params=params)
        return response
916583
async def get_playback_settings(self) -> List[Setting]:
        """"""
        return [
            Setting.make(**x)
            for x in await self.services["avContent"]["getPlaybackModeSettings"]({})
        ]
891064
def send_audio(self, *args, **kwargs):
        """"""
        return send_audio(*args, **self._merge_overrides(**kwargs)).run()
922133
def _command(self, sock_info, command, slave_ok=False, value=1, check=True,
                 allowable_errors=None, read_preference=ReadPreference.PRIMARY,
                 codec_options=DEFAULT_CODEC_OPTIONS,
                 write_concern=None,
                 parse_write_concern_error=False, session=None, **kwargs):
        """"""
        if isinstance(command, string_type):
            command = SON([(command, value)])

        command.update(kwargs)
        with self.__client._tmp_session(session) as s:
            return sock_info.command(
                self.__name,
                command,
                slave_ok,
                read_preference,
                codec_options,
                check,
                allowable_errors,
                write_concern=write_concern,
                parse_write_concern_error=parse_write_concern_error,
                session=s,
                client=self.__client)
854825
def perform_command(self):
        
        if len(self.actual_arguments) < 2:
            return self.print_help()
        source_url = self.actual_arguments[0]
        output_file_path = self.actual_arguments[1]

        download = not self.has_option("--list")
        # largest_audio = True by default or if explicitly given
        if self.has_option("--largest-audio"):
            largest_audio = True
        else:
            largest_audio = not self.has_option("--smallest-audio")
        download_format = self.has_option_with_value("--format")

        try:
            if download:
                self.print_info(u"Downloading audio stream from '%s' ..." % source_url)
                downloader = Downloader(logger=self.logger)
                result = downloader.audio_from_youtube(
                    source_url,
                    download=True,
                    output_file_path=output_file_path,
                    download_format=download_format,
                    largest_audio=largest_audio,
                )
                self.print_info(u"Downloading audio stream from '%s' ... done" % source_url)
                self.print_success(u"Downloaded file '%s'" % result)
            else:
                self.print_info(u"Downloading stream info from '%s' ..." % source_url)
                downloader = Downloader(logger=self.logger)
                result = downloader.audio_from_youtube(
                    source_url,
                    download=False
                )
                self.print_info(u"Downloading stream info from '%s' ... done" % source_url)
                msg = []
                msg.append(u"%s\t%s\t%s\t%s" % ("Format", "Extension", "Bitrate", "Size"))
                for r in result:
                    filesize = gf.human_readable_number(r["filesize"])
                    msg.append(u"%s\t%s\t%s\t%s" % (r["format"], r["ext"], r["abr"], filesize))
                self.print_generic(u"Available audio streams:")
                self.print_generic(u"\n".join(msg))
            return self.NO_ERROR_EXIT_CODE
        except ImportError:
            self.print_no_dependency_error()
        except Exception as exc:
            self.print_error(u"An unexpected error occurred while downloading audio from YouTube:")
            self.print_error(u"%s" % exc)

        return self.ERROR_EXIT_CODE