Jack2
1.9.7
|
00001 /* 00002 Copyright (C) 2001 Paul Davis 00003 Copyright (C) 2004 Jack O'Quin 00004 Copyright (C) 2010 Torben Hohn 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation; either version 2.1 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 #ifndef __jack_session_h__ 00022 #define __jack_session_h__ 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 #include <jack/types.h> 00029 #include <jack/weakmacros.h> 00030 00046 enum JackSessionEventType { 00057 JackSessionSave = 1, 00058 00064 JackSessionSaveAndQuit = 2, 00065 00075 JackSessionSaveTemplate = 3 00076 }; 00077 00078 typedef enum JackSessionEventType jack_session_event_type_t; 00079 00083 enum JackSessionFlags { 00087 JackSessionSaveError = 0x01, 00088 00092 JackSessionNeedTerminal = 0x02 00093 }; 00094 00098 typedef enum JackSessionFlags jack_session_flags_t; 00099 00100 struct _jack_session_event { 00104 jack_session_event_type_t type; 00105 00112 const char *session_dir; 00113 00120 const char *client_uuid; 00121 00135 char *command_line; 00136 00140 jack_session_flags_t flags; 00141 00145 uint32_t future; 00146 }; 00147 00148 typedef struct _jack_session_event jack_session_event_t; 00149 00162 typedef void (*JackSessionCallback)(jack_session_event_t *event, 00163 void *arg); 00164 00175 int jack_set_session_callback (jack_client_t *client, 00176 JackSessionCallback session_callback, 00177 void *arg) JACK_WEAK_EXPORT; 00178 00188 int jack_session_reply (jack_client_t *client, 00189 jack_session_event_t *event) JACK_WEAK_EXPORT; 00190 00191 00197 void jack_session_event_free (jack_session_event_t *event) JACK_WEAK_EXPORT; 00198 00199 00206 char *jack_client_get_uuid (jack_client_t *client) JACK_WEAK_EXPORT; 00207 00218 typedef struct { 00219 const char *uuid; 00220 const char *client_name; 00221 const char *command; 00222 jack_session_flags_t flags; 00223 } jack_session_command_t; 00224 00232 jack_session_command_t *jack_session_notify ( 00233 jack_client_t* client, 00234 const char *target, 00235 jack_session_event_type_t type, 00236 const char *path) JACK_WEAK_EXPORT; 00237 00241 void jack_session_commands_free (jack_session_command_t *cmds) JACK_WEAK_EXPORT; 00242 00247 char *jack_get_uuid_for_client_name (jack_client_t *client, 00248 const char *client_name) JACK_WEAK_EXPORT; 00249 00256 char *jack_get_client_name_by_uuid (jack_client_t *client, 00257 const char *client_uuid ) JACK_WEAK_EXPORT; 00258 00268 int 00269 jack_reserve_client_name (jack_client_t *client, 00270 const char *name, 00271 const char *uuid) JACK_WEAK_EXPORT; 00272 00279 int 00280 jack_client_has_session_callback (jack_client_t *client, const char *client_name) JACK_WEAK_EXPORT; 00281 00282 #ifdef __cplusplus 00283 } 00284 #endif 00285 #endif