diff --git a/common.h b/common.h new file mode 100644 index 00000000..b7b99cb4 --- /dev/null +++ b/common.h @@ -0,0 +1,39 @@ +/* -*- Mode: C ; c-basic-offset: 2 -*- */ +/* + * LADI Session Handler (ladish) + * + * Copyright (C) 2009 Nedko Arnaudov + * + ************************************************************************** + * This file contains stuff that is needed almost everywhere in ladish + ************************************************************************** + * + * LADI Session Handler is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * LADI Session Handler is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LADI Session Handler. If not, see + * or write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef COMMON_H__82C9504A_ACD2_435D_9743_781943473E6A__INCLUDED +#define COMMON_H__82C9504A_ACD2_435D_9743_781943473E6A__INCLUDED + +#include "config.h" /* configure stage result */ + +#include /* C99 bool */ +#include /* fixed bit size ints */ +#include +#include +#include +#include + +#endif /* #ifndef COMMON_H__82C9504A_ACD2_435D_9743_781943473E6A__INCLUDED */ diff --git a/daemon/common.h b/daemon/common.h index 1f8897aa..9ad0d608 100644 --- a/daemon/common.h +++ b/daemon/common.h @@ -27,14 +27,8 @@ #ifndef COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED #define COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED -#include "config.h" /* configure stage result */ +#include "../common.h" -#include /* C99 bool */ -#include /* fixed bit size ints */ -#include -#include -#include -#include #include #include #include @@ -117,6 +111,4 @@ struct room extern bool g_quit; extern studio_handle g_studio; -#define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds - #endif /* #ifndef COMMON_H__CFDC869A_31AE_4FA3_B2D3_DACA8488CA55__INCLUDED */ diff --git a/daemon/jack.c b/daemon/jack.c index 8facf5c7..e3583499 100644 --- a/daemon/jack.c +++ b/daemon/jack.c @@ -25,7 +25,7 @@ */ #include "jack.h" -#include "jack_proxy.h" +#include "../jack_proxy.h" #include "studio.h" #include "dbus_iface_control.h" diff --git a/daemon/studio.c b/daemon/studio.c index b1c0d022..afef7348 100644 --- a/daemon/studio.c +++ b/daemon/studio.c @@ -25,7 +25,7 @@ */ #include "common.h" -#include "jack_proxy.h" +#include "../jack_proxy.h" struct studio { diff --git a/dbus/helpers.c b/dbus/helpers.c index 69fc05ef..49309b1f 100644 --- a/dbus/helpers.c +++ b/dbus/helpers.c @@ -37,8 +37,6 @@ DBusConnection * g_dbus_connection; DBusError g_dbus_error; -#define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds - bool dbus_maybe_add_dict_entry_string(DBusMessageIter *dict_iter_ptr, const char * key, const char * value) { DBusMessageIter dict_entry_iter; diff --git a/dbus/helpers.h b/dbus/helpers.h index 0a678093..17e6854d 100644 --- a/dbus/helpers.h +++ b/dbus/helpers.h @@ -37,4 +37,6 @@ bool dbus_add_dict_entry_bool(DBusMessageIter * dict_iter_ptr, const char * key, bool dbus_call_simple(const char * service, const char * object, const char * iface, const char * method, char * input_signature, ...); +#define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds + #endif /* #ifndef HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED */ diff --git a/gui/dbus_helpers.c b/gui/dbus_helpers.c index b60e1585..0fe30661 100644 --- a/gui/dbus_helpers.c +++ b/gui/dbus_helpers.c @@ -2,7 +2,7 @@ /* * LADI Session Handler (ladish) * - * Copyright (C) 2008 Nedko Arnaudov + * Copyright (C) 2008, 2009 Nedko Arnaudov * ************************************************************************** * This file contains D-Bus helpers @@ -30,11 +30,7 @@ #include #include "dbus_helpers.h" - -DBusConnection * g_dbus_connection; -DBusError g_dbus_error; - -#define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds +#include "../dbus/helpers.h" void patchage_dbus_init() diff --git a/daemon/jack_proxy.c b/jack_proxy.c similarity index 99% rename from daemon/jack_proxy.c rename to jack_proxy.c index b37c090b..a21127b5 100644 --- a/daemon/jack_proxy.c +++ b/jack_proxy.c @@ -26,8 +26,12 @@ //#define LASH_DEBUG +#include + #include "common.h" #include "jack_proxy.h" +#include "dbus/helpers.h" +#include "common/debug.h" #define JACKDBUS_SERVICE "org.jackaudio.service" #define JACKDBUS_OBJECT "/org/jackaudio/Controller" diff --git a/daemon/jack_proxy.h b/jack_proxy.h similarity index 100% rename from daemon/jack_proxy.h rename to jack_proxy.h diff --git a/wscript b/wscript index 988509c5..9562a0f4 100644 --- a/wscript +++ b/wscript @@ -172,7 +172,6 @@ def build(bld): 'appdb.c', 'procfs.c', 'dbus_iface_control.c', - 'jack_proxy.c', 'jack.c', 'studio.c', 'catdup.c' @@ -192,6 +191,7 @@ def build(bld): daemon.source.append(os.path.join("dbus", source)) daemon.source.append(os.path.join("common", "safety.c")) + daemon.source.append('jack_proxy.c') # process name.arnaudov.nedko.ladish.service.in -> name.arnaudov.nedko.ladish.service import misc