Remove the not reliable initial jack canvas arrange
[ladish.git] / daemon / common.h
blob1bf4a0680ccbd0ee815a338a6f075461af8ab9ea
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
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 "../common.h"
32 #include <errno.h>
33 #include <dbus/dbus.h>
34 #include <uuid/uuid.h>
36 #include "../dbus/service.h"
37 #include "../dbus/helpers.h"
39 /* ~/BASE_DIR is where studio, room and project xml files are stored */
40 #define BASE_DIR "/." BASE_NAME
41 extern char * g_base_dir;
43 /* JACK port or virtual port */
44 struct port
46 struct list_head siblings_studio_all; /* link for the studio::all_ports list */
47 struct list_head siblings_studio; /* link for the studio::ports list */
48 struct list_head siblings_room; /* link for the room::ports list */
49 struct list_head siblings_client; /* link for the port list of the client */
50 struct list_head siblings_vclient; /* link for the port list of the virtual client */
52 uuid_t uuid; /* The UUID of the port */
53 bool virtual; /* Whether the port is virtual or JACK port */
54 char * jack_name; /* JACK name (short). Not valid for virtual ports. */
55 uint64_t jack_id; /* JACK port ID. Not valid for virtual ports. */
56 char * human_name; /* User assigned name */
58 struct client * client_ptr; /* JACK client this port belongs to. Not valid for virtual ports. */
59 struct client * vclient_ptr; /* Virtual client this port belongs to. NULL if there is no virtual client associated. */
61 /* superconnections are not in these lists */
62 struct list_head input_connections; /* list of input connections, i.e. connections that play to this port */
63 struct list_head output_connections; /* list of output connections, i.e. connections that capture from this port */
66 /* connection between two ports */
67 /* virtual connection is connection where at least one the ports is virtual */
68 /* superconnection is connection that implements virtual connection chain at JACK level */
69 struct connection
71 struct list_head siblings_studio_all; /* link for the studio::all_connections list */
72 struct list_head siblings_jack; /* link for the studio::jack_connections list, not valid for virtual connections */
73 struct list_head siblings_capture_port; /* link for the port::output_connections list, not valid for superconnections */
74 struct list_head siblings_playback_port; /* link for the port::input_connections list, not valid for superconnections */
76 struct connection * superconnection; /* Superconnection. NULL for non-virtual connections */
77 uint64_t jack_id; /* JACK connection ID, not valid for virtual connections */
79 struct port * capture_port_ptr; /* The capture output port */
80 struct port * playback_port_ptr; /* The playback input port */
83 struct client
85 struct list_head siblings_studio_all; /* link for the studio::all_clients list */
86 struct list_head siblings_room; /* link for the room::clients list */
87 struct list_head ports; /* List of ports that belong to the client */
88 uuid_t uuid; /* The UUID of the client */
89 uint64_t jack_id; /* JACK client ID */
90 char * jack_name; /* JACK name, not valid for virtual clients */
91 char * human_name; /* User assigned name, not valid for studio-room link clients */
92 bool virtual:1; /* Whether client is virtual */
93 bool link:1; /* Whether client is a studio-room link */
94 bool system:1; /* Whether client is system (server in-process) */
95 pid_t pid; /* process id. Not valid for system and virtual clients */
96 struct room * room_ptr; /* Room this client belongs to. If NULL, client belongs only to studio guts. */
97 struct studio * studio_ptr; /* Studio this client belongs to. For room clients this points to studio connected to the room */
100 struct room
102 struct list_head siblings; /* link for studio::rooms list */
103 struct list_head clients; /* non-virtual room clients */
104 struct list_head ports; /* ports of the room clients */
105 uuid_t uuid; /* The UUID of the room */
106 char * name; /* Name of the room */
107 struct client * link_client_ptr; /* client that connects the room to studio */
108 struct studio * studio_ptr; /* Studio connected to the room */
111 #include "studio.h"
113 extern bool g_quit;
115 #endif /* #ifndef COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED */