[4300] | 1 | //enumdev.h: |
---|
| 2 | |
---|
| 3 | /* |
---|
[4708] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010-2011 |
---|
[4300] | 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 | |
---|
[4355] | 41 | #define ROAR_ENUM_FLAG_NONE 0x0000 /* no flags set */ |
---|
| 42 | #define ROAR_ENUM_FLAG_DESC 0x0001 /* ask for server description */ |
---|
| 43 | #define ROAR_ENUM_FLAG_LOCATION 0x0002 /* ask for server location 1 */ |
---|
| 44 | #define ROAR_ENUM_FLAG_NONBLOCK 0x0004 /* do not block 1 */ |
---|
| 45 | #define ROAR_ENUM_FLAG_HARDNONBLOCK 0x0008 /* do even less block than NONBLOCK */ |
---|
| 46 | /* |
---|
| 47 | * 1 = This is a request. The result may include or not include the data anyway. |
---|
| 48 | * This is only so the lib does not need to spend extra work if data is not needed. |
---|
| 49 | */ |
---|
[4351] | 50 | |
---|
[4301] | 51 | struct roar_server { |
---|
| 52 | const char * server; |
---|
| 53 | const char * description; |
---|
| 54 | const char * location; |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | struct roar_mixer { |
---|
| 58 | const int dir; |
---|
| 59 | //... |
---|
| 60 | }; |
---|
| 61 | |
---|
[4355] | 62 | /* Get a list of possible devices |
---|
| 63 | * |
---|
| 64 | * This function returns a list of possible device names. |
---|
| 65 | * The list is for suggestions in GUIs and simular. |
---|
| 66 | * A implementation SHOULD (VERY, VERY RECOMMENDED) have a freeform |
---|
| 67 | * input so the user can enter any server address. |
---|
| 68 | * |
---|
| 69 | * The list returned is a array of struct roar_server elements. |
---|
| 70 | * The final element has the member server set to NULL. |
---|
| 71 | * This element represents the default server (libroar will try to find |
---|
| 72 | * a server on it's own). |
---|
| 73 | * |
---|
| 74 | */ |
---|
[4351] | 75 | struct roar_server * roar_enum_servers(int flags, int dir, int socktype); |
---|
[4355] | 76 | |
---|
| 77 | /* Free the server list |
---|
| 78 | */ |
---|
[4351] | 79 | int roar_enum_servers_free(struct roar_server * servs); |
---|
[4355] | 80 | |
---|
| 81 | /* Return the number of elements in the server list |
---|
| 82 | * |
---|
| 83 | * This function is a optimized way to find out how may entry are in the server list. |
---|
| 84 | * However you should not call this too often and avoid needing to know the total at all. |
---|
| 85 | * Write software in a way that it tests for the server == NULL condition. |
---|
| 86 | */ |
---|
[4351] | 87 | ssize_t roar_enum_servers_num(struct roar_server * servs); |
---|
| 88 | |
---|
[4300] | 89 | #endif |
---|
| 90 | |
---|
| 91 | //ll |
---|