本文整理汇总了Python中quodlibet.qltk.ccb.ConfigCheckButton.emit方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigCheckButton.emit方法的具体用法?Python ConfigCheckButton.emit怎么用?Python ConfigCheckButton.emit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quodlibet.qltk.ccb.ConfigCheckButton
的用法示例。
在下文中一共展示了ConfigCheckButton.emit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from quodlibet.qltk.ccb import ConfigCheckButton [as 别名]
# 或者: from quodlibet.qltk.ccb.ConfigCheckButton import emit [as 别名]
def __init__(self):
super(PreferencesWindow.Player, self).__init__(spacing=12)
self.set_border_width(12)
self.title = _("Playback")
# player backend
if app.player and hasattr(app.player, 'PlayerPreferences'):
player_prefs = app.player.PlayerPreferences()
f = qltk.Frame(_("Output Configuration"), child=player_prefs)
self.pack_start(f, False, True, 0)
# replaygain
fallback_gain = config.getfloat("player", "fallback_gain", 0.0)
adj = Gtk.Adjustment.new(fallback_gain, -12.0, 12.0, 0.5, 0.5, 0.0)
fb_spin = Gtk.SpinButton(adjustment=adj)
fb_spin.set_digits(1)
fb_spin.connect('changed', self.__changed,
'player', 'fallback_gain')
fb_spin.set_tooltip_text(
_("If no Replay Gain information is available "
"for a song, scale the volume by this value"))
fb_label = Gtk.Label(label=_("_Fall-back gain (dB):"))
fb_label.set_use_underline(True)
fb_label.set_mnemonic_widget(fb_spin)
pre_amp_gain = config.getfloat("player", "pre_amp_gain", 0.0)
adj = Gtk.Adjustment.new(pre_amp_gain, -6, 6, 0.5, 0.5, 0.0)
adj.connect('value-changed', self.__changed,
'player', 'pre_amp_gain')
pre_spin = Gtk.SpinButton(adjustment=adj)
pre_spin.set_digits(1)
pre_spin.set_tooltip_text(
_("Scale volume for all songs by this value, "
"as long as the result will not clip"))
pre_label = Gtk.Label(label=_("_Pre-amp gain (dB):"))
pre_label.set_use_underline(True)
pre_label.set_mnemonic_widget(pre_spin)
widgets = [pre_label, pre_spin, fb_label, fb_spin]
c = CCB(_("_Enable Replay Gain volume adjustment"),
"player", "replaygain", populate=True)
c.connect('toggled', self.__toggled_gain, widgets)
# packing
table = Gtk.Table.new(3, 2, False)
table.set_col_spacings(6)
table.set_row_spacings(6)
table.attach(c, 0, 2, 0, 1)
fb_label.set_alignment(0, 0.5)
table.attach(fb_label, 0, 1, 1, 2,
xoptions=Gtk.AttachOptions.FILL)
pre_label.set_alignment(0, 0.5)
table.attach(pre_label, 0, 1, 2, 3,
xoptions=Gtk.AttachOptions.FILL)
fb_align = Align(halign=Gtk.Align.START)
fb_align.add(fb_spin)
table.attach(fb_align, 1, 2, 1, 2)
pre_align = Align(halign=Gtk.Align.START)
pre_align.add(pre_spin)
table.attach(pre_align, 1, 2, 2, 3)
f = qltk.Frame(_("Replay Gain Volume Adjustment"), child=table)
c.emit('toggled')
self.pack_start(f, False, True, 0)
for child in self.get_children():
child.show_all()
示例2: __init__
# 需要导入模块: from quodlibet.qltk.ccb import ConfigCheckButton [as 别名]
# 或者: from quodlibet.qltk.ccb.ConfigCheckButton import emit [as 别名]
#.........这里部分代码省略.........
hb.pack_start(e)
vbox.pack_start(hb, expand=False)
hb = gtk.HBox(spacing=6)
e = UndoEntry()
e.set_text(config.get("connection", "port"))
e.connect('changed', self.__changed_tb, 'connection', 'port')
e.set_tooltip_text(
_("Port of the MPD Host"))
l = gtk.Label(_("Port:"))
l.set_use_underline(True)
l.set_mnemonic_widget(e)
hb.pack_start(l, expand=False)
hb.pack_start(e)
vbox.pack_start(hb, expand=False)
hb = gtk.HBox(spacing=6)
e = UndoEntry()
e.set_text(config.get("connection", "password"))
e.connect('changed', self.__changed_tb, 'connection', 'password')
e.set_tooltip_text(
_("Password for the MPD Host (if necessary)"))
e.set_visibility(False)
l = gtk.Label(_("Password:"))
l.set_use_underline(True)
l.set_mnemonic_widget(e)
hb.pack_start(l, expand=False)
hb.pack_start(e)
vbox.pack_start(hb, expand=False)
f = qltk.Frame(_("MPD Server Connection"), child=vbox)
self.pack_start(f, expand=False)
# player backend
# if player.backend and hasattr(player.device, 'PlayerPreferences'):
# player_prefs = player.device.PlayerPreferences()
# f = qltk.Frame(_("Output Configuration"), child=player_prefs)
# self.pack_start(f, expand=False)
# replaygain
fallback_gain = config.getfloat("player", "fallback_gain", 0.0)
adj = gtk.Adjustment(fallback_gain, -12.0, 12.0, 0.5, 0.5, 0.0)
fb_spin = gtk.SpinButton(adj)
fb_spin.set_digits(1)
fb_spin.connect('changed', self.__changed,
'player', 'fallback_gain')
fb_spin.set_tooltip_text(
_("If no Replay Gain information is available "
"for a song, scale the volume by this value"))
fb_label = gtk.Label(_("_Fall-back gain (dB):"))
fb_label.set_use_underline(True)
fb_label.set_mnemonic_widget(fb_spin)
pre_amp_gain = config.getfloat("player", "pre_amp_gain", 0.0)
adj = gtk.Adjustment(pre_amp_gain, -6, 6, 0.5, 0.5, 0.0)
adj.connect('value-changed', self.__changed,
'player', 'pre_amp_gain')
pre_spin = gtk.SpinButton(adj)
pre_spin.set_digits(1)
pre_spin.set_tooltip_text(
_("Scale volume for all songs by this value, "
"as long as the result will not clip"))
pre_label = gtk.Label(_("_Pre-amp gain (dB):"))
pre_label.set_use_underline(True)
pre_label.set_mnemonic_widget(pre_spin)
widgets = [pre_label, pre_spin, fb_label, fb_spin]
c = ConfigCheckButton(_("_Enable Replay Gain volume adjustment"),
"player", "replaygain", populate=True)
c.connect('toggled', self.__toggled_gain, widgets)
# packing
table = gtk.Table(3, 2)
table.set_col_spacings(6)
table.set_row_spacings(6)
table.attach(c, 0, 2, 0, 1)
fb_label.set_alignment(0, 0.5)
table.attach(fb_label, 0, 1, 1, 2,
xoptions=0)
pre_label.set_alignment(0, 0.5)
table.attach(pre_label, 0, 1, 2, 3,
xoptions=0)
fb_align = gtk.Alignment(0, 0.5, 0, 1)
fb_align.add(fb_spin)
table.attach(fb_align, 1, 2, 1, 2)
pre_align = gtk.Alignment(0, 0.5, 0, 1)
pre_align.add(pre_spin)
table.attach(pre_align, 1, 2, 2, 3)
f = qltk.Frame(_("Replay Gain Volume Adjustment"), child=table)
c.emit('toggled')
self.pack_start(f, expand=False)
self.show_all()