Merge lp:~osmoma/audio-recorder/trunk into lp:audio-recorder

Proposed by moma
Status: Merged
Approved by: moma
Approved revision: no longer in the source branch.
Merged at revision: 498
Proposed branch: lp:~osmoma/audio-recorder/trunk
Merge into: lp:audio-recorder
Diff against target: 1554 lines (+511/-543)
30 files modified
ChangeLog (+6/-0)
Makefile.in (+0/-1)
aclocal.m4 (+0/-25)
configure (+10/-49)
configure.ac (+1/-1)
data/Makefile.in (+0/-1)
debian/changelog (+11/-3)
icons/Makefile.in (+0/-1)
icons/hicolor/Makefile.in (+0/-1)
icons/hicolor/scalable/Makefile.in (+0/-1)
icons/hicolor/scalable/apps/Makefile.in (+0/-1)
icons/hicolor/scalable/status/Makefile.in (+0/-1)
linux-distros/arch-linux/PKGBUILD (+3/-3)
linux-distros/fedora/audio-recorder.spec (+1/-1)
pixmaps/Makefile.in (+0/-1)
po/POTFILES.in (+2/-2)
src/Makefile.am (+1/-1)
src/Makefile.in (+3/-4)
src/audio-sources.c (+1/-1)
src/dbus-mpris2.c (+24/-6)
src/gtklevelbar.c (+0/-357)
src/gtklevelbar.h (+0/-60)
src/levelbar.c (+357/-0)
src/levelbar.h (+60/-0)
src/main.c (+13/-13)
src/rec-window.h (+2/-2)
src/settings.c (+1/-1)
src/systray-icon.c (+1/-1)
src/utility.c (+13/-4)
src/utility.h (+1/-1)
To merge this branch: bzr merge lp:~osmoma/audio-recorder/trunk
Reviewer Review Type Date Requested Status
moma Approve
Review via email: mp+255223@code.launchpad.net

Commit message

dbus-mpris.c: MPRIS2 'Metdata' is not necessary if 'PlaybackStatus'=='Playing'. Missing 'Metadata' is actually an error but the recorder can survive without it.

Description of the change

Merge changes (from moma) to lp:audio-recorder.

To post a comment you must log in.
Revision history for this message
moma (osmoma) wrote :

This change should be OK.

review: Approve
lp:~osmoma/audio-recorder/trunk updated
491. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

492. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

493. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

494. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

495. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

496. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

497. By Launchpad Translations on behalf of audio-recorder

Launchpad automatic translations update.

498. By moma

