Esempio n. 1
0
    "custom": {
        "name": _("Custom")
    }
}

#
# Custom sinks
#

if sys.platform == 'win32':
    import sink_windows
    sink_windows.load_exaile_directsound_plugin(SINK_PRESETS)

elif sys.platform == 'darwin':
    import sink_osx
    sink_osx.load_osxaudiosink(SINK_PRESETS)


def sink_from_preset(player, preset):
    if preset == "custom":
        pipe = settings.get_option("%s/custom_sink_pipe" % player._name, "")
        if not pipe:
            logger.error("No custom sink pipe set for %s" % player._name)
            return None
        name = _("Custom")
    else:
        d = SINK_PRESETS.get(preset, "")
        if not d:
            logger.error("Could not find sink preset %s for %s." %
                         (preset, player._name))
            return None
Esempio n. 2
0
            "name"      : _("Custom")
        }
}


#
# Custom sinks
#   
    
if sys.platform == 'win32':
    import sink_windows
    sink_windows.load_exaile_directsound_plugin(SINK_PRESETS)

elif sys.platform == 'darwin':
    import sink_osx
    sink_osx.load_osxaudiosink(SINK_PRESETS)

def sink_from_preset(player, preset):
    if preset == "custom":
        pipe = settings.get_option("%s/custom_sink_pipe" % player._name, "")
        if not pipe:
            logger.error("No custom sink pipe set for %s" % player._name)
            return None
        name = _("Custom")
    else:
        d = SINK_PRESETS.get(preset, "")
        if not d:
            logger.error("Could not find sink preset %s for %s." % (preset, player._name))
            return None

        name = d['name']
Esempio n. 3
0
        Gst.Bin.__init__(self, name='%s-audiosink' % name)

        elems = [
            Gst.parse_launch(elem.strip()) for elem in pipeline.split('!')
        ]

        for e in elems:
            self.add(e)

        gst_utils.element_link_many(*elems)

        # GhostPad allows the bin to pretend to be an audio sink
        ghost = Gst.GhostPad.new("sink", elems[0].get_static_pad("sink"))
        self.add_pad(ghost)


#
# Custom per-platform sink stuff where GStreamer doesn't currently support
# autodetection of output devices
#

if sys.platform == 'darwin':
    import sink_osx
    dev_fn = sink_osx.load_osxaudiosink(SINK_PRESETS)
    _autodetect_devices.append(dev_fn)

elif sys.platform == 'win32':
    import sink_windows
    dev_fn = sink_windows.load_directsoundsink(SINK_PRESETS)
    _autodetect_devices.append(dev_fn)
Esempio n. 4
0
    def __init__(self, pipeline, name):
        Gst.Bin.__init__(self, name='%s-audiosink' % name)
        
        elems = [Gst.parse_launch(elem.strip()) for elem in pipeline.split('!')]
        
        for e in elems:
            self.add(e)
            
        gst_utils.element_link_many(*elems)
        
        # GhostPad allows the bin to pretend to be an audio sink
        ghost = Gst.GhostPad.new("sink",
                                 elems[0].get_static_pad("sink"))
        self.add_pad(ghost)

#
# Custom per-platform sink stuff where GStreamer doesn't currently support
# autodetection of output devices
#

if sys.platform == 'darwin':
    import sink_osx
    dev_fn = sink_osx.load_osxaudiosink(SINK_PRESETS)
    _autodetect_devices.append(dev_fn)
    
elif sys.platform == 'win32':
    import sink_windows
    dev_fn = sink_windows.load_directsoundsink(SINK_PRESETS)
    _autodetect_devices.append(dev_fn)