From b7590ed3c842af0b1fcba98692515731dc546742e4425fb29e66aec2adc9872e Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Sun, 25 Feb 2018 23:23:12 +0000 Subject: [PATCH 1/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=10 --- 0000-fix-python-indent.patch | 851 +++++++++++++++++++++ 0001-pulse-path.patch | 123 +-- 0002-remove-preamp.patch | 53 +- 0003-force-default-persistence-value.patch | 21 +- 0004-do-not-crash-on-missing-preset.patch | 32 +- 0005-window-icon.patch | 13 +- 0007-pygobject3-port.patch | 262 +++++++ 0007-remove-all-preamp.patch | 13 - 0008-fix-locale-issues.patch | 19 +- pulseaudio-equalizer.changes | 13 + pulseaudio-equalizer.spec | 61 +- 11 files changed, 1300 insertions(+), 161 deletions(-) create mode 100644 0000-fix-python-indent.patch create mode 100644 0007-pygobject3-port.patch delete mode 100644 0007-remove-all-preamp.patch diff --git a/0000-fix-python-indent.patch b/0000-fix-python-indent.patch new file mode 100644 index 0000000..81b5536 --- /dev/null +++ b/0000-fix-python-indent.patch @@ -0,0 +1,851 @@ +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -21,279 +21,281 @@ presetdir1 = configdir + "/presets" + presetdir2 = "/usr/share/pulseaudio-equalizer/presets" + + def GetSettings(): +- global rawdata +- global rawpresets +- global ladspa_filename +- global ladspa_name +- global ladspa_label +- global preamp +- global num_ladspa_controls +- global ladspa_controls +- global ladspa_inputs +- global status +- global realstatus +- global persistence +- global preset +- global ranges +- global windowtitle +- global presetmatch +- global clearpreset +- +- print "Getting settings..." +- +- os.system('pulseaudio-equalizer interface.getsettings') +- +- f = open(eqconfig, "r") +- rawdata=f.read().split('\n') +- f.close() +- +- rawpresets = {} +- f = open(eqpresets, "r") +- rawpresets=f.read().split('\n') +- f.close() +- del rawpresets[len(rawpresets)-1] +- +- ladspa_filename = str(rawdata[0]) +- ladspa_name = str(rawdata[1]) +- ladspa_label = str(rawdata[2]) +- preamp = (rawdata[3]) +- preset = str(rawdata[4]) +- status = int(rawdata[5]) +- persistence = int(rawdata[6]) +- ranges = rawdata[7:9] +- num_ladspa_controls = int(rawdata[9]) +- ladspa_controls = rawdata[10:(10+num_ladspa_controls)] +- ladspa_inputs = rawdata[(10+num_ladspa_controls):(10+num_ladspa_controls)+(num_ladspa_controls)] +- +- if status == 1: +- realstatus = "Enabled" +- else: +- realstatus = "Disabled" +- +- windowtitle = "PulseAudio " + ladspa_label +- +- clearpreset = 1 +- presetmatch = '' +- for i in range(len(rawpresets)): +- if rawpresets[i] == preset: +- print "Match!" +- presetmatch = 1 ++ global rawdata ++ global rawpresets ++ global ladspa_filename ++ global ladspa_name ++ global ladspa_label ++ global preamp ++ global num_ladspa_controls ++ global ladspa_controls ++ global ladspa_inputs ++ global status ++ global realstatus ++ global persistence ++ global preset ++ global ranges ++ global windowtitle ++ global presetmatch ++ global clearpreset ++ ++ print("Getting settings...") ++ ++ os.system("pulseaudio-equalizer interface.getsettings") ++ ++ f = open(eqconfig, "r") ++ rawdata=f.read().split("\n") ++ f.close() ++ ++ rawpresets = {} ++ f = open(eqpresets, "r") ++ rawpresets=f.read().split("\n") ++ f.close() ++ del rawpresets[len(rawpresets)-1] ++ ++ ladspa_filename = str(rawdata[0]) ++ ladspa_name = str(rawdata[1]) ++ ladspa_label = str(rawdata[2]) ++ preamp = (rawdata[3]) ++ preset = str(rawdata[4]) ++ status = int(rawdata[5]) ++ persistence = int(rawdata[6]) ++ ranges = rawdata[7 : 9] ++ num_ladspa_controls = int(rawdata[9]) ++ ladspa_controls = rawdata[10 : (10 + num_ladspa_controls)] ++ ladspa_inputs = rawdata[(10 + num_ladspa_controls) : ++ (10 + num_ladspa_controls) + (num_ladspa_controls)] ++ ++ if status == 1: ++ realstatus = "Enabled" ++ else: ++ realstatus = "Disabled" ++ ++ windowtitle = "PulseAudio " + ladspa_label ++ ++ clearpreset = 1 ++ presetmatch = '' ++ for i in range(len(rawpresets)): ++ if rawpresets[i] == preset: ++ print("Match!") ++ presetmatch = 1 + + def ApplySettings(): +- print "Applying settings..." +- f = open(eqconfig, "w") +- del rawdata[:] +- rawdata.append(str(ladspa_filename)) +- rawdata.append(str(ladspa_name)) +- rawdata.append(str(ladspa_label)) +- rawdata.append(str(preamp)) +- rawdata.append(str(preset)) +- rawdata.append(str(status)) +- rawdata.append(str(persistence)) +- for i in range(2): +- rawdata.append(str(ranges[i])) +- rawdata.append(str(num_ladspa_controls)) +- for i in range(num_ladspa_controls): +- rawdata.append(str(ladspa_controls[i])) +- for i in range(num_ladspa_controls): +- rawdata.append(str(ladspa_inputs[i])) +- +- for i in rawdata: +- f.write(str(i)+'\n') +- f.close() ++ print("Applying settings...") ++ f = open(eqconfig, "w") ++ del rawdata[:] ++ rawdata.append(str(ladspa_filename)) ++ rawdata.append(str(ladspa_name)) ++ rawdata.append(str(ladspa_label)) ++ rawdata.append(str(preamp)) ++ rawdata.append(str(preset)) ++ rawdata.append(str(status)) ++ rawdata.append(str(persistence)) ++ for i in range(2): ++ rawdata.append(str(ranges[i])) ++ rawdata.append(str(num_ladspa_controls)) ++ for i in range(num_ladspa_controls): ++ rawdata.append(str(ladspa_controls[i])) ++ for i in range(num_ladspa_controls): ++ rawdata.append(str(ladspa_inputs[i])) ++ ++ for i in rawdata: ++ f.write(str(i) + "\n") ++ f.close() + +- os.system('pulseaudio-equalizer interface.applysettings') ++ os.system("pulseaudio-equalizer interface.applysettings") + + def FormatLabels(x): +- global c +- global suffix +- global whitespace1 +- global whitespace2 +- +- whitespace1 = "" +- whitespace2 = "" +- +- current_input = int(ladspa_inputs[x-1]) +- if current_input < 99: +- a = current_input +- suffix = "Hz" +- if current_input > 99 and current_input < 999: +- a = current_input +- suffix = "Hz" +- if current_input > 999 and current_input < 9999: +- a = float(current_input)/1000 +- suffix = "KHz" +- if current_input > 9999: +- a = float(current_input)/1000 +- suffix = "KHz" +- +- # Filter out unnecessary ".0" from ladspa_inputs +- b=str(a) +- if b[-2:] == ".0": +- c = b[:-2] +- else: +- c = b +- +- # Add whitespace formatting to ensure text is centered +- if len(c) == 3 and len(suffix) == 2: +- whitespace2 = " " +- if len(c) < 4 and len(suffix) == 3: +- whitespace1 = " " +- if len(c) < 2 and len(suffix) == 3: +- whitespace1 = " " ++ global c ++ global suffix ++ global whitespace1 ++ global whitespace2 ++ ++ whitespace1 = "" ++ whitespace2 = "" ++ ++ current_input = int(ladspa_inputs[x-1]) ++ if current_input < 99: ++ a = current_input ++ suffix = "Hz" ++ elif current_input < 999: ++ a = current_input ++ suffix = "Hz" ++ elif current_input < 9999: ++ a = float(current_input) / 1000 ++ suffix = "KHz" ++ else: ++ a = float(current_input) / 1000 ++ suffix = "KHz" ++ ++ # Filter out unnecessary ".0" from ladspa_inputs ++ b=str(a) ++ if b[-2:] == ".0": ++ c = b[:-2] ++ else: ++ c = b ++ ++ # Add whitespace formatting to ensure text is centered ++ if len(c) == 3 and len(suffix) == 2: ++ whitespace2 = " " ++ if len(c) < 4 and len(suffix) == 3: ++ whitespace1 = " " ++ if len(c) < 2 and len(suffix) == 3: ++ whitespace1 = " " + + class Equalizer: + def on_scale(self, widget, y): +- global ladspa_controls +- global preset +- global clearpreset +- newvalue = float(round(widget.get_value(),1)) +- del ladspa_controls[y-1] +- ladspa_controls.insert(y-1, newvalue) +- if clearpreset == 1: +- preset = '' +- presetsbox.get_child().set_text(preset) +- for i in range(1,num_ladspa_controls+1): +- self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") ++ global ladspa_controls ++ global preset ++ global clearpreset ++ newvalue = float(round(widget.get_value(), 1)) ++ del ladspa_controls[y - 1] ++ ladspa_controls.insert(y - 1, newvalue) ++ if clearpreset == 1: ++ preset = "" ++ presetsbox.get_child().set_text(preset) ++ for i in range(1,num_ladspa_controls + 1): ++ self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") + + def on_presetsbox(self, widget, x): +- global preset +- global presetmatch +- global clearpreset +- global ladspa_filename +- global ladspa_name +- global ladspa_label +- global preamp +- global num_ladspa_controls +- global ladspa_controls +- global ladspa_inputs +- global windowtitle +- preset = presetsbox.get_child().get_text() +- +- presetmatch = '' +- for i in range(len(rawpresets)): +- if rawpresets[i] == preset: +- print "Match!" +- presetmatch = 1 +- +- if presetmatch == 1: +- if os.path.isfile(presetdir1 + "/" + preset + ".preset"): +- f = open(presetdir1 + "/" + preset + ".preset", "r") +- rawdata=f.read().split('\n') +- else: +- f = open(presetdir2 + "/" + preset + ".preset", "r") +- rawdata=f.read().split('\n') +- f.close +- +- ladspa_filename = str(rawdata[0]) +- ladspa_name = str(rawdata[1]) +- ladspa_label = str(rawdata[2]) +- #preamp = (rawdata[3]) +- preset = str(rawdata[4]) +- num_ladspa_controls = int(rawdata[5]) +- ladspa_controls = rawdata[6:(6+num_ladspa_controls)] +- ladspa_inputs = rawdata[(6+num_ladspa_controls):(6+num_ladspa_controls)+(num_ladspa_controls)] +- +- preampscale.set_value(float(preamp)) +- preampscalevalue.set_markup(str(preampscale.get_value()) + "x") +- windowtitle = "PulseAudio " + ladspa_label +- self.window.set_title(windowtitle + " [" + realstatus + "]") +- clearpreset = '' +- for i in range(1,num_ladspa_controls+1): +- self.scales[i].set_value(float(ladspa_controls[i-1])) +- FormatLabels(i) +- self.labels[i].set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") +- self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") +- # Set preset again due to interference from scale modifications +- preset = str(rawdata[4]) +- clearpreset = 1 +- presetsbox.get_child().set_text(preset) +- ApplySettings() ++ global preset ++ global presetmatch ++ global clearpreset ++ global ladspa_filename ++ global ladspa_name ++ global ladspa_label ++ global preamp ++ global num_ladspa_controls ++ global ladspa_controls ++ global ladspa_inputs ++ global windowtitle ++ preset = presetsbox.get_child().get_text() ++ ++ presetmatch = "" ++ for i in range(len(rawpresets)): ++ if rawpresets[i] == preset: ++ print("Match!") ++ presetmatch = 1 ++ ++ if presetmatch == 1: ++ if os.path.isfile(presetdir1 + "/" + preset + ".preset"): ++ f = open(presetdir1 + "/" + preset + ".preset", "r") ++ rawdata=f.read().split("\n") ++ else: ++ f = open(presetdir2 + "/" + preset + ".preset", "r") ++ rawdata=f.read().split("\n") ++ f.close ++ ++ ladspa_filename = str(rawdata[0]) ++ ladspa_name = str(rawdata[1]) ++ ladspa_label = str(rawdata[2]) ++ #preamp = (rawdata[3]) ++ preset = str(rawdata[4]) ++ num_ladspa_controls = int(rawdata[5]) ++ ladspa_controls = rawdata[6 : (6 + num_ladspa_controls)] ++ ladspa_inputs = rawdata[(6 + num_ladspa_controls) : ++ (6 + num_ladspa_controls) + (num_ladspa_controls)] ++ ++ preampscale.set_value(float(preamp)) ++ preampscalevalue.set_markup(str(preampscale.get_value()) + "x") ++ windowtitle = "PulseAudio " + ladspa_label ++ self.window.set_title(windowtitle + " [" + realstatus + "]") ++ clearpreset = '' ++ for i in range(1,num_ladspa_controls + 1): ++ self.scales[i].set_value(float(ladspa_controls[i - 1])) ++ FormatLabels(i) ++ self.labels[i].set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") ++ self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") ++ # Set preset again due to interference from scale modifications ++ preset = str(rawdata[4]) ++ clearpreset = 1 ++ presetsbox.get_child().set_text(preset) ++ ApplySettings() + + def on_applysettings(self, widget): +- ApplySettings() ++ ApplySettings() + + def on_resetsettings(self, widget): +- print "Resetting to defaults..." +- os.system('pulseaudio-equalizer interface.resetsettings') +- GetSettings() +- +- eqenabled.set_active(status) +- keepsettings.set_active(persistence) +- presetsbox.get_child().set_text(preset) +- preampscale.set_value(float(preamp)) +- for i in range(1,num_ladspa_controls+1): +- self.scales[i].set_value(float(ladspa_controls[i-1])) +- FormatLabels(i) +- self.labels[i].set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") +- self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") ++ print("Resetting to defaults...") ++ os.system("pulseaudio-equalizer interface.resetsettings") ++ GetSettings() ++ ++ eqenabled.set_active(status) ++ keepsettings.set_active(persistence) ++ presetsbox.get_child().set_text(preset) ++ preampscale.set_value(float(preamp)) ++ for i in range(1, num_ladspa_controls+1): ++ self.scales[i].set_value(float(ladspa_controls[i-1])) ++ FormatLabels(i) ++ self.labels[i].set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") ++ self.scalevalues[i].set_markup("" + str(float(ladspa_controls[i-1])) + "\ndB") + + def on_savepreset(self, widget): +- global preset +- global presetmatch +- preset = presetsbox.get_child().get_text() +- if preset == '' or presetmatch == 1: +- print 'Invalid preset name' +- else: +- f = open(presetdir1 + "/" + preset + ".preset", "w") +- +- del rawdata[:] +- rawdata.append(str(ladspa_filename)) +- rawdata.append(str(ladspa_name)) +- rawdata.append(str(ladspa_label)) +- rawdata.append(str(preamp)) +- rawdata.append(str(preset)) +- rawdata.append(str(num_ladspa_controls)) +- for i in range(num_ladspa_controls): +- rawdata.append(str(ladspa_controls[i])) +- for i in range(num_ladspa_controls): +- rawdata.append(str(ladspa_inputs[i])) +- +- for i in rawdata: +- f.write(str(i)+'\n') +- f.close() +- +- # Clear preset list from ComboBox +- for i in range(len(rawpresets)): +- presetsbox.remove_text(0) +- +- # Apply settings (which will save new preset as default) +- ApplySettings() +- +- # Refresh (and therefore, sort) preset list +- GetSettings() +- +- # Repopulate preset list into ComboBox +- for i in range(len(rawpresets)): +- presetsbox.append_text(rawpresets[i]) ++ global preset ++ global presetmatch ++ preset = presetsbox.get_child().get_text() ++ if preset == "" or presetmatch == 1: ++ print("Invalid preset name") ++ else: ++ f = open(presetdir1 + "/" + preset + ".preset", "w") ++ ++ del rawdata[:] ++ rawdata.append(str(ladspa_filename)) ++ rawdata.append(str(ladspa_name)) ++ rawdata.append(str(ladspa_label)) ++ rawdata.append(str(preamp)) ++ rawdata.append(str(preset)) ++ rawdata.append(str(num_ladspa_controls)) ++ for i in range(num_ladspa_controls): ++ rawdata.append(str(ladspa_controls[i])) ++ for i in range(num_ladspa_controls): ++ rawdata.append(str(ladspa_inputs[i])) ++ ++ for i in rawdata: ++ f.write(str(i)+'\n') ++ f.close() ++ ++ # Clear preset list from ComboBox ++ for i in range(len(rawpresets)): ++ presetsbox.remove_text(0) ++ ++ # Apply settings (which will save new preset as default) ++ ApplySettings() ++ ++ # Refresh (and therefore, sort) preset list ++ GetSettings() ++ ++ # Repopulate preset list into ComboBox ++ for i in range(len(rawpresets)): ++ presetsbox.append_text(rawpresets[i]) + + def on_preampscale(self, widget): +- global preamp +- preamp = float(round(widget.get_value(),1)) +- preampscalevalue.set_markup(str(preamp) + "x") +- #preset = '' +- #presetsbox.get_child().set_text(preset) ++ global preamp ++ preamp = float(round(widget.get_value(), 1)) ++ preampscalevalue.set_markup(str(preamp) + "x") ++ #preset = "" ++ #presetsbox.get_child().set_text(preset) + + def on_eqenabled(self, widget): +- global status ++ global status + if widget.get_active(): +- self.window.set_title(windowtitle + " [Enabled]") +- status = 1 ++ self.window.set_title(windowtitle + " [Enabled]") ++ status = 1 + else: +- self.window.set_title(windowtitle + " [Disabled]") +- status = 0 +- ApplySettings() ++ self.window.set_title(windowtitle + " [Disabled]") ++ status = 0 ++ ApplySettings() + + def on_keepsettings(self, widget): +- global persistence ++ global persistence + if widget.get_active(): +- persistence = 1 ++ persistence = 1 + else: +- persistence = 0 +- ApplySettings() ++ persistence = 0 ++ ApplySettings() + + def on_removepreset(self,widget): +- global preset ++ global preset + global presets + dialog = gtk.FileChooserDialog("Choose preset to remove...", + None, +@@ -311,39 +313,39 @@ class Equalizer: + + response = dialog.run() + if response == gtk.RESPONSE_OK: +- filename = dialog.get_filename() +- path_and_name = os.path.split(filename) +- name = path_and_name[1] +- os.remove(filename) +- +- # Make a note of the current preset, then clear it temporarily +- preset = presetsbox.get_child().get_text() +- realpreset = preset +- preset = '' +- presetsbox.get_child().set_text('') +- +- # Clear preset list from ComboBox +- for i in range(len(rawpresets)): +- presetsbox.remove_text(0) +- +- # Refresh (and therefore, sort) preset list +- GetSettings() +- +- # Clear preset (if it is the same as removed preset), or restore preset +- if (presetdir1 + "/" + preset + ".preset") == filename: +- preset = '' +- else: +- preset = realpreset +- +- # Restore preset +- presetsbox.get_child().set_text(preset) +- +- # Repopulate preset list into ComboBox +- for i in range(len(rawpresets)): +- presetsbox.append_text(rawpresets[i]) ++ filename = dialog.get_filename() ++ path_and_name = os.path.split(filename) ++ name = path_and_name[1] ++ os.remove(filename) ++ ++ # Make a note of the current preset, then clear it temporarily ++ preset = presetsbox.get_child().get_text() ++ realpreset = preset ++ preset = "" ++ presetsbox.get_child().set_text("") ++ ++ # Clear preset list from ComboBox ++ for i in range(len(rawpresets)): ++ presetsbox.remove_text(0) ++ ++ # Refresh (and therefore, sort) preset list ++ GetSettings() ++ ++ # Clear preset (if it is the same as removed preset), or restore preset ++ if (presetdir1 + "/" + preset + ".preset") == filename: ++ preset = '' ++ else: ++ preset = realpreset ++ ++ # Restore preset ++ presetsbox.get_child().set_text(preset) ++ ++ # Repopulate preset list into ComboBox ++ for i in range(len(rawpresets)): ++ presetsbox.append_text(rawpresets[i]) + +- # Apply settings +- ApplySettings() ++ # Apply settings ++ ApplySettings() + + dialog.destroy() + +@@ -351,7 +353,7 @@ class Equalizer: + gtk.main_quit() + + def __init__(self): +- GetSettings() ++ GetSettings() + + self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) + self.window.set_resizable(True) +@@ -359,18 +361,18 @@ class Equalizer: + self.window.connect("destroy", self.destroy_equalizer) + self.window.set_title(windowtitle + " [" + realstatus + "]") + self.window.set_border_width(0) +- icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") ++ icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") + + menu = gtk.Menu() + + menu_item = gtk.MenuItem('Reset to defaults') + menu_item.connect("activate", self.on_resetsettings) +- menu.append(menu_item) +- menu_item.show() +- menu_item = gtk.MenuItem('Remove user preset...') +- menu_item.connect("activate", self.on_removepreset) + menu.append(menu_item) +- menu_item.show() ++ menu_item.show() ++ menu_item = gtk.MenuItem("Remove user preset...") ++ menu_item.connect("activate", self.on_removepreset) ++ menu.append(menu_item) ++ menu_item.show() + root_menu = gtk.MenuItem("Advanced") + root_menu.show() + root_menu.set_submenu(menu) +@@ -392,67 +394,67 @@ class Equalizer: + table.set_border_width(5) + hbox1.add(table) + +- # Preamp widget +- global preampscale +- global preampscalevalue +- preampscale = gtk.VScale() +- preampscale.set_draw_value(0) +- preampscale.set_inverted(1) +- preampscale.set_value_pos(gtk.POS_BOTTOM) +- preampscale.set_range(0.0,2.0) +- preampscale.set_increments(1, 0.1) +- preampscale.set_digits(1) +- preampscale.set_size_request(35,200) +- preampscale.set_value(float(preamp)) +- preampscale.connect("value-changed", self.on_preampscale) +- label = gtk.Label() +- label.set_markup("Preamp") +- preampscalevalue = gtk.Label() +- preampscalevalue.set_markup(str(preampscale.get_value()) + "x") +- table.attach(label, 1, 2, 0, 1) +- table.attach(preampscale, 1, 2, 1, 2) +- table.attach(preampscalevalue, 1, 2, 2, 3) +- label.show() +- preampscale.show() +- preampscalevalue.show() +- +- # Separator between preamp and bands +- separator = gtk.VSeparator() +- table.attach(separator, 2, 3, 1, 2) +- separator.show() +- +- # Equalizer bands +- global scale +- self.scales = {} +- self.labels = {} +- self.scalevalues = {} +- for x in range(1,num_ladspa_controls+1): +- scale = gtk.VScale() +- self.scales[x] = scale +- scale.set_draw_value(0) +- scale.set_inverted(1) +- scale.set_value_pos(gtk.POS_BOTTOM) +- scale.set_range(float(ranges[0]), float(ranges[1])) +- scale.set_increments(1, 0.1) +- scale.set_digits(1) +- scale.set_size_request(35,200) +- scale.set_value(float(ladspa_controls[x-1])) +- scale.connect("value-changed", self.on_scale, x) +- FormatLabels(x) +- label = gtk.Label() +- self.labels[x] = label +- label.set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") +- scalevalue = gtk.Label() +- self.scalevalues[x] = scalevalue +- scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") +- table.attach(label, x+2, x+3, 0, 1) +- table.attach(scale, x+2, x+3, 1, 2) +- table.attach(scalevalue, x+2, x+3, 2, 3) +- label.show() +- scale.show() +- scalevalue.show() ++ # Preamp widget ++ global preampscale ++ global preampscalevalue ++ preampscale = gtk.VScale() ++ preampscale.set_draw_value(0) ++ preampscale.set_inverted(1) ++ preampscale.set_value_pos(gtk.POS_BOTTOM) ++ preampscale.set_range(0.0, 2.0) ++ preampscale.set_increments(1, 0.1) ++ preampscale.set_digits(1) ++ preampscale.set_size_request(35, 200) ++ preampscale.set_value(float(preamp)) ++ preampscale.connect("value-changed", self.on_preampscale) ++ label = gtk.Label() ++ label.set_markup("Preamp") ++ preampscalevalue = gtk.Label() ++ preampscalevalue.set_markup(str(preampscale.get_value()) + "x") ++ table.attach(label, 1, 2, 0, 1) ++ table.attach(preampscale, 1, 2, 1, 2) ++ table.attach(preampscalevalue, 1, 2, 2, 3) ++ label.show() ++ preampscale.show() ++ preampscalevalue.show() ++ ++ # Separator between preamp and bands ++ separator = gtk.VSeparator() ++ table.attach(separator, 2, 3, 1, 2) ++ separator.show() ++ ++ # Equalizer bands ++ global scale ++ self.scales = {} ++ self.labels = {} ++ self.scalevalues = {} ++ for x in range(1,num_ladspa_controls+1): ++ scale = gtk.VScale() ++ self.scales[x] = scale ++ scale.set_draw_value(0) ++ scale.set_inverted(1) ++ scale.set_value_pos(gtk.POS_BOTTOM) ++ scale.set_range(float(ranges[0]), float(ranges[1])) ++ scale.set_increments(1, 0.1) ++ scale.set_digits(1) ++ scale.set_size_request(35, 200) ++ scale.set_value(float(ladspa_controls[x - 1])) ++ scale.connect("value-changed", self.on_scale, x) ++ FormatLabels(x) ++ label = gtk.Label() ++ self.labels[x] = label ++ label.set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") ++ scalevalue = gtk.Label() ++ self.scalevalues[x] = scalevalue ++ scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") ++ table.attach(label, x + 2, x + 3, 0, 1) ++ table.attach(scale, x + 2, x + 3, 1, 2) ++ table.attach(scalevalue, x + 2, x + 3, 2, 3) ++ label.show() ++ scale.show() ++ scalevalue.show() + +- table.show() ++ table.show() + + vbox2 = gtk.VBox(True, 1) + vbox2.set_border_width(10) +@@ -460,54 +462,54 @@ class Equalizer: + vbox2.show() + + presetslabel = gtk.Label() +- presetslabel.set_markup("Preset:") +- vbox2.pack_start(presetslabel, False, False, 0) +- presetslabel.show() +- +- global presetsbox +- presetsbox = gtk.combo_box_entry_new_text() +- vbox2.pack_start(presetsbox, False, False, 0) +- presetsbox.get_child().set_text(preset) +- for i in range(len(rawpresets)): +- presetsbox.append_text(rawpresets[i]) ++ presetslabel.set_markup("Preset:") ++ vbox2.pack_start(presetslabel, False, False, 0) ++ presetslabel.show() ++ ++ global presetsbox ++ presetsbox = gtk.combo_box_entry_new_text() ++ vbox2.pack_start(presetsbox, False, False, 0) ++ presetsbox.get_child().set_text(preset) ++ for i in range(len(rawpresets)): ++ presetsbox.append_text(rawpresets[i]) + presetsbox.connect("changed", self.on_presetsbox, x) +- presetsbox.show() ++ presetsbox.show() + +- savepreset = gtk.Button('Save Preset') +- vbox2.pack_start(savepreset, False, False, 0) ++ savepreset = gtk.Button("Save Preset") ++ vbox2.pack_start(savepreset, False, False, 0) + savepreset.connect("clicked", self.on_savepreset) +- savepreset.show() ++ savepreset.show() + +- global eqenabled ++ global eqenabled + eqenabled = gtk.CheckButton("EQ Enabled") + eqenabled.set_active(status) + eqenabled.unset_flags(gtk.CAN_FOCUS) + eqenabled.connect("clicked", self.on_eqenabled) +- vbox2.pack_start(eqenabled, False, False, 0) +- eqenabled.show() ++ vbox2.pack_start(eqenabled, False, False, 0) ++ eqenabled.show() + +- global keepsettings ++ global keepsettings + keepsettings = gtk.CheckButton('Keep Settings') +- keepsettings.set_active(persistence) ++ keepsettings.set_active(persistence) + keepsettings.unset_flags(gtk.CAN_FOCUS) + keepsettings.connect("clicked", self.on_keepsettings) +- vbox2.pack_start(keepsettings, False, False, 0) +- keepsettings.show() ++ vbox2.pack_start(keepsettings, False, False, 0) ++ keepsettings.show() + +- applysettings = gtk.Button('Apply Settings') +- vbox2.pack_start(applysettings, False, False, 0) ++ applysettings = gtk.Button("Apply Settings") ++ vbox2.pack_start(applysettings, False, False, 0) + applysettings.connect("clicked", self.on_applysettings) +- applysettings.show() ++ applysettings.show() + +- quitbutton = gtk.Button('Quit') +- vbox2.pack_start(quitbutton, False, False, 0) +- quitbutton.connect("clicked", lambda w: gtk.main_quit()) +- quitbutton.show() +- +- separator = gtk.HSeparator() +- vbox2.pack_start(separator, False, False, 0) +- separator.set_size_request(100, 10) +- #separator.show() ++ quitbutton = gtk.Button("Quit") ++ vbox2.pack_start(quitbutton, False, False, 0) ++ quitbutton.connect("clicked", lambda w: gtk.main_quit()) ++ quitbutton.show() ++ ++ separator = gtk.HSeparator() ++ vbox2.pack_start(separator, False, False, 0) ++ separator.set_size_request(100, 10) ++ #separator.show() + + self.window.show() + diff --git a/0001-pulse-path.patch b/0001-pulse-path.patch index 1067c0c..748ccc2 100644 --- a/0001-pulse-path.patch +++ b/0001-pulse-path.patch @@ -1,42 +1,56 @@ ---- pulseaudio-equalizer.orig/usr/bin/pulseaudio-equalizer 2013-10-24 10:23:27.000000000 +0000 -+++ pulseaudio-equalizer/usr/bin/pulseaudio-equalizer 2013-10-24 10:53:48.000000000 +0000 -@@ -18,11 +18,11 @@ +--- a/usr/bin/pulseaudio-equalizer ++++ b/usr/bin/pulseaudio-equalizer +@@ -18,12 +18,17 @@ PA_CONTROL_MAX="30" PA_PREAMP="1.0" PA_CURRENT_PRESET="" -PRESET_DIR1=$HOME/.pulse/presets -+PRESET_DIR1=$HOME/.config/pulse/presets ++if [ -z "$XDG_CONFIG_HOME" ]; then ++ PULSE_DIR="$HOME/.config/pulse" ++else ++ PULSE_DIR="$XDG_CONFIG_HOME/pulse" ++fi ++PRESET_DIR1="$PULSE_DIR/presets" PRESET_DIR2=/usr/share/pulseaudio-equalizer/presets SCRIPT_NAME=pulseaudio-equalizer SCRIPT_VERSION="2.7 (05/02/2010)" -CONFIG_NAME=$HOME/.pulse/equalizerrc -+CONFIG_NAME=$HOME/.config/pulse/equalizerrc - LOG_NAME=$HOME/Desktop/pulseaudio-equalizer.log +-LOG_NAME=$HOME/Desktop/pulseaudio-equalizer.log ++CONFIG_NAME="$PULSE_DIR/equalizerrc" ++LOG_NAME="$HOME/pulseaudio-equalizer.log" # Don't execute the script with elevated privileges -@@ -125,8 +125,8 @@ + if [[ ! $EUID -ne 0 ]]; then +@@ -125,12 +130,12 @@ else fi # Check if equalizer is set as persistent -if [ -f $HOME/.pulse/default.pa ]; then - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+if [ -f $HOME/.config/pulse/default.pa ]; then -+ if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - PA_EQUALIZER_PERSISTENCE=1 - fi +- PA_EQUALIZER_PERSISTENCE=1 +- fi ++if [ -f "$PULSE_DIR/default.pa" ]; then ++ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ PA_EQUALIZER_PERSISTENCE=1 ++ fi else -@@ -204,8 +204,8 @@ +- PA_EQUALIZER_PERSISTENCE=0 ++ PA_EQUALIZER_PERSISTENCE=0 + fi + + # DEBUG +@@ -204,8 +209,8 @@ if [ "$1" = "log" ]; then echo PA_PREAMP=$PA_PREAMP echo PA_REAL_PREAMP=$PA_REAL_PREAMP - if [ -f $HOME/.pulse/default.pa ]; then - tail -n7 $HOME/.pulse/default.pa -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ tail -n7 $HOME/.config/pulse/default.pa ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ tail -n7 "$PULSE_DIR/default.pa" fi echo "---" -@@ -253,24 +253,24 @@ +@@ -253,24 +258,24 @@ if [ "$1" = "enable-config" ]; then echo "-------------------------------------" # If equalizer configuration is already set, delete file @@ -44,10 +58,10 @@ - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - echo "Equalizer definition detected in file '$HOME/.pulse/default.pa', deleting..." - rm $HOME/.pulse/default.pa -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ echo "Equalizer definition detected in file '$HOME/.config/pulse/default.pa', deleting..." -+ rm $HOME/.config/pulse/default.pa ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ echo "Equalizer definition detected in file '$PULSE_DIR/default.pa', deleting..." ++ rm "$PULSE_DIR/default.pa" fi fi @@ -56,61 +70,61 @@ - echo "Found '$HOME/.pulse/default.pa', making a copy..." - cp $HOME/.pulse/default.pa $HOME/.pulse/default.pa.noeq - CFG_SOURCE_FILE="$HOME/.pulse/default.pa.noeq" -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ echo "Found '$HOME/.config/pulse/default.pa', making a copy..." -+ cp $HOME/.config/pulse/default.pa $HOME/.config/pulse/default.pa.noeq -+ CFG_SOURCE_FILE="$HOME/.config/pulse/default.pa.noeq" ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ echo "Found '$PULSE_DIR/default.pa', making a copy..." ++ cp "$PULSE_DIR/default.pa" "$PULSE_DIR/default.pa.noeq" ++ CFG_SOURCE_FILE="$PULSE_DIR/default.pa.noeq" fi # Decide which file to use as the configuration source - if [ -f $HOME/.pulse/default.pa.noeq ]; then - echo "Found '$HOME/.pulse/default.pa.noeq'..." - CFG_SOURCE_FILE="$HOME/.pulse/default.pa.noeq" -+ if [ -f $HOME/.config/pulse/default.pa.noeq ]; then -+ echo "Found '$HOME/.config/pulse/default.pa.noeq'..." -+ CFG_SOURCE_FILE="$HOME/.config/pulse/default.pa.noeq" ++ if [ -f "$PULSE_DIR/default.pa.noeq" ]; then ++ echo "Found '$PULSE_DIR/default.pa.noeq'..." ++ CFG_SOURCE_FILE="$PULSE_DIR/default.pa.noeq" else CFG_SOURCE_FILE="/etc/pulse/default.pa" fi -@@ -278,19 +278,19 @@ +@@ -278,19 +283,19 @@ if [ "$1" = "enable-config" ]; then echo "Using configuration file '$CFG_SOURCE_FILE' as source..." # Modify module-stream-restore line to disable cached sinks - cat $CFG_SOURCE_FILE | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >$HOME/.pulse/default.pa -+ cat $CFG_SOURCE_FILE | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >$HOME/.config/pulse/default.pa ++ cat "$CFG_SOURCE_FILE" | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >"$PULSE_DIR/default.pa" # Add module-ladspa-sink definition - echo "" >>$HOME/.pulse/default.pa - echo "### BEGIN: Equalized audio configuration" >>$HOME/.pulse/default.pa - echo "### Generated from: $SCRIPT_NAME" >>$HOME/.pulse/default.pa - echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>$HOME/.pulse/default.pa -+ echo "" >>$HOME/.config/pulse/default.pa -+ echo "### BEGIN: Equalized audio configuration" >>$HOME/.config/pulse/default.pa -+ echo "### Generated from: $SCRIPT_NAME" >>$HOME/.config/pulse/default.pa -+ echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>$HOME/.config/pulse/default.pa ++ echo "" >>"$PULSE_DIR/default.pa" ++ echo "### BEGIN: Equalized audio configuration" >>"$PULSE_DIR/default.pa" ++ echo "### Generated from: $SCRIPT_NAME" >>"$PULSE_DIR/default.pa" ++ echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>"$PULSE_DIR/default.pa" # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume - echo "set-default-sink $PA_LADSPA_SINK" >>$HOME/.pulse/default.pa - echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.pulse/default.pa - echo "set-sink-mute $PA_MASTER_SINK 0" >>$HOME/.pulse/default.pa - echo "### END: Equalized audio configuration" >>$HOME/.pulse/default.pa -+ echo "set-default-sink $PA_LADSPA_SINK" >>$HOME/.config/pulse/default.pa -+ echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.config/pulse/default.pa -+ echo "set-sink-mute $PA_MASTER_SINK 0" >>$HOME/.config/pulse/default.pa -+ echo "### END: Equalized audio configuration" >>$HOME/.config/pulse/default.pa ++ echo "set-default-sink $PA_LADSPA_SINK" >>"$PULSE_DIR/default.pa" ++ echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" ++ echo "set-sink-mute $PA_MASTER_SINK 0" >>"$PULSE_DIR/default.pa" ++ echo "### END: Equalized audio configuration" >>"$PULSE_DIR/default.pa" echo "Equalizer setting saved (enable-config)." echo "-------------------------------------" -@@ -306,16 +306,16 @@ +@@ -306,16 +311,16 @@ if [ "$1" = "disable-config" ]; then echo "-------------------------------------" # Move .noeq configuration file if it exists - if [ -f $HOME/.pulse/default.pa.noeq ]; then - echo "Found '$HOME/.pulse/default.pa.noeq', moving..." - mv $HOME/.pulse/default.pa.noeq $HOME/.pulse/default.pa -+ if [ -f $HOME/.config/pulse/default.pa.noeq ]; then -+ echo "Found '$HOME/.config/pulse/default.pa.noeq', moving..." -+ mv $HOME/.config/pulse/default.pa.noeq $HOME/.config/pulse/default.pa ++ if [ -f "$PULSE_DIR/default.pa.noeq" ]; then ++ echo "Found '$PULSE_DIR/default.pa.noeq', moving..." ++ mv "$PULSE_DIR/default.pa.noeq" "$PULSE_DIR/default.pa" fi # If equalizer configuration is present, delete file @@ -118,44 +132,43 @@ - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - echo "Equalizer definition detected, deleting '$HOME/.pulse/default.pa'..." - rm $HOME/.pulse/default.pa -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ echo "Equalizer definition detected, deleting '$HOME/.config/pulse/default.pa'..." -+ rm $HOME/.config/pulse/default.pa ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ echo "Equalizer definition detected, deleting '$PULSE_DIR/default.pa'..." ++ rm "$PULSE_DIR/default.pa" fi fi -@@ -426,8 +426,8 @@ +@@ -426,8 +431,8 @@ if [ "$PA_CURRENT_SINK" = "$PA_LADSPA_SI echo "-------------------------------------" echo "Equalizer status: [enabled]" - if [ -f $HOME/.pulse/default.pa ]; then - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then echo "Equalizer configuration status: [enabled]" else echo "Equalizer configuration status: [disabled]" -@@ -448,8 +448,8 @@ +@@ -448,8 +453,8 @@ else echo "-------------------------------------" echo "Equalizer status: [disabled]" - if [ -f $HOME/.pulse/default.pa ]; then - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ if [ -f $HOME/.config/pulse/default.pa ]; then -+ if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ if [ -f "$PULSE_DIR/default.pa" ]; then ++ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then echo "Equalizer configuration status: [enabled]" echo "Equalizer plugin: [$PA_LADSPA_PLUGIN/$PA_LADSPA_LABEL]" echo "Equalizer control: [$PA_LADSPA_CONTROLS]" - ---- pulseaudio-equalizer.orig/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2013-10-24 10:23:27.000000000 +0000 -+++ pulseaudio-equalizer/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2013-10-24 10:53:48.000000000 +0000 -@@ -13,7 +13,7 @@ +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -13,7 +13,7 @@ pygtk.require('2.0') import gtk, gobject import os -configdir = os.getenv('HOME') + "/.pulse" -+configdir = os.getenv('HOME') + "/.config/pulse" ++configdir = glib.get_user_config_dir() + "/pulse" eqconfig = configdir + "/equalizerrc" eqconfig2 = configdir + "/equalizerrc.test" eqpresets = eqconfig + ".availablepresets" diff --git a/0002-remove-preamp.patch b/0002-remove-preamp.patch index 74c2d84..af1e79d 100644 --- a/0002-remove-preamp.patch +++ b/0002-remove-preamp.patch @@ -1,6 +1,15 @@ ---- pulseaudio-equalizer.orig/usr/bin/pulseaudio-equalizer -+++ pulseaudio-equalizer/usr/bin/pulseaudio-equalizer -@@ -378,7 +378,7 @@ +--- a/usr/bin/pulseaudio-equalizer ++++ b/usr/bin/pulseaudio-equalizer +@@ -293,7 +293,7 @@ if [ "$1" = "enable-config" ]; then + + # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume + echo "set-default-sink $PA_LADSPA_SINK" >>"$PULSE_DIR/default.pa" +- echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" ++ #echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" + echo "set-sink-mute $PA_MASTER_SINK 0" >>"$PULSE_DIR/default.pa" + echo "### END: Equalized audio configuration" >>"$PULSE_DIR/default.pa" + +@@ -383,7 +383,7 @@ if [ "$1" = "enable" ]; then # Unmute & set preamp level on ALSA sink (as LADSPA sink will act as primary volume control) echo "Setting ALSA sink ($PA_MASTER_SINK) preamp ("$PA_PREAMP"x)..." @@ -9,24 +18,24 @@ echo >>/tmp/eqcommands.sh "set-sink-mute $PA_MASTER_SINK 0" # Set the LADSPA sink as the default ---- pulseaudio-equalizer.orig/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py -+++ pulseaudio-equalizer/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py -@@ -412,14 +412,14 @@ - table.attach(label, 1, 2, 0, 1) - table.attach(preampscale, 1, 2, 1, 2) - table.attach(preampscalevalue, 1, 2, 2, 3) -- label.show() -- preampscale.show() -- preampscalevalue.show() -+ #label.show() -+ #preampscale.show() -+ #preampscalevalue.show() +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -414,14 +414,14 @@ class Equalizer: + table.attach(label, 1, 2, 0, 1) + table.attach(preampscale, 1, 2, 1, 2) + table.attach(preampscalevalue, 1, 2, 2, 3) +- label.show() +- preampscale.show() +- preampscalevalue.show() ++ #label.show() ++ #preampscale.show() ++ #preampscalevalue.show() - # Separator between preamp and bands - separator = gtk.VSeparator() - table.attach(separator, 2, 3, 1, 2) -- separator.show() -+ #separator.show() + # Separator between preamp and bands + separator = gtk.VSeparator() + table.attach(separator, 2, 3, 1, 2) +- separator.show() ++ #separator.show() - # Equalizer bands - global scale + # Equalizer bands + global scale diff --git a/0003-force-default-persistence-value.patch b/0003-force-default-persistence-value.patch index d76c007..3546a39 100644 --- a/0003-force-default-persistence-value.patch +++ b/0003-force-default-persistence-value.patch @@ -1,14 +1,11 @@ ---- pulseaudio-equalizer.orig/usr/bin/pulseaudio-equalizer -+++ pulseaudio-equalizer/usr/bin/pulseaudio-equalizer -@@ -128,7 +128,9 @@ - if [ -f $HOME/.config/pulse/default.pa ]; then - if [ "$(cat $HOME/.config/pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - PA_EQUALIZER_PERSISTENCE=1 -- fi +--- a/usr/bin/pulseaudio-equalizer ++++ b/usr/bin/pulseaudio-equalizer +@@ -133,6 +133,8 @@ fi + if [ -f "$PULSE_DIR/default.pa" ]; then + if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then + PA_EQUALIZER_PERSISTENCE=1 + else -+ PA_EQUALIZER_PERSISTENCE=0 -+ fi ++ PA_EQUALIZER_PERSISTENCE=0 + fi else - PA_EQUALIZER_PERSISTENCE=0 - fi - + PA_EQUALIZER_PERSISTENCE=0 diff --git a/0004-do-not-crash-on-missing-preset.patch b/0004-do-not-crash-on-missing-preset.patch index 6e67545..0e7c9c1 100644 --- a/0004-do-not-crash-on-missing-preset.patch +++ b/0004-do-not-crash-on-missing-preset.patch @@ -1,17 +1,17 @@ ---- pulseaudio-equalizer.orig/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2011-03-17 10:53:48.000000000 +0000 -+++ pulseaudio-equalizer/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2011-03-17 11:18:04.000000000 +0000 -@@ -180,10 +180,13 @@ class Equalizer: - if os.path.isfile(presetdir1 + "/" + preset + ".preset"): - f = open(presetdir1 + "/" + preset + ".preset", "r") - rawdata=f.read().split('\n') -- else: -+ f.close -+ elif os.path.isfile(presetdir2 + "/" + preset + ".preset"): - f = open(presetdir2 + "/" + preset + ".preset", "r") - rawdata=f.read().split('\n') - f.close -+ else: -+ print "Can't find %s preset" % preset +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -181,10 +181,13 @@ class Equalizer: + if os.path.isfile(presetdir1 + "/" + preset + ".preset"): + f = open(presetdir1 + "/" + preset + ".preset", "r") + rawdata=f.read().split("\n") +- else: ++ f.close ++ elif os.path.isfile(presetdir2 + "/" + preset + ".preset"): + f = open(presetdir2 + "/" + preset + ".preset", "r") + rawdata=f.read().split("\n") + f.close ++ else: ++ print("Can't find %s preset" % preset) - ladspa_filename = str(rawdata[0]) - ladspa_name = str(rawdata[1]) + ladspa_filename = str(rawdata[0]) + ladspa_name = str(rawdata[1]) diff --git a/0005-window-icon.patch b/0005-window-icon.patch index d9dda03..037dd88 100644 --- a/0005-window-icon.patch +++ b/0005-window-icon.patch @@ -1,12 +1,11 @@ ---- pulseaudio-equalizer.orig/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2011-03-17 10:23:27.000000000 +0000 -+++ pulseaudio-equalizer/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py 2011-03-17 10:53:48.000000000 +0000 -@@ -359,7 +359,20 @@ class Equalizer: +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -364,7 +364,19 @@ class Equalizer: self.window.connect("destroy", self.destroy_equalizer) self.window.set_title(windowtitle + " [" + realstatus + "]") self.window.set_border_width(0) -- icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") -+ -+ icon_theme = gtk.icon_theme_get_default() +- icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") ++ + icon_theme = gtk.icon_theme_get_default() + if icon_theme.has_icon("multimedia-volume-control"): + icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) @@ -18,7 +17,7 @@ + icon = icon_theme.load_icon("stock_volume",16,0) + self.window.set_icon(icon) + else: -+ print ("No icon found, window will be iconless") ++ print("No icon found, window will be iconless") menu = gtk.Menu() diff --git a/0007-pygobject3-port.patch b/0007-pygobject3-port.patch new file mode 100644 index 0000000..818f3b0 --- /dev/null +++ b/0007-pygobject3-port.patch @@ -0,0 +1,262 @@ +--- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py ++++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +@@ -8,11 +8,13 @@ + # Version: (see '/usr/pulseaudio-equalizer' script) + # + +-import pygtk +-pygtk.require('2.0') +-import gtk, gobject ++import gi ++gi.require_version("Gtk", "3.0") ++from gi.repository import GLib as glib, Gtk as gtk + import os + ++GTK_VERSION = (gtk.MAJOR_VERSION, gtk.MINOR_VERSION, gtk.MICRO_VERSION) ++ + configdir = glib.get_user_config_dir() + "/pulse" + eqconfig = configdir + "/equalizerrc" + eqconfig2 = configdir + "/equalizerrc.test" +@@ -300,12 +302,16 @@ class Equalizer: + def on_removepreset(self,widget): + global preset + global presets +- dialog = gtk.FileChooserDialog("Choose preset to remove...", +- None, +- gtk.FILE_CHOOSER_ACTION_OPEN, +- (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, +- gtk.STOCK_OK, gtk.RESPONSE_OK)) +- dialog.set_default_response(gtk.RESPONSE_OK) ++ dialog = gtk.FileChooserDialog(title="Choose preset to remove...", ++ transient_for=widget.get_toplevel(), ++ action=gtk.FileChooserAction.OPEN) ++ ++ button = dialog.add_button("_Cancel", gtk.ResponseType.CANCEL) ++ button.set_image(gtk.Image.new_from_icon_name("gtk-cancel", gtk.IconSize.BUTTON)) ++ button = dialog.add_button("_Open", gtk.ResponseType.OK) ++ button.set_image(gtk.Image.new_from_icon_name("document-open", gtk.IconSize.BUTTON)) ++ button.grab_default() ++ dialog.set_default_response(gtk.ResponseType.OK) + + filter = gtk.FileFilter() + filter.set_name("Preset files") +@@ -315,7 +321,7 @@ class Equalizer: + dialog.show() + + response = dialog.run() +- if response == gtk.RESPONSE_OK: ++ if response == gtk.ResponseType.OK: + filename = dialog.get_filename() + path_and_name = os.path.split(filename) + name = path_and_name[1] +@@ -358,14 +364,14 @@ class Equalizer: + def __init__(self): + GetSettings() + +- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) ++ self.window = gtk.Window() + self.window.set_resizable(True) + + self.window.connect("destroy", self.destroy_equalizer) + self.window.set_title(windowtitle + " [" + realstatus + "]") + self.window.set_border_width(0) + +- icon_theme = gtk.icon_theme_get_default() ++ icon_theme = gtk.IconTheme.get_default() + if icon_theme.has_icon("multimedia-volume-control"): + icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) + self.window.set_icon(icon) +@@ -380,19 +386,22 @@ class Equalizer: + + menu = gtk.Menu() + +- menu_item = gtk.MenuItem('Reset to defaults') ++ menu_item = gtk.MenuItem(label="Reset to defaults") + menu_item.connect("activate", self.on_resetsettings) + menu.append(menu_item) + menu_item.show() +- menu_item = gtk.MenuItem("Remove user preset...") ++ menu_item = gtk.MenuItem(label="Remove user preset...") + menu_item.connect("activate", self.on_removepreset) + menu.append(menu_item) + menu_item.show() +- root_menu = gtk.MenuItem("Advanced") ++ root_menu = gtk.MenuItem(label="Advanced") + root_menu.show() + root_menu.set_submenu(menu) + +- vbox1 = gtk.VBox(False, 0) ++ if GTK_VERSION >= (3, 0, 0): ++ vbox1 = gtk.Box(orientation=gtk.Orientation.VERTICAL) ++ else: ++ vbox1 = gtk.VBox() + self.window.add(vbox1) + vbox1.show() + menu_bar = gtk.MenuBar() +@@ -400,22 +409,31 @@ class Equalizer: + menu_bar.show() + menu_bar.append (root_menu) + +- hbox1 = gtk.HBox(False, 1) ++ if GTK_VERSION >= (3, 0, 0): ++ hbox1 = gtk.Box(orientation=gtk.Orientation.HORIZONTAL, spacing=1) ++ else: ++ hbox1 = gtk.HBox(spacing=1) + #hbox1.set_border_width(10) + vbox1.add(hbox1) + hbox1.show() + +- table = gtk.Table(3, 17, False) +- table.set_border_width(5) +- hbox1.add(table) ++ if GTK_VERSION >= (3, 10, 0): ++ grid = gtk.Grid() ++ else: ++ grid = gtk.Table(n_rows=3, n_columns=17) ++ grid.set_border_width(5) ++ hbox1.add(grid) + + # Preamp widget + global preampscale + global preampscalevalue +- preampscale = gtk.VScale() ++ if GTK_VERSION >= (3, 2, 0): ++ preampscale = gtk.Scale(orientation=gtk.Orientation.VERTICAL) ++ else: ++ preampscale = gtk.VScale() + preampscale.set_draw_value(0) + preampscale.set_inverted(1) +- preampscale.set_value_pos(gtk.POS_BOTTOM) ++ preampscale.set_value_pos(gtk.PositionType.BOTTOM) + preampscale.set_range(0.0, 2.0) + preampscale.set_increments(1, 0.1) + preampscale.set_digits(1) +@@ -426,16 +444,25 @@ class Equalizer: + label.set_markup("Preamp") + preampscalevalue = gtk.Label() + preampscalevalue.set_markup(str(preampscale.get_value()) + "x") +- table.attach(label, 1, 2, 0, 1) +- table.attach(preampscale, 1, 2, 1, 2) +- table.attach(preampscalevalue, 1, 2, 2, 3) ++ if GTK_VERSION >= (3, 10, 0): ++ grid.attach(label, 1, 0, 1, 1) ++ grid.attach(preampscale, 1, 1, 1, 1) ++ grid.attach(preampscalevalue, 1, 2, 1, 1) ++ else: ++ grid.attach(label, 1, 2, 0, 1) ++ grid.attach(preampscale, 1, 2, 1, 2) ++ grid.attach(preampscalevalue, 1, 2, 2, 3) + #label.show() + #preampscale.show() + #preampscalevalue.show() + + # Separator between preamp and bands +- separator = gtk.VSeparator() +- table.attach(separator, 2, 3, 1, 2) ++ if GTK_VERSION >= (3, 10, 0): ++ separator = gtk.Separator(orientation=gtk.Orientation.VERTICAL) ++ grid.attach(separator, 2, 1, 1, 1) ++ else: ++ separator = gtk.VSeparator() ++ grid.attach(separator, 2, 3, 1, 2) + #separator.show() + + # Equalizer bands +@@ -448,7 +475,7 @@ class Equalizer: + self.scales[x] = scale + scale.set_draw_value(0) + scale.set_inverted(1) +- scale.set_value_pos(gtk.POS_BOTTOM) ++ scale.set_value_pos(gtk.PositionType.BOTTOM) + scale.set_range(float(ranges[0]), float(ranges[1])) + scale.set_increments(1, 0.1) + scale.set_digits(1) +@@ -462,16 +489,24 @@ class Equalizer: + scalevalue = gtk.Label() + self.scalevalues[x] = scalevalue + scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") +- table.attach(label, x + 2, x + 3, 0, 1) +- table.attach(scale, x + 2, x + 3, 1, 2) +- table.attach(scalevalue, x + 2, x + 3, 2, 3) ++ if GTK_VERSION >= (3, 10, 0): ++ grid.attach(label, x + 2, 0, 1, 1) ++ grid.attach(scale, x + 2, 1, 1, 1) ++ grid.attach(scalevalue, x + 2, 2, 1, 1) ++ else: ++ grid.attach(label, x + 2, x + 3, 0, 1) ++ grid.attach(scale, x + 2, x + 3, 1, 2) ++ grid.attach(scalevalue, x + 2, x + 3, 2, 3) + label.show() + scale.show() + scalevalue.show() + +- table.show() ++ grid.show() + +- vbox2 = gtk.VBox(True, 1) ++ if GTK_VERSION >= (3, 0, 0): ++ vbox2 = gtk.Box(orientation=gtk.Orientation.VERTICAL, homogeneous=True, spacing=1) ++ else: ++ vbox2 = gtk.VBox(homogeneous=True, spacing=1) + vbox2.set_border_width(10) + hbox1.add(vbox2) + vbox2.show() +@@ -482,7 +517,7 @@ class Equalizer: + presetslabel.show() + + global presetsbox +- presetsbox = gtk.combo_box_entry_new_text() ++ presetsbox = gtk.ComboBoxText.new_with_entry() + vbox2.pack_start(presetsbox, False, False, 0) + presetsbox.get_child().set_text(preset) + for i in range(len(rawpresets)): +@@ -490,38 +525,41 @@ class Equalizer: + presetsbox.connect("changed", self.on_presetsbox, x) + presetsbox.show() + +- savepreset = gtk.Button("Save Preset") ++ savepreset = gtk.Button(label="Save Preset") + vbox2.pack_start(savepreset, False, False, 0) + savepreset.connect("clicked", self.on_savepreset) + savepreset.show() + + global eqenabled +- eqenabled = gtk.CheckButton("EQ Enabled") ++ eqenabled = gtk.CheckButton(label="EQ Enabled") + eqenabled.set_active(status) +- eqenabled.unset_flags(gtk.CAN_FOCUS) ++ eqenabled.set_can_focus(False) + eqenabled.connect("clicked", self.on_eqenabled) + vbox2.pack_start(eqenabled, False, False, 0) + eqenabled.show() + + global keepsettings +- keepsettings = gtk.CheckButton('Keep Settings') ++ keepsettings = gtk.CheckButton(label="Keep Settings") + keepsettings.set_active(persistence) +- keepsettings.unset_flags(gtk.CAN_FOCUS) ++ keepsettings.set_can_focus(False) + keepsettings.connect("clicked", self.on_keepsettings) + vbox2.pack_start(keepsettings, False, False, 0) + keepsettings.show() + +- applysettings = gtk.Button("Apply Settings") ++ applysettings = gtk.Button(label="Apply Settings") + vbox2.pack_start(applysettings, False, False, 0) + applysettings.connect("clicked", self.on_applysettings) + applysettings.show() + +- quitbutton = gtk.Button("Quit") ++ quitbutton = gtk.Button(label="Quit") + vbox2.pack_start(quitbutton, False, False, 0) + quitbutton.connect("clicked", lambda w: gtk.main_quit()) + quitbutton.show() + +- separator = gtk.HSeparator() ++ if GTK_VERSION >= (3, 2, 0): ++ separator = gtk.Separator(orientation=gtk.Orientation.HORIZONTAL) ++ else: ++ separator = gtk.HSeparator() + vbox2.pack_start(separator, False, False, 0) + separator.set_size_request(100, 10) + #separator.show() diff --git a/0007-remove-all-preamp.patch b/0007-remove-all-preamp.patch deleted file mode 100644 index 3182ed1..0000000 --- a/0007-remove-all-preamp.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: pulseaudio-equalizer-2.7.0.2/usr/bin/pulseaudio-equalizer -=================================================================== ---- pulseaudio-equalizer-2.7.0.2.orig/usr/bin/pulseaudio-equalizer -+++ pulseaudio-equalizer-2.7.0.2/usr/bin/pulseaudio-equalizer -@@ -290,7 +290,7 @@ if [ "$1" = "enable-config" ]; then - - # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume - echo "set-default-sink $PA_LADSPA_SINK" >>$HOME/.config/pulse/default.pa -- echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.config/pulse/default.pa -+ #echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.config/pulse/default.pa - echo "set-sink-mute $PA_MASTER_SINK 0" >>$HOME/.config/pulse/default.pa - echo "### END: Equalized audio configuration" >>$HOME/.config/pulse/default.pa - diff --git a/0008-fix-locale-issues.patch b/0008-fix-locale-issues.patch index 2fb2471..eefb7fa 100644 --- a/0008-fix-locale-issues.patch +++ b/0008-fix-locale-issues.patch @@ -1,15 +1,14 @@ -diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer --- a/usr/bin/pulseaudio-equalizer +++ b/usr/bin/pulseaudio-equalizer -@@ -18,6 +18,7 @@ +@@ -18,6 +18,7 @@ PA_CONTROL_MAX="30" PA_PREAMP="1.0" PA_CURRENT_PRESET="" +LC_MESSAGES=C - PRESET_DIR1=$HOME/.config/pulse/presets - PRESET_DIR2=/usr/share/pulseaudio-equalizer/presets - SCRIPT_NAME=pulseaudio-equalizer -@@ -108,20 +109,20 @@ + if [ -z "$XDG_CONFIG_HOME" ]; then + PULSE_DIR="$HOME/.config/pulse" + else +@@ -113,20 +114,20 @@ fi # Get sink names and volumes PA_LADSPA_SINK="ladspa_output.$PA_LADSPA_PLUGIN.$PA_LADSPA_LABEL" @@ -35,7 +34,7 @@ diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer fi # Check if equalizer is set as persistent -@@ -337,16 +338,16 @@ +@@ -342,16 +343,16 @@ if [ "$1" = "disable" -o "$1" = "enable" # Unload & reload stream-restore module echo "Unloading & reloading stream-restore module..." @@ -55,7 +54,7 @@ diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer # Transfer current mute/sink volume to ALSA sink echo "Transferring current mute ($PA_CURRENT_MUTE) & volume ($PA_CURRENT_VOLUME%) to ALSA sink ($PA_MASTER_SINK)..." -@@ -366,7 +367,7 @@ +@@ -371,7 +372,7 @@ if [ "$1" = "enable" ]; then # Unload & reload stream-restore module with restore_device option disabled (to ensure that previously cached per-client sinks are not used) echo "Unloading & reloading stream-restore module..." @@ -64,7 +63,7 @@ diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer echo >>/tmp/eqcommands.sh "load-module module-stream-restore restore_device=false" # Load LADSPA sink module -@@ -389,7 +390,7 @@ +@@ -394,7 +395,7 @@ if [ "$1" = "enable" ]; then # Move currently active client sinks to LADSPA sink echo "Moving active PulseAudio clients to LADSPA sink ($PA_LADSPA_SINK)..." @@ -73,7 +72,7 @@ diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer # Execute all queued commands (for potential speed benefit)... pacmd /dev/null -@@ -423,7 +424,7 @@ +@@ -428,7 +429,7 @@ if [ "$1" = "status" ]; then fi # Refresh current sink status and display equalizer information diff --git a/pulseaudio-equalizer.changes b/pulseaudio-equalizer.changes index 78b50b7..a5482c0 100644 --- a/pulseaudio-equalizer.changes +++ b/pulseaudio-equalizer.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Sun Feb 25 18:16:05 UTC 2018 - sor.alexei@meowr.ru + +- Add 0000-fix-python-indent.patch: Fix Python indentation. +- Rebase and improve 0001-pulse-path.patch. +- Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch. +- Rebase 0003-force-default-persistence-value.patch, + 0004-do-not-crash-on-missing-preset.patch, 0005-window-icon.patch, + 0008-fix-locale-issues.patch. +- Add 0007-pygobject3-port.patch: Port to PyGObject3 and GTK+3. +- Unwrap pulseaudio-equalizer-gtk. +- Switch to Python3. + ------------------------------------------------------------------- Fri Sep 4 14:47:08 UTC 2015 - altesholz@gmail.com diff --git a/pulseaudio-equalizer.spec b/pulseaudio-equalizer.spec index 6533315..429123f 100644 --- a/pulseaudio-equalizer.spec +++ b/pulseaudio-equalizer.spec @@ -1,7 +1,7 @@ # # spec file for package pulseaudio-equalizer # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,39 +20,44 @@ Name: pulseaudio-equalizer Version: 2.7.0.2 Release: 0 Summary: PulseAudio's LADSPA plugin graphical user interface -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Productivity/Multimedia/Sound/Mixers -Url: http://ubuntuforums.org/showthread.php?t=1308838 -Source: http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu/pool/main/p/%{name}/%{name}_%{version}.orig.tar.gz -# PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to a new one. -Patch0: 0001-pulse-path.patch -# PATCH-FIX-UPSTREAM 0002-remove-preamp.patch webupd8@gmail.com -- Remove preamp. -Patch1: 0002-remove-preamp.patch +Url: https://ubuntuforums.org/showthread.php?t=1308838 +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. +Patch0: 0000-fix-python-indent.patch +# PATCH-FIX-UPSTREAM 0001-pulse-path.patch webupd8@gmail.com -- Update path to PulseAudio files to the new one. +Patch1: 0001-pulse-path.patch +# PATCH-FIX-UPSTREAM 0002-remove-preamp.patch -- Remove preamp. +Patch2: 0002-remove-preamp.patch # PATCH-FIX-UPSTREAM 0003-force-default-persistence-value.patch webupd8@gmail.com -- Force default persistence value. -Patch2: 0003-force-default-persistence-value.patch +Patch3: 0003-force-default-persistence-value.patch # PATCH-FIX-UPSTREAM 0004-do-not-crash-on-missing-preset.patch webupd8@gmail.com -- Do not crash on missing preset. -Patch3: 0004-do-not-crash-on-missing-preset.patch +Patch4: 0004-do-not-crash-on-missing-preset.patch # PATCH-FIX-UPSTREAM 0005-window-icon.patch webupd8@gmail.com -- Correct way of setting window icon. -Patch4: 0005-window-icon.patch +Patch5: 0005-window-icon.patch # PATCH-FIX-UPSTREAM 0006-fix-desktop.patch malcolmlewis@opensuse.org -- Fix .desktop file. -Patch5: 0006-fix-desktop.patch -# PATCH-FIX-UPSTREAM 0007-remove-all-preamp.patch alex@warwickvesztrocy.co.uk -- Remove all preamp. -Patch6: 0007-remove-all-preamp.patch +Patch6: 0006-fix-desktop.patch +# PATCH-FIX-UPSTREAM 0007-pygobject3-port.patch sor.alexei@meowr.ru -- Port to PyGObject3 and GTK+3. +Patch7: 0007-pygobject3-port.patch # PATCH-FIX-UPSTREAM 0008-fix-locale-issues.patch sor.alexei@meowr.ru -- Fix issues on non-Latin systems. -Patch7: 0008-fix-locale-issues.patch +Patch8: 0008-fix-locale-issues.patch # PATCH-FIX-UPSTREAM 0009-do-not-zero-volume.patch sor.alexei@meowr.ru -- Fix volume zeroing on fresh PulseAudio. -Patch8: 0009-do-not-zero-volume.patch +Patch9: 0009-do-not-zero-volume.patch BuildRequires: update-desktop-files Requires: ladspa-swh-plugins Requires: pulseaudio >= 4.0 Requires: pulseaudio-utils >= 4.0 -Requires: python-gnome -Requires: python-gtk +Requires: python3 +Requires: python3-gobject BuildArch: noarch +%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200 +Requires: python3-gobject-Gdk +%endif %description GUI for PulseAudio's LADSPA interface using Steve Harris' Multiband EQ -(mbeq_1197) plugin +(mbeq_1197) plugin. %prep %setup -q -n %{name} @@ -61,30 +66,34 @@ GUI for PulseAudio's LADSPA interface using Steve Harris' Multiband EQ %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -%patch6 -p1 +%patch5 -p1 +%patch6 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +sed -i '/^#!/s|env python$|python3|' .%{_datadir}/%{name}/%{name}.py %build # Nothing to build. %install mkdir -p %{buildroot}%{_bindir}/ %{buildroot}%{_datadir}/%{name}/presets/ -install -Dm 0755 .%{_bindir}/%{name}* %{buildroot}%{_bindir}/ -install -Dm 0755 .%{_datadir}/%{name}/%{name}.py %{buildroot}%{_datadir}/%{name}/%{name}.py -install -Dm 0644 .%{_datadir}/%{name}/presets/* %{buildroot}%{_datadir}/%{name}/presets/ -install -Dm 0644 .%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop +install -Dpm 0755 .%{_bindir}/%{name}* %{buildroot}%{_bindir}/ +install -Dpm 0755 .%{_datadir}/%{name}/%{name}.py %{buildroot}%{_bindir}/%{name}-gtk +install -Dpm 0644 .%{_datadir}/%{name}/presets/* %{buildroot}%{_datadir}/%{name}/presets/ +install -Dpm 0644 .%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop + %suse_update_desktop_file %{name} +%if 0%{?suse_version} < 1500 %post %desktop_database_post %postun %desktop_database_postun +%endif %files -%defattr(-,root,root) %{_bindir}/%{name}* %{_datadir}/%{name}/ %{_datadir}/applications/%{name}.desktop From a3f4f1604db4448f3309accfb774c1839173b37808493187d0eaaa69321f418d Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Sun, 25 Feb 2018 23:29:27 +0000 Subject: [PATCH 2/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=11 --- 0009-do-not-zero-volume.patch | 5 ++--- pulseaudio-equalizer.changes | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/0009-do-not-zero-volume.patch b/0009-do-not-zero-volume.patch index 8c8fec5..a7a28d7 100644 --- a/0009-do-not-zero-volume.patch +++ b/0009-do-not-zero-volume.patch @@ -1,14 +1,13 @@ -diff -aur a/usr/bin/pulseaudio-equalizer b/usr/bin/pulseaudio-equalizer --- a/usr/bin/pulseaudio-equalizer +++ b/usr/bin/pulseaudio-equalizer -@@ -110,8 +110,14 @@ +@@ -115,8 +115,14 @@ fi # Get sink names and volumes PA_LADSPA_SINK="ladspa_output.$PA_LADSPA_PLUGIN.$PA_LADSPA_LABEL" PA_CURRENT_SINK=$(pacmd stat | sed -e '/Default sink name/!d;s/Default sink name: //g') -PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: 0:' | awk '{print $NF}' | sed 's/%//g') -PA_REAL_VOLUME=$((PA_CURRENT_VOLUME*65536/100)) +if [ "$( (echo '4.0'; pulseaudio --version | awk '{print $2}') | sort -V | sed -n '2p' )" != '4.0' ]; then -+ # Version of PulseAudio is superior than 4.0. ++ # The version of PulseAudio is higher than 4.0. + PA_CURRENT_VOLUME=$(pacmd list | iconv -c -t ascii | grep -A20 "<$PA_CURRENT_SINK>" | grep -m1 'volume: front-left:' | awk '{print $3}') + PA_REAL_VOLUME="$PA_CURRENT_VOLUME" +else diff --git a/pulseaudio-equalizer.changes b/pulseaudio-equalizer.changes index a5482c0..8903c0d 100644 --- a/pulseaudio-equalizer.changes +++ b/pulseaudio-equalizer.changes @@ -6,7 +6,7 @@ Sun Feb 25 18:16:05 UTC 2018 - sor.alexei@meowr.ru - Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch. - Rebase 0003-force-default-persistence-value.patch, 0004-do-not-crash-on-missing-preset.patch, 0005-window-icon.patch, - 0008-fix-locale-issues.patch. + 0008-fix-locale-issues.patch, 0009-do-not-zero-volume.patch. - Add 0007-pygobject3-port.patch: Port to PyGObject3 and GTK+3. - Unwrap pulseaudio-equalizer-gtk. - Switch to Python3. From a8e1fb3c419c5aa0f9cf824d25086d1dc7774fc83866163d049ba94ef11dfd56 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Sun, 25 Feb 2018 23:57:14 +0000 Subject: [PATCH 3/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=12 --- pulseaudio-equalizer.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pulseaudio-equalizer.spec b/pulseaudio-equalizer.spec index 429123f..da155d3 100644 --- a/pulseaudio-equalizer.spec +++ b/pulseaudio-equalizer.spec @@ -20,7 +20,7 @@ Name: pulseaudio-equalizer Version: 2.7.0.2 Release: 0 Summary: PulseAudio's LADSPA plugin graphical user interface -License: GPL-3.0-or-later +License: GPL-3.0+ Group: Productivity/Multimedia/Sound/Mixers Url: https://ubuntuforums.org/showthread.php?t=1308838 Source: https://launchpad.net/~nilarimogard/+archive/ubuntu/webupd8/+files/%{name}_%{version}.orig.tar.gz @@ -44,6 +44,7 @@ Patch7: 0007-pygobject3-port.patch Patch8: 0008-fix-locale-issues.patch # PATCH-FIX-UPSTREAM 0009-do-not-zero-volume.patch sor.alexei@meowr.ru -- Fix volume zeroing on fresh PulseAudio. Patch9: 0009-do-not-zero-volume.patch +BuildRequires: gobject-introspection-devel BuildRequires: update-desktop-files Requires: ladspa-swh-plugins Requires: pulseaudio >= 4.0 From bb8fb62b981ca35b85da6bc9b5da46638a81389e415d3066f35613213ec4e690 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Mon, 26 Feb 2018 09:43:47 +0000 Subject: [PATCH 4/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=13 --- ...ent.patch => 0000-add-python3-compat.patch | 14 ++-- 0007-pygobject3-port.patch | 70 +++++++++++++------ pulseaudio-equalizer.changes | 2 +- pulseaudio-equalizer.spec | 6 +- 4 files changed, 61 insertions(+), 31 deletions(-) rename 0000-fix-python-indent.patch => 0000-add-python3-compat.patch (99%) diff --git a/0000-fix-python-indent.patch b/0000-add-python3-compat.patch similarity index 99% rename from 0000-fix-python-indent.patch rename to 0000-add-python3-compat.patch index 81b5536..d30b2d7 100644 --- a/0000-fix-python-indent.patch +++ b/0000-add-python3-compat.patch @@ -114,7 +114,7 @@ + windowtitle = "PulseAudio " + ladspa_label + + clearpreset = 1 -+ presetmatch = '' ++ presetmatch = "" + for i in range(len(rawpresets)): + if rawpresets[i] == preset: + print("Match!") @@ -216,13 +216,13 @@ + if current_input < 99: + a = current_input + suffix = "Hz" -+ elif current_input < 999: ++ if current_input > 99 and current_input < 999: + a = current_input + suffix = "Hz" -+ elif current_input < 9999: ++ if current_input > 999 and current_input < 9999: + a = float(current_input) / 1000 + suffix = "KHz" -+ else: ++ if current_input > 9999: + a = float(current_input) / 1000 + suffix = "KHz" + @@ -361,7 +361,7 @@ + preampscalevalue.set_markup(str(preampscale.get_value()) + "x") + windowtitle = "PulseAudio " + ladspa_label + self.window.set_title(windowtitle + " [" + realstatus + "]") -+ clearpreset = '' ++ clearpreset = "" + for i in range(1,num_ladspa_controls + 1): + self.scales[i].set_value(float(ladspa_controls[i - 1])) + FormatLabels(i) @@ -464,7 +464,7 @@ + rawdata.append(str(ladspa_inputs[i])) + + for i in rawdata: -+ f.write(str(i)+'\n') ++ f.write(str(i) + "\n") + f.close() + + # Clear preset list from ComboBox @@ -581,7 +581,7 @@ + + # Clear preset (if it is the same as removed preset), or restore preset + if (presetdir1 + "/" + preset + ".preset") == filename: -+ preset = '' ++ preset = "" + else: + preset = realpreset + diff --git a/0007-pygobject3-port.patch b/0007-pygobject3-port.patch index 818f3b0..19259ca 100644 --- a/0007-pygobject3-port.patch +++ b/0007-pygobject3-port.patch @@ -49,7 +49,7 @@ filename = dialog.get_filename() path_and_name = os.path.split(filename) name = path_and_name[1] -@@ -358,14 +364,14 @@ class Equalizer: +@@ -358,14 +364,13 @@ class Equalizer: def __init__(self): GetSettings() @@ -59,14 +59,14 @@ self.window.connect("destroy", self.destroy_equalizer) 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.IconTheme.get_default() if icon_theme.has_icon("multimedia-volume-control"): icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) self.window.set_icon(icon) -@@ -380,19 +386,22 @@ class Equalizer: +@@ -380,42 +385,59 @@ class Equalizer: menu = gtk.Menu() @@ -93,16 +93,23 @@ self.window.add(vbox1) vbox1.show() 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.append (root_menu) +- menu_bar.append (root_menu) ++ menu_bar.append(root_menu) - hbox1 = gtk.HBox(False, 1) +- #hbox1.set_border_width(10) + if GTK_VERSION >= (3, 0, 0): + hbox1 = gtk.Box(orientation=gtk.Orientation.HORIZONTAL, spacing=1) + else: + hbox1 = gtk.HBox(spacing=1) - #hbox1.set_border_width(10) ++ #hbox1.props.margin = 10 vbox1.add(hbox1) hbox1.show() @@ -111,9 +118,10 @@ - hbox1.add(table) + if GTK_VERSION >= (3, 10, 0): + grid = gtk.Grid() ++ grid.props.margin = 5 + else: + grid = gtk.Table(n_rows=3, n_columns=17) -+ grid.set_border_width(5) ++ grid.set_border_width(5) + hbox1.add(grid) # Preamp widget @@ -131,7 +139,7 @@ preampscale.set_range(0.0, 2.0) preampscale.set_increments(1, 0.1) preampscale.set_digits(1) -@@ -426,16 +444,25 @@ class Equalizer: +@@ -426,16 +448,25 @@ class Equalizer: label.set_markup("Preamp") preampscalevalue = gtk.Label() preampscalevalue.set_markup(str(preampscale.get_value()) + "x") @@ -162,7 +170,15 @@ #separator.show() # 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 scale.set_draw_value(0) scale.set_inverted(1) @@ -171,7 +187,7 @@ scale.set_range(float(ranges[0]), float(ranges[1])) scale.set_increments(1, 0.1) scale.set_digits(1) -@@ -462,16 +489,24 @@ class Equalizer: +@@ -462,67 +496,79 @@ class Equalizer: scalevalue = gtk.Label() self.scalevalues[x] = scalevalue scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") @@ -194,29 +210,37 @@ + grid.show() - vbox2 = gtk.VBox(True, 1) +- vbox2.set_border_width(10) + if GTK_VERSION >= (3, 0, 0): + vbox2 = gtk.Box(orientation=gtk.Orientation.VERTICAL, homogeneous=True, spacing=1) ++ vbox2.props.margin = 10 + else: + vbox2 = gtk.VBox(homogeneous=True, spacing=1) - vbox2.set_border_width(10) ++ vbox2.set_border_width(10) hbox1.add(vbox2) vbox2.show() -@@ -482,7 +517,7 @@ class Equalizer: + + presetslabel = gtk.Label() + presetslabel.set_markup("Preset:") +- vbox2.pack_start(presetslabel, False, False, 0) ++ vbox2.add(presetslabel) presetslabel.show() global presetsbox - presetsbox = gtk.combo_box_entry_new_text() +- vbox2.pack_start(presetsbox, False, False, 0) + presetsbox = gtk.ComboBoxText.new_with_entry() - vbox2.pack_start(presetsbox, False, False, 0) ++ vbox2.add(presetsbox) presetsbox.get_child().set_text(preset) 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.show() - savepreset = gtk.Button("Save Preset") +- vbox2.pack_start(savepreset, False, False, 0) + savepreset = gtk.Button(label="Save Preset") - vbox2.pack_start(savepreset, False, False, 0) ++ vbox2.add(savepreset) savepreset.connect("clicked", self.on_savepreset) savepreset.show() @@ -227,7 +251,8 @@ - eqenabled.unset_flags(gtk.CAN_FOCUS) + eqenabled.set_can_focus(False) 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() global keepsettings @@ -237,26 +262,31 @@ - keepsettings.unset_flags(gtk.CAN_FOCUS) + keepsettings.set_can_focus(False) 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() - applysettings = gtk.Button("Apply Settings") +- vbox2.pack_start(applysettings, False, False, 0) + applysettings = gtk.Button(label="Apply Settings") - vbox2.pack_start(applysettings, False, False, 0) ++ vbox2.add(applysettings) applysettings.connect("clicked", self.on_applysettings) applysettings.show() - quitbutton = gtk.Button("Quit") +- vbox2.pack_start(quitbutton, False, False, 0) + quitbutton = gtk.Button(label="Quit") - vbox2.pack_start(quitbutton, False, False, 0) ++ vbox2.add(quitbutton) quitbutton.connect("clicked", lambda w: gtk.main_quit()) quitbutton.show() - separator = gtk.HSeparator() +- vbox2.pack_start(separator, False, False, 0) + if GTK_VERSION >= (3, 2, 0): + separator = gtk.Separator(orientation=gtk.Orientation.HORIZONTAL) + else: + separator = gtk.HSeparator() - vbox2.pack_start(separator, False, False, 0) ++ vbox2.add(separator) separator.set_size_request(100, 10) #separator.show() + diff --git a/pulseaudio-equalizer.changes b/pulseaudio-equalizer.changes index 8903c0d..3cb4c39 100644 --- a/pulseaudio-equalizer.changes +++ b/pulseaudio-equalizer.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- 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. - Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch. - Rebase 0003-force-default-persistence-value.patch, diff --git a/pulseaudio-equalizer.spec b/pulseaudio-equalizer.spec index da155d3..7879ac9 100644 --- a/pulseaudio-equalizer.spec +++ b/pulseaudio-equalizer.spec @@ -20,12 +20,12 @@ Name: pulseaudio-equalizer Version: 2.7.0.2 Release: 0 Summary: PulseAudio's LADSPA plugin graphical user interface -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Productivity/Multimedia/Sound/Mixers Url: https://ubuntuforums.org/showthread.php?t=1308838 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. -Patch0: 0000-fix-python-indent.patch +# PATCH-FIX-UPSTREAM 0000-add-python3-compat.patch sor.alexei@meowr.ru -- Add Python3 compatibility. +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. Patch1: 0001-pulse-path.patch # PATCH-FIX-UPSTREAM 0002-remove-preamp.patch -- Remove preamp. From 68f3cb795eb8f1b3065925bdd066439201aa18855a305050a1c59a0b9bccde34 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Mon, 26 Feb 2018 10:01:28 +0000 Subject: [PATCH 5/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=14 --- 0000-add-python3-compat.patch | 133 +++++++++++++++++++++-------- 0001-pulse-path.patch | 10 ++- 0002-remove-preamp.patch | 2 +- 0005-window-icon.patch | 4 +- 0007-pygobject3-port.patch | 154 +++++++++++++++++----------------- 5 files changed, 184 insertions(+), 119 deletions(-) diff --git a/0000-add-python3-compat.patch b/0000-add-python3-compat.patch index d30b2d7..174fc7a 100644 --- a/0000-add-python3-compat.patch +++ b/0000-add-python3-compat.patch @@ -1,6 +1,15 @@ --- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py -@@ -21,279 +21,281 @@ presetdir1 = configdir + "/presets" +@@ -10,7 +10,7 @@ + + import pygtk + pygtk.require('2.0') +-import gtk, gobject ++import gtk as Gtk + import os + + configdir = os.getenv('HOME') + "/.pulse" +@@ -21,288 +21,290 @@ presetdir1 = configdir + "/presets" presetdir2 = "/usr/share/pulseaudio-equalizer/presets" def GetSettings(): @@ -525,12 +534,28 @@ - global preset + global preset global presets - dialog = gtk.FileChooserDialog("Choose preset to remove...", +- dialog = gtk.FileChooserDialog("Choose preset to remove...", ++ dialog = Gtk.FileChooserDialog("Choose preset to remove...", None, -@@ -311,39 +313,39 @@ class Equalizer: +- gtk.FILE_CHOOSER_ACTION_OPEN, +- (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, +- gtk.STOCK_OK, gtk.RESPONSE_OK)) +- dialog.set_default_response(gtk.RESPONSE_OK) ++ Gtk.FILE_CHOOSER_ACTION_OPEN, ++ (Gtk.STOCK_CANCEL, Gtk.RESPONSE_CANCEL, ++ Gtk.STOCK_OK, Gtk.RESPONSE_OK)) ++ dialog.set_default_response(Gtk.RESPONSE_OK) + +- filter = gtk.FileFilter() ++ filter = Gtk.FileFilter() + filter.set_name("Preset files") + filter.add_pattern("*.preset") + dialog.add_filter(filter) +@@ -310,209 +312,209 @@ class Equalizer: + dialog.show() response = dialog.run() - if response == gtk.RESPONSE_OK: +- if response == gtk.RESPONSE_OK: - filename = dialog.get_filename() - path_and_name = os.path.split(filename) - name = path_and_name[1] @@ -561,6 +586,7 @@ - # Repopulate preset list into ComboBox - for i in range(len(rawpresets)): - presetsbox.append_text(rawpresets[i]) ++ if response == Gtk.RESPONSE_OK: + filename = dialog.get_filename() + path_and_name = os.path.split(filename) + name = path_and_name[1] @@ -599,25 +625,29 @@ dialog.destroy() -@@ -351,7 +353,7 @@ class Equalizer: - gtk.main_quit() + def destroy_equalizer(self, widget, data=None): +- gtk.main_quit() ++ Gtk.main_quit() def __init__(self): - GetSettings() + GetSettings() - self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) +- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) ++ self.window = Gtk.Window(Gtk.WINDOW_TOPLEVEL) self.window.set_resizable(True) -@@ -359,18 +361,18 @@ class Equalizer: + self.window.connect("destroy", self.destroy_equalizer) self.window.set_title(windowtitle + " [" + realstatus + "]") self.window.set_border_width(0) - icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") + icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") - menu = gtk.Menu() +- menu = gtk.Menu() ++ menu = Gtk.Menu() - menu_item = gtk.MenuItem('Reset to defaults') +- menu_item = gtk.MenuItem('Reset to defaults') ++ menu_item = Gtk.MenuItem("Reset to defaults") menu_item.connect("activate", self.on_resetsettings) - menu.append(menu_item) - menu_item.show() @@ -625,15 +655,34 @@ - menu_item.connect("activate", self.on_removepreset) menu.append(menu_item) - menu_item.show() +- root_menu = gtk.MenuItem("Advanced") + menu_item.show() -+ menu_item = gtk.MenuItem("Remove user preset...") ++ menu_item = Gtk.MenuItem("Remove user preset...") + menu_item.connect("activate", self.on_removepreset) + menu.append(menu_item) + menu_item.show() - root_menu = gtk.MenuItem("Advanced") ++ root_menu = Gtk.MenuItem("Advanced") root_menu.show() root_menu.set_submenu(menu) -@@ -392,67 +394,67 @@ class Equalizer: + +- vbox1 = gtk.VBox(False, 0) ++ vbox1 = Gtk.VBox(False, 0) + self.window.add(vbox1) + vbox1.show() +- menu_bar = gtk.MenuBar() ++ menu_bar = Gtk.MenuBar() + vbox1.pack_start(menu_bar, False, False, 2) + menu_bar.show() + menu_bar.append (root_menu) + +- hbox1 = gtk.HBox(False, 1) ++ hbox1 = Gtk.HBox(False, 1) + #hbox1.set_border_width(10) + vbox1.add(hbox1) + hbox1.show() + +- table = gtk.Table(3, 17, False) ++ table = Gtk.Table(3, 17, False) table.set_border_width(5) hbox1.add(table) @@ -699,19 +748,19 @@ + # Preamp widget + global preampscale + global preampscalevalue -+ preampscale = gtk.VScale() ++ preampscale = Gtk.VScale() + preampscale.set_draw_value(0) + preampscale.set_inverted(1) -+ preampscale.set_value_pos(gtk.POS_BOTTOM) ++ preampscale.set_value_pos(Gtk.POS_BOTTOM) + preampscale.set_range(0.0, 2.0) + preampscale.set_increments(1, 0.1) + preampscale.set_digits(1) + preampscale.set_size_request(35, 200) + preampscale.set_value(float(preamp)) + preampscale.connect("value-changed", self.on_preampscale) -+ label = gtk.Label() ++ label = Gtk.Label() + label.set_markup("Preamp") -+ preampscalevalue = gtk.Label() ++ preampscalevalue = Gtk.Label() + preampscalevalue.set_markup(str(preampscale.get_value()) + "x") + table.attach(label, 1, 2, 0, 1) + table.attach(preampscale, 1, 2, 1, 2) @@ -721,7 +770,7 @@ + preampscalevalue.show() + + # Separator between preamp and bands -+ separator = gtk.VSeparator() ++ separator = Gtk.VSeparator() + table.attach(separator, 2, 3, 1, 2) + separator.show() + @@ -731,11 +780,11 @@ + self.labels = {} + self.scalevalues = {} + for x in range(1,num_ladspa_controls+1): -+ scale = gtk.VScale() ++ scale = Gtk.VScale() + self.scales[x] = scale + scale.set_draw_value(0) + scale.set_inverted(1) -+ scale.set_value_pos(gtk.POS_BOTTOM) ++ scale.set_value_pos(Gtk.POS_BOTTOM) + scale.set_range(float(ranges[0]), float(ranges[1])) + scale.set_increments(1, 0.1) + scale.set_digits(1) @@ -743,10 +792,10 @@ + scale.set_value(float(ladspa_controls[x - 1])) + scale.connect("value-changed", self.on_scale, x) + FormatLabels(x) -+ label = gtk.Label() ++ label = Gtk.Label() + self.labels[x] = label + label.set_markup("" + whitespace1 + c + "\n" + whitespace2 + suffix + "") -+ scalevalue = gtk.Label() ++ scalevalue = Gtk.Label() + self.scalevalues[x] = scalevalue + scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") + table.attach(label, x + 2, x + 3, 0, 1) @@ -759,12 +808,13 @@ - table.show() + table.show() - vbox2 = gtk.VBox(True, 1) +- vbox2 = gtk.VBox(True, 1) ++ vbox2 = Gtk.VBox(True, 1) vbox2.set_border_width(10) -@@ -460,54 +462,54 @@ class Equalizer: + hbox1.add(vbox2) vbox2.show() - presetslabel = gtk.Label() +- presetslabel = gtk.Label() - presetslabel.set_markup("Preset:") - vbox2.pack_start(presetslabel, False, False, 0) - presetslabel.show() @@ -775,12 +825,13 @@ - presetsbox.get_child().set_text(preset) - for i in range(len(rawpresets)): - presetsbox.append_text(rawpresets[i]) ++ presetslabel = Gtk.Label() + presetslabel.set_markup("Preset:") + vbox2.pack_start(presetslabel, False, False, 0) + presetslabel.show() + + global presetsbox -+ presetsbox = gtk.combo_box_entry_new_text() ++ presetsbox = Gtk.combo_box_entry_new_text() + vbox2.pack_start(presetsbox, False, False, 0) + presetsbox.get_child().set_text(preset) + for i in range(len(rawpresets)): @@ -791,17 +842,19 @@ - savepreset = gtk.Button('Save Preset') - vbox2.pack_start(savepreset, False, False, 0) -+ savepreset = gtk.Button("Save Preset") ++ savepreset = Gtk.Button("Save Preset") + vbox2.pack_start(savepreset, False, False, 0) savepreset.connect("clicked", self.on_savepreset) - savepreset.show() + savepreset.show() - global eqenabled +- eqenabled = gtk.CheckButton("EQ Enabled") + global eqenabled - eqenabled = gtk.CheckButton("EQ Enabled") ++ eqenabled = Gtk.CheckButton("EQ Enabled") eqenabled.set_active(status) - eqenabled.unset_flags(gtk.CAN_FOCUS) +- eqenabled.unset_flags(gtk.CAN_FOCUS) ++ eqenabled.unset_flags(Gtk.CAN_FOCUS) eqenabled.connect("clicked", self.on_eqenabled) - vbox2.pack_start(eqenabled, False, False, 0) - eqenabled.show() @@ -809,11 +862,13 @@ + eqenabled.show() - global keepsettings -+ global keepsettings - keepsettings = gtk.CheckButton('Keep Settings') +- keepsettings = gtk.CheckButton('Keep Settings') - keepsettings.set_active(persistence) +- keepsettings.unset_flags(gtk.CAN_FOCUS) ++ global keepsettings ++ keepsettings = Gtk.CheckButton("Keep Settings") + keepsettings.set_active(persistence) - keepsettings.unset_flags(gtk.CAN_FOCUS) ++ keepsettings.unset_flags(Gtk.CAN_FOCUS) keepsettings.connect("clicked", self.on_keepsettings) - vbox2.pack_start(keepsettings, False, False, 0) - keepsettings.show() @@ -822,7 +877,7 @@ - applysettings = gtk.Button('Apply Settings') - vbox2.pack_start(applysettings, False, False, 0) -+ applysettings = gtk.Button("Apply Settings") ++ applysettings = Gtk.Button("Apply Settings") + vbox2.pack_start(applysettings, False, False, 0) applysettings.connect("clicked", self.on_applysettings) - applysettings.show() @@ -837,15 +892,21 @@ - vbox2.pack_start(separator, False, False, 0) - separator.set_size_request(100, 10) - #separator.show() -+ quitbutton = gtk.Button("Quit") ++ quitbutton = Gtk.Button("Quit") + vbox2.pack_start(quitbutton, False, False, 0) -+ quitbutton.connect("clicked", lambda w: gtk.main_quit()) ++ quitbutton.connect("clicked", lambda w: Gtk.main_quit()) + quitbutton.show() + -+ separator = gtk.HSeparator() ++ separator = Gtk.HSeparator() + vbox2.pack_start(separator, False, False, 0) + separator.set_size_request(100, 10) + #separator.show() self.window.show() + def main(): +- gtk.main() ++ Gtk.main() + return 0 + + if __name__ == "__main__": diff --git a/0001-pulse-path.patch b/0001-pulse-path.patch index 748ccc2..beb2fdd 100644 --- a/0001-pulse-path.patch +++ b/0001-pulse-path.patch @@ -163,12 +163,16 @@ echo "Equalizer control: [$PA_LADSPA_CONTROLS]" --- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py -@@ -13,7 +13,7 @@ pygtk.require('2.0') - import gtk, gobject +@@ -10,10 +10,10 @@ + + import pygtk + pygtk.require('2.0') +-import gtk as Gtk ++import glib as GLib, gtk as Gtk import os -configdir = os.getenv('HOME') + "/.pulse" -+configdir = glib.get_user_config_dir() + "/pulse" ++configdir = GLib.get_user_config_dir() + "/pulse" eqconfig = configdir + "/equalizerrc" eqconfig2 = configdir + "/equalizerrc.test" eqpresets = eqconfig + ".availablepresets" diff --git a/0002-remove-preamp.patch b/0002-remove-preamp.patch index af1e79d..fe64641 100644 --- a/0002-remove-preamp.patch +++ b/0002-remove-preamp.patch @@ -32,7 +32,7 @@ + #preampscalevalue.show() # Separator between preamp and bands - separator = gtk.VSeparator() + separator = Gtk.VSeparator() table.attach(separator, 2, 3, 1, 2) - separator.show() + #separator.show() diff --git a/0005-window-icon.patch b/0005-window-icon.patch index 037dd88..4721827 100644 --- a/0005-window-icon.patch +++ b/0005-window-icon.patch @@ -6,7 +6,7 @@ self.window.set_border_width(0) - icon = self.window.set_icon_from_file("/usr/share/icons/hicolor/scalable/apps/multimedia-volume-control.svg") + -+ icon_theme = gtk.icon_theme_get_default() ++ icon_theme = Gtk.icon_theme_get_default() + if icon_theme.has_icon("multimedia-volume-control"): + icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) + self.window.set_icon(icon) @@ -19,5 +19,5 @@ + else: + print("No icon found, window will be iconless") - menu = gtk.Menu() + menu = Gtk.Menu() diff --git a/0007-pygobject3-port.patch b/0007-pygobject3-port.patch index 19259ca..39c205b 100644 --- a/0007-pygobject3-port.patch +++ b/0007-pygobject3-port.patch @@ -6,46 +6,46 @@ -import pygtk -pygtk.require('2.0') --import gtk, gobject +-import glib as GLib, gtk as Gtk +import gi +gi.require_version("Gtk", "3.0") -+from gi.repository import GLib as glib, Gtk as gtk ++from gi.repository import GLib, Gtk import os -+GTK_VERSION = (gtk.MAJOR_VERSION, gtk.MINOR_VERSION, gtk.MICRO_VERSION) ++GTK_VERSION = (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION, Gtk.MICRO_VERSION) + - configdir = glib.get_user_config_dir() + "/pulse" + configdir = GLib.get_user_config_dir() + "/pulse" eqconfig = configdir + "/equalizerrc" eqconfig2 = configdir + "/equalizerrc.test" @@ -300,12 +302,16 @@ class Equalizer: def on_removepreset(self,widget): global preset global presets -- dialog = gtk.FileChooserDialog("Choose preset to remove...", +- dialog = Gtk.FileChooserDialog("Choose preset to remove...", - None, -- gtk.FILE_CHOOSER_ACTION_OPEN, -- (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, -- gtk.STOCK_OK, gtk.RESPONSE_OK)) -- dialog.set_default_response(gtk.RESPONSE_OK) -+ dialog = gtk.FileChooserDialog(title="Choose preset to remove...", +- Gtk.FILE_CHOOSER_ACTION_OPEN, +- (Gtk.STOCK_CANCEL, Gtk.RESPONSE_CANCEL, +- Gtk.STOCK_OK, Gtk.RESPONSE_OK)) +- dialog.set_default_response(Gtk.RESPONSE_OK) ++ dialog = Gtk.FileChooserDialog(title="Choose preset to remove...", + transient_for=widget.get_toplevel(), -+ action=gtk.FileChooserAction.OPEN) ++ action=Gtk.FileChooserAction.OPEN) + -+ button = dialog.add_button("_Cancel", gtk.ResponseType.CANCEL) -+ button.set_image(gtk.Image.new_from_icon_name("gtk-cancel", gtk.IconSize.BUTTON)) -+ button = dialog.add_button("_Open", gtk.ResponseType.OK) -+ button.set_image(gtk.Image.new_from_icon_name("document-open", gtk.IconSize.BUTTON)) ++ button = dialog.add_button("_Cancel", Gtk.ResponseType.CANCEL) ++ button.set_image(Gtk.Image.new_from_icon_name("gtk-cancel", Gtk.IconSize.BUTTON)) ++ button = dialog.add_button("_Open", Gtk.ResponseType.OK) ++ button.set_image(Gtk.Image.new_from_icon_name("document-open", Gtk.IconSize.BUTTON)) + button.grab_default() -+ dialog.set_default_response(gtk.ResponseType.OK) ++ dialog.set_default_response(Gtk.ResponseType.OK) - filter = gtk.FileFilter() + filter = Gtk.FileFilter() filter.set_name("Preset files") @@ -315,7 +321,7 @@ class Equalizer: dialog.show() response = dialog.run() -- if response == gtk.RESPONSE_OK: -+ if response == gtk.ResponseType.OK: +- if response == Gtk.RESPONSE_OK: ++ if response == Gtk.ResponseType.OK: filename = dialog.get_filename() path_and_name = os.path.split(filename) name = path_and_name[1] @@ -53,46 +53,46 @@ def __init__(self): GetSettings() -- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) -+ self.window = gtk.Window() +- self.window = Gtk.Window(Gtk.WINDOW_TOPLEVEL) ++ self.window = Gtk.Window() self.window.set_resizable(True) self.window.connect("destroy", self.destroy_equalizer) self.window.set_title(windowtitle + " [" + realstatus + "]") - self.window.set_border_width(0) -- icon_theme = gtk.icon_theme_get_default() -+ icon_theme = gtk.IconTheme.get_default() +- icon_theme = Gtk.icon_theme_get_default() ++ icon_theme = Gtk.IconTheme.get_default() if icon_theme.has_icon("multimedia-volume-control"): icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) self.window.set_icon(icon) @@ -380,42 +385,59 @@ class Equalizer: - menu = gtk.Menu() + menu = Gtk.Menu() -- menu_item = gtk.MenuItem('Reset to defaults') -+ menu_item = gtk.MenuItem(label="Reset to defaults") +- menu_item = Gtk.MenuItem("Reset to defaults") ++ menu_item = Gtk.MenuItem(label="Reset to defaults") menu_item.connect("activate", self.on_resetsettings) menu.append(menu_item) menu_item.show() -- menu_item = gtk.MenuItem("Remove user preset...") -+ menu_item = gtk.MenuItem(label="Remove user preset...") +- menu_item = Gtk.MenuItem("Remove user preset...") ++ menu_item = Gtk.MenuItem(label="Remove user preset...") menu_item.connect("activate", self.on_removepreset) menu.append(menu_item) menu_item.show() -- root_menu = gtk.MenuItem("Advanced") -+ root_menu = gtk.MenuItem(label="Advanced") +- root_menu = Gtk.MenuItem("Advanced") ++ root_menu = Gtk.MenuItem(label="Advanced") root_menu.show() root_menu.set_submenu(menu) -- vbox1 = gtk.VBox(False, 0) +- vbox1 = Gtk.VBox(False, 0) + if GTK_VERSION >= (3, 0, 0): -+ vbox1 = gtk.Box(orientation=gtk.Orientation.VERTICAL) ++ vbox1 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) + else: -+ vbox1 = gtk.VBox() ++ vbox1 = Gtk.VBox() self.window.add(vbox1) vbox1.show() - menu_bar = gtk.MenuBar() + menu_bar = Gtk.MenuBar() - vbox1.pack_start(menu_bar, False, False, 2) + if GTK_VERSION >= (3, 0, 0): + menu_bar.set_margin_bottom(4) @@ -103,45 +103,45 @@ - 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): -+ hbox1 = gtk.Box(orientation=gtk.Orientation.HORIZONTAL, spacing=1) ++ hbox1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=1) + else: -+ hbox1 = gtk.HBox(spacing=1) ++ hbox1 = Gtk.HBox(spacing=1) + #hbox1.props.margin = 10 vbox1.add(hbox1) hbox1.show() -- table = gtk.Table(3, 17, False) +- table = Gtk.Table(3, 17, False) - table.set_border_width(5) - hbox1.add(table) + if GTK_VERSION >= (3, 10, 0): -+ grid = gtk.Grid() ++ grid = Gtk.Grid() + grid.props.margin = 5 + else: -+ grid = gtk.Table(n_rows=3, n_columns=17) ++ grid = Gtk.Table(n_rows=3, n_columns=17) + grid.set_border_width(5) + hbox1.add(grid) # Preamp widget global preampscale global preampscalevalue -- preampscale = gtk.VScale() +- preampscale = Gtk.VScale() + if GTK_VERSION >= (3, 2, 0): -+ preampscale = gtk.Scale(orientation=gtk.Orientation.VERTICAL) ++ preampscale = Gtk.Scale(orientation=Gtk.Orientation.VERTICAL) + else: -+ preampscale = gtk.VScale() ++ preampscale = Gtk.VScale() preampscale.set_draw_value(0) preampscale.set_inverted(1) -- preampscale.set_value_pos(gtk.POS_BOTTOM) -+ preampscale.set_value_pos(gtk.PositionType.BOTTOM) +- preampscale.set_value_pos(Gtk.POS_BOTTOM) ++ preampscale.set_value_pos(Gtk.PositionType.BOTTOM) preampscale.set_range(0.0, 2.0) preampscale.set_increments(1, 0.1) preampscale.set_digits(1) @@ -426,16 +448,25 @@ class Equalizer: label.set_markup("Preamp") - preampscalevalue = gtk.Label() + preampscalevalue = Gtk.Label() preampscalevalue.set_markup(str(preampscale.get_value()) + "x") - table.attach(label, 1, 2, 0, 1) - table.attach(preampscale, 1, 2, 1, 2) @@ -159,13 +159,13 @@ #preampscalevalue.show() # Separator between preamp and bands -- separator = gtk.VSeparator() +- separator = Gtk.VSeparator() - table.attach(separator, 2, 3, 1, 2) + if GTK_VERSION >= (3, 10, 0): -+ separator = gtk.Separator(orientation=gtk.Orientation.VERTICAL) ++ separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL) + grid.attach(separator, 2, 1, 1, 1) + else: -+ separator = gtk.VSeparator() ++ separator = Gtk.VSeparator() + grid.attach(separator, 2, 3, 1, 2) #separator.show() @@ -174,21 +174,21 @@ self.labels = {} self.scalevalues = {} for x in range(1,num_ladspa_controls+1): -- scale = gtk.VScale() +- scale = Gtk.VScale() + if GTK_VERSION >= (3, 2, 0): -+ scale = gtk.Scale(orientation=gtk.Orientation.VERTICAL) ++ scale = Gtk.Scale(orientation=Gtk.Orientation.VERTICAL) + else: -+ scale = gtk.VScale() ++ scale = Gtk.VScale() self.scales[x] = scale scale.set_draw_value(0) scale.set_inverted(1) -- scale.set_value_pos(gtk.POS_BOTTOM) -+ scale.set_value_pos(gtk.PositionType.BOTTOM) +- scale.set_value_pos(Gtk.POS_BOTTOM) ++ scale.set_value_pos(Gtk.PositionType.BOTTOM) scale.set_range(float(ranges[0]), float(ranges[1])) scale.set_increments(1, 0.1) scale.set_digits(1) @@ -462,67 +496,79 @@ class Equalizer: - scalevalue = gtk.Label() + scalevalue = Gtk.Label() self.scalevalues[x] = scalevalue scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") - table.attach(label, x + 2, x + 3, 0, 1) @@ -209,27 +209,27 @@ - table.show() + grid.show() -- vbox2 = gtk.VBox(True, 1) +- vbox2 = Gtk.VBox(True, 1) - vbox2.set_border_width(10) + 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: -+ vbox2 = gtk.VBox(homogeneous=True, spacing=1) ++ vbox2 = Gtk.VBox(homogeneous=True, spacing=1) + vbox2.set_border_width(10) hbox1.add(vbox2) vbox2.show() - presetslabel = gtk.Label() + presetslabel = Gtk.Label() presetslabel.set_markup("Preset:") - vbox2.pack_start(presetslabel, False, False, 0) + vbox2.add(presetslabel) presetslabel.show() 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.add(presetsbox) presetsbox.get_child().set_text(preset) for i in range(len(rawpresets)): @@ -237,18 +237,18 @@ presetsbox.connect("changed", self.on_presetsbox, x) 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.add(savepreset) savepreset.connect("clicked", self.on_savepreset) savepreset.show() global eqenabled -- eqenabled = gtk.CheckButton("EQ Enabled") -+ eqenabled = gtk.CheckButton(label="EQ Enabled") +- eqenabled = Gtk.CheckButton("EQ Enabled") ++ eqenabled = Gtk.CheckButton(label="EQ Enabled") eqenabled.set_active(status) -- eqenabled.unset_flags(gtk.CAN_FOCUS) +- eqenabled.unset_flags(Gtk.CAN_FOCUS) + eqenabled.set_can_focus(False) eqenabled.connect("clicked", self.on_eqenabled) - vbox2.pack_start(eqenabled, False, False, 0) @@ -256,36 +256,36 @@ eqenabled.show() global keepsettings -- keepsettings = gtk.CheckButton('Keep Settings') -+ keepsettings = gtk.CheckButton(label="Keep Settings") +- keepsettings = Gtk.CheckButton("Keep Settings") ++ keepsettings = Gtk.CheckButton(label="Keep Settings") keepsettings.set_active(persistence) -- keepsettings.unset_flags(gtk.CAN_FOCUS) +- keepsettings.unset_flags(Gtk.CAN_FOCUS) + keepsettings.set_can_focus(False) keepsettings.connect("clicked", self.on_keepsettings) - vbox2.pack_start(keepsettings, False, False, 0) + vbox2.add(keepsettings) 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.add(applysettings) applysettings.connect("clicked", self.on_applysettings) 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.add(quitbutton) - quitbutton.connect("clicked", lambda w: gtk.main_quit()) + quitbutton.connect("clicked", lambda w: Gtk.main_quit()) quitbutton.show() -- separator = gtk.HSeparator() +- separator = Gtk.HSeparator() - vbox2.pack_start(separator, False, False, 0) + if GTK_VERSION >= (3, 2, 0): -+ separator = gtk.Separator(orientation=gtk.Orientation.HORIZONTAL) ++ separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL) + else: -+ separator = gtk.HSeparator() ++ separator = Gtk.HSeparator() + vbox2.add(separator) separator.set_size_request(100, 10) #separator.show() From 54a32061db9b1f2ac8d952b34d768cac66a08f9666e58e5625a67fe86a2ee803 Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Mon, 26 Feb 2018 11:56:28 +0000 Subject: [PATCH 6/6] OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/pulseaudio-equalizer?expand=0&rev=15 --- 0001-pulse-path.patch | 78 +++++++++++----------- 0002-remove-preamp.patch | 10 +-- 0003-force-default-persistence-value.patch | 4 +- 0005-window-icon.patch | 13 ++-- 0007-pygobject3-port.patch | 32 +++++---- 0008-fix-locale-issues.patch | 2 +- pulseaudio-equalizer.changes | 6 +- 7 files changed, 74 insertions(+), 71 deletions(-) diff --git a/0001-pulse-path.patch b/0001-pulse-path.patch index beb2fdd..2cbcb4c 100644 --- a/0001-pulse-path.patch +++ b/0001-pulse-path.patch @@ -6,17 +6,17 @@ -PRESET_DIR1=$HOME/.pulse/presets +if [ -z "$XDG_CONFIG_HOME" ]; then -+ PULSE_DIR="$HOME/.config/pulse" ++ CONFIG_DIR="$HOME/.config/pulse" +else -+ PULSE_DIR="$XDG_CONFIG_HOME/pulse" ++ CONFIG_DIR="$XDG_CONFIG_HOME/pulse" +fi -+PRESET_DIR1="$PULSE_DIR/presets" ++PRESET_DIR1="$CONFIG_DIR/presets" PRESET_DIR2=/usr/share/pulseaudio-equalizer/presets SCRIPT_NAME=pulseaudio-equalizer SCRIPT_VERSION="2.7 (05/02/2010)" -CONFIG_NAME=$HOME/.pulse/equalizerrc -LOG_NAME=$HOME/Desktop/pulseaudio-equalizer.log -+CONFIG_NAME="$PULSE_DIR/equalizerrc" ++CONFIG_NAME="$CONFIG_DIR/equalizerrc" +LOG_NAME="$HOME/pulseaudio-equalizer.log" # Don't execute the script with elevated privileges @@ -29,8 +29,8 @@ - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - PA_EQUALIZER_PERSISTENCE=1 - fi -+if [ -f "$PULSE_DIR/default.pa" ]; then -+ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++if [ -f "$CONFIG_DIR/default.pa" ]; then ++ if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then + PA_EQUALIZER_PERSISTENCE=1 + fi else @@ -45,8 +45,8 @@ - if [ -f $HOME/.pulse/default.pa ]; then - tail -n7 $HOME/.pulse/default.pa -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ tail -n7 "$PULSE_DIR/default.pa" ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ tail -n7 "$CONFIG_DIR/default.pa" fi echo "---" @@ -58,10 +58,10 @@ - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - echo "Equalizer definition detected in file '$HOME/.pulse/default.pa', deleting..." - rm $HOME/.pulse/default.pa -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ echo "Equalizer definition detected in file '$PULSE_DIR/default.pa', deleting..." -+ rm "$PULSE_DIR/default.pa" ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ echo "Equalizer definition detected in file '$CONFIG_DIR/default.pa', deleting..." ++ rm "$CONFIG_DIR/default.pa" fi fi @@ -70,19 +70,19 @@ - echo "Found '$HOME/.pulse/default.pa', making a copy..." - cp $HOME/.pulse/default.pa $HOME/.pulse/default.pa.noeq - CFG_SOURCE_FILE="$HOME/.pulse/default.pa.noeq" -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ echo "Found '$PULSE_DIR/default.pa', making a copy..." -+ cp "$PULSE_DIR/default.pa" "$PULSE_DIR/default.pa.noeq" -+ CFG_SOURCE_FILE="$PULSE_DIR/default.pa.noeq" ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ echo "Found '$CONFIG_DIR/default.pa', making a copy..." ++ cp "$CONFIG_DIR/default.pa" "$CONFIG_DIR/default.pa.noeq" ++ CFG_SOURCE_FILE="$CONFIG_DIR/default.pa.noeq" fi # Decide which file to use as the configuration source - if [ -f $HOME/.pulse/default.pa.noeq ]; then - echo "Found '$HOME/.pulse/default.pa.noeq'..." - CFG_SOURCE_FILE="$HOME/.pulse/default.pa.noeq" -+ if [ -f "$PULSE_DIR/default.pa.noeq" ]; then -+ echo "Found '$PULSE_DIR/default.pa.noeq'..." -+ CFG_SOURCE_FILE="$PULSE_DIR/default.pa.noeq" ++ if [ -f "$CONFIG_DIR/default.pa.noeq" ]; then ++ echo "Found '$CONFIG_DIR/default.pa.noeq'..." ++ CFG_SOURCE_FILE="$CONFIG_DIR/default.pa.noeq" else CFG_SOURCE_FILE="/etc/pulse/default.pa" fi @@ -91,27 +91,27 @@ # Modify module-stream-restore line to disable cached sinks - cat $CFG_SOURCE_FILE | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >$HOME/.pulse/default.pa -+ cat "$CFG_SOURCE_FILE" | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >"$PULSE_DIR/default.pa" ++ cat "$CFG_SOURCE_FILE" | sed 's/load-module module-stream-restore/load-module module-stream-restore restore_device=false/g' >"$CONFIG_DIR/default.pa" # Add module-ladspa-sink definition - echo "" >>$HOME/.pulse/default.pa - echo "### BEGIN: Equalized audio configuration" >>$HOME/.pulse/default.pa - echo "### Generated from: $SCRIPT_NAME" >>$HOME/.pulse/default.pa - echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>$HOME/.pulse/default.pa -+ echo "" >>"$PULSE_DIR/default.pa" -+ echo "### BEGIN: Equalized audio configuration" >>"$PULSE_DIR/default.pa" -+ echo "### Generated from: $SCRIPT_NAME" >>"$PULSE_DIR/default.pa" -+ echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>"$PULSE_DIR/default.pa" ++ echo "" >>"$CONFIG_DIR/default.pa" ++ echo "### BEGIN: Equalized audio configuration" >>"$CONFIG_DIR/default.pa" ++ echo "### Generated from: $SCRIPT_NAME" >>"$CONFIG_DIR/default.pa" ++ echo "load-module module-ladspa-sink sink_name=$PA_LADSPA_SINK master=$PA_MASTER_SINK plugin=$PA_LADSPA_PLUGIN label=$PA_LADSPA_LABEL control=$PA_LADSPA_CONTROLS" >>"$CONFIG_DIR/default.pa" # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume - echo "set-default-sink $PA_LADSPA_SINK" >>$HOME/.pulse/default.pa - echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>$HOME/.pulse/default.pa - echo "set-sink-mute $PA_MASTER_SINK 0" >>$HOME/.pulse/default.pa - echo "### END: Equalized audio configuration" >>$HOME/.pulse/default.pa -+ echo "set-default-sink $PA_LADSPA_SINK" >>"$PULSE_DIR/default.pa" -+ echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" -+ echo "set-sink-mute $PA_MASTER_SINK 0" >>"$PULSE_DIR/default.pa" -+ echo "### END: Equalized audio configuration" >>"$PULSE_DIR/default.pa" ++ echo "set-default-sink $PA_LADSPA_SINK" >>"$CONFIG_DIR/default.pa" ++ echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$CONFIG_DIR/default.pa" ++ echo "set-sink-mute $PA_MASTER_SINK 0" >>"$CONFIG_DIR/default.pa" ++ echo "### END: Equalized audio configuration" >>"$CONFIG_DIR/default.pa" echo "Equalizer setting saved (enable-config)." echo "-------------------------------------" @@ -122,9 +122,9 @@ - if [ -f $HOME/.pulse/default.pa.noeq ]; then - echo "Found '$HOME/.pulse/default.pa.noeq', moving..." - mv $HOME/.pulse/default.pa.noeq $HOME/.pulse/default.pa -+ if [ -f "$PULSE_DIR/default.pa.noeq" ]; then -+ echo "Found '$PULSE_DIR/default.pa.noeq', moving..." -+ mv "$PULSE_DIR/default.pa.noeq" "$PULSE_DIR/default.pa" ++ if [ -f "$CONFIG_DIR/default.pa.noeq" ]; then ++ echo "Found '$CONFIG_DIR/default.pa.noeq', moving..." ++ mv "$CONFIG_DIR/default.pa.noeq" "$CONFIG_DIR/default.pa" fi # If equalizer configuration is present, delete file @@ -132,10 +132,10 @@ - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then - echo "Equalizer definition detected, deleting '$HOME/.pulse/default.pa'..." - rm $HOME/.pulse/default.pa -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ echo "Equalizer definition detected, deleting '$PULSE_DIR/default.pa'..." -+ rm "$PULSE_DIR/default.pa" ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ echo "Equalizer definition detected, deleting '$CONFIG_DIR/default.pa'..." ++ rm "$CONFIG_DIR/default.pa" fi fi @@ -145,8 +145,8 @@ - if [ -f $HOME/.pulse/default.pa ]; then - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then echo "Equalizer configuration status: [enabled]" else echo "Equalizer configuration status: [disabled]" @@ -156,8 +156,8 @@ - if [ -f $HOME/.pulse/default.pa ]; then - if [ "$(cat $HOME/.pulse/default.pa | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then -+ if [ -f "$PULSE_DIR/default.pa" ]; then -+ if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then ++ if [ -f "$CONFIG_DIR/default.pa" ]; then ++ if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then echo "Equalizer configuration status: [enabled]" echo "Equalizer plugin: [$PA_LADSPA_PLUGIN/$PA_LADSPA_LABEL]" echo "Equalizer control: [$PA_LADSPA_CONTROLS]" diff --git a/0002-remove-preamp.patch b/0002-remove-preamp.patch index fe64641..7adfe06 100644 --- a/0002-remove-preamp.patch +++ b/0002-remove-preamp.patch @@ -3,11 +3,11 @@ @@ -293,7 +293,7 @@ if [ "$1" = "enable-config" ]; then # Set LADSPA sink as default sink & set appropriate master sink (preamp) volume - echo "set-default-sink $PA_LADSPA_SINK" >>"$PULSE_DIR/default.pa" -- echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" -+ #echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$PULSE_DIR/default.pa" - echo "set-sink-mute $PA_MASTER_SINK 0" >>"$PULSE_DIR/default.pa" - echo "### END: Equalized audio configuration" >>"$PULSE_DIR/default.pa" + echo "set-default-sink $PA_LADSPA_SINK" >>"$CONFIG_DIR/default.pa" +- echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$CONFIG_DIR/default.pa" ++ #echo "set-sink-volume $PA_MASTER_SINK $PA_REAL_PREAMP" >>"$CONFIG_DIR/default.pa" + echo "set-sink-mute $PA_MASTER_SINK 0" >>"$CONFIG_DIR/default.pa" + echo "### END: Equalized audio configuration" >>"$CONFIG_DIR/default.pa" @@ -383,7 +383,7 @@ if [ "$1" = "enable" ]; then diff --git a/0003-force-default-persistence-value.patch b/0003-force-default-persistence-value.patch index 3546a39..b11fb9c 100644 --- a/0003-force-default-persistence-value.patch +++ b/0003-force-default-persistence-value.patch @@ -1,8 +1,8 @@ --- a/usr/bin/pulseaudio-equalizer +++ b/usr/bin/pulseaudio-equalizer @@ -133,6 +133,8 @@ fi - if [ -f "$PULSE_DIR/default.pa" ]; then - if [ "$(cat "$PULSE_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then + if [ -f "$CONFIG_DIR/default.pa" ]; then + if [ "$(cat "$CONFIG_DIR/default.pa" | grep -m1 "### BEGIN: Equalized audio configuration")" = "### BEGIN: Equalized audio configuration" ]; then PA_EQUALIZER_PERSISTENCE=1 + else + PA_EQUALIZER_PERSISTENCE=0 diff --git a/0005-window-icon.patch b/0005-window-icon.patch index 4721827..b3357f4 100644 --- a/0005-window-icon.patch +++ b/0005-window-icon.patch @@ -1,6 +1,6 @@ --- a/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py +++ b/usr/share/pulseaudio-equalizer/pulseaudio-equalizer.py -@@ -364,7 +364,19 @@ class Equalizer: +@@ -364,7 +364,16 @@ class Equalizer: self.window.connect("destroy", self.destroy_equalizer) self.window.set_title(windowtitle + " [" + realstatus + "]") self.window.set_border_width(0) @@ -8,16 +8,13 @@ + + icon_theme = Gtk.icon_theme_get_default() + if icon_theme.has_icon("multimedia-volume-control"): -+ icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) -+ self.window.set_icon(icon) ++ self.window.set_icon_name("multimedia-volume-control") + elif icon_theme.has_icon("gnome-volume-control"): -+ icon = icon_theme.load_icon("gnome-volume-control",16,0) -+ self.window.set_icon(icon) ++ self.window.set_icon_name("gnome-volume-control") + elif icon_theme.has_icon("stock_volume"): -+ icon = icon_theme.load_icon("stock_volume",16,0) -+ self.window.set_icon(icon) ++ self.window.set_icon_name("stock_volume") + else: -+ print("No icon found, window will be iconless") ++ print("No icon found, the window will be iconless") menu = Gtk.Menu() diff --git a/0007-pygobject3-port.patch b/0007-pygobject3-port.patch index 39c205b..d8fcc72 100644 --- a/0007-pygobject3-port.patch +++ b/0007-pygobject3-port.patch @@ -64,9 +64,9 @@ - icon_theme = Gtk.icon_theme_get_default() + icon_theme = Gtk.IconTheme.get_default() if icon_theme.has_icon("multimedia-volume-control"): - icon = icon_theme.load_icon("multimedia-volume-control", 16, 0) - self.window.set_icon(icon) -@@ -380,42 +385,59 @@ class Equalizer: + self.window.set_icon_name("multimedia-volume-control") + elif icon_theme.has_icon("gnome-volume-control"): +@@ -377,42 +382,61 @@ class Equalizer: menu = Gtk.Menu() @@ -130,6 +130,8 @@ - preampscale = Gtk.VScale() + if GTK_VERSION >= (3, 2, 0): + preampscale = Gtk.Scale(orientation=Gtk.Orientation.VERTICAL) ++ preampscale.set_hexpand(True) ++ preampscale.set_vexpand(True) + else: + preampscale = Gtk.VScale() preampscale.set_draw_value(0) @@ -139,7 +141,7 @@ preampscale.set_range(0.0, 2.0) preampscale.set_increments(1, 0.1) preampscale.set_digits(1) -@@ -426,16 +448,25 @@ class Equalizer: +@@ -423,16 +447,25 @@ class Equalizer: label.set_markup("Preamp") preampscalevalue = Gtk.Label() preampscalevalue.set_markup(str(preampscale.get_value()) + "x") @@ -151,9 +153,9 @@ + grid.attach(preampscale, 1, 1, 1, 1) + grid.attach(preampscalevalue, 1, 2, 1, 1) + else: -+ grid.attach(label, 1, 2, 0, 1) -+ grid.attach(preampscale, 1, 2, 1, 2) -+ grid.attach(preampscalevalue, 1, 2, 2, 3) ++ grid.attach(label, 1, 2, 0, 1, yoptions=Gtk.AttachOptions.SHRINK) ++ grid.attach(preampscale, 1, 2, 1, 2, yoptions=(Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL)) ++ grid.attach(preampscalevalue, 1, 2, 2, 3, yoptions=Gtk.AttachOptions.SHRINK) #label.show() #preampscale.show() #preampscalevalue.show() @@ -170,13 +172,15 @@ #separator.show() # Equalizer bands -@@ -444,11 +475,14 @@ class Equalizer: +@@ -441,11 +474,16 @@ 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) ++ scale.set_hexpand(True) ++ scale.set_vexpand(True) + else: + scale = Gtk.VScale() self.scales[x] = scale @@ -187,7 +191,7 @@ scale.set_range(float(ranges[0]), float(ranges[1])) scale.set_increments(1, 0.1) scale.set_digits(1) -@@ -462,67 +496,79 @@ class Equalizer: +@@ -459,67 +497,80 @@ class Equalizer: scalevalue = Gtk.Label() self.scalevalues[x] = scalevalue scalevalue.set_markup("" + str(scale.get_value()) + "\ndB") @@ -199,9 +203,9 @@ + grid.attach(scale, x + 2, 1, 1, 1) + grid.attach(scalevalue, x + 2, 2, 1, 1) + else: -+ grid.attach(label, x + 2, x + 3, 0, 1) -+ grid.attach(scale, x + 2, x + 3, 1, 2) -+ grid.attach(scalevalue, x + 2, x + 3, 2, 3) ++ grid.attach(label, x + 2, x + 3, 0, 1, yoptions=Gtk.AttachOptions.SHRINK) ++ grid.attach(scale, x + 2, x + 3, 1, 2, yoptions=(Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL)) ++ grid.attach(scalevalue, x + 2, x + 3, 2, 3, yoptions=Gtk.AttachOptions.SHRINK) label.show() scale.show() scalevalue.show() @@ -211,13 +215,15 @@ - vbox2 = Gtk.VBox(True, 1) - vbox2.set_border_width(10) +- hbox1.add(vbox2) + if GTK_VERSION >= (3, 0, 0): + vbox2 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, homogeneous=True, spacing=1) + vbox2.props.margin = 10 ++ hbox1.add(vbox2) + else: + vbox2 = Gtk.VBox(homogeneous=True, spacing=1) + vbox2.set_border_width(10) - hbox1.add(vbox2) ++ hbox1.pack_start(vbox2, False, True, 0) vbox2.show() presetslabel = Gtk.Label() diff --git a/0008-fix-locale-issues.patch b/0008-fix-locale-issues.patch index eefb7fa..192db5e 100644 --- a/0008-fix-locale-issues.patch +++ b/0008-fix-locale-issues.patch @@ -6,7 +6,7 @@ +LC_MESSAGES=C if [ -z "$XDG_CONFIG_HOME" ]; then - PULSE_DIR="$HOME/.config/pulse" + CONFIG_DIR="$HOME/.config/pulse" else @@ -113,20 +114,20 @@ fi diff --git a/pulseaudio-equalizer.changes b/pulseaudio-equalizer.changes index 3cb4c39..56e43cd 100644 --- a/pulseaudio-equalizer.changes +++ b/pulseaudio-equalizer.changes @@ -2,13 +2,13 @@ Sun Feb 25 18:16:05 UTC 2018 - sor.alexei@meowr.ru - Add 0000-add-python3-compat.patch: Add Python3 compatibility. -- Rebase and improve 0001-pulse-path.patch. +- Rebase and improve 0001-pulse-path.patch, 0005-window-icon.patch. - Squash 0007-remove-all-preamp.patch into 0002-remove-preamp.patch. - Rebase 0003-force-default-persistence-value.patch, - 0004-do-not-crash-on-missing-preset.patch, 0005-window-icon.patch, + 0004-do-not-crash-on-missing-preset.patch, 0008-fix-locale-issues.patch, 0009-do-not-zero-volume.patch. - Add 0007-pygobject3-port.patch: Port to PyGObject3 and GTK+3. -- Unwrap pulseaudio-equalizer-gtk. +- Do not use a wrapper for pulseaudio-equalizer-gtk. - Switch to Python3. -------------------------------------------------------------------