Pushing my changes, revisions 471 - 477 of ~osmoma.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2015-03-17 16:24:30 +0000
+++ ChangeLog 2015-04-11 20:15:48 +0000
@@ -1,3 +1,9 @@
12015-04-11 Osmo Antero <osmoma@gmail.com>
2
3 * Version 1.6-4
4 * GTK3+ has now a standard GtkLevelBar widget. Renamed our 'GtkLevelBar' widget to 'LevelBar'.
5 * Renamed src/gtklevelbar.[ch] to src/levelbar.[ch].
6
12015-03-17 Osmo Antero <osmoma@gmail.com>72015-03-17 Osmo Antero <osmoma@gmail.com>
28
3 * Version 1.6-39 * Version 1.6-3
410
=== modified file 'Makefile.in'
--- Makefile.in 2015-02-10 20:45:27 +0000
+++ Makefile.in 2015-04-11 20:15:48 +0000
@@ -237,7 +237,6 @@
237CXXDEPMODE = @CXXDEPMODE@237CXXDEPMODE = @CXXDEPMODE@
238CXXFLAGS = @CXXFLAGS@238CXXFLAGS = @CXXFLAGS@
239CYGPATH_W = @CYGPATH_W@239CYGPATH_W = @CYGPATH_W@
240DATADIRNAME = @DATADIRNAME@
241DBUS_CFLAGS = @DBUS_CFLAGS@240DBUS_CFLAGS = @DBUS_CFLAGS@
242DBUS_LIBS = @DBUS_LIBS@241DBUS_LIBS = @DBUS_LIBS@
243DEFS = @DEFS@242DEFS = @DEFS@
244243
=== modified file 'aclocal.m4'
--- aclocal.m4 2014-09-24 13:51:15 +0000
+++ aclocal.m4 2015-04-11 20:15:48 +0000
@@ -238,31 +238,6 @@
238# Substitute ALL_LINGUAS so we can use it in po/Makefile238# Substitute ALL_LINGUAS so we can use it in po/Makefile
239AC_SUBST(ALL_LINGUAS)239AC_SUBST(ALL_LINGUAS)
240240
241# Set DATADIRNAME correctly if it is not set yet
242# (copied from glib-gettext.m4)
243if test -z "$DATADIRNAME"; then
244 AC_LINK_IFELSE(
245 [AC_LANG_PROGRAM([[]],
246 [[extern int _nl_msg_cat_cntr;
247 return _nl_msg_cat_cntr]])],
248 [DATADIRNAME=share],
249 [case $host in
250 *-*-solaris*)
251 dnl On Solaris, if bind_textdomain_codeset is in libc,
252 dnl GNU format message catalog is always supported,
253 dnl since both are added to the libc all together.
254 dnl Hence, we'd like to go with DATADIRNAME=share
255 dnl in this case.
256 AC_CHECK_FUNC(bind_textdomain_codeset,
257 [DATADIRNAME=share], [DATADIRNAME=lib])
258 ;;
259 *)
260 [DATADIRNAME=lib]
261 ;;
262 esac])
263fi
264AC_SUBST(DATADIRNAME)
265
266IT_PO_SUBDIR([po])241IT_PO_SUBDIR([po])
267242
268])243])
269244
=== modified file 'configure'
--- configure 2015-03-17 16:24:30 +0000
+++ configure 2015-04-11 20:15:48 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for Audio Recorder 1.6-3.3# Generated by GNU Autoconf 2.69 for Audio Recorder 1.6-4.
4#4#
5# Report bugs to <https://bugs.launchpad.net/audio-recorder/+filebug>.5# Report bugs to <https://bugs.launchpad.net/audio-recorder/+filebug>.
6#6#
@@ -581,8 +581,8 @@
581# Identity of this package.581# Identity of this package.
582PACKAGE_NAME='Audio Recorder'582PACKAGE_NAME='Audio Recorder'
583PACKAGE_TARNAME='audio-recorder'583PACKAGE_TARNAME='audio-recorder'
584PACKAGE_VERSION='1.6-3'584PACKAGE_VERSION='1.6-4'
585PACKAGE_STRING='Audio Recorder 1.6-3'585PACKAGE_STRING='Audio Recorder 1.6-4'
586PACKAGE_BUGREPORT='https://bugs.launchpad.net/audio-recorder/+filebug'586PACKAGE_BUGREPORT='https://bugs.launchpad.net/audio-recorder/+filebug'
587PACKAGE_URL=''587PACKAGE_URL=''
588588
@@ -631,7 +631,6 @@
631GLIB_COMPILE_SCHEMAS631GLIB_COMPILE_SCHEMAS
632gsettingsschemadir632gsettingsschemadir
633GSETTINGS_DISABLE_SCHEMAS_COMPILE633GSETTINGS_DISABLE_SCHEMAS_COMPILE
634DATADIRNAME
635ALL_LINGUAS634ALL_LINGUAS
636INTLTOOL_PERL635INTLTOOL_PERL
637GMSGFMT636GMSGFMT
@@ -1364,7 +1363,7 @@
1364 # Omit some internal or obsolete options to make the list less imposing.1363 # Omit some internal or obsolete options to make the list less imposing.
1365 # This message is too long to be a string in the A/UX 3.1 sh.1364 # This message is too long to be a string in the A/UX 3.1 sh.
1366 cat <<_ACEOF1365 cat <<_ACEOF
1367\`configure' configures Audio Recorder 1.6-3 to adapt to many kinds of systems.1366\`configure' configures Audio Recorder 1.6-4 to adapt to many kinds of systems.
13681367
1369Usage: $0 [OPTION]... [VAR=VALUE]...1368Usage: $0 [OPTION]... [VAR=VALUE]...
13701369
@@ -1430,7 +1429,7 @@
14301429
1431if test -n "$ac_init_help"; then1430if test -n "$ac_init_help"; then
1432 case $ac_init_help in1431 case $ac_init_help in
1433 short | recursive ) echo "Configuration of Audio Recorder 1.6-3:";;1432 short | recursive ) echo "Configuration of Audio Recorder 1.6-4:";;
1434 esac1433 esac
1435 cat <<\_ACEOF1434 cat <<\_ACEOF
14361435
@@ -1558,7 +1557,7 @@
1558test -n "$ac_init_help" && exit $ac_status1557test -n "$ac_init_help" && exit $ac_status
1559if $ac_init_version; then1558if $ac_init_version; then
1560 cat <<\_ACEOF1559 cat <<\_ACEOF
1561Audio Recorder configure 1.6-31560Audio Recorder configure 1.6-4
1562generated by GNU Autoconf 2.691561generated by GNU Autoconf 2.69
15631562
1564Copyright (C) 2012 Free Software Foundation, Inc.1563Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1965,7 +1964,7 @@
1965This file contains any messages produced by compilers while1964This file contains any messages produced by compilers while
1966running configure, to aid debugging if configure makes a mistake.1965running configure, to aid debugging if configure makes a mistake.
19671966
1968It was created by Audio Recorder $as_me 1.6-3, which was1967It was created by Audio Recorder $as_me 1.6-4, which was
1969generated by GNU Autoconf 2.69. Invocation command line was1968generated by GNU Autoconf 2.69. Invocation command line was
19701969
1971 $ $0 $@1970 $ $0 $@
@@ -2828,7 +2827,7 @@
28282827
2829# Define the identity of the package.2828# Define the identity of the package.
2830 PACKAGE='audio-recorder'2829 PACKAGE='audio-recorder'
2831 VERSION='1.6-3'2830 VERSION='1.6-4'
28322831
28332832
2834cat >>confdefs.h <<_ACEOF2833cat >>confdefs.h <<_ACEOF
@@ -8056,44 +8055,6 @@
8056# Substitute ALL_LINGUAS so we can use it in po/Makefile8055# Substitute ALL_LINGUAS so we can use it in po/Makefile
80578056
80588057
8059# Set DATADIRNAME correctly if it is not set yet
8060# (copied from glib-gettext.m4)
8061if test -z "$DATADIRNAME"; then
8062 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8063/* end confdefs.h. */
8064
8065int
8066main ()
8067{
8068extern int _nl_msg_cat_cntr;
8069 return _nl_msg_cat_cntr
8070 ;
8071 return 0;
8072}
8073_ACEOF
8074if ac_fn_c_try_link "$LINENO"; then :
8075 DATADIRNAME=share
8076else
8077 case $host in
8078 *-*-solaris*)
8079 ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
8080if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
8081 DATADIRNAME=share
8082else
8083 DATADIRNAME=lib
8084fi
8085
8086 ;;
8087 *)
8088 DATADIRNAME=lib
8089 ;;
8090 esac
8091fi
8092rm -f core conftest.err conftest.$ac_objext \
8093 conftest$ac_exeext conftest.$ac_ext
8094fi
8095
8096
80978058
80988059
80998060
@@ -8924,7 +8885,7 @@
8924# report actual input values of CONFIG_FILES etc. instead of their8885# report actual input values of CONFIG_FILES etc. instead of their
8925# values after options handling.8886# values after options handling.
8926ac_log="8887ac_log="
8927This file was extended by Audio Recorder $as_me 1.6-3, which was8888This file was extended by Audio Recorder $as_me 1.6-4, which was
8928generated by GNU Autoconf 2.69. Invocation command line was8889generated by GNU Autoconf 2.69. Invocation command line was
89298890
8930 CONFIG_FILES = $CONFIG_FILES8891 CONFIG_FILES = $CONFIG_FILES
@@ -8981,7 +8942,7 @@
8981cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=18942cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
8982ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"8943ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
8983ac_cs_version="\\8944ac_cs_version="\\
8984Audio Recorder config.status 1.6-38945Audio Recorder config.status 1.6-4
8985configured by $0, generated by GNU Autoconf 2.69,8946configured by $0, generated by GNU Autoconf 2.69,
8986 with options \\"\$ac_cs_config\\"8947 with options \\"\$ac_cs_config\\"
89878948
89888949
=== modified file 'configure.ac'
--- configure.ac 2015-03-17 16:24:30 +0000
+++ configure.ac 2015-04-11 20:15:48 +0000
@@ -1,5 +1,5 @@
1# ================= initialization =================== #1# ================= initialization =================== #
2AC_INIT([Audio Recorder], [1.6-3], [https://bugs.launchpad.net/audio-recorder/+filebug], [audio-recorder])2AC_INIT([Audio Recorder], [1.6-4], [https://bugs.launchpad.net/audio-recorder/+filebug], [audio-recorder])
3AM_INIT_AUTOMAKE3AM_INIT_AUTOMAKE
44
5AC_USE_SYSTEM_EXTENSIONS5AC_USE_SYSTEM_EXTENSIONS
66
=== modified file 'data/Makefile.in'
--- data/Makefile.in 2015-02-02 21:59:14 +0000
+++ data/Makefile.in 2015-04-11 20:15:48 +0000
@@ -157,7 +157,6 @@
157CXXDEPMODE = @CXXDEPMODE@157CXXDEPMODE = @CXXDEPMODE@
158CXXFLAGS = @CXXFLAGS@158CXXFLAGS = @CXXFLAGS@
159CYGPATH_W = @CYGPATH_W@159CYGPATH_W = @CYGPATH_W@
160DATADIRNAME = @DATADIRNAME@
161DBUS_CFLAGS = @DBUS_CFLAGS@160DBUS_CFLAGS = @DBUS_CFLAGS@
162DBUS_LIBS = @DBUS_LIBS@161DBUS_LIBS = @DBUS_LIBS@
163DEFS = @DEFS@162DEFS = @DEFS@
164163
=== modified file 'debian/changelog'
--- debian/changelog 2015-03-17 16:24:30 +0000
+++ debian/changelog 2015-04-11 20:15:48 +0000
@@ -1,6 +1,14 @@
1audio-recorder (1.6-3~vivid) vivid; urgency=low1audio-recorder (1.6-4~vivid) vivid; urgency=low
22
3 * Version 1.6-33 * Version 1.6-4
4 * GTK3+ has now a standard GtkLevelBar widget. Renamed our 'GtkLevelBar' widget to 'LevelBar'.
5 * Renamed src/gtklevelbar.[ch] to src/levelbar.[ch].
6
7 -- moma <osmoma@gmail.com> tue, 11 Apr 2015 10:00:00 +0200
8
9audio-recorder (1.6-4~vivid) vivid; urgency=low
10
11 * Version 1.6-4
4 * Added -e (--eos-on-shutdown) option to the gst-launch command in Additional Settings -> Recording Commands -> Show Cmd.12 * Added -e (--eos-on-shutdown) option to the gst-launch command in Additional Settings -> Recording Commands -> Show Cmd.
5 * This will make sure all test files (test recordings) are terminated properly. 13 * This will make sure all test files (test recordings) are terminated properly.
614
715
=== modified file 'icons/Makefile.in'
--- icons/Makefile.in 2015-02-02 21:59:14 +0000
+++ icons/Makefile.in 2015-04-11 20:15:48 +0000
@@ -185,7 +185,6 @@
185CXXDEPMODE = @CXXDEPMODE@185CXXDEPMODE = @CXXDEPMODE@
186CXXFLAGS = @CXXFLAGS@186CXXFLAGS = @CXXFLAGS@
187CYGPATH_W = @CYGPATH_W@187CYGPATH_W = @CYGPATH_W@
188DATADIRNAME = @DATADIRNAME@
189DBUS_CFLAGS = @DBUS_CFLAGS@188DBUS_CFLAGS = @DBUS_CFLAGS@
190DBUS_LIBS = @DBUS_LIBS@189DBUS_LIBS = @DBUS_LIBS@
191DEFS = @DEFS@190DEFS = @DEFS@
192191
=== modified file 'icons/hicolor/Makefile.in'
--- icons/hicolor/Makefile.in 2015-02-02 21:59:14 +0000
+++ icons/hicolor/Makefile.in 2015-04-11 20:15:48 +0000
@@ -185,7 +185,6 @@
185CXXDEPMODE = @CXXDEPMODE@185CXXDEPMODE = @CXXDEPMODE@
186CXXFLAGS = @CXXFLAGS@186CXXFLAGS = @CXXFLAGS@
187CYGPATH_W = @CYGPATH_W@187CYGPATH_W = @CYGPATH_W@
188DATADIRNAME = @DATADIRNAME@
189DBUS_CFLAGS = @DBUS_CFLAGS@188DBUS_CFLAGS = @DBUS_CFLAGS@
190DBUS_LIBS = @DBUS_LIBS@189DBUS_LIBS = @DBUS_LIBS@
191DEFS = @DEFS@190DEFS = @DEFS@
192191
=== modified file 'icons/hicolor/scalable/Makefile.in'
--- icons/hicolor/scalable/Makefile.in 2015-02-02 21:59:14 +0000
+++ icons/hicolor/scalable/Makefile.in 2015-04-11 20:15:48 +0000
@@ -185,7 +185,6 @@
185CXXDEPMODE = @CXXDEPMODE@185CXXDEPMODE = @CXXDEPMODE@
186CXXFLAGS = @CXXFLAGS@186CXXFLAGS = @CXXFLAGS@
187CYGPATH_W = @CYGPATH_W@187CYGPATH_W = @CYGPATH_W@
188DATADIRNAME = @DATADIRNAME@
189DBUS_CFLAGS = @DBUS_CFLAGS@188DBUS_CFLAGS = @DBUS_CFLAGS@
190DBUS_LIBS = @DBUS_LIBS@189DBUS_LIBS = @DBUS_LIBS@
191DEFS = @DEFS@190DEFS = @DEFS@
192191
=== modified file 'icons/hicolor/scalable/apps/Makefile.in'
--- icons/hicolor/scalable/apps/Makefile.in 2015-02-02 21:59:14 +0000
+++ icons/hicolor/scalable/apps/Makefile.in 2015-04-11 20:15:48 +0000
@@ -155,7 +155,6 @@
155CXXDEPMODE = @CXXDEPMODE@155CXXDEPMODE = @CXXDEPMODE@
156CXXFLAGS = @CXXFLAGS@156CXXFLAGS = @CXXFLAGS@
157CYGPATH_W = @CYGPATH_W@157CYGPATH_W = @CYGPATH_W@
158DATADIRNAME = @DATADIRNAME@
159DBUS_CFLAGS = @DBUS_CFLAGS@158DBUS_CFLAGS = @DBUS_CFLAGS@
160DBUS_LIBS = @DBUS_LIBS@159DBUS_LIBS = @DBUS_LIBS@
161DEFS = @DEFS@160DEFS = @DEFS@
162161
=== modified file 'icons/hicolor/scalable/status/Makefile.in'
--- icons/hicolor/scalable/status/Makefile.in 2015-02-02 21:59:14 +0000
+++ icons/hicolor/scalable/status/Makefile.in 2015-04-11 20:15:48 +0000
@@ -155,7 +155,6 @@
155CXXDEPMODE = @CXXDEPMODE@155CXXDEPMODE = @CXXDEPMODE@
156CXXFLAGS = @CXXFLAGS@156CXXFLAGS = @CXXFLAGS@
157CYGPATH_W = @CYGPATH_W@157CYGPATH_W = @CYGPATH_W@
158DATADIRNAME = @DATADIRNAME@
159DBUS_CFLAGS = @DBUS_CFLAGS@158DBUS_CFLAGS = @DBUS_CFLAGS@
160DBUS_LIBS = @DBUS_LIBS@159DBUS_LIBS = @DBUS_LIBS@
161DEFS = @DEFS@160DEFS = @DEFS@
162161
=== modified file 'linux-distros/arch-linux/PKGBUILD'
--- linux-distros/arch-linux/PKGBUILD 2015-03-17 16:24:30 +0000
+++ linux-distros/arch-linux/PKGBUILD 2015-04-11 20:15:48 +0000
@@ -2,8 +2,8 @@
2# Contributor: Lucas Saliรฉs Brum <lucas@archlinux.com.br>2# Contributor: Lucas Saliรฉs Brum <lucas@archlinux.com.br>
33
4pkgname=audio-recorder4pkgname=audio-recorder
5pkgver=1.6-35pkgver=1.6-4
6pkgrel=36pkgrel=4
7pkgdesc="Audio recorder for GNOME and Unity Desktops"7pkgdesc="Audio recorder for GNOME and Unity Desktops"
8arch=('i686' 'x86_64')8arch=('i686' 'x86_64')
9url='https://launchpad.net/audio-recorder'9url='https://launchpad.net/audio-recorder'
@@ -19,7 +19,7 @@
19provides=('audio-recorder')19provides=('audio-recorder')
20install="$pkgname.install"20install="$pkgname.install"
21conflicts=('audio-recorder-bzr' 'audio-recorder-from-deb')21conflicts=('audio-recorder-bzr' 'audio-recorder-from-deb')
22source=("https://launchpad.net/$pkgname/trunk/version1.6-3/+download/$pkgname-1.6-3.tar.gz")22source=("https://launchpad.net/$pkgname/trunk/version1.6-4/+download/$pkgname-1.6-4.tar.gz")
23md5sums=('??????')23md5sums=('??????')
2424
25build() {25build() {
2626
=== modified file 'linux-distros/fedora/audio-recorder.spec'
--- linux-distros/fedora/audio-recorder.spec 2015-03-17 16:24:30 +0000
+++ linux-distros/fedora/audio-recorder.spec 2015-04-11 20:15:48 +0000
@@ -1,4 +1,4 @@
1%define releasenum 31%define releasenum 4
22
3Name: audio-recorder3Name: audio-recorder
4Version: 1.64Version: 1.6
55
=== modified file 'pixmaps/Makefile.in'
--- pixmaps/Makefile.in 2015-02-02 21:59:14 +0000
+++ pixmaps/Makefile.in 2015-04-11 20:15:48 +0000
@@ -157,7 +157,6 @@
157CXXDEPMODE = @CXXDEPMODE@157CXXDEPMODE = @CXXDEPMODE@
158CXXFLAGS = @CXXFLAGS@158CXXFLAGS = @CXXFLAGS@
159CYGPATH_W = @CYGPATH_W@159CYGPATH_W = @CYGPATH_W@
160DATADIRNAME = @DATADIRNAME@
161DBUS_CFLAGS = @DBUS_CFLAGS@160DBUS_CFLAGS = @DBUS_CFLAGS@
162DBUS_LIBS = @DBUS_LIBS@161DBUS_LIBS = @DBUS_LIBS@
163DEFS = @DEFS@162DEFS = @DEFS@
164163
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2014-09-30 19:54:05 +0000
+++ po/POTFILES.in 2015-04-11 20:15:48 +0000
@@ -24,8 +24,8 @@
24src/gst-pipeline.h24src/gst-pipeline.h
25src/gst-recorder.c25src/gst-recorder.c
26src/gst-recorder.h26src/gst-recorder.h
27src/gtklevelbar.c27src/levelbar.c
28src/gtklevelbar.h28src/levelbar.h
29src/help.c29src/help.c
30src/help.h30src/help.h
31src/log.c31src/log.c
3232
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2014-10-07 17:02:33 +0000
+++ src/Makefile.am 2015-04-11 20:15:48 +0000
@@ -43,7 +43,7 @@
43 utility.c utility.h \43 utility.c utility.h \
44 settings.c settings-pipe.c settings.h \44 settings.c settings-pipe.c settings.h \
45 about.c about.h \45 about.c about.h \
46 gtklevelbar.c gtklevelbar.h \46 levelbar.c levelbar.h \
47 main.c47 main.c
4848
4949
5050
=== modified file 'src/Makefile.in'
--- src/Makefile.in 2015-02-02 21:59:14 +0000
+++ src/Makefile.in 2015-04-11 20:15:48 +0000
@@ -98,7 +98,7 @@
98 gst-devices.$(OBJEXT) rec-manager.$(OBJEXT) support.$(OBJEXT) \98 gst-devices.$(OBJEXT) rec-manager.$(OBJEXT) support.$(OBJEXT) \
99 timer.$(OBJEXT) timer-parser.$(OBJEXT) utility.$(OBJEXT) \99 timer.$(OBJEXT) timer-parser.$(OBJEXT) utility.$(OBJEXT) \
100 settings.$(OBJEXT) settings-pipe.$(OBJEXT) about.$(OBJEXT) \100 settings.$(OBJEXT) settings-pipe.$(OBJEXT) about.$(OBJEXT) \
101 gtklevelbar.$(OBJEXT) main.$(OBJEXT)101 levelbar.$(OBJEXT) main.$(OBJEXT)
102audio_recorder_OBJECTS = $(am_audio_recorder_OBJECTS)102audio_recorder_OBJECTS = $(am_audio_recorder_OBJECTS)
103audio_recorder_LDADD = $(LDADD)103audio_recorder_LDADD = $(LDADD)
104AM_V_P = $(am__v_P_@AM_V@)104AM_V_P = $(am__v_P_@AM_V@)
@@ -175,7 +175,6 @@
175CXXDEPMODE = @CXXDEPMODE@175CXXDEPMODE = @CXXDEPMODE@
176CXXFLAGS = @CXXFLAGS@176CXXFLAGS = @CXXFLAGS@
177CYGPATH_W = @CYGPATH_W@177CYGPATH_W = @CYGPATH_W@
178DATADIRNAME = @DATADIRNAME@
179DBUS_CFLAGS = @DBUS_CFLAGS@178DBUS_CFLAGS = @DBUS_CFLAGS@
180DBUS_LIBS = @DBUS_LIBS@179DBUS_LIBS = @DBUS_LIBS@
181DEFS = @DEFS@180DEFS = @DEFS@
@@ -329,7 +328,7 @@
329 utility.c utility.h \328 utility.c utility.h \
330 settings.c settings-pipe.c settings.h \329 settings.c settings-pipe.c settings.h \
331 about.c about.h \330 about.c about.h \
332 gtklevelbar.c gtklevelbar.h \331 levelbar.c levelbar.h \
333 main.c332 main.c
334333
335all: all-am334all: all-am
@@ -431,8 +430,8 @@
431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-pipeline.Po@am__quote@430@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-pipeline.Po@am__quote@
432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-recorder.Po@am__quote@431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-recorder.Po@am__quote@
433@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-vad.Po@am__quote@432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gst-vad.Po@am__quote@
434@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtklevelbar.Po@am__quote@
435@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@433@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@
434@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/levelbar.Po@am__quote@
436@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@435@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@
437@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@436@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
438@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/media-profiles.Po@am__quote@437@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/media-profiles.Po@am__quote@
439438
=== modified file 'src/audio-sources.c'
--- src/audio-sources.c 2015-02-06 14:13:34 +0000
+++ src/audio-sources.c 2015-04-11 20:15:48 +0000
@@ -687,7 +687,7 @@
687 GdkPixbuf *pixbuf = NULL;687 GdkPixbuf *pixbuf = NULL;
688 if (item->type == MEDIA_PLAYER || item->type == COMM_PROGRAM) {688 if (item->type == MEDIA_PLAYER || item->type == COMM_PROGRAM) {
689689
690 pixbuf = load_icon_pixbuf((gchar*)p);690 pixbuf = load_icon_pixbuf((gchar*)p, 22);
691691
692 // Got icon??692 // Got icon??
693 if (!GDK_IS_PIXBUF(pixbuf)) {693 if (!GDK_IS_PIXBUF(pixbuf)) {
694694
=== modified file 'src/dbus-mpris2.c'
--- src/dbus-mpris2.c 2015-02-06 14:13:34 +0000
+++ src/dbus-mpris2.c 2015-04-11 20:15:48 +0000
@@ -3,10 +3,7 @@
3 *3 *
4 * This library is free software; you can redistribute it and/or4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either6 * License as published by the Free Software Foundation; either"OK
7 * version 3 of the License (GPL3), or any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU Library General Public License 3 for more details.9 * See the GNU Library General Public License 3 for more details.
@@ -573,6 +570,20 @@
573 return res;570 return res;
574}571}
575572
573#if 0
574void debug_variant(const gchar *tag, GVariant *v) {
575 if (!v) {
576 g_print("%s is NULL.\n", tag);
577 return;
578 }
579
580 gchar *sval = g_variant_print(v, TRUE);
581 const gchar *stype = g_variant_get_type_string(v);
582 g_print("%s has type:%s and value:%s\n", tag, stype, sval);
583 g_free(sval);
584}
585#endif
586
576void mpris2_get_metadata(gpointer player_rec) {587void mpris2_get_metadata(gpointer player_rec) {
577 // Get track information (=metadata) and state for the given media player.588 // Get track information (=metadata) and state for the given media player.
578 // Ref: http://www.mpris.org/2.1/spec/Player_Node.html#Property:Metadata589 // Ref: http://www.mpris.org/2.1/spec/Player_Node.html#Property:Metadata
@@ -602,6 +613,8 @@
602 //613 //
603 GVariant *result = mpris2_get_player_value(player, "PlaybackStatus");614 GVariant *result = mpris2_get_player_value(player, "PlaybackStatus");
604615
616 // DEBUG: debug_variant("PlaybackStatus", result);
617
605 if (!result) {618 if (!result) {
606 // Cannot contact player (it has quit)?619 // Cannot contact player (it has quit)?
607 tr->status = PLAYER_STATUS_CLOSED;620 tr->status = PLAYER_STATUS_CLOSED;
@@ -657,9 +670,14 @@
657 //670 //
658 GVariant *dict = mpris2_get_player_value(player, "Metadata");671 GVariant *dict = mpris2_get_player_value(player, "Metadata");
659672
673 // DEBUG: debug_variant("Metadata", dict);
674
660 if (!dict) {675 if (!dict) {
661 // Cannot contact player (it has quit)?676 // Cannot get Metadata (should we consider this as on error?)
662 tr->status = PLAYER_STATUS_CLOSED;677 // 03.april.2015, commented out by MOma: Ambient Noise Player does not support "Metadata" yet.
678
679 // tr->status = PLAYER_STATUS_CLOSED;
680
663 return;681 return;
664 }682 }
665683
666684
=== removed file 'src/gtklevelbar.c'
--- src/gtklevelbar.c 2015-02-06 14:13:34 +0000
+++ src/gtklevelbar.c 1970-01-01 00:00:00 +0000
@@ -1,357 +0,0 @@
1/*
2 * Copyright (c) Linux community.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License (GPL3), or any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU Library General Public License 3 for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License 3 along with this program; if not, see /usr/share/common-licenses/GPL file
16 * or write to Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18*/
19#include "gtklevelbar.h"
20#include <math.h> // round()
21
22// A simple level bar widget.
23// By Osmo Antero.
24//
25// Sample call:
26// GtkWidget *lb = gtk_level_bar_new();
27// gtk_widget_show(lb);
28//
29// Set value [0.0, 1.0].
30// gtk_level_bar_set_fraction(GTK_LEVEL_BAR(lb), 0.8);
31//
32// Show %-value [0 - 100%] or plain value [0 - 1.0] on the level bar. See BAR_VALUE enum.
33// gtk_level_bar_set_value_type(GTK_LEVEL_BAR(lb), VALUE_PRECENT);
34//
35
36struct _GtkLevelBarPrivate {
37 gdouble fraction;
38 guint bar_height;
39 enum BAR_VALUE bar_value;
40 enum BAR_SHAPE bar_shape;
41};
42
43static void gtk_level_bar_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural);
44static void gtk_level_bar_get_preferred_height (GtkWidget *widget,gint *minimum, gint *natural);
45
46static void gtk_level_bar_real_update(GtkLevelBar *progress);
47static gboolean gtk_level_bar_draw(GtkWidget *widget, cairo_t *cr);
48
49static void gtk_level_bar_finalize(GObject *object);
50
51G_DEFINE_TYPE(GtkLevelBar, gtk_level_bar, GTK_TYPE_WIDGET);
52
53static void gtk_level_bar_class_init (GtkLevelBarClass *class) {
54 GObjectClass *gobject_class;
55 GtkWidgetClass *widget_class;
56
57 gobject_class = G_OBJECT_CLASS (class);
58 widget_class = (GtkWidgetClass *)class;
59
60 gobject_class->set_property = NULL;
61 gobject_class->get_property = NULL;
62 gobject_class->finalize = gtk_level_bar_finalize;
63
64 widget_class->draw = gtk_level_bar_draw;
65 widget_class->get_preferred_width = gtk_level_bar_get_preferred_width;
66 widget_class->get_preferred_height = gtk_level_bar_get_preferred_height;
67
68 g_type_class_add_private (class, sizeof (GtkLevelBarPrivate));
69}
70
71static void gtk_level_bar_init(GtkLevelBar *pbar) {
72 GtkLevelBarPrivate *priv;
73
74 pbar->priv = G_TYPE_INSTANCE_GET_PRIVATE(pbar, GTK_TYPE_LEVEL_BAR, GtkLevelBarPrivate);
75 priv = pbar->priv;
76
77 priv->fraction = 0.0;
78 priv->bar_height = 8;
79 priv->bar_value = VALUE_NONE;
80 priv->bar_shape = SHAPE_CIRCLE; // pulsing line with circle at end.
81
82 gtk_widget_set_has_window(GTK_WIDGET (pbar), FALSE);
83}
84
85GtkWidget *gtk_level_bar_new(void) {
86 GtkWidget *pbar;
87 pbar = g_object_new(GTK_TYPE_LEVEL_BAR, NULL);
88 return pbar;
89}
90
91static void gtk_level_bar_real_update (GtkLevelBar *pbar) {
92 GtkWidget *widget;
93
94 g_return_if_fail (GTK_IS_LEVEL_BAR (pbar));
95
96 GtkLevelBarPrivate __attribute__ ((unused)) *priv = pbar->priv;
97
98 widget = GTK_WIDGET(pbar);
99
100 gtk_widget_queue_draw(widget);
101}
102
103static void gtk_level_bar_finalize (GObject *object) {
104 G_OBJECT_CLASS(gtk_level_bar_parent_class)->finalize (object);
105}
106
107static void gtk_level_bar_get_preferred_width (GtkWidget *widget,gint *minimum, gint *natural) {
108 *minimum = 50;
109 *natural = 160;
110}
111
112static void gtk_level_bar_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) {
113 *minimum = 6;
114 *natural = 8;
115}
116
117static gboolean gtk_level_bar_draw(GtkWidget *widget, cairo_t *cr) {
118 // Draw level bar and optional text
119 GtkLevelBar *pbar = GTK_LEVEL_BAR (widget);
120 GtkLevelBarPrivate *priv = pbar->priv;
121 GtkStyleContext *context;
122 int width, height;
123
124 context = gtk_widget_get_style_context(widget);
125
126 width = gtk_widget_get_allocated_width(widget);
127 height = gtk_widget_get_allocated_height(widget);
128
129 // Bar thickness
130 gdouble bar_height = MIN(height , priv->bar_height);
131
132 // Vertical pos
133 gdouble y = (height - bar_height)/2;
134
135 // Pulse width
136 gdouble w = priv->fraction/(1.00/width);
137
138 // Debug:
139 // LOG_DEBUG("width=%d height=%d bar_height=%2.1f y=%2.1f w=%2.1f fraction=%2.1f\n", width, height, bar_height, y, w, priv->fraction);
140
141 gtk_style_context_save(context);
142 gtk_render_background(context, cr, 0, 0, width, height);
143 gtk_render_frame(context, cr, 0, 0, width, height);
144
145 // Render level bar with current theme and color.
146
147 // Progressbar style
148 gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR);
149
150 if (priv->fraction > 0.001) {
151
152 switch (priv->bar_shape) {
153
154 case SHAPE_LINE:
155 // Render a single line
156 if (priv->bar_value == VALUE_NONE) {
157 // No value (text) shown. Draw a line on the middle.
158 gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
159
160 } else {
161 // Draw a line under text.
162 gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
163 }
164
165 break;
166
167 case SHAPE_LINE2:
168 // Render two horizontal lines + close the end.
169 gtk_render_line(context, cr, 0, y-1 , w, y-1);
170 gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
171 gtk_render_line(context, cr, w, y - 1, w, y + (bar_height ));
172 break;
173
174 case SHAPE_CIRCLE:
175 // Draw a line on the middle + circle at the end.
176 gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
177 gtk_render_option(context, cr, w, y, bar_height+1, bar_height+1);
178 break;
179
180 default:
181 // case SHAPE_LEVELBAR:
182
183 // EDIT: gtk_render_activity() does not work in GTK 3.14+
184 // gtk_style_context_set_state(context, GTK_STATE_FLAG_ACTIVE);
185 // gtk_render_activity(context, cr, 0, y, w, bar_height);
186
187 // Render a filled frame (this is a typical levelbar).
188 gtk_render_frame(context, cr, 0, y, w, bar_height);
189 break;
190
191 }
192 }
193
194 gtk_style_context_restore(context);
195
196 cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
197 cairo_set_font_size(cr, priv->bar_height);
198
199 GdkRGBA color;
200 gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
201 gdk_cairo_set_source_rgba(cr, &color);
202 color.alpha = 0.9;
203
204 // Calculate total width of scale
205 cairo_text_extents_t extents;
206 cairo_text_extents(cr, "0.0", &extents);
207 gint total_w = 9 * (extents.x_advance + extents.width);
208
209 // Debug:
210 // g_print("Bar width=%d total_w=%d bearing=%3.1f advance=%3.1f char.width=%3.1f\n", width, total_w,
211 // extents.x_bearing, extents.x_advance, extents.width);
212
213 // Draw values
214 gboolean draw_all = (total_w - extents.width) < width;
215
216 // Show normalized value [0 - 1.0]?
217 if (priv->bar_value == VALUE_0_1) {
218 // Value: 0.1 0.2 0.3 0.4...0.9
219
220 gint i = 0;
221 for (i=0; i < 10; i++) {
222 gchar *s = NULL;
223
224 // Draw all or draw only each second value?
225 if (draw_all || (i % 2 == 0))
226 s = g_strdup_printf("%2.1f", (gdouble)i/10.0);
227
228 if (!s) continue;
229
230 cairo_text_extents_t extents;
231 cairo_text_extents(cr, s, &extents);
232
233 gdouble xx = (width/10) * i;
234 gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing) + 0.2;
235
236 cairo_move_to(cr, xx, yy);
237 cairo_show_text(cr, s);
238
239 g_free(s);
240 }
241
242 // Show percentage value?
243 } else if (priv->bar_value == VALUE_PERCENT) {
244 // Value: 10% . 20% . 30% . 40% . 50% ... 90%
245 gint i = 0;
246 for (i=0; i < 10; i++) {
247 gchar *s = NULL;
248 if (i % 2 == 0)
249 s = g_strdup_printf("%2.0f%%", (gdouble)i*10.0);
250 else
251 s = g_strdup_printf("%3s", ".");
252
253 cairo_text_extents_t extents;
254 cairo_text_extents(cr, s, &extents);
255
256 gdouble xx = (width/10) * i;
257 gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing);
258
259 cairo_move_to(cr, xx, yy);
260 cairo_show_text(cr, s);
261
262 g_free(s);
263 }
264 }
265
266#if 0
267 // Commented out by moma 30.sep.2012.
268
269 // Set text
270 if (priv->text) {
271 cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
272
273 cairo_set_font_size(cr, 0.5*height);
274 cairo_text_extents_t extents;
275 cairo_text_extents(cr, priv->text, &extents);
276
277 // Ref: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-text-extents-t
278 gdouble xx = width-(extents.width + extents.x_bearing)-2;
279 gdouble yy = height/2-(extents.height/2 + extents.y_bearing);
280
281 GdkRGBA color;
282 gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
283 gdk_cairo_set_source_rgba(cr, &color);
284 color.alpha = 0.9;
285
286 cairo_move_to(cr, xx, yy);
287 cairo_show_text(cr, priv->text);
288 }
289#endif
290
291 return FALSE;
292}
293
294void gtk_level_bar_set_fraction(GtkLevelBar *pbar, gdouble fraction) {
295 // Set fraction [0.0, 1.0]
296 GtkLevelBarPrivate* priv;
297 g_return_if_fail (GTK_IS_LEVEL_BAR (pbar));
298 priv = pbar->priv;
299
300 priv->fraction = CLAMP(fraction, 0.0, 1.0);
301 gtk_level_bar_real_update (pbar);
302}
303
304gdouble gtk_level_bar_get_fraction(GtkLevelBar *pbar) {
305 // Get fraction
306 g_return_val_if_fail(GTK_IS_LEVEL_BAR (pbar), 0);
307 return pbar->priv->fraction;
308}
309
310void gtk_level_bar_set_bar_height(GtkLevelBar *pbar, guint height) {
311 // Set bar height (thickness). Normally 8 pixels.
312 g_return_if_fail(GTK_IS_LEVEL_BAR (pbar));
313 GtkLevelBarPrivate* priv = pbar->priv;
314 priv->bar_height = height;
315 // Redraw
316 gtk_level_bar_real_update(pbar);
317}
318
319guint gtk_level_bar_get_bar_height(GtkLevelBar *pbar) {
320 // Get bar thickness
321 g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), 0);
322 return pbar->priv->bar_height;
323}
324
325void gtk_level_bar_set_value_type(GtkLevelBar *pbar, enum BAR_VALUE bar_value) {
326 // Set BAR_VALUE
327 g_return_if_fail(GTK_IS_LEVEL_BAR(pbar));
328 GtkLevelBarPrivate* priv = pbar->priv;
329 priv->bar_value = bar_value;
330 // Redraw
331 gtk_level_bar_real_update(pbar);
332}
333
334enum BAR_VALUE gtk_level_bar_get_scale(GtkLevelBar *pbar) {
335 // Get BAR_VALUE
336 g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), VALUE_NONE);
337 GtkLevelBarPrivate* priv = pbar->priv;
338 return priv->bar_value;
339}
340
341void gtk_level_bar_set_shape(GtkLevelBar *pbar, enum BAR_SHAPE bar_shape) {
342 // Set BAR_SHAPE
343 g_return_if_fail(GTK_IS_LEVEL_BAR(pbar));
344 GtkLevelBarPrivate* priv = pbar->priv;
345 priv->bar_shape = bar_shape;
346 // Redraw
347 gtk_level_bar_real_update(pbar);
348}
349
350enum BAR_SHAPE gtk_level_bar_get_shape(GtkLevelBar *pbar) {
351 // Get BAR_SHAPE
352 g_return_val_if_fail(GTK_IS_LEVEL_BAR(pbar), SHAPE_LEVELBAR);
353 GtkLevelBarPrivate* priv = pbar->priv;
354 return priv->bar_shape;
355}
356
357
3580
=== removed file 'src/gtklevelbar.h'
--- src/gtklevelbar.h 2015-02-06 14:13:34 +0000
+++ src/gtklevelbar.h 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
1#ifndef __GTK_LEVEL_BAR_H__
2#define __GTK_LEVEL_BAR_H__
3
4// A simple level bar widget.
5
6#include <gtk/gtk.h>
7
8typedef enum BAR_VALUE {VALUE_NONE, VALUE_0_1/*0 - 1.0*/, VALUE_PERCENT/*0 - 100%*/} BAR_VALUE;
9typedef enum BAR_SHAPE {SHAPE_LEVELBAR, SHAPE_LINE, SHAPE_LINE2, SHAPE_CIRCLE} BAR_SHAPE;
10
11G_BEGIN_DECLS
12
13#define GTK_TYPE_LEVEL_BAR (gtk_level_bar_get_type ())
14#define GTK_LEVEL_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LEVEL_BAR, GtkLevelBar))
15#define GTK_LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LEVEL_BAR, GtkLevelBarClass))
16#define GTK_IS_LEVEL_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LEVEL_BAR))
17#define GTK_IS_LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LEVEL_BAR))
18#define GTK_LEVEL_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LEVEL_BAR, GtkLevelBarClass))
19
20typedef struct _GtkLevelBar GtkLevelBar;
21typedef struct _GtkLevelBarPrivate GtkLevelBarPrivate;
22typedef struct _GtkLevelBarClass GtkLevelBarClass;
23
24struct _GtkLevelBar {
25 GtkWidget parent;
26
27 /*< private >*/
28 GtkLevelBarPrivate *priv;
29};
30
31struct _GtkLevelBarClass {
32 GtkWidgetClass parent_class;
33
34 /* Padding for future expansion */
35 void (*_gtk_reserved1) (void);
36 void (*_gtk_reserved2) (void);
37 void (*_gtk_reserved3) (void);
38 void (*_gtk_reserved4) (void);
39};
40
41GType gtk_level_bar_get_type(void) G_GNUC_CONST;
42GtkWidget* gtk_level_bar_new(void);
43
44void gtk_level_bar_set_bar_height(GtkLevelBar *pbar, guint height);
45void gtk_level_bar_set_fraction(GtkLevelBar *pbar, gdouble fraction);
46
47guint gtk_level_bar_get_bar_height(GtkLevelBar *pbar);
48gdouble gtk_level_bar_get_fraction(GtkLevelBar *pbar);
49
50void gtk_level_bar_set_value_type(GtkLevelBar *pbar, enum BAR_VALUE bar_value);
51enum BAR_VALUE gtk_level_bar_get_value_type(GtkLevelBar *pbar);
52
53void gtk_level_bar_set_shape(GtkLevelBar *pbar, enum BAR_SHAPE bar_shape);
54enum BAR_SHAPE gtk_level_bar_get_shape(GtkLevelBar *pbar);
55
56G_END_DECLS
57
58#endif
59
60
610
=== added file 'src/levelbar.c'
--- src/levelbar.c 1970-01-01 00:00:00 +0000
+++ src/levelbar.c 2015-04-11 20:15:48 +0000
@@ -0,0 +1,357 @@
1/*
2 * Copyright (c) Linux community.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License (GPL3), or any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU Library General Public License 3 for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License 3 along with this program; if not, see /usr/share/common-licenses/GPL file
16 * or write to Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18*/
19#include "levelbar.h"
20#include <math.h> // round()
21
22// A simple level bar widget.
23// By Osmo Antero.
24//
25// Sample call:
26// GtkWidget *lb = level_bar_new();
27// gtk_widget_show(lb);
28//
29// Set value [0.0, 1.0].
30// level_bar_set_fraction(LEVEL_BAR(lb), 0.8);
31//
32// Show %-value [0 - 100%] or plain value [0 - 1.0] on the level bar. See BAR_VALUE enum.
33// level_bar_set_value_type(LEVEL_BAR(lb), VALUE_PRECENT);
34//
35
36struct _LevelBarPrivate {
37 gdouble fraction;
38 guint bar_height;
39 enum BAR_VALUE bar_value;
40 enum BAR_SHAPE bar_shape;
41};
42
43static void level_bar_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural);
44static void level_bar_get_preferred_height (GtkWidget *widget,gint *minimum, gint *natural);
45
46static void level_bar_real_update(LevelBar *progress);
47static gboolean level_bar_draw(GtkWidget *widget, cairo_t *cr);
48
49static void level_bar_finalize(GObject *object);
50
51G_DEFINE_TYPE(LevelBar, level_bar, GTK_TYPE_WIDGET);
52
53static void level_bar_class_init(LevelBarClass *class) {
54 GObjectClass *gobject_class;
55 GtkWidgetClass *widget_class;
56
57 gobject_class = G_OBJECT_CLASS (class);
58 widget_class = (GtkWidgetClass *)class;
59
60 gobject_class->set_property = NULL;
61 gobject_class->get_property = NULL;
62 gobject_class->finalize = level_bar_finalize;
63
64 widget_class->draw = level_bar_draw;
65 widget_class->get_preferred_width = level_bar_get_preferred_width;
66 widget_class->get_preferred_height = level_bar_get_preferred_height;
67
68 g_type_class_add_private(class, sizeof (LevelBarPrivate));
69}
70
71static void level_bar_init(LevelBar *pbar) {
72 LevelBarPrivate *priv;
73
74 pbar->priv = G_TYPE_INSTANCE_GET_PRIVATE(pbar, TYPE_LEVEL_BAR, LevelBarPrivate);
75 priv = pbar->priv;
76
77 priv->fraction = 0.0;
78 priv->bar_height = 8;
79 priv->bar_value = VALUE_NONE;
80 priv->bar_shape = SHAPE_CIRCLE; // pulsing line with circle at end.
81
82 gtk_widget_set_has_window(GTK_WIDGET (pbar), FALSE);
83}
84
85GtkWidget *level_bar_new(void) {
86 GtkWidget *pbar;
87 pbar = g_object_new(TYPE_LEVEL_BAR, NULL);
88 return pbar;
89}
90
91static void level_bar_real_update (LevelBar *pbar) {
92 GtkWidget *widget;
93
94 g_return_if_fail (IS_LEVEL_BAR (pbar));
95
96 LevelBarPrivate __attribute__ ((unused)) *priv = pbar->priv;
97
98 widget = GTK_WIDGET(pbar);
99
100 gtk_widget_queue_draw(widget);
101}
102
103static void level_bar_finalize (GObject *object) {
104 G_OBJECT_CLASS(level_bar_parent_class)->finalize (object);
105}
106
107static void level_bar_get_preferred_width (GtkWidget *widget,gint *minimum, gint *natural) {
108 *minimum = 50;
109 *natural = 160;
110}
111
112static void level_bar_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) {
113 *minimum = 6;
114 *natural = 8;
115}
116
117static gboolean level_bar_draw(GtkWidget *widget, cairo_t *cr) {
118 // Draw level bar and optional text
119 LevelBar *pbar = LEVEL_BAR (widget);
120 LevelBarPrivate *priv = pbar->priv;
121 GtkStyleContext *context;
122 int width, height;
123
124 context = gtk_widget_get_style_context(widget);
125
126 width = gtk_widget_get_allocated_width(widget);
127 height = gtk_widget_get_allocated_height(widget);
128
129 // Bar thickness
130 gdouble bar_height = MIN(height , priv->bar_height);
131
132 // Vertical pos
133 gdouble y = (height - bar_height)/2;
134
135 // Pulse width
136 gdouble w = priv->fraction/(1.00/width);
137
138 // Debug:
139 // LOG_DEBUG("width=%d height=%d bar_height=%2.1f y=%2.1f w=%2.1f fraction=%2.1f\n", width, height, bar_height, y, w, priv->fraction);
140
141 gtk_style_context_save(context);
142 gtk_render_background(context, cr, 0, 0, width, height);
143 gtk_render_frame(context, cr, 0, 0, width, height);
144
145 // Render level bar with current theme and color.
146
147 // Progressbar style
148 gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR);
149
150 if (priv->fraction > 0.001) {
151
152 switch (priv->bar_shape) {
153
154 case SHAPE_LINE:
155 // Render a single line
156 if (priv->bar_value == VALUE_NONE) {
157 // No value (text) shown. Draw a line on the middle.
158 gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
159
160 } else {
161 // Draw a line under text.
162 gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
163 }
164
165 break;
166
167 case SHAPE_LINE2:
168 // Render two horizontal lines + close the end.
169 gtk_render_line(context, cr, 0, y-1 , w, y-1);
170 gtk_render_line(context, cr, 0, y + (bar_height ), w, y + (bar_height ));
171 gtk_render_line(context, cr, w, y - 1, w, y + (bar_height ));
172 break;
173
174 case SHAPE_CIRCLE:
175 // Draw a line on the middle + circle at the end.
176 gtk_render_line(context, cr, 0, y + (bar_height / 2), w, y + (bar_height / 2));
177 gtk_render_option(context, cr, w, y, bar_height+1, bar_height+1);
178 break;
179
180 default:
181 // case SHAPE_LEVELBAR:
182
183 // EDIT: gtk_render_activity() does not work in GTK 3.14+
184 // gtk_style_context_set_state(context, GTK_STATE_FLAG_ACTIVE);
185 // gtk_render_activity(context, cr, 0, y, w, bar_height);
186
187 // Render a filled frame (this is a typical levelbar).
188 gtk_render_frame(context, cr, 0, y, w, bar_height);
189 break;
190
191 }
192 }
193
194 gtk_style_context_restore(context);
195
196 cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
197 cairo_set_font_size(cr, priv->bar_height);
198
199 GdkRGBA color;
200 gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
201 gdk_cairo_set_source_rgba(cr, &color);
202 color.alpha = 0.9;
203
204 // Calculate total width of scale
205 cairo_text_extents_t extents;
206 cairo_text_extents(cr, "0.0", &extents);
207 gint total_w = 9 * (extents.x_advance + extents.width);
208
209 // Debug:
210 // g_print("Bar width=%d total_w=%d bearing=%3.1f advance=%3.1f char.width=%3.1f\n", width, total_w,
211 // extents.x_bearing, extents.x_advance, extents.width);
212
213 // Draw values
214 gboolean draw_all = (total_w - extents.width) < width;
215
216 // Show normalized value [0 - 1.0]?
217 if (priv->bar_value == VALUE_0_1) {
218 // Value: 0.1 0.2 0.3 0.4...0.9
219
220 gint i = 0;
221 for (i=0; i < 10; i++) {
222 gchar *s = NULL;
223
224 // Draw all or draw only each second value?
225 if (draw_all || (i % 2 == 0))
226 s = g_strdup_printf("%2.1f", (gdouble)i/10.0);
227
228 if (!s) continue;
229
230 cairo_text_extents_t extents;
231 cairo_text_extents(cr, s, &extents);
232
233 gdouble xx = (width/10) * i;
234 gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing) + 0.2;
235
236 cairo_move_to(cr, xx, yy);
237 cairo_show_text(cr, s);
238
239 g_free(s);
240 }
241
242 // Show percentage value?
243 } else if (priv->bar_value == VALUE_PERCENT) {
244 // Value: 10% . 20% . 30% . 40% . 50% ... 90%
245 gint i = 0;
246 for (i=0; i < 10; i++) {
247 gchar *s = NULL;
248 if (i % 2 == 0)
249 s = g_strdup_printf("%2.0f%%", (gdouble)i*10.0);
250 else
251 s = g_strdup_printf("%3s", ".");
252
253 cairo_text_extents_t extents;
254 cairo_text_extents(cr, s, &extents);
255
256 gdouble xx = (width/10) * i;
257 gdouble yy = (height/2)-(extents.height/2 + extents.y_bearing);
258
259 cairo_move_to(cr, xx, yy);
260 cairo_show_text(cr, s);
261
262 g_free(s);
263 }
264 }
265
266#if 0
267 // Commented out by moma 30.sep.2012.
268
269 // Set text
270 if (priv->text) {
271 cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
272
273 cairo_set_font_size(cr, 0.5*height);
274 cairo_text_extents_t extents;
275 cairo_text_extents(cr, priv->text, &extents);
276
277 // Ref: http://cairographics.org/manual/cairo-cairo-scaled-font-t.html#cairo-text-extents-t
278 gdouble xx = width-(extents.width + extents.x_bearing)-2;
279 gdouble yy = height/2-(extents.height/2 + extents.y_bearing);
280
281 GdkRGBA color;
282 gtk_style_context_get_border_color(context, GTK_STATE_NORMAL, &color);
283 gdk_cairo_set_source_rgba(cr, &color);
284 color.alpha = 0.9;
285
286 cairo_move_to(cr, xx, yy);
287 cairo_show_text(cr, priv->text);
288 }
289#endif
290
291 return FALSE;
292}
293
294void level_bar_set_fraction(LevelBar *pbar, gdouble fraction) {
295 // Set fraction [0.0, 1.0]
296 LevelBarPrivate* priv;
297 g_return_if_fail (IS_LEVEL_BAR (pbar));
298 priv = pbar->priv;
299
300 priv->fraction = CLAMP(fraction, 0.0, 1.0);
301 level_bar_real_update (pbar);
302}
303
304gdouble level_bar_get_fraction(LevelBar *pbar) {
305 // Get fraction
306 g_return_val_if_fail(IS_LEVEL_BAR (pbar), 0);
307 return pbar->priv->fraction;
308}
309
310void level_bar_set_bar_height(LevelBar *pbar, guint height) {
311 // Set bar height (thickness). Normally 8 pixels.
312 g_return_if_fail(IS_LEVEL_BAR (pbar));
313 LevelBarPrivate* priv = pbar->priv;
314 priv->bar_height = height;
315 // Redraw
316 level_bar_real_update(pbar);
317}
318
319guint level_bar_get_bar_height(LevelBar *pbar) {
320 // Get bar thickness
321 g_return_val_if_fail(IS_LEVEL_BAR(pbar), 0);
322 return pbar->priv->bar_height;
323}
324
325void level_bar_set_value_type(LevelBar *pbar, enum BAR_VALUE bar_value) {
326 // Set BAR_VALUE
327 g_return_if_fail(IS_LEVEL_BAR(pbar));
328 LevelBarPrivate* priv = pbar->priv;
329 priv->bar_value = bar_value;
330 // Redraw
331 level_bar_real_update(pbar);
332}
333
334enum BAR_VALUE level_bar_get_scale(LevelBar *pbar) {
335 // Get BAR_VALUE
336 g_return_val_if_fail(IS_LEVEL_BAR(pbar), VALUE_NONE);
337 LevelBarPrivate* priv = pbar->priv;
338 return priv->bar_value;
339}
340
341void level_bar_set_shape(LevelBar *pbar, enum BAR_SHAPE bar_shape) {
342 // Set BAR_SHAPE
343 g_return_if_fail(IS_LEVEL_BAR(pbar));
344 LevelBarPrivate* priv = pbar->priv;
345 priv->bar_shape = bar_shape;
346 // Redraw
347 level_bar_real_update(pbar);
348}
349
350enum BAR_SHAPE level_bar_get_shape(LevelBar *pbar) {
351 // Get BAR_SHAPE
352 g_return_val_if_fail(IS_LEVEL_BAR(pbar), SHAPE_LEVELBAR);
353 LevelBarPrivate* priv = pbar->priv;
354 return priv->bar_shape;
355}
356
357
0358
=== added file 'src/levelbar.h'
--- src/levelbar.h 1970-01-01 00:00:00 +0000
+++ src/levelbar.h 2015-04-11 20:15:48 +0000
@@ -0,0 +1,60 @@
1#ifndef __LEVEL_BAR_H__
2#define __LEVEL_BAR_H__
3
4// A simple level bar widget.
5
6#include <gtk/gtk.h>
7
8typedef enum BAR_VALUE {VALUE_NONE, VALUE_0_1/*0 - 1.0*/, VALUE_PERCENT/*0 - 100%*/} BAR_VALUE;
9typedef enum BAR_SHAPE {SHAPE_LEVELBAR, SHAPE_LINE, SHAPE_LINE2, SHAPE_CIRCLE} BAR_SHAPE;
10
11G_BEGIN_DECLS
12
13#define TYPE_LEVEL_BAR (level_bar_get_type ())
14#define LEVEL_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LEVEL_BAR, LevelBar))
15#define LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LEVEL_BAR, LevelBarClass))
16#define IS_LEVEL_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LEVEL_BAR))
17#define IS_LEVEL_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LEVEL_BAR))
18#define LEVEL_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LEVEL_BAR, LevelBarClass))
19
20typedef struct _LevelBar LevelBar;
21typedef struct _LevelBarPrivate LevelBarPrivate;
22typedef struct _LevelBarClass LevelBarClass;
23
24struct _LevelBar {
25 GtkWidget parent;
26
27 /*< private >*/
28 LevelBarPrivate *priv;
29};
30
31struct _LevelBarClass {
32 GtkWidgetClass parent_class;
33
34 /* Padding for future expansion */
35 void (*_gtk_reserved1) (void);
36 void (*_gtk_reserved2) (void);
37 void (*_gtk_reserved3) (void);
38 void (*_gtk_reserved4) (void);
39};
40
41GType level_bar_get_type(void) G_GNUC_CONST;
42GtkWidget* level_bar_new(void);
43
44void level_bar_set_bar_height(LevelBar *pbar, guint height);
45void level_bar_set_fraction(LevelBar *pbar, gdouble fraction);
46
47guint level_bar_get_bar_height(LevelBar *pbar);
48gdouble level_bar_get_fraction(LevelBar *pbar);
49
50void level_bar_set_value_type(LevelBar *pbar, enum BAR_VALUE bar_value);
51enum BAR_VALUE level_bar_get_value_type(LevelBar *pbar);
52
53void level_bar_set_shape(LevelBar *pbar, enum BAR_SHAPE bar_shape);
54enum BAR_SHAPE level_bar_get_shape(LevelBar *pbar);
55
56G_END_DECLS
57
58#endif
59
60
061
=== modified file 'src/main.c'
--- src/main.c 2015-02-11 16:45:04 +0000
+++ src/main.c 2015-04-11 20:15:48 +0000
@@ -25,7 +25,7 @@
2525
26#include <gst/pbutils/pbutils.h>26#include <gst/pbutils/pbutils.h>
2727
28#include "gtklevelbar.h" // Level bar widget28#include "levelbar.h" // Level bar widget
29#include "support.h"29#include "support.h"
30#include "audio-sources.h"30#include "audio-sources.h"
31#include "rec-window.h"31#include "rec-window.h"
@@ -274,13 +274,13 @@
274}274}
275275
276void win_update_level_bar(gdouble norm_rms, gdouble norm_peak) {276void win_update_level_bar(gdouble norm_rms, gdouble norm_peak) {
277 // Set pulse on gtklevelbar277 // Set pulse on the levelbar
278278
279 if (!GTK_IS_LEVEL_BAR(g_win.level_bar)) return;279 if (!IS_LEVEL_BAR(g_win.level_bar)) return;
280280
281 // Show either RMS or peak-value on the levelbar.281 // Show either RMS or peak-value on the levelbar.
282 // Notice: This value has no GUI-setting. User must change it in the dconf-editor.282 // Notice: This value has no GUI-setting. User must change it in the dconf-editor.
283 gtk_level_bar_set_fraction(GTK_LEVEL_BAR(g_win.level_bar),283 level_bar_set_fraction(LEVEL_BAR(g_win.level_bar),
284 (g_win.pulse_type == PULSE_RMS ? norm_rms : norm_peak));284 (g_win.pulse_type == PULSE_RMS ? norm_rms : norm_peak));
285}285}
286286
@@ -810,7 +810,7 @@
810810
811void win_level_bar_clicked(GtkWidget *widget, GdkEvent *event, gpointer data) {811void win_level_bar_clicked(GtkWidget *widget, GdkEvent *event, gpointer data) {
812 // User clicked on the level bar.812 // User clicked on the level bar.
813 // Set BAR_VALUE or BAR_SHAPE. See gtklevelbar.h.value813 // Set BAR_VALUE or BAR_SHAPE. See levelbar.h.
814 GdkEventButton *ev = (GdkEventButton*)event;814 GdkEventButton *ev = (GdkEventButton*)event;
815815
816 if (ev->button == 1) {816 if (ev->button == 1) {
@@ -827,7 +827,7 @@
827 }827 }
828828
829 // Update GUI829 // Update GUI
830 gtk_level_bar_set_value_type(GTK_LEVEL_BAR(g_win.level_bar), bar_value);830 level_bar_set_value_type(LEVEL_BAR(g_win.level_bar), bar_value);
831831
832 // Save in DConf832 // Save in DConf
833 conf_save_int_value("level-bar-value", bar_value);833 conf_save_int_value("level-bar-value", bar_value);
@@ -846,7 +846,7 @@
846 }846 }
847847
848 // Update GUI848 // Update GUI
849 gtk_level_bar_set_shape(GTK_LEVEL_BAR(g_win.level_bar), bar_shape);849 level_bar_set_shape(LEVEL_BAR(g_win.level_bar), bar_shape);
850850
851 // Save in DConf851 // Save in DConf
852 conf_save_int_value("level-bar-shape", bar_shape);852 conf_save_int_value("level-bar-shape", bar_shape);
@@ -981,7 +981,7 @@
981 }981 }
982 }982 }
983983
984 // Gtklevelbar/pulsebar: Indicator for sound amplitude (a GtkLevelBar widget).984 // Levelbar/pulsebar: Indicator for sound amplitude.
985 // Put it in a GtkEventBox so we can catch click events.985 // Put it in a GtkEventBox so we can catch click events.
986986
987 GtkWidget *event_box = gtk_event_box_new();987 GtkWidget *event_box = gtk_event_box_new();
@@ -992,24 +992,24 @@
992 gtk_widget_set_events(event_box, GDK_BUTTON_PRESS_MASK);992 gtk_widget_set_events(event_box, GDK_BUTTON_PRESS_MASK);
993 g_signal_connect(event_box, "button_press_event", G_CALLBACK(win_level_bar_clicked), NULL);993 g_signal_connect(event_box, "button_press_event", G_CALLBACK(win_level_bar_clicked), NULL);
994994
995 // Create GtkLevelBar widget and put it in the GtkEventBox995 // Create a LevelBar widget and put it in the GtkEventBox
996 g_win.level_bar = gtk_level_bar_new();996 g_win.level_bar = level_bar_new();
997 gtk_widget_show(g_win.level_bar);997 gtk_widget_show(g_win.level_bar);
998 gtk_container_add(GTK_CONTAINER(event_box), g_win.level_bar);998 gtk_container_add(GTK_CONTAINER(event_box), g_win.level_bar);
999 gtk_level_bar_set_fraction(GTK_LEVEL_BAR(g_win.level_bar), 0.0);999 level_bar_set_fraction(LEVEL_BAR(g_win.level_bar), 0.0);
10001000
1001 // How to draw the level bar?1001 // How to draw the level bar?
1002 // Get from DConf1002 // Get from DConf
1003 gint bar_shape = SHAPE_CIRCLE;1003 gint bar_shape = SHAPE_CIRCLE;
1004 conf_get_int_value("level-bar-shape", &bar_shape);1004 conf_get_int_value("level-bar-shape", &bar_shape);
1005 gtk_level_bar_set_shape(GTK_LEVEL_BAR(g_win.level_bar), bar_shape);1005 level_bar_set_shape(LEVEL_BAR(g_win.level_bar), bar_shape);
1006 // Notice: User can change this by RIGHT-clicking on the level-bar1006 // Notice: User can change this by RIGHT-clicking on the level-bar
10071007
1008 // Type of value on the level bar?1008 // Type of value on the level bar?
1009 // Get from DConf1009 // Get from DConf
1010 gint bar_value = VALUE_NONE;1010 gint bar_value = VALUE_NONE;
1011 conf_get_int_value("level-bar-value", &bar_value);1011 conf_get_int_value("level-bar-value", &bar_value);
1012 gtk_level_bar_set_value_type(GTK_LEVEL_BAR(g_win.level_bar), bar_value);1012 level_bar_set_value_type(LEVEL_BAR(g_win.level_bar), bar_value);
1013 // Notice: User can change this by LEFT-clicking on the level-bar1013 // Notice: User can change this by LEFT-clicking on the level-bar
10141014
1015 // Should we show RMS or peak-value on the levelbar?1015 // Should we show RMS or peak-value on the levelbar?
10161016
=== modified file 'src/rec-window.h'
--- src/rec-window.h 2015-02-06 14:13:34 +0000
+++ src/rec-window.h 2015-04-11 20:15:48 +0000
@@ -5,12 +5,12 @@
5#include <gtk/gtk.h>5#include <gtk/gtk.h>
6#include <gdk/gdk.h>6#include <gdk/gdk.h>
77
8#include "gtklevelbar.h"8#include "levelbar.h"
99
10// Width of the settings window10// Width of the settings window
11#define PREF_WINDOW_WIDTH 30011#define PREF_WINDOW_WIDTH 300
1212
13// PULSE_TYPE: Type of pulse on the gtklevelbar.13// PULSE_TYPE: Type of pulse on the levelbar.
14// Notice: This cannot be changed from the GUI.14// Notice: This cannot be changed from the GUI.
15// Use Gsettings/dconf-editor and find "level-bar-pulse-type" in apps -> audio-recorder.15// Use Gsettings/dconf-editor and find "level-bar-pulse-type" in apps -> audio-recorder.
16typedef enum PULSE_TYPE {PULSE_PEAK, PULSE_RMS} PULSE_TYPE;16typedef enum PULSE_TYPE {PULSE_PEAK, PULSE_RMS} PULSE_TYPE;
1717
=== modified file 'src/settings.c'
--- src/settings.c 2015-02-10 20:45:27 +0000
+++ src/settings.c 2015-04-11 20:15:48 +0000
@@ -354,7 +354,7 @@
354 case COMM_PROGRAM:354 case COMM_PROGRAM:
355 descr = g_strdup(item->description);355 descr = g_strdup(item->description);
356356
357 pixbuf = load_icon_pixbuf(item->icon_name);357 pixbuf = load_icon_pixbuf(item->icon_name, 22);
358358
359 // Translators: This is a label/help text in the [Additional settings] dialog359 // Translators: This is a label/help text in the [Additional settings] dialog
360 help_text = g_strdup(_("Select both output device (speakers) and webcam/microphone."));360 help_text = g_strdup(_("Select both output device (speakers) and webcam/microphone."));
361361
=== modified file 'src/systray-icon.c'
--- src/systray-icon.c 2015-02-06 14:13:34 +0000
+++ src/systray-icon.c 2015-04-11 20:15:48 +0000
@@ -101,7 +101,7 @@
101static void systray_popup_menu_cb(GtkWidget * widget, gpointer data) {101static void systray_popup_menu_cb(GtkWidget * widget, gpointer data) {
102 gchar *cmd = (gchar*)data;102 gchar *cmd = (gchar*)data;
103103
104 LOG_SYSTRAY("%s: systray_popup_menu_cb: %s\n", INSTALLED_INDICATOR_TYPE, cmd);104 LOG_SYSTRAY("systray_popup_menu_cb: %s\n", cmd);
105105
106 if (!g_strcmp0(cmd, "start")) {106 if (!g_strcmp0(cmd, "start")) {
107 rec_manager_flip_recording();107 rec_manager_flip_recording();
108108
=== modified file 'src/utility.c'
--- src/utility.c 2015-02-06 14:13:34 +0000
+++ src/utility.c 2015-04-11 20:15:48 +0000
@@ -923,7 +923,7 @@
923 return value;923 return value;
924}924}
925925
926GdkPixbuf *load_icon_pixbuf(gchar *icon_name) {926GdkPixbuf *load_icon_pixbuf(gchar *icon_name, guint _size) {
927 // Load icon pixbuf from current icon theme.927 // Load icon pixbuf from current icon theme.
928 GdkPixbuf *pixbuf = NULL;928 GdkPixbuf *pixbuf = NULL;
929929
@@ -935,11 +935,11 @@
935 GtkIconTheme *theme = gtk_icon_theme_get_default();935 GtkIconTheme *theme = gtk_icon_theme_get_default();
936936
937 // Load icon from its theme937 // Load icon from its theme
938 pixbuf = gtk_icon_theme_load_icon(theme, icon_name, 22, 0, NULL);938 pixbuf = gtk_icon_theme_load_icon(theme, icon_name, _size, 0, NULL);
939939
940 // Got it?940 // Got it?
941 if (GDK_IS_PIXBUF(pixbuf)) {941 if (GDK_IS_PIXBUF(pixbuf)) {
942 return pixbuf;942 goto LBL_1;
943 }943 }
944944
945 // Executable name != icon_name.945 // Executable name != icon_name.
@@ -969,13 +969,22 @@
969969
970 if (icon_n) {970 if (icon_n) {
971 // Load icon971 // Load icon
972 pixbuf = gtk_icon_theme_load_icon(theme, icon_n, 22, 0, NULL);972 pixbuf = gtk_icon_theme_load_icon(theme, icon_n, _size, 0, NULL);
973 }973 }
974974
975 g_free(icon_n);975 g_free(icon_n);
976 g_free(desktop_file);976 g_free(desktop_file);
977 g_object_unref(app_info);977 g_object_unref(app_info);
978978
979LBL_1:
980
981 // Some icons are large. Force to _size.
982 if (GDK_IS_PIXBUF(pixbuf)) {
983 GdkPixbuf *img = gdk_pixbuf_scale_simple(pixbuf, _size, _size, GDK_INTERP_HYPER);
984 g_object_unref(pixbuf);
985 pixbuf = img;
986 }
987
979 // Caller should g_object_unref() this value988 // Caller should g_object_unref() this value
980 return pixbuf;989 return pixbuf;
981}990}
982991
=== modified file 'src/utility.h'
--- src/utility.h 2014-10-27 17:16:32 +0000
+++ src/utility.h 2015-04-11 20:15:48 +0000
@@ -74,7 +74,7 @@
74gboolean str_lists_equal(GList *l1, GList *l2);74gboolean str_lists_equal(GList *l1, GList *l2);
7575
76gchar *read_value_from_keyfile(gchar *key_file, gchar *group_name, gchar *key_name);76gchar *read_value_from_keyfile(gchar *key_file, gchar *group_name, gchar *key_name);
77GdkPixbuf *load_icon_pixbuf(gchar *icon_name);77GdkPixbuf *load_icon_pixbuf(gchar *icon_name, guint _size);
7878
79void kill_frozen_instances(gchar *program_path, GPid preserve_pid);79void kill_frozen_instances(gchar *program_path, GPid preserve_pid);
80void kill_program_by_name(gchar *app_name, GPid preserve_pid);80void kill_program_by_name(gchar *app_name, GPid preserve_pid);

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: