diff options
author | Lars Engels <lme@FreeBSD.org> | 2015-03-07 21:16:56 +0000 |
---|---|---|
committer | Lars Engels <lme@FreeBSD.org> | 2015-03-07 21:16:56 +0000 |
commit | 58e5d866f71444c4b73a3abd3c70cf8e1ca09959 (patch) | |
tree | 5fbce701db2e5b477b7d33001d6e6bab2b8f9c61 /audio/volumeicon | |
parent | 7a46846564f8ab864b6d6d6585187ecdb4abe7dd (diff) |
Notes
Diffstat (limited to 'audio/volumeicon')
-rw-r--r-- | audio/volumeicon/Makefile | 29 | ||||
-rw-r--r-- | audio/volumeicon/distinfo | 2 | ||||
-rw-r--r-- | audio/volumeicon/files/patch-src_oss__backend.c | 180 | ||||
-rw-r--r-- | audio/volumeicon/pkg-descr | 13 | ||||
-rw-r--r-- | audio/volumeicon/pkg-plist | 36 |
5 files changed, 260 insertions, 0 deletions
diff --git a/audio/volumeicon/Makefile b/audio/volumeicon/Makefile new file mode 100644 index 000000000000..4001b091e821 --- /dev/null +++ b/audio/volumeicon/Makefile @@ -0,0 +1,29 @@ +# $FreeBSD$ + +PORTNAME= volumeicon +PORTVERSION= 0.5.0 +CATEGORIES= audio +MASTER_SITES= http://softwarebakery.com/maato/files/volumeicon/ + +MAINTAINER= lme@FfreeBSD.org +COMMENT= Lightweight volume control for the systray + +LICENSE= GPLv3 + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --enable-oss \ + --with-oss-include-path=/usr/include/sys +CPPFLAGS+= -I${LOCALBASE}/include +LIBS+= -L${LOCALBASE}/lib + +USES= gmake gettext pkgconfig +USE_GNOME= gtk30 + +OPTIONS_DEFINE= NLS NOTIFY +OPTIONS_DEFAULT= NOTIFY +OPTIONS_SUB= yes + +NOTIFY_LIB_DEPENDS= libnotify.so:${PORTSDIR}/devel/libnotify +NOTIFY_CONFIGURE_ENABLE=notify + +.include <bsd.port.mk> diff --git a/audio/volumeicon/distinfo b/audio/volumeicon/distinfo new file mode 100644 index 000000000000..99b20f834e6e --- /dev/null +++ b/audio/volumeicon/distinfo @@ -0,0 +1,2 @@ +SHA256 (volumeicon-0.5.0.tar.gz) = e5f1179f9ec5ab25e3740e4f6bbe0baa75368f0ae87d370197b3fbefb61bd782 +SIZE (volumeicon-0.5.0.tar.gz) = 160089 diff --git a/audio/volumeicon/files/patch-src_oss__backend.c b/audio/volumeicon/files/patch-src_oss__backend.c new file mode 100644 index 000000000000..f67eb62e50d2 --- /dev/null +++ b/audio/volumeicon/files/patch-src_oss__backend.c @@ -0,0 +1,180 @@ +--- src/oss_backend.c.orig 2013-02-25 16:52:49.000000000 +0100 ++++ src/oss_backend.c 2015-03-07 20:58:26.522101000 +0100 +@@ -22,7 +22,7 @@ + //############################################################################## + + #include OSS_HEADER +-#include <stropts.h> ++#include <sys/soundcard.h> + #include <fcntl.h> + #include <assert.h> + #include <stdlib.h> +@@ -30,12 +30,16 @@ + + #include "oss_backend.h" + ++#define MIXT_MONOSLIDER16 19 ++#define MIXT_STEREOSLIDER16 20 ++#define MIXT_MUTE 21 ++ + //############################################################################## + // Static variables + //############################################################################## + static char * m_channel = NULL; + static GList * m_channel_names = NULL; +-static int m_actual_maxvalue = 0; ++//static int m_actual_maxvalue = 0; + static int m_mixer_fd = -1; + static oss_mixext m_ext; + +@@ -44,6 +48,7 @@ static oss_mixext m_ext; + //############################################################################## + static int get_raw_value() + { ++#if 0 + assert(m_mixer_fd != -1); + + oss_mixer_value vr; +@@ -51,7 +56,7 @@ static int get_raw_value() + vr.ctrl = m_ext.ctrl; + vr.timestamp = m_ext.timestamp; + +- int result = ioctl(m_mixer_fd, SNDCTL_MIX_READ, &vr); ++ int result = ioctl(m_mixer_fd, SOUND_MIXER_READ_VOLUME, &vr); + if(result == -1) + return 0; + +@@ -78,6 +83,7 @@ static int get_raw_value() + return short_value->lower; + } + ++#endif + return 0; + } + +@@ -97,9 +103,20 @@ const GList * oss_get_channel_names() + int oss_get_volume() + { + assert(m_mixer_fd != -1); ++#if 0 + if(m_actual_maxvalue == 0) + return 0; + return 100 * get_raw_value() / m_actual_maxvalue; ++#endif ++ ++ int current_volume; ++ if (ioctl(m_mixer_fd, SOUND_MIXER_READ_VOLUME, ¤t_volume) == -1) { ++ perror("Cannot read volume!"); ++ exit(EXIT_FAILURE); ++ } ++ ++ /* Only the left channel is returned */ ++ return current_volume & 0x7f; + } + + gboolean oss_get_mute() +@@ -108,6 +125,7 @@ gboolean oss_get_mute() + + gboolean mute = FALSE; + ++#if 0 + // Save current control; + int parent = m_ext.parent; + int control = m_ext.ctrl; +@@ -132,6 +150,7 @@ gboolean oss_get_mute() + // Restore to previous control + m_ext.ctrl = control; + ioctl(m_mixer_fd, SNDCTL_MIX_EXTINFO, &m_ext); ++#endif + + return mute; + } +@@ -148,12 +167,13 @@ void oss_setup(const gchar * card, const + char * devmixer; + if((devmixer=getenv("OSS_MIXERDEV")) == NULL) + devmixer = "/dev/mixer"; +- if((m_mixer_fd = open(devmixer, O_RDWR, 0)) == -1) ++ if((m_mixer_fd = open(devmixer, O_RDWR)) == -1) + { + perror(devmixer); + exit(1); + } + ++#if 0 + // Check that there is at least one mixer + int nmix; + ioctl(m_mixer_fd, SNDCTL_MIX_NRMIX, &nmix); +@@ -163,6 +183,7 @@ void oss_setup(const gchar * card, const + exit(EXIT_FAILURE); + } + ++ + m_ext.dev=0; + m_ext.ctrl = 0; + while(ioctl(m_mixer_fd, SNDCTL_MIX_EXTINFO, &m_ext) >= 0) +@@ -175,6 +196,7 @@ void oss_setup(const gchar * card, const + } + m_ext.ctrl++; + } ++#endif + + // Setup channel using the provided channelname + if(channel != NULL) +@@ -195,6 +217,7 @@ void oss_set_channel(const gchar * chann + g_free(m_channel); + m_channel = g_strdup(channel); + ++#if 0 + // Find channel and then return + m_ext.dev=0; + m_ext.ctrl = 0; +@@ -207,6 +230,7 @@ void oss_set_channel(const gchar * chann + } + m_ext.ctrl++; + } ++#endif + } + + void oss_set_mute(gboolean mute) +@@ -219,6 +243,7 @@ void oss_set_mute(gboolean mute) + + // Check for mute in this group + m_ext.ctrl = 0; ++#if 0 + while(ioctl(m_mixer_fd, SNDCTL_MIX_EXTINFO, &m_ext) >= 0) + { + if(m_ext.parent == parent && m_ext.type == MIXT_MUTE) +@@ -239,6 +264,7 @@ void oss_set_mute(gboolean mute) + m_ext.ctrl = control; + ioctl(m_mixer_fd, SNDCTL_MIX_EXTINFO, &m_ext); + ++#endif + // If no mute control was found, revert to setting the volume to zero + if(!mute_found && mute) + { +@@ -251,6 +277,7 @@ void oss_set_volume(int volume) + assert(m_mixer_fd != -1); + assert(volume >= 0 && volume <= 100); + ++#if 0 + oss_mixer_value vr; + vr.dev = m_ext.dev; + vr.ctrl = m_ext.ctrl; +@@ -286,9 +313,14 @@ void oss_set_volume(int volume) + default: + return; + } +- +- ioctl(m_mixer_fd, SNDCTL_MIX_WRITE, &vr); +- ++#endif ++ volume = (volume << 8) | volume; ++ if(ioctl(m_mixer_fd, SOUND_MIXER_WRITE_VOLUME, &volume) == -1) { ++ perror("Mixer write failed"); ++ exit(EXIT_FAILURE); ++ } ++#if 0 + if(volume == 100) + m_actual_maxvalue = get_raw_value(); ++#endif + } diff --git a/audio/volumeicon/pkg-descr b/audio/volumeicon/pkg-descr new file mode 100644 index 000000000000..761a6f6c9f6c --- /dev/null +++ b/audio/volumeicon/pkg-descr @@ -0,0 +1,13 @@ +Volume Icon aims to be a lightweight volume control that sits in your systray. +It is often used in conjuction with the lightweight tint2 panel/taskbar. + +Features + +- Change volume by scrolling on the systray icon +- Ability to choose which channel to control +- Several icon themes (with gtk theme as default) +- Configurable external mixer +- Volume Slider +- Hotkey support + +WWW: http://softwarebakery.com/maato/volumeicon.html diff --git a/audio/volumeicon/pkg-plist b/audio/volumeicon/pkg-plist new file mode 100644 index 000000000000..87a2db1fa539 --- /dev/null +++ b/audio/volumeicon/pkg-plist @@ -0,0 +1,36 @@ +bin/volumeicon +%%NLS%%share/locale/fr/LC_MESSAGES/volumeicon.mo +%%DATADIR%%/gui/appicon.svg +%%DATADIR%%/gui/preferences.ui +%%DATADIR%%/icons/Black Gnome/1.png +%%DATADIR%%/icons/Black Gnome/2.png +%%DATADIR%%/icons/Black Gnome/3.png +%%DATADIR%%/icons/Black Gnome/4.png +%%DATADIR%%/icons/Black Gnome/5.png +%%DATADIR%%/icons/Black Gnome/6.png +%%DATADIR%%/icons/Black Gnome/7.png +%%DATADIR%%/icons/Black Gnome/8.png +%%DATADIR%%/icons/Blue Bar/1.png +%%DATADIR%%/icons/Blue Bar/2.png +%%DATADIR%%/icons/Blue Bar/3.png +%%DATADIR%%/icons/Blue Bar/4.png +%%DATADIR%%/icons/Blue Bar/5.png +%%DATADIR%%/icons/Blue Bar/6.png +%%DATADIR%%/icons/Blue Bar/7.png +%%DATADIR%%/icons/Blue Bar/8.png +%%DATADIR%%/icons/White Gnome/1.png +%%DATADIR%%/icons/White Gnome/2.png +%%DATADIR%%/icons/White Gnome/3.png +%%DATADIR%%/icons/White Gnome/4.png +%%DATADIR%%/icons/White Gnome/5.png +%%DATADIR%%/icons/White Gnome/6.png +%%DATADIR%%/icons/White Gnome/7.png +%%DATADIR%%/icons/White Gnome/8.png +%%DATADIR%%/icons/tango/1.png +%%DATADIR%%/icons/tango/2.png +%%DATADIR%%/icons/tango/3.png +%%DATADIR%%/icons/tango/4.png +%%DATADIR%%/icons/tango/5.png +%%DATADIR%%/icons/tango/6.png +%%DATADIR%%/icons/tango/7.png +%%DATADIR%%/icons/tango/8.png |