'Computes the track or album gain of a list of items, returns
a list of TrackGain objects.
When computing album gain, the last TrackGain object returned is
the album gain'

def compute_gain(self, items, is_album):

    if (len(items) == 0):
        self._log.debug(u'no    supported    tracks    to    analyze')
        return []
    'Compute    ReplayGain    values    and    return    a    list    of    results\n                                dictionaries    as    given    by    `parse_tool_output`.\n                                '
    cmd = [self.command, '-o', '-s', 's']
    if self.noclip:
        cmd = (cmd + ['-k'])
    else:
        cmd = (cmd + ['-c'])
    cmd = (cmd + ['-d', str(self.gain_offset)])
    cmd = (cmd + [syspath(i.path) for i in items])
    self._log.debug(u'analyzing    {0}    files', len(items))
    self._log.debug(u'executing    {0}', '    '.join(map(displayable_path, cmd)))
    output = call(cmd)
    self._log.debug(u'analysis    finished')
    return self.parse_tool_output(output, (len(items) + (1 if is_album else 0)))
