~ubuntu-branches/ubuntu/quantal/alsa-utils/quantal

« back to all changes in this revision

Viewing changes to debian/patches/aplay_interactive.patch

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich
  • Date: 2012-02-16 13:44:24 UTC
  • mfrom: (1.2.16) (2.3.16 sid)
  • Revision ID: package-import@ubuntu.com-20120216134424-bolv9yy21p006jv2
Tags: 1.0.25-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Move alsactl to sbin
  - Move init script volume settings to new alsactl database:
    + Set sane level for 'Speaker' and 'Headphone', needed for Dell Mini 9
      and Dell E series
    + ute PC Beep on hda cards that support it during initial volume setup
    + Mute *Analog/Digital Control for Creative cards by default
    + Default Digital Input Source to be Digital Mic 1 so that users
      with digital mic will be able to use it out of the box
    + Mute "IEC958 Optical Raw" by default
    + Set sane level for headphone 1 for Dell Studio XPS with 2.6.30
    + Prefer built-in digital mics on newer Dells
    + Unmute 'Line HP Swap' for Dove boards
  - ship udev rules file in /lib/udev/rules.d
  - debian/README.init.cs4236: Include in /usr/share/doc/alsa-utils so that
    users of snd-cs4236 (e.g., ThinkPad 600) can have audible sound
  - debian/patches/unset_pulse_internal.patch: We don't want alsamixer to
    show the pulse mixer by default, since it can be controlled from
    pulseaudio itself
  - Use upstart jobs for storing/restoring card settings
  - Add udev rule to apply UCM profiles for panda and equivalent hardware
  - Install alsa udev rules, at the least they are needed for hotplugged
    devices
  - Add Vcs-Bzr field

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff --git a/aplay/aplay.1 b/aplay/aplay.1
2
 
index b6caf0b..8cd1d56 100644
3
 
--- a/aplay/aplay.1
4
 
+++ b/aplay/aplay.1
5
 
@@ -137,6 +137,10 @@ by typing aplay.
6
 
 Record.  This is the default if the program is invoked
7
 
 by typing arecord.
8
 
 .TP
9
 
+\fI\-i, \-\-interactive\fP
10
 
+Allow interactive operation via stdin.
11
 
+Currently only pause/resume via space key is implemented.
12
 
+.TP
13
 
 \fI\-\-disable\-resample\fP
14
 
 Disable automatic rate resample.
15
 
 .TP
16
 
diff --git a/aplay/aplay.c b/aplay/aplay.c
17
 
index c09f23c..04959b8 100644
18
 
--- a/aplay/aplay.c
19
 
+++ b/aplay/aplay.c
20
 
@@ -103,6 +103,7 @@ static int avail_min = -1;
21
 
 static int start_delay = 0;
22
 
 static int stop_delay = 0;
23
 
 static int monotonic = 0;
24
 
+static int interactive = 0;
25
 
 static int can_pause = 0;
26
 
 static int verbose = 0;
27
 
 static int vumeter = VUMETER_NONE;
28
 
@@ -200,6 +201,7 @@ _("Usage: %s [OPTION]... [FILE]...\n"
29
 
 "-v, --verbose           show PCM structure and setup (accumulative)\n"
30
 
 "-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)\n"
31
 
 "-I, --separate-channels one file for each channel\n"
32
 
+"-i, --interactive       allow interactive operation from stdin\n"
33
 
 "    --disable-resample  disable automatic rate resample\n"
34
 
 "    --disable-channels  disable automatic channel conversions\n"
35
 
 "    --disable-format    disable automatic format conversions\n"
36
 
@@ -404,7 +406,7 @@ enum {
37
 
 int main(int argc, char *argv[])
38
 
 {
39
 
        int option_index;
40
 
-       static const char short_options[] = "hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPC";
41
 
+       static const char short_options[] = "hnlLD:qt:c:f:r:d:MNF:A:R:T:B:vV:IPCi";
42
 
        static const struct option long_options[] = {
43
 
                {"help", 0, 0, 'h'},
44
 
                {"version", 0, 0, OPT_VERSION},
45
 
@@ -442,6 +444,7 @@ int main(int argc, char *argv[])
46
 
                {"max-file-time", 1, 0, OPT_MAX_FILE_TIME},
47
 
                {"process-id-file", 1, 0, OPT_PROCESS_ID_FILE},
48
 
                {"use-strftime", 0, 0, OPT_USE_STRFTIME},
49
 
+               {"interactive", 0, 0, 'i'},
50
 
                {0, 0, 0, 0}
51
 
        };
52
 
        char *pcm_name = "default";
53
 
@@ -608,6 +611,9 @@ int main(int argc, char *argv[])
54
 
                        if (file_type == FORMAT_DEFAULT)
55
 
                                file_type = FORMAT_WAVE;
56
 
                        break;
57
 
+               case 'i':
58
 
+                       interactive = 1;
59
 
+                       break;
60
 
                case OPT_DISABLE_RESAMPLE:
61
 
                        open_mode |= SND_PCM_NO_AUTO_RESAMPLE;
62
 
                        break;
63
 
@@ -1206,6 +1212,8 @@ static void init_stdin(void)
64
 
        struct termios term;
65
 
        long flags;
66
 
 
67
 
+       if (!interactive)
68
 
+               return;
69
 
        tcgetattr(fileno(stdin), &term);
70
 
        term_c_lflag = term.c_lflag;
71
 
        if (fd == fileno(stdin))
72
 
@@ -1221,6 +1229,8 @@ static void done_stdin(void)
73
 
 {
74
 
        struct termios term;
75
 
 
76
 
+       if (!interactive)
77
 
+               return;
78
 
        if (fd == fileno(stdin) || term_c_lflag == -1)
79
 
                return;
80
 
        tcgetattr(fileno(stdin), &term);
81
 
@@ -1258,6 +1268,8 @@ static void check_stdin(void)
82
 
 {
83
 
        unsigned char b;
84
 
 
85
 
+       if (!interactive)
86
 
+               return;
87
 
        if (fd != fileno(stdin)) {
88
 
                while (read(fileno(stdin), &b, 1) == 1) {
89
 
                        if (b == ' ' || b == '\r') {
90