Volume changing

Replies:

Parents:

  • None.

--Part10104021035.A22963
Content-Type: Text/Plain; charset="us-ascii"

I was over at Geralds' the other night and he showed me this neat key
binding to pause xmms[1] with the Pause/Break key.  The command to
pause xmms is "xmms -u" from the command line.

Both him and I use enlightenment[2] so binding the key is relatively
easy from the enlightenment configuration[3] program.

Gerald then said it was too bad that he couldn't control the volume,
and I was sure there was a program from the command line that could do
it.  Doing some searching with man I found aumix is capable.

So I spent some time and wrote this small perl script.  I am no perl
expert so feel free to modify the code.  The code is a bit anal, but is
quite readable.  You shell scripters could probably do it in a couple
of lines.

 1. www.xmms.org
 2. www.enlightenment.org
 3. I don't think it's being actively developed anymore, but you can
find it at www.rpmfind.net or search for it over the web.  If you can't
contact me.

Chris


--Part10104021035.A22963
Content-Type: Application/Octet-Stream; name="cvol.pl"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="cvol.pl"

IyEvdXNyL2Jpbi9wZXJsCgojIE1PRFVMRQojIFRoaXMgcHJvZ3JhbSB3aWxs
IGFkanVzdCB0aGUgdm9sdW1lIG9mIHRoZSBQQ00gdXNpbmcgYXVtaXguCiMg
SXQgd2lsbCB0YWtlIGFyZ3VtZW50cyArIGFuZCAtIHRvIGluY3JlYXNlIGFu
ZCBkZWNyZWFzZSB0aGUKIyB2b2x1bWUgcmVzcGVjdGl2ZWx5LgojIEVORCBN
T0RVTEUKCnN1YiBxdWVyeVBDTSB7CiAgIAogICAgbG9jYWwgJHZvbHVtZSA9
IC0xOwogICAgbG9jYWwgJGNvbW1hbmQgPSAiYXVtaXggLXEiOwoKICAgIG9w
ZW4gKEFVTUlYLCAiJGNvbW1hbmQgfCIpIHx8IGRpZSAiQ2Fubm90IGV4ZWN1
dGUgJGNvbW1hbmRcbiI7CiAKICAgIHdoaWxlICg8QVVNSVg+KSB7CiMgOiBn
ZXQgY3VycmVudCBwY20gdm9sdW1lIHNldHRpbmcKICAgICAgICBpZiAoJF8g
PX4gL3BjbVxzKFxkKykvKSB7CgkgICAgJ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nQgIlVzYWdlOiBjdm9sLnBsICt8LVxuIjsKICAg
ICAgICBwcmludCAiKyB0byBpbmNyZWFzZSB2b2x1bWVcbiI7CiAgICAgICAg
cHJpbnQgIi0gdG8gZGVjcmVhc2Ugdm9sdW1lXG4iOwoJcmV0dXJuIDE7CiAg
ICB9CgogICAgJHBjbSA9IHF1ZXJ5UENNKCk7CiAgICBpZiAoJHBjbSA9PSAt
MSkgewoJcmV0dXJuIDE7CiAgICB9CgogICAgY2hhbmdlVm9sKCRpbmNfZGVj
LCAkcGNtKTsKCiAgICByZXR1cm4gMDsKfQoKZXhpdCBtYWluKCk7Cgo=

--Part10104021035.A22963--

Re: Volume changing

Replies:

Parents:

On Mon, Apr 02, 2001 at 10:35:57AM -0500, Christopher Yap wrote:
> I was over at Geralds' the other night and he showed me this neat key
> binding to pause xmms[1] with the Pause/Break key.  The command to
> pause xmms is "xmms -u" from the command line.
>
> Both him and I use enlightenment[2] so binding the key is relatively
> easy from the enlightenment configuration[3] program.
>
> Gerald then said it was too bad that he couldn't control the volume,
> and I was sure there was a program from the command line that could do
> it.  Doing some searching with man I found aumix is capable.

Cool!

But I don't understand why your extra perl script is needed -- I
just set up enlightenment to call "aumix -v+10" or "aumix -v-10"
whenever I press +/- on the keypad. (-v sets the master volume,
and -w sets the pcm.)

I wonder what the reasons are to use the master volume vs pcm? In
the past I have generally left the pcm at 90% (in xmms) and used
a gnome-panel applet to change the master volume.

--
Gerald Oskoboiny <[email protected]>
http://impressive.net/people/gerald/

Re: Volume changing

Replies:

  • None.

Parents:

On Sat, 14 Apr 2001, Gerald Oskoboiny wrote:

> On Mon, Apr 02, 2001 at 10:35:57AM -0500, Christopher Yap wrote:
> > I was over at Geralds' the other night and he showed me this neat key
> > binding to pause xmms[1] with the Pause/Break key.  The command to
> > pause xmms is "xmms -u" from the command line.
> >
> > Both him and I use enlightenment[2] so binding the key is relatively
> > easy from the enlightenment configuration[3] program.
> >
> > Gerald then said it was too bad that he couldn't control the volume,
> > and I was sure there was a program from the command line that could do
> > it.  Doing some searching with man I found aumix is capable.
>
> Cool!
>
> But I don't understand why your extra perl script is needed -- I
> just set up enlightenment to call "aumix -v+10" or "aumix -v-10"
> whenever I press +/- on the keypad. (-v sets the master volume,
> and -w sets the pcm.)
>
> I wonder what the reasons are to use the master volume vs pcm? In
> the past I have generally left the pcm at 90% (in xmms) and used
> a gnome-panel applet to change the master volume.
>
>
Boy do I feel stoopid :)

See I knew someone would figure out a faster way.  To be honest I never
even thought about binding the command to the key.  Guess I am too used to
scripting stuff and that's what first popped into my head.  Getting old.

Chris

HURL: fogo mailing list archives, maintained by Gerald Oskoboiny