Clean the control interface
This commit is contained in:
parent
137c0464de
commit
6368707025
File diff suppressed because it is too large
Load Diff
|
@ -30,67 +30,4 @@
|
|||
|
||||
extern const interface_t g_lashd_interface_control;
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_studio_appeared();
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_studio_disappeared();
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_appeared(
|
||||
const char * project_name,
|
||||
const char * project_path);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_disappeared(
|
||||
const char * project_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_name_changed(
|
||||
const char * old_name,
|
||||
const char * new_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_path_changed(
|
||||
const char * project_name,
|
||||
const char * new_path);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_description_changed(
|
||||
const char * project_name,
|
||||
const char * description);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_notes_changed(
|
||||
const char * project_name,
|
||||
const char * notes);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_saved(
|
||||
const char * project_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_project_loaded(
|
||||
const char * project_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_client_appeared(
|
||||
const char * client_id,
|
||||
const char * project_name,
|
||||
const char * client_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_client_disappeared(
|
||||
const char * client_id,
|
||||
const char * project_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_client_name_changed(
|
||||
const char * client_id,
|
||||
const char * new_client_name);
|
||||
|
||||
void
|
||||
lashd_dbus_signal_emit_progress(
|
||||
uint8_t percentage);
|
||||
|
||||
#endif /* __LASHD_DBUS_IFACE_CONTROL_H__ */
|
||||
|
|
|
@ -430,7 +430,6 @@ on_jack_server_started(
|
|||
{
|
||||
g_studio_ptr->jack_conf_stable = true;
|
||||
lash_info("jack conf successfully retrieved");
|
||||
lashd_dbus_signal_emit_studio_appeared();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -458,7 +457,6 @@ on_jack_server_stopped(
|
|||
|
||||
if (!g_studio_ptr->persisted)
|
||||
{
|
||||
lashd_dbus_signal_emit_studio_disappeared();
|
||||
studio_destroy(g_studio_ptr);
|
||||
g_studio_ptr = NULL;
|
||||
return;
|
||||
|
|
|
@ -238,7 +238,6 @@ int main(int argc, char ** argv, char ** envp)
|
|||
|
||||
if (g_studio_ptr != NULL)
|
||||
{
|
||||
lashd_dbus_signal_emit_studio_appeared();
|
||||
studio_destroy(g_studio_ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains code of the D-Bus helpers
|
||||
**************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
bool dbus_maybe_add_dict_entry_string(DBusMessageIter *dict_iter_ptr, const char * key, const char * value)
|
||||
{
|
||||
DBusMessageIter dict_entry_iter;
|
||||
|
||||
if (value == NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_open_container(dict_iter_ptr, DBUS_TYPE_DICT_ENTRY, NULL, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_append_basic(&dict_entry_iter, DBUS_TYPE_STRING, (const void *) &key))
|
||||
{
|
||||
dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter);
|
||||
return false;
|
||||
}
|
||||
|
||||
method_iter_append_variant(&dict_entry_iter, DBUS_TYPE_STRING, &value);
|
||||
|
||||
if (!dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dbus_add_dict_entry_uint32(DBusMessageIter * dict_iter_ptr, const char * key, dbus_uint32_t value)
|
||||
{
|
||||
DBusMessageIter dict_entry_iter;
|
||||
|
||||
if (value == NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_open_container(dict_iter_ptr, DBUS_TYPE_DICT_ENTRY, NULL, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_append_basic(&dict_entry_iter, DBUS_TYPE_STRING, (const void *) &key))
|
||||
{
|
||||
dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter);
|
||||
return false;
|
||||
}
|
||||
|
||||
method_iter_append_variant(&dict_entry_iter, DBUS_TYPE_UINT32, &value);
|
||||
|
||||
if (!dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dbus_add_dict_entry_bool(DBusMessageIter * dict_iter_ptr, const char * key, dbus_bool_t value)
|
||||
{
|
||||
DBusMessageIter dict_entry_iter;
|
||||
|
||||
if (!dbus_message_iter_open_container(dict_iter_ptr, DBUS_TYPE_DICT_ENTRY, NULL, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dbus_message_iter_append_basic(&dict_entry_iter, DBUS_TYPE_STRING, (const void *) &key))
|
||||
{
|
||||
dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter);
|
||||
return false;
|
||||
}
|
||||
|
||||
method_iter_append_variant(&dict_entry_iter, DBUS_TYPE_BOOLEAN, &value);
|
||||
|
||||
if (!dbus_message_iter_close_container(dict_iter_ptr, &dict_entry_iter))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains interface to the D-Bus helpers code
|
||||
**************************************************************************
|
||||
*
|
||||
* 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 HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED
|
||||
#define HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED
|
||||
|
||||
bool dbus_maybe_add_dict_entry_string(DBusMessageIter *dict_iter_ptr, const char * key, const char * value);
|
||||
bool dbus_add_dict_entry_uint32(DBusMessageIter * dict_iter_ptr, const char * key, dbus_uint32_t value);
|
||||
bool dbus_add_dict_entry_bool(DBusMessageIter * dict_iter_ptr, const char * key, dbus_bool_t value);
|
||||
|
||||
#endif /* #ifndef HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED */
|
Loading…
Reference in New Issue