Alexei Sorokin 2018-02-26 09:43:47 +00:00 committed by Git OBS Bridge
parent a8e1fb3c41
commit bb8fb62b98
4 changed files with 61 additions and 31 deletions

View File

@ -114,7 +114,7 @@
+ windowtitle = "PulseAudio " + ladspa_label + windowtitle = "PulseAudio " + ladspa_label
+ +
+ clearpreset = 1 + clearpreset = 1
+ presetmatch = '' + presetmatch = ""
+ for i in range(len(rawpresets)): + for i in range(len(rawpresets)):
+ if rawpresets[i] == preset: + if rawpresets[i] == preset:
+ print("Match!") + print("Match!")
@ -216,13 +216,13 @@
+ if current_input < 99: + if current_input < 99:
+ a = current_input + a = current_input
+ suffix = "Hz" + suffix = "Hz"
+ elif current_input < 999: + if current_input > 99 and current_input < 999:
+ a = current_input + a = current_input
+ suffix = "Hz" + suffix = "Hz"
+ elif current_input < 9999: + if current_input > 999 and current_input < 9999:
+ a = float(current_input) / 1000 + a = float(current_input) / 1000
+ suffix = "KHz" + suffix = "KHz"
+ else: + if current_input > 9999:
+ a = float(current_input) / 1000 + a = float(current_input) / 1000
+ suffix = "KHz" + suffix = "KHz"
+ +
@ -361,7 +361,7 @@
+ preampscalevalue.set_markup(str(preampscale.get_value()) + "x") + preampscalevalue.set_markup(str(preampscale.get_value()) + "x")
+ windowtitle = "PulseAudio " + ladspa_label + windowtitle = "PulseAudio " + ladspa_label
+ self.window.set_title(windowtitle + " [" + realstatus + "]") + self.window.set_title(windowtitle + " [" + realstatus + "]")
+ clearpreset = '' + clearpreset = ""
+ for i in range(1,num_ladspa_controls + 1): + for i in range(1,num_ladspa_controls + 1):
+ self.scales[i].set_value(float(ladspa_controls[i - 1])) + self.scales[i].set_value(float(ladspa_controls[i - 1]))
+ FormatLabels(i) + FormatLabels(i)
@ -464,7 +464,7 @@
+ rawdata.append(str(ladspa_inputs[i])) + rawdata.append(str(ladspa_inputs[i]))
+ +
+ for i in rawdata: + for i in rawdata:
+ f.write(str(i)+'\n') + f.write(str(i) + "\n")
+ f.close() + f.close()
+ +
+ # Clear preset list from ComboBox + # Clear preset list from ComboBox
@ -581,7 +581,7 @@
+ +
+ # Clear preset (if it is the same as removed preset), or restore preset + # Clear preset (if it is the same as removed preset), or restore preset
+ if (presetdir1 + "/" + preset + ".preset") == filename: + if (presetdir1 + "/" + preset + ".preset") == filename:
+ preset = '' + preset = ""
+ else: + else:
+ preset = realpreset + preset = realpreset
+ +

View File

