1 | //enumdev.h: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010-2013 |
---|
5 | * |
---|
6 | * This file is part of libroar a part of RoarAudio, |
---|
7 | * a cross-platform sound system for both, home and professional use. |
---|
8 | * See README for details. |
---|
9 | * |
---|
10 | * This file is free software; you can redistribute it and/or modify |
---|
11 | * it under the terms of the GNU General Public License version 3 |
---|
12 | * as published by the Free Software Foundation. |
---|
13 | * |
---|
14 | * libroar is distributed in the hope that it will be useful, |
---|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | * GNU General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with this software; see the file COPYING. If not, write to |
---|
21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
22 | * Boston, MA 02110-1301, USA. |
---|
23 | * |
---|
24 | * NOTE for everyone want's to change something and send patches: |
---|
25 | * read README and HACKING! There a addition information on |
---|
26 | * the license of this document you need to read before you send |
---|
27 | * any patches. |
---|
28 | * |
---|
29 | * NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc |
---|
30 | * or libpulse*: |
---|
31 | * The libs libroaresd, libroararts and libroarpulse link this lib |
---|
32 | * and are therefore GPL. Because of this it may be illigal to use |
---|
33 | * them with any software that uses libesd, libartsc or libpulse*. |
---|
34 | */ |
---|
35 | |
---|
36 | #ifndef _LIBROARENUMDEV_H_ |
---|
37 | #define _LIBROARENUMDEV_H_ |
---|
38 | |
---|
39 | #include "libroar.h" |
---|
40 | |
---|
41 | #define ROAR_ENUM_FLAG_NONE 0x0000 /* no flags set */ |
---|
42 | #define ROAR_ENUM_FLAG_DESC 0x0001 /* ask for server description 1 */ |
---|
43 | #define ROAR_ENUM_FLAG_LOCATION 0x0002 /* ask for server location 1 */ |
---|
44 | #define ROAR_ENUM_FLAG_NONBLOCK 0x0004 /* do not block */ |
---|
45 | #define ROAR_ENUM_FLAG_HARDNONBLOCK 0x0008 /* do even less block than NONBLOCK */ |
---|
46 | #define ROAR_ENUM_FLAG_LOCALONLY 0x0010 /* only list local servers */ |
---|
47 | /* |
---|
48 | * 1 = This is a request. The result may include or not include the data anyway. |
---|
49 | * This is only so the lib does not need to spend extra work when data is not needed. |
---|
50 | */ |
---|
51 | |
---|
52 | struct roar_server { |
---|
53 | const char * server; |
---|
54 | const char * description; |
---|
55 | const char * location; |
---|
56 | }; |
---|
57 | |
---|
58 | struct roar_mixer { |
---|
59 | const int dir; |
---|
60 | //... |
---|
61 | }; |
---|
62 | |
---|
63 | /* Get a list of possible devices |
---|
64 | * |
---|
65 | * This function returns a list of possible device names. |
---|
66 | * The list is for suggestions in GUIs and simular. |
---|
67 | * A implementation SHOULD (VERY, VERY RECOMMENDED) have a freeform |
---|
68 | * input so the user can enter any server address. |
---|
69 | * |
---|
70 | * The list returned is a array of struct roar_server elements. |
---|
71 | * The final element has the member server set to NULL. |
---|
72 | * This element represents the default server (libroar will try to find |
---|
73 | * a server on it's own). |
---|
74 | * |
---|
75 | */ |
---|
76 | struct roar_server * roar_enum_servers(int flags, int dir, int socktype); |
---|
77 | |
---|
78 | /* Free the server list |
---|
79 | */ |
---|
80 | int roar_enum_servers_free(struct roar_server * servs); |
---|
81 | |
---|
82 | /* Return the number of elements in the server list |
---|
83 | * |
---|
84 | * This function is a optimized way to find out how may entry are in the server list. |
---|
85 | * However you should not call this too often and avoid needing to know the total at all. |
---|
86 | * Write software in a way that it tests for the server == NULL condition. |
---|
87 | */ |
---|
88 | ssize_t roar_enum_servers_num(struct roar_server * servs); |
---|
89 | |
---|
90 | #endif |
---|
91 | |
---|
92 | //ll |
---|