Move daemon jack_proxy code to top dir

Step toward removal of code duplication between daemon and gui
This commit is contained in:
Nedko Arnaudov 2009-08-11 11:50:22 +03:00
parent 36f9173e13
commit 5defb7982b
10 changed files with 51 additions and 20 deletions

39
common.h Normal file
View File

@ -0,0 +1,39 @@
/* -*- Mode: C ; c-basic-offset: 2 -*- */
/*
* LADI Session Handler (ladish)
*
* Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
*
**************************************************************************
* 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 <http://www.gnu.org/licenses/>
* 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 <stdbool.h> /* C99 bool */
#include <stdint.h> /* fixed bit size ints */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#endif /* #ifndef COMMON_H__82C9504A_ACD2_435D_9743_781943473E6A__INCLUDED */

View File

@ -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 <stdbool.h> /* C99 bool */
#include <stdint.h> /* fixed bit size ints */
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <dbus/dbus.h>
#include <uuid/uuid.h>
@ -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 */

View File

@ -25,7 +25,7 @@
*/
#include "jack.h"
#include "jack_proxy.h"
#include "../jack_proxy.h"
#include "studio.h"
#include "dbus_iface_control.h"

View File

@ -25,7 +25,7 @@
*/
#include "common.h"
#include "jack_proxy.h"
#include "../jack_proxy.h"
struct studio
{

View File

@ -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;

View File

@ -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 */

View File

@ -2,7 +2,7 @@
/*
* LADI Session Handler (ladish)
*
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
* Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
*
**************************************************************************
* This file contains D-Bus helpers
@ -30,11 +30,7 @@
#include <dbus/dbus-glib-lowlevel.h>
#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()

View File

@ -26,8 +26,12 @@
//#define LASH_DEBUG
#include <dbus/dbus.h>
#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"

View File

@ -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