@ -49,7 +49,7 @@
filename = dialog.get_filename() filename = dialog.get_filename()
path_and_name = os.path.split(filename) path_and_name = os.path.split(filename)
name = path_and_name[1] name = path_and_name[1]
@@ -358,14 +364,14 @@ class Equalizer: @@ -358,14 +364,13 @@ class Equalizer:
def __init__(self): def __init__(self):
GetSettings() GetSettings()
@ -59,14 +59,14 @@
self.window.connect("destroy", self.destroy_equalizer) self.window.connect("destroy", self.destroy_equalizer)
self.window.set_title(windowtitle + " [" + realstatus + "]") self.window.set_title(windowtitle + " [" + realstatus + "]")
self.window.set_border_width(0) - self.window.set_border_width(0)
- icon_theme = gtk.icon_theme_get_default() - icon_theme = gtk.icon_theme_get_default()
+ icon_theme = gtk.IconTheme.get_default() + icon_theme = gtk.IconTheme.get_default()
if icon_theme.has_icon("multimedia-volume-control"): if icon_theme.has_icon("multimedia-volume-control"):
icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) icon = icon_theme.load_icon("multimedia-volume-control", 16, 0)
self.window.set_icon(icon) self.window.set_icon(icon)
@@ -380,19 +386,22 @@ class Equalizer: @@ -380,42 +385,59 @@ class Equalizer:
menu = gtk.Menu() menu = gtk.Menu()
@ -93,16 +93,23 @@
self.window.add(vbox1) self.window.add(vbox1)
vbox1.show() vbox1.show()
menu_bar = gtk.MenuBar() menu_bar = gtk.MenuBar()
@@ -400,22 +409,31 @@ class Equalizer: - vbox1.pack_start(menu_bar, False, False, 2)
+ if GTK_VERSION >= (3, 0, 0):
+ menu_bar.set_margin_bottom(4)
+ vbox1.add(menu_bar)
+ else:
+ vbox1.pack_start(menu_bar, False, False, 2)
menu_bar.show() menu_bar.show()
menu_bar.append (root_menu) - menu_bar.append (root_menu)
+ menu_bar.append(root_menu)
- hbox1 = gtk.HBox(False, 1) - hbox1 = gtk.HBox(False, 1)
- #hbox1.set_border_width(10)
+ if GTK_VERSION >= (3, 0, 0): + if GTK_VERSION >= (3, 0, 0):
+ hbox1 = gtk.Box(orientation=gtk.Orientation.HORIZONTAL, spacing=1) + hbox1 = gtk.Box(orientation=gtk.Orientation.HORIZONTAL, spacing=1)
+ else: + else:
+ hbox1 = gtk.HBox(spacing=1) + hbox1 = gtk.HBox(spacing=1)
#hbox1.set_border_width(10) + #hbox1.props.margin = 10
vbox1.add(hbox1) vbox1.add(hbox1)
hbox1.show() hbox1.show()
@ -111,9 +118,10 @@
- hbox1.add(table) - hbox1.add(table)
+ if GTK_VERSION >= (3, 10, 0): + if GTK_VERSION >= (3, 10, 0):
+ grid = gtk.Grid() + grid = gtk.Grid()
+ grid.props.margin = 5
+ else: + else:
+ grid = gtk.Table(n_rows=3, n_columns=17) + grid = gtk.Table(n_rows=3, n_columns=17)
+ grid.set_border_width(5) + grid.set_border_width(5)
+ hbox1.add(grid) + hbox1.add(grid)
# Preamp widget # Preamp widget
@ -131,7 +139,7 @@
preampscale.set_range(0.0, 2.0) preampscale.set_range(0.0, 2.0)
preampscale.set_increments(1, 0.1) preampscale.set_increments(1, 0.1)
preampscale.set_digits(1) preampscale.set_digits(1)
@@ -426,16 +444,25 @@ class Equalizer: @@ -426,16 +448,25 @@ class Equalizer:
label.set_markup("<small>Preamp</small>") label.set_markup("<small>Preamp</small>")
preampscalevalue = gtk.Label() preampscalevalue = gtk.Label()
preampscalevalue.set_markup(str(preampscale.get_value()) + "x") preampscalevalue.set_markup(str(preampscale.get_value()) + "x")
@ -162,7 +170,15 @@
#separator.show() #separator.show()
# Equalizer bands # Equalizer bands
@@ -448,7 +475,7 @@ class Equalizer: @@ -444,11 +475,14 @@ class Equalizer:
self.labels = {}
self.scalevalues = {}
for x in range(1,num_ladspa_controls+1):
- scale = gtk.VScale()
+ if GTK_VERSION >= (3, 2, 0):
+ scale = gtk.Scale(orientation=gtk.Orientation.VERTICAL)
+ else:
+ scale = gtk.VScale()
self.scales[x] = scale self.scales[x] = scale
scale.set_draw_value(0) scale.set_draw_value(0)
scale.set_inverted(1) scale.set_inverted(1)
@ -171,7 +187,7 @@
scale.set_range(float(ranges[0]), float(ranges[1])) scale.set_range(float(ranges[0]), float(ranges[1]))
scale.set_increments(1, 0.1) scale.set_increments(1, 0.1)
scale.set_digits(1) scale.set_digits(1)
@@ -462,16 +489,24 @@ class Equalizer: @@ -462,67 +496,79 @@ class Equalizer:
scalevalue = gtk.Label() scalevalue = gtk.Label()
self.scalevalues[x] = scalevalue self.scalevalues[x] = scalevalue
scalevalue.set_markup("<small>" + str(scale.get_value()) + "\ndB</small>") scalevalue.set_markup("<small>" + str(scale.get_value()) + "\ndB</small>")
@ -194,29 +210,37 @@
+ grid.show() + grid.show()
- vbox2 = gtk.VBox(True, 1) - vbox2 = gtk.VBox(True, 1)
- vbox2.set_border_width(10)
+ if GTK_VERSION >= (3, 0, 0): + if GTK_VERSION >= (3, 0, 0):
+ vbox2 = gtk.Box(orientation=gtk.Orientation.VERTICAL, homogeneous=True, spacing=1) + vbox2 = gtk.Box(orientation=gtk.Orientation.VERTICAL, homogeneous=True, spacing=1)
+ vbox2.props.margin = 10
+ else: + else:
+ vbox2 = gtk.VBox(homogeneous=True, spacing=1) + vbox2 = gtk.VBox(homogeneous=True, spacing=1)
vbox2.set_border_width(10) + vbox2.set_border_width(10)
hbox1.add(vbox2) hbox1.add(vbox2)
vbox2.show() vbox2.show()
@@ -482,7 +517,7 @@ class Equalizer:
presetslabel = gtk.Label()
presetslabel.set_markup("<small>Preset:</small>")
- vbox2.pack_start(presetslabel, False, False, 0)
+ vbox2.add(presetslabel)
presetslabel.show() presetslabel.show()
global presetsbox global presetsbox
- presetsbox = gtk.combo_box_entry_new_text() - presetsbox = gtk.combo_box_entry_new_text()
- vbox2.pack_start(presetsbox, False, False, 0)
+ presetsbox = gtk.ComboBoxText.new_with_entry() + presetsbox = gtk.ComboBoxText.new_with_entry()
vbox2.pack_start(presetsbox, False, False, 0) + vbox2.add(presetsbox)
presetsbox.get_child().set_text(preset) presetsbox.get_child().set_text(preset)
for i in range(len(rawpresets)): for i in range(len(rawpresets)):
@@ -490,38 +525,41 @@ class Equalizer: presetsbox.append_text(rawpresets[i])
presetsbox.connect("changed", self.on_presetsbox, x) presetsbox.connect("changed", self.on_presetsbox, x)
presetsbox.show() presetsbox.show()
- savepreset = gtk.Button("Save Preset") - savepreset = gtk.Button("Save Preset")
- vbox2.pack_start(savepreset, False, False, 0)
+ savepreset = gtk.Button(label="Save Preset") + savepreset = gtk.Button(label="Save Preset")
vbox2.pack_start(savepreset, False, False, 0) + vbox2.add(savepreset)
savepreset.connect("clicked", self.on_savepreset) savepreset.connect("clicked", self.on_savepreset)
savepreset.show() savepreset.show()
@ -227,7 +251,8 @@
- eqenabled.unset_flags(gtk.CAN_FOCUS) - eqenabled.unset_flags(gtk.CAN_FOCUS)
+ eqenabled.set_can_focus(False) + eqenabled.set_can_focus(False)
eqenabled.connect("clicked", self.on_eqenabled) eqenabled.connect("clicked", self.on_eqenabled)
vbox2.pack_start(eqenabled, False, False, 0) - vbox2.pack_start(eqenabled, False, False, 0)
+ vbox2.add(eqenabled)
eqenabled.show() eqenabled.show()
global keepsettings global keepsettings
@ -237,26 +262,31 @@
- keepsettings.unset_flags(gtk.CAN_FOCUS) - keepsettings.unset_flags(gtk.CAN_FOCUS)
+ keepsettings.set_can_focus(False) + keepsettings.set_can_focus(False)
keepsettings.connect("clicked", self.on_keepsettings) keepsettings.connect("clicked", self.on_keepsettings)
vbox2.pack_start(keepsettings, False, False, 0) - vbox2.pack_start(keepsettings, False, False, 0)
+ vbox2.add(keepsettings)
keepsettings.show() keepsettings.show()
- applysettings = gtk.Button("Apply Settings") - applysettings = gtk.Button("Apply Settings")
- vbox2.pack_start(applysettings, False, False, 0)
+ applysettings = gtk.Button(label="Apply Settings") + applysettings = gtk.Button(label="Apply Settings")
vbox2.pack_start(applysettings, False, False, 0) + vbox2.add(applysettings)
applysettings.connect("clicked", self.on_applysettings) applysettings.connect("clicked", self.on_applysettings)
applysettings.show() applysettings.show()
- quitbutton = gtk.Button("Quit") - quitbutton = gtk.Button("Quit")
- vbox2.pack_start(quitbutton, False, False, 0)
+ quitbutton = gtk.Button(label="Quit") + quitbutton = gtk.Button(label="Quit")
vbox2.pack_start(quitbutton, False, False, 0) + vbox2.add(quitbutton)
quitbutton.connect("clicked", lambda w: gtk.main_quit()) quitbutton.connect("clicked", lambda w: gtk.main_quit())
quitbutton.show() quitbutton.show()
- separator = gtk.HSeparator() - separator = gtk.HSeparator()
- vbox2.pack_start(separator, False, False, 0)
+ if GTK_VERSION >= (3, 2, 0): + if GTK_VERSION >= (3, 2, 0):
+ separator = gtk.Separator(orientation=gtk.Orientation.HORIZONTAL) + separator = gtk.Separator(orientation=gtk.Orientation.HORIZONTAL)
+ else: + else:
+ separator = gtk.HSeparator() + separator = gtk.HSeparator()
vbox2.pack_start(separator, False, False, 0) + vbox2.add(separator)
separator.set_size_request(100, 10) separator.set_size_request(100, 10)
#separator.show() #separator.show()

