Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pamixer for openSUSE:Factory checked in at 2021-11-09 23:54:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pamixer (Old) and /work/SRC/openSUSE:Factory/.pamixer.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pamixer" Tue Nov 9 23:54:46 2021 rev:3 rq:930220 version:1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/pamixer/pamixer.changes 2020-08-18 12:02:57.483422773 +0200 +++ /work/SRC/openSUSE:Factory/.pamixer.new.1890/pamixer.changes 2021-11-09 23:55:13.351971338 +0100 @@ -1,0 +2,10 @@ +Sat Nov 6 10:48:44 UTC 2021 - Ferdinand Thiessen <r...@fthiessen.de> + +- Update to 1.5: + * Add "set-limit" option, set a limit for the volume + * Fixed typos + * Fix memory leak on Pulseaudio object destruction + * Add man page +- Add fix-makefile-installation.patch + +------------------------------------------------------------------- Old: ---- pamixer-1.4.tar.gz New: ---- fix-makefile-installation.patch pamixer-1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pamixer.spec ++++++ --- /var/tmp/diff_new_pack.218PPT/_old 2021-11-09 23:55:13.843971589 +0100 +++ /var/tmp/diff_new_pack.218PPT/_new 2021-11-09 23:55:13.843971589 +0100 @@ -1,7 +1,7 @@ # # spec file for package pamixer # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # Copyright (c) 2017 Dakota Williams <rainefor...@raineforest.me> # # All modifications and additions to the file contributed by third parties @@ -18,13 +18,15 @@ Name: pamixer -Version: 1.4 +Version: 1.5 Release: 0 Summary: PulseAudio commandline mixer License: GPL-3.0-or-later Group: Productivity/Multimedia/Sound/Mixers URL: https://github.com/cdemoulins/pamixer -Source0: https://github.com/cdemoulins/pamixer/archive/%{version}/%{name}-%{version}.tar.gz +Source: https://github.com/cdemoulins/pamixer/archive/%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-OPENSUSE fix-makefile-installation.patch -- Fix mandir and CXX flags +Patch: fix-makefile-installation.patch BuildRequires: gcc-c++ BuildRequires: libboost_program_options-devel BuildRequires: pkgconfig @@ -36,18 +38,19 @@ %prep %setup -q +%patch -p1 %build export CXXFLAGS="%{optflags}" %make_build %install -mkdir -p %{buildroot}%{_bindir} -%make_install PREFIX=%{buildroot}%{_prefix} +%make_install PREFIX=%{_prefix} MANDIR=%{_mandir} %files %doc README.rst %license COPYING %{_bindir}/pamixer +%{_mandir}/man1/pamixer.1%{?ext_man} %changelog ++++++ fix-makefile-installation.patch ++++++ diff -Nur pamixer-1.5/Makefile new/Makefile --- pamixer-1.5/Makefile 2021-10-04 10:09:29.000000000 +0200 +++ new/Makefile 2021-11-06 12:32:09.179999619 +0100 @@ -1,6 +1,8 @@ LDLIBS ?= -lpulse -lboost_program_options -CXXFLAGS ?= -std=c++11 -Wall -Werror -Wextra -pedantic -DVERSION=\"1.5\" +CXXFLAGS ?= -Wall -Werror -Wextra -pedantic +CXXFLAGS += -std=c++11 -DVERSION=\"1.5\" PREFIX ?= /usr/local +MANDIR ?= $(PREFIX)/man RM ?= rm -f target := pamixer @@ -28,6 +30,6 @@ install: pamixer install -d $(DESTDIR)$(PREFIX)/bin/ install $(target) $(DESTDIR)$(PREFIX)/bin/ - install -d $(DESTDIR)$(PREFIX)/man/man1/ - install $(manpage) $(DESTDIR)$(PREFIX)/man/man1/ - gzip $(DESTDIR)$(PREFIX)/man/man1/$(manpage) + install -d $(DESTDIR)$(MANDIR)/man1/ + install -m 644 $(manpage) $(DESTDIR)$(MANDIR)/man1/ + gzip $(DESTDIR)$(MANDIR)/man1/$(manpage) ++++++ pamixer-1.4.tar.gz -> pamixer-1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pamixer-1.4/Makefile new/pamixer-1.5/Makefile --- old/pamixer-1.4/Makefile 2019-02-13 14:55:29.000000000 +0100 +++ new/pamixer-1.5/Makefile 2021-10-04 10:09:29.000000000 +0200 @@ -1,9 +1,10 @@ LDLIBS ?= -lpulse -lboost_program_options -CXXFLAGS ?= -std=c++11 -Wall -Werror -Wextra -pedantic +CXXFLAGS ?= -std=c++11 -Wall -Werror -Wextra -pedantic -DVERSION=\"1.5\" PREFIX ?= /usr/local RM ?= rm -f target := pamixer +manpage := pamixer.1 main := $(addsuffix .cc,$(target)) objects := $(addsuffix .o,callbacks device pulseaudio) @@ -25,4 +26,8 @@ $(RM) $(target) install: pamixer - install $(target) $(PREFIX)/bin/ + install -d $(DESTDIR)$(PREFIX)/bin/ + install $(target) $(DESTDIR)$(PREFIX)/bin/ + install -d $(DESTDIR)$(PREFIX)/man/man1/ + install $(manpage) $(DESTDIR)$(PREFIX)/man/man1/ + gzip $(DESTDIR)$(PREFIX)/man/man1/$(manpage) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pamixer-1.4/README.rst new/pamixer-1.5/README.rst --- old/pamixer-1.4/README.rst 2019-02-13 14:55:29.000000000 +0100 +++ new/pamixer-1.5/README.rst 2021-10-04 10:09:29.000000000 +0200 @@ -23,6 +23,8 @@ * libpulse * boost-program_options +You need the headers as well (???-dev??? packages for Debian). + Installation ------------ @@ -42,6 +44,7 @@ Allowed options: -h [ --help ] help message + -v [ --version ] print version info --sink arg choose a different sink than the default --source arg choose a different source than the default --default-source select the default source @@ -53,6 +56,7 @@ -t [ --toggle-mute ] switch between mute and unmute -m [ --mute ] set mute --allow-boost allow volume to go above 100% + --set-limit arg set a limit for the volume --gamma arg (=1) increase/decrease using gamma correction e.g. 2.2 -u [ --unmute ] unset mute --get-mute display true if the volume is mute, false otherwise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pamixer-1.4/pamixer.1 new/pamixer-1.5/pamixer.1 --- old/pamixer-1.4/pamixer.1 1970-01-01 01:00:00.000000000 +0100 +++ new/pamixer-1.5/pamixer.1 2021-10-04 10:09:29.000000000 +0200 @@ -0,0 +1,115 @@ +.TH pamixer 1 + +.SH NAME +pamixer \- Pulseaudio command line mixer + +.SH SYNOPSIS +.B pamixer +[OPTIONS] + +.SH DESCRIPTION +.B pamixer +controls the volume levels of Pulseaudio sinks. + +.SH OPTIONS +.TP +.B "\-h, \-\-help" +.br +Show help message. + +.TP +.BI \-\-sink " INDEX" +.br +Choose a different sink than the default. + +.TP +.BI \-\-source " INDEX" +.br +Choose a different source than the default. + +.TP +.B \-\-default-source +.br +Select the default source. + +.TP +.B \-\-get-volume +.br +Get the current volume. + +.TP +.B \-\-get-volume-human +.br +Get the current volume percentage or the string "muted". + +.TP +.BI \-\-set-volume " PERCENTAGE" +.br +Set the volume. + +.TP +.BI "\-i, \-\-increase" " PERCENTAGE" +.br +Increase the volume. + +.TP +.BI "\-d, \-\-decrease" " PERCENTAGE" +.br +Decrease the volume. + +.TP +.B "\-t, \-\-toggle-mute" +.br +Switch between mute and unmute. + +.TP +.BI "\-m, \-\-mute" +.hr +Set mute. + +.TP +.BI \-\-allow-boost +.br +Allow volume to go above 100%. + +.TP +.BI \-\-gamma " AMOUNT" +.br +Increase/decrease using gamma correction e.g. 2.2. + +.TP +.B "\-u, \-\-unmute" +.br +Unset mute. + +.TP +.B \-\-get-mute +.br +Display true if the volume is mute, false otherwise. + +.TP +.B \-\-list-sinks +.br +List the sinks. + +.TP +.B \-\-list-sources +.br +List the sources. + +.SH EXAMPLES +.TP +.B "pamixer -d 5" +Will decrease the volume by 5% on the default sink. + +.TP +.B "pamixer --source 2 -m" +Will mute source 2. + +.SH SEE ALSO +.BR amixer (1), +.BR alsamixer (1) + + +.SH COPYRIGHT +Copyright \(co 2011 - 2021 Cl??ment D??moulins <clem...@archivel.fr>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pamixer-1.4/pamixer.cc new/pamixer-1.5/pamixer.cc --- old/pamixer-1.4/pamixer.cc 2019-02-13 14:55:29.000000000 +0100 +++ new/pamixer-1.5/pamixer.cc 2021-10-04 10:09:29.000000000 +0200 @@ -81,12 +81,13 @@ int main(int argc, char* argv[]) { string sink_name, source_name; - int value; + int value, limit_value; double gamma; po::options_description options("Allowed options"); options.add_options() ("help,h", "help message") + ("version,v", "print version info") ("sink", po::value(&sink_name), "choose a different sink than the default") ("source", po::value(&source_name), "choose a different source than the default") ("default-source", "select the default source") @@ -98,11 +99,13 @@ ("toggle-mute,t", "switch between mute and unmute") ("mute,m", "set mute") ("allow-boost", "allow volume to go above 100%") + ("set-limit", po::value<int>(&limit_value), "set a limit for the volume") ("gamma", po::value<double>(&gamma)->default_value(1.0), "increase/decrease using gamma correction e.g. 2.2") ("unmute,u", "unset mute") ("get-mute", "display true if the volume is mute, false otherwise") ("list-sinks", "list the sinks") ("list-sources", "list the sources") + ("get-default-sink", "print the default sink") ; try @@ -116,6 +119,11 @@ return 0; } + if (vm.count("version")) { + cout << VERSION << endl; + return 0; + } + conflicting_options(vm, "set-volume", "increase"); conflicting_options(vm, "set-volume", "decrease"); conflicting_options(vm, "decrease", "increase"); @@ -127,11 +135,14 @@ conflicting_options(vm, "get-volume", "list-sinks"); conflicting_options(vm, "get-volume", "list-sources"); conflicting_options(vm, "get-volume", "get-volume-human"); + conflicting_options(vm, "get-volume", "get-default-sink"); conflicting_options(vm, "get-volume-human", "list-sinks"); conflicting_options(vm, "get-volume-human", "list-sources"); conflicting_options(vm, "get-volume-human", "get-mute"); + conflicting_options(vm, "get-volume-human", "get-default-sink"); conflicting_options(vm, "get-mute", "list-sinks"); conflicting_options(vm, "get-mute", "list-sources"); + conflicting_options(vm, "get-mute", "get-default-sink"); Pulseaudio pulse("pamixer"); Device device = get_selected_device(pulse, vm, sink_name, source_name); @@ -158,6 +169,19 @@ device = get_selected_device(pulse, vm, sink_name, source_name); } + if (vm.count("set-limit")) { + + if (limit_value < 0 ) { + limit_value = 0; + } + + pa_volume_t limit = round( (double)limit_value * (double)PA_VOLUME_NORM / 100.0); + if (device.volume_avg > limit) { + pulse.set_volume(device, limit); + device = get_selected_device(pulse, vm, sink_name, source_name); + } + } + if (vm.count("toggle-mute") || vm.count("mute") || vm.count("unmute")) { if (vm.count("toggle-mute")) { pulse.set_mute(device, !device.mute); @@ -201,6 +225,13 @@ << source.description << "\"\n"; } } + if (vm.count("get-default-sink")) { + Device sink = pulse.get_default_sink(); + cout << "Default sink:\n"; + cout << sink.index << " \"" + << sink.name << "\" \"" + << sink.description << "\"\n"; + } } return ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pamixer-1.4/pulseaudio.cc new/pamixer-1.5/pulseaudio.cc --- old/pamixer-1.4/pulseaudio.cc 2019-02-13 14:55:29.000000000 +0100 +++ new/pamixer-1.5/pulseaudio.cc 2021-10-04 10:09:29.000000000 +0200 @@ -52,8 +52,10 @@ } Pulseaudio::~Pulseaudio() { + pa_context_set_state_callback(context, NULL, NULL); if (state == CONNECTED) pa_context_disconnect(context); + pa_context_unref(context); pa_mainloop_free(mainloop); } @@ -84,7 +86,7 @@ iterate(op); pa_operation_unref(op); - if (sinks.empty()) throw "The sink doesn't exit\n"; + if (sinks.empty()) throw "The sink doesn't exist\n"; return *(sinks.begin()); } @@ -95,7 +97,7 @@ iterate(op); pa_operation_unref(op); - if (sinks.empty()) throw "The sink doesn't exit\n"; + if (sinks.empty()) throw "The sink doesn't exist\n"; return *(sinks.begin()); } @@ -106,7 +108,7 @@ iterate(op); pa_operation_unref(op); - if (sources.empty()) throw "The source doesn't exit\n"; + if (sources.empty()) throw "The source doesn't exist\n"; return *(sources.begin()); } @@ -117,7 +119,7 @@ iterate(op); pa_operation_unref(op); - if (sources.empty()) throw "The source doesn't exit\n"; + if (sources.empty()) throw "The source doesn't exist\n"; return *(sources.begin()); }