17
|
1 |
-----------------------------------------------------------
|
19
|
2 |
stdin mixer - Copyright (C) 2007 Lluis Batlle i Rossell
|
17
|
3 |
Program licensed under GPL v2 or above.
|
|
4 |
See the file COPYING.
|
|
5 |
[http://vicerveza.homeunix.net/~viric/soft/stdinmix]
|
|
6 |
-----------------------------------------------------------
|
|
7 |
|
14
|
8 |
Motivation
|
|
9 |
-----------
|
|
10 |
I wanted to run mplayer, and command things to it using a key bind. I could
|
|
11 |
run "mplayer -slave", but I needed its standard input accessible from any other
|
|
12 |
program. Then, I wrote this program to share stdin.
|
|
13 |
|
|
14 |
|
|
15 |
What does it do
|
|
16 |
-----------------
|
|
17 |
It allows the standard input of a program to be accessible from other terminals
|
|
18 |
through a unix socket, offering also a simple client for this socket.
|
|
19 |
|
|
20 |
|
|
21 |
Exmaple of use
|
|
22 |
-----------------
|
|
23 |
You can try it with 'cat'. In a shell, start "stdinmix cat". Test how 'cat'
|
|
24 |
works; write lines, and see its output.
|
|
25 |
|
|
26 |
From another shell, start "stdinmix", and write there lines. See how they
|
|
27 |
are treated as if they went to 'cat' input. In fact they went to 'cat' input.
|
|
28 |
|
|
29 |
|
|
30 |
How does it work
|
|
31 |
------------------
|
|
32 |
'stdinmix [app]' allow two ways of sending commands to its child application
|
|
33 |
stdin:
|
|
34 |
- using the terminal stdin (as if you run the application alone)
|
|
35 |
- using a unix socket, by default at /tmp/socket-sm.UID, overwritable by
|
|
36 |
the environment variable SM_SOCKET.
|
|
37 |
|
|
38 |
If you don't specify any argument, it will connect to the mentioned unix socket,
|
|
39 |
and forward the current stdin to that socket.
|
|
40 |
|
|
41 |
|
17
|
42 |
Known problems
|
|
43 |
------------------
|
|
44 |
If you write data at the same time to the application stdin and to the unix
|
|
45 |
socket, both will be mixed in a quite unpredictable way. I let the user
|
|
46 |
control this not to happen.
|
|
47 |
|
|
48 |
|
14
|
49 |
How do I use it
|
|
50 |
------------------
|
|
51 |
I wanted a program for transcribing voice in audio tracks. I had mplayer, and
|
|
52 |
I only needed a way to send commands to it as "-slave". By now, on need,
|
|
53 |
I use xbindkeys [1] to map F1 to "mplayer-remote -p" (pause) and
|
|
54 |
F2 to "mplayer-remote -b" (back a few seconds). Then I can transcribe in
|
|
55 |
my favourite editor (vim) pausing and moving back the audio track when needed.
|
|
56 |
|
17
|
57 |
You can find some scripts in the utils/ directory.
|
|
58 |
|
|
59 |
|
|
60 |
Author
|
|
61 |
---------
|
19
|
62 |
Lluis Batlle i Rossell
|
17
|
63 |
[http://vicerveza.homeunix.net/~viric/]
|
|
64 |
[viric ĉe vicerveza punkto homelinux punkto net]
|
|
65 |
|
14
|
66 |
|
|
67 |
References
|
|
68 |
------------
|
|
69 |
[1] xbindkeys: http://hocwp.free.fr/xbindkeys/xbindkeys.html
|