View File

@ -1,7 +1,7 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Feb 25 18:16:05 UTC 2018 - sor.alexei@meowr.ru Sun Feb 25 18:16:05 UTC 2018 - sor.alexei@meowr.ru
- Add 0000-fix-python-indent.patch: Fix Python indentation. - Add 0000-add-python3-compat.patch: Add Python3 compatibility.
- Rebase and improve 0001-pulse-path.patch. - Rebase and improve 0001-pulse-path.patch.
- Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch. - Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch.
- Rebase 0003-force-default-persistence-value.patch, - Rebase 0003-force-default-persistence-value.patch,

View File

@ -20,12 +20,12 @@ Name: pulseaudio-equalizer
Version: 2.7.0.2 Version: 2.7.0.2
Release: 0 Release: 0
Summary: PulseAudio's LADSPA plugin graphical user interface Summary: PulseAudio's LADSPA plugin graphical user interface
License: GPL-3.0+ License: GPL-3.0-or-later
Group: Productivity/Multimedia/Sound/Mixers Group: Productivity/Multimedia/Sound/Mixers
Url: https://ubuntuforums.org/showthread.php?t=1308838 Url: https://ubuntuforums.org/showthread.php?t=1308838
Source: https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+files/%{name}_%{version}.orig.tar.gz Source: https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+files/%{name}_%{version}.orig.tar.gz
# PATCH-FIX-UPSTREAM 0000-fix-python-indent.patch sor.alexei@meowr.ru -- Fix Python indentation. # PATCH-FIX-UPSTREAM 0000-add-python3-compat.patch sor.alexei@meowr.ru -- Add Python3 compatibility.
Patch0: 0000-fix-python-indent.patch Patch0: 0000-add-python3-compat.patch
# PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to the new one. # PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to the new one.
Patch1: 0001-pulse-path.patch Patch1: 0001-pulse-path.patch
# PATCH-FIX-UPSTREAM 0002-remove-preamp.patch -- Remove preamp. # PATCH-FIX-UPSTREAM 0002-remove-preamp.patch -- Remove preamp.