File: fmlib.h

package info (click to toggle)
fmtools 2.0.8
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 220 kB
  • sloc: sh: 2,196; ansic: 687; makefile: 54
file content (58 lines) | stat: -rw-r--r-- 1,895 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* fmlib.c - simple V4L2 compatible tuner for radio cards

   Copyright (C) 2009 Ben Pfaff <blp@cs.stanford.edu>

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 2 of the License, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.

   You should have received a copy of the GNU General Public License along with
   this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef FMLIB_H
#define FMLIB_H 1

#include <linux/videodev2.h>
#include <stdint.h>
#include <stdbool.h>

struct tuner {
        int fd;
        int index;
        struct v4l2_queryctrl volume_ctrl;
        struct v4l2_tuner tuner;
        struct tuner_test *test;
};

extern char *program_name;

void fatal(int error, const char *msg, ...)
        __attribute__((noreturn, format(printf, 2, 3)));

void tuner_open(struct tuner *, const char *device, int index);
void tuner_close(struct tuner *);

bool tuner_is_muted(const struct tuner *);
void tuner_set_mute(struct tuner *, bool mute);

bool tuner_has_volume_control(const struct tuner *);
double tuner_get_volume(const struct tuner *);
void tuner_set_volume(struct tuner *, double volume);

long long int tuner_get_min_freq(const struct tuner *);
long long int tuner_get_max_freq(const struct tuner *);
void tuner_set_freq(const struct tuner *, long long int frequency,
                    bool override_range);

int tuner_get_signal(const struct tuner *);
void tuner_sleep(const struct tuner *, int secs);
void tuner_usleep(const struct tuner *, int usecs);

#endif /* fmlib.h */