From 47246db7e9d71ba694b719001033fba1766a58c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 10 Jun 2006 02:43:54 +0000 Subject: More juggling git-svn-id: http://svn.drobilla.net/lad/grauph@16 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/SigClientInterface.h | 120 +++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/libs/client/SigClientInterface.h (limited to 'src/libs/client/SigClientInterface.h') diff --git a/src/libs/client/SigClientInterface.h b/src/libs/client/SigClientInterface.h new file mode 100644 index 00000000..f384f239 --- /dev/null +++ b/src/libs/client/SigClientInterface.h @@ -0,0 +1,120 @@ +/* This file is part of Om. Copyright (C) 2006 Dave Robillard. + * + * Om 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. + * + * Om 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 details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SIGCLIENTINTERFACE_H +#define SIGCLIENTINTERFACE_H + +#include +#include +#include +#include "interface/ClientInterface.h" +using std::string; + +namespace LibOmClient { + + +/** A LibSigC++ signal emitting interface for clients to use. + * + * sed would have the copyright to this code if it was a legal person. + */ +class SigClientInterface : virtual public Om::Shared::ClientInterface, public sigc::trackable +{ +public: + sigc::signal bundle_begin_sig; + sigc::signal bundle_end_sig; + sigc::signal error_sig; + sigc::signal num_plugins_sig; + sigc::signal new_plugin_sig; + sigc::signal new_patch_sig; + sigc::signal new_node_sig; + sigc::signal new_port_sig; + sigc::signal patch_enabled_sig; + sigc::signal patch_disabled_sig; + sigc::signal patch_cleared_sig; + sigc::signal object_renamed_sig; + sigc::signal object_destroyed_sig; + sigc::signal connection_sig; + sigc::signal disconnection_sig; + sigc::signal metadata_update_sig; + sigc::signal control_change_sig; + sigc::signal program_add_sig; + sigc::signal program_remove_sig; + + inline void emit_bundle_begin() + { bundle_begin_sig.emit(); } + + inline void emit_bundle_end() + { bundle_end_sig.emit(); } + + inline void emit_error(const string& msg) + { error_sig.emit(msg); } + + inline void emit_num_plugins(uint32_t num) + { num_plugins_sig.emit(num); } + + inline void emit_new_plugin(const string& type, const string& uri, const string& name) + { new_plugin_sig.emit(type, uri, name); } + + inline void emit_new_patch(const string& path, uint32_t poly) + { new_patch_sig.emit(path, poly); } + + inline void emit_new_node(const string& plugin_type, const string& plugin_uri, const string& node_path, bool is_polyphonic, uint32_t num_ports) + { new_node_sig.emit(plugin_type, plugin_uri, node_path, is_polyphonic, num_ports); } + + inline void emit_new_port(const string& path, const string& data_type, bool is_output) + { new_port_sig.emit(path, data_type, is_output); } + + inline void emit_patch_enabled(const string& path) + { patch_enabled_sig.emit(path); } + + inline void emit_patch_disabled(const string& path) + { patch_disabled_sig.emit(path); } + + inline void emit_patch_cleared(const string& path) + { patch_cleared_sig.emit(path); } + + inline void emit_object_renamed(const string& old_path, const string& new_path) + { object_renamed_sig.emit(old_path, new_path); } + + inline void emit_object_destroyed(const string& path) + { object_destroyed_sig.emit(path); } + + inline void emit_connection(const string& src_port_path, const string& dst_port_path) + { connection_sig.emit(src_port_path, dst_port_path); } + + inline void emit_disconnection(const string& src_port_path, const string& dst_port_path) + { disconnection_sig.emit(src_port_path, dst_port_path); } + + inline void emit_metadata_update(const string& subject_path, const string& predicate, const string& value) + { metadata_update_sig.emit(subject_path, predicate, value); } + + inline void emit_control_change(const string& port_path, float value) + { control_change_sig.emit(port_path, value); } + + inline void emit_program_add(const string& node_path, uint32_t bank, uint32_t program, const string& program_name) + { program_add_sig.emit(node_path, bank, program, program_name); } + + inline void emit_program_remove(const string& node_path, uint32_t bank, uint32_t program) + { program_remove_sig.emit(node_path, bank, program); } + +protected: + SigClientInterface() {} +}; + + +} // namespace LibOmClient + +#endif -- cgit v1.2.1