~ubuntu-branches/ubuntu/trusty/alsa-utils/trusty

« back to all changes in this revision

Viewing changes to alsactl/alsactl.h

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich
  • Date: 2013-07-26 10:56:44 UTC
  • mfrom: (1.2.17) (93.1.1 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130726105644-kim9enke2jnozg73
Tags: 1.0.27.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - 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
    + Set reasonable volume levels for VMWare guests using snd.ens1371
  - 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
  - Add Vcs-Bzr field
* Create a new upstart job for the alsa state daemon, and adjust the
  other upstart jobs accordingly
* Put the daemon file in /var/lib/alsa

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
extern int debugflag;
2
2
extern int force_restore;
3
3
extern int ignore_nocards;
 
4
extern int do_lock;
 
5
extern int use_syslog;
4
6
extern char *command;
5
7
extern char *statefile;
6
8
 
7
 
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
8
 
#define info(...) do {\
9
 
        fprintf(stdout, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
10
 
        fprintf(stdout, __VA_ARGS__); \
11
 
        putc('\n', stdout); \
12
 
} while (0)
13
 
#else
14
 
#define info(args...) do {\
15
 
        fprintf(stdout, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
16
 
        fprintf(stdout, ##args); \
17
 
        putc('\n', stdout); \
18
 
} while (0)
19
 
#endif  
20
 
 
21
 
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
22
 
#define error(...) do {\
23
 
        fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
24
 
        fprintf(stderr, __VA_ARGS__); \
25
 
        putc('\n', stderr); \
26
 
} while (0)
27
 
#else
28
 
#define error(args...) do {\
29
 
        fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
30
 
        fprintf(stderr, ##args); \
31
 
        putc('\n', stderr); \
32
 
} while (0)
33
 
#endif  
34
 
 
35
 
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
36
 
#define cerror(cond, ...) do {\
37
 
        if (cond || debugflag) { \
38
 
                fprintf(stderr, "%s%s: %s:%d: ", debugflag ? "WARNING: " : "", command, __FUNCTION__, __LINE__); \
39
 
                fprintf(stderr, __VA_ARGS__); \
40
 
                putc('\n', stderr); \
41
 
        } \
42
 
} while (0)
43
 
#else
44
 
#define cerror(cond, args...) do {\
45
 
        if (cond || debugflag) { \
46
 
                fprintf(stderr, "%s%s: %s:%d: ", debugflag ? "WARNING: " : "", command, __FUNCTION__, __LINE__); \
47
 
                fprintf(stderr, ##args); \
48
 
                putc('\n', stderr); \
49
 
        } \
50
 
} while (0)
51
 
#endif  
52
 
 
53
 
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
54
 
#define dbg(...) do {\
55
 
        if (!debugflag) break; \
56
 
        fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
57
 
        fprintf(stderr, __VA_ARGS__); \
58
 
        putc('\n', stderr); \
59
 
} while (0)
60
 
#else
61
 
#define dbg(args...) do {\
62
 
        if (!debugflag) break; \
63
 
        fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \
64
 
        fprintf(stderr, ##args); \
65
 
        putc('\n', stderr); \
66
 
} while (0)
 
9
void info_(const char *fcn, long line, const char *fmt, ...);
 
10
void error_(const char *fcn, long line, const char *fmt, ...);
 
11
void cerror_(const char *fcn, long line, int cond, const char *fmt, ...);
 
12
void dbg_(const char *fcn, long line, const char *fmt, ...);
 
13
 
 
14
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
 
15
#define info(...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
 
16
#define error(...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
 
17
#define cerror(cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0)
 
18
#define dbg(...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0)
 
19
#else
 
20
#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); }  while (0)
 
21
#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); }  while (0)
 
22
#define cerror(cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0)
 
23
#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); }  while (0)
67
24
#endif  
68
25
 
69
26
int init(const char *file, const char *cardname);
 
27
int state_lock(const char *file, int lock, int timeout);
70
28
int save_state(const char *file, const char *cardname);
71
29
int load_state(const char *file, const char *initfile, const char *cardname,
72
30
               int do_init);
73
31
int power(const char *argv[], int argc);
74
 
int generate_names(const char *cfgfile);
 
32
int state_daemon(const char *file, const char *cardname, int period,
 
33
                 const char *pidfile);
 
34
int state_daemon_kill(const char *pidfile, const char *cmd);
75
35
 
76
36
/* utils */
77
37
 
92
52
                return -1;
93
53
        return c;
94
54
}
 
55
 
 
56
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a)[0])