1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains stuff that is needed almost everywhere in the ladishd
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED
28 #define COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED
30 #include "config.h" /* configure stage result */
32 #include <stdbool.h> /* C99 bool */
33 #include <stdint.h> /* fixed bit size ints */
39 #include <dbus/dbus.h>
40 #include <uuid/uuid.h>
42 #include "../dbus/service.h"
43 #include "../dbus/helpers.h"
44 #include "../common/klist.h"
45 #include "../common/debug.h"
47 /* JACK port or virtual port */
50 struct list_head siblings_studio_all
; /* link for the studio::all_ports list */
51 struct list_head siblings_studio
; /* link for the studio::ports list */
52 struct list_head siblings_room
; /* link for the room::ports list */
53 struct list_head siblings_client
; /* link for the port list of the client */
54 struct list_head siblings_vclient
; /* link for the port list of the virtual client */
56 uuid_t uuid
; /* The UUID of the port */
57 bool virtual; /* Whether the port is virtual or JACK port */
58 char * jack_name
; /* JACK name (short). Not valid for virtual ports. */
59 uint64_t jack_id
; /* JACK port ID. Not valid for virtual ports. */
60 char * human_name
; /* User assigned name */
62 struct client
* client_ptr
; /* JACK client this port belongs to. Not valid for virtual ports. */
63 struct client
* vclient_ptr
; /* Virtual client this port belongs to. NULL if there is no virtual client associated. */
65 /* superconnections are not in these lists */
66 struct list_head input_connections
; /* list of input connections, i.e. connections that play to this port */
67 struct list_head output_connections
; /* list of output connections, i.e. connections that capture from this port */
70 /* connection between two ports */
71 /* virtual connection is connection where at least one the ports is virtual */
72 /* superconnection is connection that implements virtual connection chain at JACK level */
75 struct list_head siblings_studio_all
; /* link for the studio::all_connections list */
76 struct list_head siblings_jack
; /* link for the studio::jack_connections list, not valid for virtual connections */
77 struct list_head siblings_capture_port
; /* link for the port::output_connections list, not valid for superconnections */
78 struct list_head siblings_playback_port
; /* link for the port::input_connections list, not valid for superconnections */
80 struct connection
* superconnection
; /* Superconnection. NULL for non-virtual connections */
81 uint64_t jack_id
; /* JACK connection ID, not valid for virtual connections */
83 struct port
* capture_port_ptr
; /* The capture output port */
84 struct port
* playback_port_ptr
; /* The playback input port */
89 struct list_head siblings_studio_all
; /* link for the studio::all_clients list */
90 struct list_head siblings_room
; /* link for the room::clients list */
91 struct list_head ports
; /* List of ports that belong to the client */
92 uuid_t uuid
; /* The UUID of the client */
93 uint64_t jack_id
; /* JACK client ID */
94 char * jack_name
; /* JACK name, not valid for virtual clients */
95 char * human_name
; /* User assigned name, not valid for studio-room link clients */
96 bool virtual:1; /* Whether client is virtual */
97 bool link
:1; /* Whether client is a studio-room link */
98 bool system
:1; /* Whether client is system (server in-process) */
99 pid_t pid
; /* process id. Not valid for system and virtual clients */
100 struct room
* room_ptr
; /* Room this client belongs to. If NULL, client belongs only to studio guts. */
101 struct studio
* studio_ptr
; /* Studio this client belongs to. For room clients this points to studio connected to the room */
106 struct list_head siblings
; /* link for studio::rooms list */
107 struct list_head clients
; /* non-virtual room clients */
108 struct list_head ports
; /* ports of the room clients */
109 uuid_t uuid
; /* The UUID of the room */
110 char * name
; /* Name of the room */
111 struct client
* link_client_ptr
; /* client that connects the room to studio */
112 struct studio
* studio_ptr
; /* Studio connected to the room */
118 extern studio_handle g_studio
;
120 #define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds
122 #endif /* #ifndef COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED */