diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | src/Client.cpp | 73 | ||||
-rw-r--r-- | src/Client.hpp | 51 | ||||
-rw-r--r-- | src/LashProxy.cpp | 790 | ||||
-rw-r--r-- | src/LashProxy.hpp | 58 | ||||
-rw-r--r-- | src/LoadProjectDialog.cpp | 155 | ||||
-rw-r--r-- | src/LoadProjectDialog.hpp | 57 | ||||
-rw-r--r-- | src/Patchage.cpp | 75 | ||||
-rw-r--r-- | src/Patchage.hpp | 24 | ||||
-rw-r--r-- | src/Project.cpp | 141 | ||||
-rw-r--r-- | src/Project.hpp | 71 | ||||
-rw-r--r-- | src/ProjectList.cpp | 311 | ||||
-rw-r--r-- | src/ProjectList.hpp | 37 | ||||
-rw-r--r-- | src/ProjectPropertiesDialog.cpp | 93 | ||||
-rw-r--r-- | src/ProjectPropertiesDialog.hpp | 37 | ||||
-rw-r--r-- | src/Session.cpp | 128 | ||||
-rw-r--r-- | src/Session.hpp | 54 | ||||
-rw-r--r-- | src/patchage.ui | 536 | ||||
-rw-r--r-- | wscript | 19 |
19 files changed, 176 insertions, 2538 deletions
@@ -1,8 +1,8 @@ Patchage ----- +-------- Patchage is a modular patch bay for audio and MIDI systems -based on JACK, LASH, and ALSA. +based on JACK and ALSA. For more information, see <http://drobilla.net/software/patchage>. diff --git a/src/Client.cpp b/src/Client.cpp deleted file mode 100644 index a522ebb..0000000 --- a/src/Client.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <string> - -#include "Client.hpp" -#include "Patchage.hpp" - -using std::string; - -struct ClientImpl { - Project* project; - string id; - string name; -}; - -Client::Client( - Project* project, - const string& id, - const string& name) -{ - _impl = new ClientImpl(); - _impl->project = project; - _impl->id = id; - _impl->name = name; -} - -Client::~Client() -{ - delete _impl; -} - -Project* -Client::get_project() -{ - return _impl->project; -} - -const string& -Client::get_id() const -{ - return _impl->id; -} - -const string& -Client::get_name() const -{ - return _impl->name; -} - -void -Client::set_name(const string& name) -{ - if (_impl->name != name) { - _impl->name = name; - _signal_renamed.emit(); - } -} diff --git a/src/Client.hpp b/src/Client.hpp deleted file mode 100644 index d7defe4..0000000 --- a/src/Client.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_LASH_CLIENT_HPP -#define PATCHAGE_LASH_CLIENT_HPP - -#include <string> -#include <sigc++/signal.h> - -struct ClientImpl; -class Project; - -class Client -{ -public: - Client( - Project* project, - const std::string& id, - const std::string& name); - - ~Client(); - - Project* get_project(); - - const std::string& get_id() const; - const std::string& get_name() const; - - void set_name(const std::string& name); - - sigc::signal<void> _signal_renamed; - -private: - ClientImpl* _impl; -}; - -#endif // PATCHAGE_LASH_CLIENT_HPP diff --git a/src/LashProxy.cpp b/src/LashProxy.cpp deleted file mode 100644 index 9a14b1d..0000000 --- a/src/LashProxy.cpp +++ /dev/null @@ -1,790 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <string.h> - -#include <string> -#include <list> - -#include <boost/shared_ptr.hpp> -#include <boost/format.hpp> - -#include "LashProxy.hpp" -#include "Session.hpp" -#include "Project.hpp" -#include "Client.hpp" -#include "DBus.hpp" - -#define LASH_SERVICE "org.nongnu.LASH" -#define LASH_OBJECT "/" -#define LASH_IFACE_CONTROL "org.nongnu.LASH.Control" - -using boost::shared_ptr; -using std::list; -using std::string; - -struct LashProxyImpl { - void init(Patchage* app); - - void fetch_loaded_projects(); - void fetch_project_clients(shared_ptr<Project> project); - - void error_msg(const std::string& msg); - void info_msg(const std::string& msg); - - static DBusHandlerResult dbus_message_hook( - DBusConnection* connection, - DBusMessage* message, - void* proxy); - - bool call( - bool response_expected, - const char* iface, - const char* method, - DBusMessage** reply_ptr, - int in_type, - ...); - - shared_ptr<Project> on_project_added(const std::string& name); - - shared_ptr<Client> on_client_added( - shared_ptr<Project> project, - string id, - string name); - - void get_loaded_project_properties( - const std::string& name, - LoadedProjectProperties& properties); - - bool _server_responding; - Session* _session; - LashProxy* _interface; - Patchage* _app; -}; - -LashProxy::LashProxy(Patchage* app, Session* session) -{ - _impl = new LashProxyImpl; - _impl->_interface = this; - _impl->_session = session; - _impl->_app = app; - _impl->init(app); -} - -LashProxy::~LashProxy() -{ - delete _impl; -} - -void -LashProxyImpl::init(Patchage* app) -{ - _server_responding = false; - - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" DBUS_INTERFACE_DBUS "',member=NameOwnerChanged,arg0='" LASH_SERVICE "'", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectAppeared", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectDisappeared", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectNameChanged", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectModifiedStatusChanged", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectDescriptionChanged", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ProjectNotesChanged", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ClientAppeared", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ClientDisappeared", NULL); - dbus_bus_add_match(app->dbus()->connection(), "type='signal',interface='" LASH_IFACE_CONTROL "',member=ClientNameChanged", NULL); - - dbus_connection_add_filter(app->dbus()->connection(), dbus_message_hook, this, NULL); - - // get initial list of projects - // calling any method to updates server responding status - // this also actiavtes lash object if it not activated already - fetch_loaded_projects(); - - app->set_lash_available(_server_responding); -} - -void -LashProxyImpl::error_msg(const std::string& msg) -{ - _app->error_msg((std::string)"[LASH] " + msg); -} - -void -LashProxyImpl::info_msg(const std::string& msg) -{ - _app->info_msg((std::string)"[LASH] " + msg); -} - -DBusHandlerResult -LashProxyImpl::dbus_message_hook( - DBusConnection* connection, - DBusMessage* message, - void* proxy) -{ - const char* project_name; - const char* new_project_name; - const char* object_name; - const char* old_owner; - const char* new_owner; - const char* value_string; - const char* client_id; - const char* client_name; - dbus_bool_t modified_status; - shared_ptr<Project> project; - shared_ptr<Client> client; - - assert(proxy); - LashProxyImpl* me = reinterpret_cast<LashProxyImpl*>(proxy); - assert(me->_app->dbus()->connection()); - - Patchage* const app = me->_app; - - //info_msg("dbus_message_hook() called."); - - // Handle signals we have subscribed for in attach() - - if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &object_name, - DBUS_TYPE_STRING, &old_owner, - DBUS_TYPE_STRING, &new_owner, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract NameOwnerChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - if ((string)object_name != LASH_SERVICE) { - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - - if (old_owner[0] == '\0') { - me->info_msg("LASH activated."); - app->set_lash_available(true); - } else if (new_owner[0] == '\0') { - me->info_msg((string)"LASH deactivated."); - app->set_lash_available(false); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectAppeared")) { - if (!dbus_message_get_args( message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectAppeared signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' appeared."); - me->on_project_added(project_name); - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectDisappeared")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectDisappeared signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' disappeared."); - me->_session->project_close(project_name); - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectNameChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_STRING, &new_project_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectNameChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' renamed to '" + new_project_name + "'."); - - project = me->_session->find_project_by_name(project_name); - if (project) { - project->on_name_changed(new_project_name); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectModifiedStatusChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_BOOLEAN, &modified_status, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectModifiedStatusChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' modified status changed to '" + (modified_status ? "true" : "false") + "'."); - - project = me->_session->find_project_by_name(project_name); - if (project) { - project->on_modified_status_changed(modified_status); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectDescriptionChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_STRING, &value_string, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectDescriptionChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' description changed."); - - project = me->_session->find_project_by_name(project_name); - if (project) { - project->on_description_changed(value_string); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ProjectNotesChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_STRING, &value_string, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ProjectNotesChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Project '" + project_name + "' notes changed."); - - project = me->_session->find_project_by_name(project_name); - if (project) { - project->on_notes_changed(value_string); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ClientAppeared")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &client_id, - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_STRING, &client_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ClientAppeared signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Client '" + client_id + "':'" + client_name + "' appeared in project '" + project_name + "'."); - - project = me->_session->find_project_by_name(project_name); - if (project) { - me->on_client_added(project, client_id, client_name); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ClientDisappeared")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &client_id, - DBUS_TYPE_STRING, &project_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ClientDisappeared signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Client '" + client_id + "' of project '" + project_name + "' disappeared."); - - client = me->_session->find_client_by_id(client_id); - if (client) { - client->get_project()->on_client_removed(client_id); - me->_session->client_remove(client_id); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "ClientNameChanged")) { - if (!dbus_message_get_args( - message, &app->dbus()->error(), - DBUS_TYPE_STRING, &client_id, - DBUS_TYPE_STRING, &client_name, - DBUS_TYPE_INVALID)) { - me->error_msg(str(boost::format("dbus_message_get_args() failed to extract ClientNameChanged signal arguments (%s)") % app->dbus()->error().message)); - dbus_error_free(&app->dbus()->error()); - return DBUS_HANDLER_RESULT_HANDLED; - } - - me->info_msg((string)"Client '" + client_id + "' name changed to '" + client_name + "'."); - - client = me->_session->find_client_by_id(client_id); - if (client) { - client->set_name(client_name); - } - - return DBUS_HANDLER_RESULT_HANDLED; - } - - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -bool -LashProxyImpl::call( - bool response_expected, - const char* iface, - const char* method, - DBusMessage** reply_ptr, - int in_type, - ...) -{ - va_list ap; - va_start(ap, in_type); - - _server_responding = _app->dbus()->call( - response_expected, - LASH_SERVICE, - LASH_OBJECT, - iface, - method, - reply_ptr, - in_type, - ap); - - va_end(ap); - return _server_responding; -} - -void -LashProxyImpl::fetch_loaded_projects() -{ - DBusMessage* reply_ptr; - const char* reply_signature; - DBusMessageIter iter; - DBusMessageIter array_iter; - const char* project_name; - shared_ptr<Project> project; - - if (!call(true, LASH_IFACE_CONTROL, "ProjectsGet", &reply_ptr, DBUS_TYPE_INVALID)) { - return; - } - - reply_signature = dbus_message_get_signature(reply_ptr); - - if (strcmp(reply_signature, "as") != 0) { - error_msg((string)"ProjectsGet() reply signature mismatch. " + reply_signature); - goto unref; - } - - dbus_message_iter_init(reply_ptr, &iter); - - for (dbus_message_iter_recurse(&iter, &array_iter); - dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID; - dbus_message_iter_next(&array_iter)) { - dbus_message_iter_get_basic(&array_iter, &project_name); - project = on_project_added(project_name); - fetch_project_clients(project); - } - -unref: - dbus_message_unref(reply_ptr); -} - -void -LashProxyImpl::fetch_project_clients(shared_ptr<Project> project) -{ - DBusMessage* reply_ptr; - const char* reply_signature; - DBusMessageIter iter; - DBusMessageIter array_iter; - DBusMessageIter struct_iter; - const char* client_id; - const char* client_name; - - const string& project_name = project->get_name(); - const char* const project_name_cstr = project_name.c_str(); - - if (!call( - true, - LASH_IFACE_CONTROL, - "ProjectGetClients", - &reply_ptr, - DBUS_TYPE_STRING, &project_name_cstr, - DBUS_TYPE_INVALID)) { - return; - } - - reply_signature = dbus_message_get_signature(reply_ptr); - - if (strcmp(reply_signature, "a(ss)") != 0) { - error_msg((string)"ProjectGetClients() reply signature mismatch. " + reply_signature); - goto unref; - } - - dbus_message_iter_init(reply_ptr, &iter); - - for (dbus_message_iter_recurse(&iter, &array_iter); - dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID; - dbus_message_iter_next(&array_iter)) { - dbus_message_iter_recurse(&array_iter, &struct_iter); - - dbus_message_iter_get_basic(&struct_iter, &client_id); - dbus_message_iter_next(&struct_iter); - dbus_message_iter_get_basic(&struct_iter, &client_name); - dbus_message_iter_next(&struct_iter); - - on_client_added(project, client_id, client_name); - } - -unref: - dbus_message_unref(reply_ptr); -} - -shared_ptr<Project> -LashProxyImpl::on_project_added(const string& name) -{ - LoadedProjectProperties properties; - get_loaded_project_properties(name, properties); - - shared_ptr<Project> project(new Project(name, properties)); - - _session->project_add(project); - - return project; -} - -shared_ptr<Client> -LashProxyImpl::on_client_added( - shared_ptr<Project> project, - string id, - string name) -{ - shared_ptr<Client> client(new Client(project.get(), id, name)); - - project->on_client_added(client); - _session->client_add(client); - - return client; -} - -void -LashProxyImpl::get_loaded_project_properties( - const string& name, - LoadedProjectProperties& properties) -{ - DBusMessage* reply_ptr; - const char* reply_signature; - DBusMessageIter iter; - DBusMessageIter dict_iter; - DBusMessageIter dict_entry_iter; - DBusMessageIter variant_iter; - const char* key; - const char* value_type; - dbus_bool_t value_bool; - const char* value_string; - - const char* const project_name_cstr = name.c_str(); - - if (!call( - true, - LASH_IFACE_CONTROL, - "ProjectGetProperties", - &reply_ptr, - DBUS_TYPE_STRING, &project_name_cstr, - DBUS_TYPE_INVALID)) { - return; - } - - reply_signature = dbus_message_get_signature(reply_ptr); - - if (strcmp(reply_signature, "a{sv}") != 0) { - error_msg((string)"ProjectGetProperties() reply signature mismatch. " + reply_signature); - goto unref; - } - - dbus_message_iter_init(reply_ptr, &iter); - - for (dbus_message_iter_recurse(&iter, &dict_iter); - dbus_message_iter_get_arg_type(&dict_iter) != DBUS_TYPE_INVALID; - dbus_message_iter_next(&dict_iter)) { - dbus_message_iter_recurse(&dict_iter, &dict_entry_iter); - dbus_message_iter_get_basic(&dict_entry_iter, &key); - dbus_message_iter_next(&dict_entry_iter); - dbus_message_iter_recurse(&dict_entry_iter, &variant_iter); - value_type = dbus_message_iter_get_signature(&variant_iter); - if (value_type[0] != 0 && value_type[1] == 0) { - switch (*value_type) { - case DBUS_TYPE_BOOLEAN: - if (strcmp(key, "Modified Status") == 0) { - dbus_message_iter_get_basic(&variant_iter, &value_bool); - properties.modified_status = value_bool; - } - break; - case DBUS_TYPE_STRING: - if (strcmp(key, "Description") == 0) { - dbus_message_iter_get_basic(&variant_iter, &value_string); - properties.description = value_string; - } else if (strcmp(key, "Notes") == 0) { - dbus_message_iter_get_basic(&variant_iter, &value_string); - properties.notes = value_string; - } - break; - } - } - } - -unref: - dbus_message_unref(reply_ptr); -} - -void -LashProxy::get_available_projects(list<ProjectInfo>& projects) -{ - DBusMessage* reply_ptr; - const char* reply_signature; - DBusMessageIter iter; - DBusMessageIter array_iter; - DBusMessageIter struct_iter; - DBusMessageIter dict_iter; - DBusMessageIter dict_entry_iter; - DBusMessageIter variant_iter; - const char* project_name; - const char* key; - const char* value_type; - dbus_uint32_t value_uint32; - const char* value_string; - ProjectInfo project_info; - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectsGetAvailable", &reply_ptr, DBUS_TYPE_INVALID)) { - return; - } - - reply_signature = dbus_message_get_signature(reply_ptr); - - if (strcmp(reply_signature, "a(sa{sv})") != 0) { - _impl->error_msg((string)"ProjectsGetAvailable() reply signature mismatch. " + reply_signature); - goto unref; - } - - dbus_message_iter_init(reply_ptr, &iter); - - for (dbus_message_iter_recurse(&iter, &array_iter); - dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID; - dbus_message_iter_next(&array_iter)) { - dbus_message_iter_recurse(&array_iter, &struct_iter); - - dbus_message_iter_get_basic(&struct_iter, &project_name); - - project_info.name = project_name; - project_info.modification_time = 0; - project_info.description.erase(); - - dbus_message_iter_next(&struct_iter); - - for (dbus_message_iter_recurse(&struct_iter, &dict_iter); - dbus_message_iter_get_arg_type(&dict_iter) != DBUS_TYPE_INVALID; - dbus_message_iter_next(&dict_iter)) { - dbus_message_iter_recurse(&dict_iter, &dict_entry_iter); - dbus_message_iter_get_basic(&dict_entry_iter, &key); - dbus_message_iter_next(&dict_entry_iter); - dbus_message_iter_recurse(&dict_entry_iter, &variant_iter); - value_type = dbus_message_iter_get_signature(&variant_iter); - if (value_type[0] != 0 && value_type[1] == 0) { - switch (*value_type) { - case DBUS_TYPE_UINT32: - if (strcmp(key, "Modification Time") == 0) { - dbus_message_iter_get_basic(&variant_iter, &value_uint32); - project_info.modification_time = value_uint32; - } - break; - case DBUS_TYPE_STRING: - if (strcmp(key, "Description") == 0) { - dbus_message_iter_get_basic(&variant_iter, &value_string); - project_info.description = value_string; - } - break; - } - } - } - - projects.push_back(project_info); - } - -unref: - dbus_message_unref(reply_ptr); -} - -void -LashProxy::get_loaded_project_properties( - const string& name, - LoadedProjectProperties& properties) -{ - return _impl->get_loaded_project_properties(name, properties); -} - -void -LashProxy::load_project(const string& project_name) -{ - DBusMessage* reply_ptr; - const char* const project_name_cstr = project_name.c_str(); - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectOpen", &reply_ptr, DBUS_TYPE_STRING, &project_name_cstr, DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::save_all_projects() -{ - DBusMessage* reply_ptr; - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectsSaveAll", &reply_ptr, DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::save_project(const string& project_name) -{ - DBusMessage* reply_ptr; - const char* const project_name_cstr = project_name.c_str(); - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectSave", &reply_ptr, DBUS_TYPE_STRING, &project_name_cstr, DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::close_project(const string& project_name) -{ - DBusMessage* reply_ptr; - const char* const project_name_cstr = project_name.c_str(); - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectClose", &reply_ptr, DBUS_TYPE_STRING, &project_name_cstr, DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::close_all_projects() -{ - DBusMessage* reply_ptr; - - if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectsCloseAll", &reply_ptr, DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::project_rename(const string& old_name, const string& new_name) -{ - DBusMessage* reply_ptr; - const char* const old_name_cstr = old_name.c_str(); - const char* const new_name_cstr = new_name.c_str(); - - if (!_impl->call( - true, - LASH_IFACE_CONTROL, - "ProjectRename", - &reply_ptr, - DBUS_TYPE_STRING, &old_name_cstr, - DBUS_TYPE_STRING, &new_name_cstr, - DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::project_set_description(const string& project_name, const string& description) -{ - DBusMessage* reply_ptr; - const char* const project_name_cstr = project_name.c_str(); - const char* const description_cstr = description.c_str(); - - if (!_impl->call( - true, - LASH_IFACE_CONTROL, - "ProjectSetDescription", - &reply_ptr, - DBUS_TYPE_STRING, &project_name_cstr, - DBUS_TYPE_STRING, &description_cstr, - DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - -void -LashProxy::project_set_notes( - const string& project_name, - const string& notes) -{ - DBusMessage* reply_ptr; - const char* const project_name_cstr = project_name.c_str(); - const char* const notes_cstr = notes.c_str(); - - if (!_impl->call( - true, - LASH_IFACE_CONTROL, - "ProjectSetNotes", - &reply_ptr, - DBUS_TYPE_STRING, &project_name_cstr, - DBUS_TYPE_STRING, ¬es_cstr, - DBUS_TYPE_INVALID)) { - return; - } - - dbus_message_unref(reply_ptr); -} - diff --git a/src/LashProxy.hpp b/src/LashProxy.hpp deleted file mode 100644 index bf8e389..0000000 --- a/src/LashProxy.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_LASH_PROXY_HPP -#define PATCHAGE_LASH_PROXY_HPP - -#include <list> -#include <string> - -#include "Patchage.hpp" - -struct ProjectInfo { - std::string name; - time_t modification_time; - std::string description; -}; - -class Patchage; -class Session; -struct LashProxyImpl; -struct LoadedProjectProperties; - -class LashProxy { -public: - LashProxy(Patchage* app, Session* session); - ~LashProxy(); - - void get_available_projects(std::list<ProjectInfo>& projects); - void load_project(const std::string& project_name); - void save_all_projects(); - void save_project(const std::string& project_name); - void close_project(const std::string& project_name); - void close_all_projects(); - void project_rename(const std::string& old_name, const std::string& new_name); - void get_loaded_project_properties(const std::string& name, LoadedProjectProperties& properties); - void project_set_description(const std::string& project_name, const std::string& description); - void project_set_notes(const std::string& project_name, const std::string& notes); - -private: - LashProxyImpl* _impl; -}; - -#endif // PATCHAGE_LASH_PROXY_HPP diff --git a/src/LoadProjectDialog.cpp b/src/LoadProjectDialog.cpp deleted file mode 100644 index 01615a6..0000000 --- a/src/LoadProjectDialog.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <gtkmm/dialog.h> -#include <gtkmm/liststore.h> -#include <gtkmm/treemodel.h> -#include <gtkmm/treeview.h> - -#include "LoadProjectDialog.hpp" -#include "Patchage.hpp" -#include "LashProxy.hpp" - -static void -convert_timestamp_to_string( - const time_t timestamp, - std::string& timestamp_string) -{ - GDate mtime; - GDate now; - gint days_diff; - struct tm tm_mtime; - time_t time_now; - const gchar* format; - gchar buf[256]; - - if (timestamp == 0) { - timestamp_string = "Unknown"; - return; - } - - localtime_r(×tamp, &tm_mtime); - - g_date_set_time_t(&mtime, timestamp); - time_now = time(NULL); - g_date_set_time_t(&now, time_now); - - days_diff = g_date_get_julian(&now) - g_date_get_julian(&mtime); - - if (days_diff == 0) { - format = "Today at %H:%M"; - } else if (days_diff == 1) { - format = "Yesterday at %H:%M"; - } else { - if (days_diff > 1 && days_diff < 7) { - format = "%A"; /* Days from last week */ - } else { - format = "%x"; /* Any other date */ - } - } - - if (strftime(buf, sizeof(buf), format, &tm_mtime) != 0) { - timestamp_string = buf; - } else { - timestamp_string = "Unknown"; - } -} - -LoadProjectDialog::LoadProjectDialog(Patchage* app) - : _app(app) - , _dialog(app->xml(), "load_project_dialog") - , _widget(app->xml(), "loadable_projects_list") -{ - _columns.add(_columns.name); - _columns.add(_columns.modified); - _columns.add(_columns.description); - - _model = Gtk::ListStore::create(_columns); - _widget->set_model(_model); - - _widget->remove_all_columns(); - _widget->append_column("Project Name", _columns.name); - _widget->append_column("Modified", _columns.modified); - _widget->append_column("Description", _columns.description); -} - -void -LoadProjectDialog::run(std::list<ProjectInfo>& projects) -{ - Gtk::TreeModel::Row row; - int result; - - for (std::list<ProjectInfo>::iterator iter = projects.begin(); iter != projects.end(); iter++) { - std::string str; - row = *(_model->append()); - row[_columns.name] = iter->name; - convert_timestamp_to_string(iter->modification_time, str); - row[_columns.modified] = str; - row[_columns.description] = iter->description; - } - - _widget->signal_button_press_event().connect(sigc::mem_fun(*this, &LoadProjectDialog::on_button_press_event), false); - _widget->signal_key_press_event().connect(sigc::mem_fun(*this, &LoadProjectDialog::on_key_press_event), false); - -loop: - result = _dialog->run(); - - if (result == 2) { - Glib::RefPtr<Gtk::TreeView::Selection> selection = _widget->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) - goto loop; - - Glib::ustring project_name = (*iter)[_columns.name]; - _app->lash_proxy()->load_project(project_name); - } - - _dialog->hide(); -} - -void -LoadProjectDialog::load_selected_project() -{ - Glib::RefPtr<Gtk::TreeView::Selection> selection = _widget->get_selection(); - Glib::ustring name = (*selection->get_selected())[_columns.name]; - _app->lash_proxy()->load_project(name); - _dialog->hide(); -} - -bool -LoadProjectDialog::on_button_press_event(GdkEventButton * event_ptr) -{ - if (event_ptr->type == GDK_2BUTTON_PRESS && event_ptr->button == 1) { - load_selected_project(); - return true; - } - return false; -} - -bool -LoadProjectDialog::on_key_press_event(GdkEventKey * event_ptr) -{ - if (event_ptr->type == GDK_KEY_PRESS && - (event_ptr->keyval == GDK_Return || - event_ptr->keyval == GDK_KP_Enter)) { - load_selected_project(); - return true; - } - return false; -} - diff --git a/src/LoadProjectDialog.hpp b/src/LoadProjectDialog.hpp deleted file mode 100644 index 22934c0..0000000 --- a/src/LoadProjectDialog.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_LOAD_PROJECT_DIALOG_H -#define PATCHAGE_LOAD_PROJECT_DIALOG_H - -#include <list> - -#include <gtkmm/liststore.h> -#include <gtkmm/treemodel.h> -#include <gtkmm/treeview.h> - -#include "Widget.hpp" - -class Patchage; -struct ProjectInfo; - -class LoadProjectDialog { -public: - explicit LoadProjectDialog(Patchage* app); - - void run(std::list<ProjectInfo>& projects); - -private: - struct Record : public Gtk::TreeModel::ColumnRecord { - Gtk::TreeModelColumn<Glib::ustring> name; - Gtk::TreeModelColumn<Glib::ustring> modified; - Gtk::TreeModelColumn<Glib::ustring> description; - }; - - void load_selected_project(); - bool on_button_press_event(GdkEventButton* event_ptr); - bool on_key_press_event(GdkEventKey* event_ptr); - - Patchage* _app; - Widget<Gtk::Dialog> _dialog; - Widget<Gtk::TreeView> _widget; - Record _columns; - Glib::RefPtr<Gtk::ListStore> _model; -}; - -#endif // PATCHAGE_LOAD_PROJECT_DIALOG_H diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 5f38389..6f8933c 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -56,15 +56,6 @@ #ifdef HAVE_ALSA #include "AlsaDriver.hpp" #endif -#ifdef HAVE_LASH - #include "DBus.hpp" -#endif -#ifdef HAVE_LASH - #include "LashProxy.hpp" - #include "LoadProjectDialog.hpp" - #include "ProjectList.hpp" - #include "Session.hpp" -#endif #define LOG_TO_STATUS 1 @@ -80,12 +71,6 @@ struct ProjectList_column_record : public Gtk::TreeModel::ColumnRecord { Patchage::Patchage(int argc, char** argv) : _xml(UIFile::open("patchage")) -#ifdef HAVE_LASH - , _dbus(NULL) - , _lash_proxy(NULL) - , _project_list(NULL) - , _session(NULL) -#endif #ifdef HAVE_ALSA , _alsa_driver(NULL) #endif @@ -107,7 +92,6 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_menu_store_positions) , INIT_WIDGET(_menu_view_arrange) , INIT_WIDGET(_menu_view_messages) - , INIT_WIDGET(_menu_view_projects) , INIT_WIDGET(_menu_view_refresh) , INIT_WIDGET(_menu_view_statusbar) , INIT_WIDGET(_menu_zoom_in) @@ -116,7 +100,6 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_messages_clear_but) , INIT_WIDGET(_messages_close_but) , INIT_WIDGET(_messages_win) - , INIT_WIDGET(_project_list_viewport) , INIT_WIDGET(_latency_frames_label) , INIT_WIDGET(_latency_ms_label) , INIT_WIDGET(_sample_rate_label) @@ -172,22 +155,15 @@ Patchage::Patchage(int argc, char** argv) _main_scrolledwin->signal_scroll_event().connect( sigc::mem_fun(this, &Patchage::on_scroll)); -#ifdef HAVE_LASH - _menu_open_session->signal_activate().connect( - sigc::mem_fun(this, &Patchage::show_load_project_dialog)); - _menu_view_projects->set_active(true); -#elif defined(PATCHAGE_JACK_SESSION) +#ifdef PATCHAGE_JACK_SESSION _menu_open_session->signal_activate().connect( sigc::mem_fun(this, &Patchage::show_open_session_dialog)); _menu_save_session->signal_activate().connect( sigc::mem_fun(this, &Patchage::show_save_session_dialog)); _menu_save_close_session->signal_activate().connect( sigc::mem_fun(this, &Patchage::show_save_close_session_dialog)); - #else _menu_open_session->set_sensitive(false); - _menu_view_projects->set_active(false); - _menu_view_projects->set_sensitive(false); #endif #ifdef HAVE_ALSA @@ -212,8 +188,6 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::on_view_statusbar)); _menu_view_messages->signal_toggled().connect( sigc::mem_fun(this, &Patchage::on_show_messages)); - _menu_view_projects->signal_toggled().connect( - sigc::mem_fun(this, &Patchage::on_show_projects)); _menu_help_about->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_help_about)); _menu_zoom_in->signal_activate().connect( @@ -259,15 +233,6 @@ Patchage::Patchage(int argc, char** argv) _alsa_driver = new AlsaDriver(this); #endif -#ifdef HAVE_LASH - _dbus = new DBus(this); - _session = new Session(); - _project_list = new ProjectList(this, _session); - _lash_proxy = new LashProxy(this, _session); -#else - _project_list_viewport->hide(); -#endif - connect_widgets(); update_state(); @@ -286,12 +251,7 @@ Patchage::~Patchage() #ifdef HAVE_ALSA delete _alsa_driver; #endif -#ifdef HAVE_LASH - delete _lash_proxy; - delete _project_list; - delete _session; - delete _dbus; -#endif + delete _state_manager; _about_win.destroy(); @@ -656,28 +616,6 @@ Patchage::show_save_close_session_dialog() #endif -#ifdef HAVE_LASH -void -Patchage::show_load_project_dialog() -{ - std::list<ProjectInfo> projects; - _lash_proxy->get_available_projects(projects); - - LoadProjectDialog dialog(this); - dialog.run(projects); -} - -void -Patchage::set_lash_available(bool available) -{ - _project_list->set_lash_available(available); - if (!available) { - _menu_view_projects->set_active(false); - _session->clear(); - } -} -#endif - #ifdef HAVE_ALSA void Patchage::menu_alsa_connect() @@ -771,15 +709,6 @@ Patchage::on_show_messages() } void -Patchage::on_show_projects() -{ - if (_menu_view_projects->get_active()) - _project_list_viewport->show(); - else - _project_list_viewport->hide(); -} - -void Patchage::on_store_positions() { store_window_location(); diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 9143e48..d4f7bb0 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -43,13 +43,8 @@ #include "Widget.hpp" class AlsaDriver; -class DBus; class JackDriver; -class JackSettingsDialog; -class LashProxy; class PatchageCanvas; -class ProjectList; -class Session; class StateManager; namespace FlowCanvas { class Module; } @@ -68,20 +63,11 @@ public: #ifdef HAVE_ALSA AlsaDriver* alsa_driver() const { return _alsa_driver; } #endif -#ifdef HAVE_LASH - DBus* dbus() const { return _dbus; } -#endif #ifdef PATCHAGE_JACK_SESSION void show_open_session_dialog(); void show_save_session_dialog(); void show_save_close_session_dialog(); #endif -#ifdef HAVE_LASH - LashProxy* lash_proxy() const { return _lash_proxy; } - - void show_load_project_dialog(); - void set_lash_available(bool available); -#endif Glib::RefPtr<Gtk::Builder> xml() { return _xml; } @@ -109,7 +95,6 @@ protected: bool on_messages_delete(GdkEventAny*); void on_quit(); void on_show_messages(); - void on_show_projects(); void on_store_positions(); void on_view_statusbar(); void on_zoom_in(); @@ -127,13 +112,6 @@ protected: Glib::RefPtr<Gtk::Builder> _xml; -#ifdef HAVE_LASH - DBus* _dbus; - LashProxy* _lash_proxy; - ProjectList* _project_list; - Session* _session; -#endif - #ifdef HAVE_ALSA AlsaDriver* _alsa_driver; void menu_alsa_connect(); @@ -169,7 +147,6 @@ protected: Widget<Gtk::MenuItem> _menu_store_positions; Widget<Gtk::MenuItem> _menu_view_arrange; Widget<Gtk::CheckMenuItem> _menu_view_messages; - Widget<Gtk::CheckMenuItem> _menu_view_projects; Widget<Gtk::MenuItem> _menu_view_refresh; Widget<Gtk::CheckMenuItem> _menu_view_statusbar; Widget<Gtk::ImageMenuItem> _menu_zoom_in; @@ -178,7 +155,6 @@ protected: Widget<Gtk::Button> _messages_clear_but; Widget<Gtk::Button> _messages_close_but; Widget<Gtk::Dialog> _messages_win; - Widget<Gtk::Viewport> _project_list_viewport; Widget<Gtk::Label> _latency_frames_label; Widget<Gtk::Label> _latency_ms_label; Widget<Gtk::Label> _sample_rate_label; diff --git a/src/Project.cpp b/src/Project.cpp deleted file mode 100644 index 952930a..0000000 --- a/src/Project.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "Project.hpp" -#include "Client.hpp" - -using boost::shared_ptr; -using std::string; -using std::list; - -struct ProjectImpl { - string name; - string description; - string notes; - bool modified_status; - list< shared_ptr<Client> > clients; -}; - -Project::Project(const string& name, const LoadedProjectProperties& properties) -{ - _impl = new ProjectImpl(); - _impl->name = name; - _impl->description = properties.description; - _impl->notes = properties.notes; - _impl->modified_status = properties.modified_status; -} - -Project::~Project() -{ - delete _impl; -} - -void -Project::clear() -{ - shared_ptr<Client> client; - - while (!_impl->clients.empty()) { - client = _impl->clients.front(); - _impl->clients.pop_front(); - _signal_client_removed.emit(client); - } -} - -const string& -Project::get_name() const -{ - return _impl->name; -} - -void -Project::on_name_changed(const string& name) -{ - _impl->name = name; - _signal_renamed.emit(); -} - -const string& -Project::get_description() const -{ - return _impl->description; -} - -const string& -Project::get_notes() const -{ - return _impl->notes; -} - -bool -Project::get_modified_status() const -{ - return _impl->modified_status; -} - -const Project::Clients& -Project::get_clients() const -{ - return _impl->clients; -} - -void -Project::on_client_added(shared_ptr<Client> client) -{ - _impl->clients.push_back(client); - _signal_client_added.emit(client); -} - -void -Project::on_client_removed(const string& id) -{ - shared_ptr<Client> client; - - for (list< shared_ptr<Client> >::iterator iter = _impl->clients.begin(); - iter != _impl->clients.end(); iter++) { - client = *iter; - - if (client->get_id() == id) { - _signal_client_removed.emit(client); - _impl->clients.erase(iter); - return; - } - } -} - -void -Project::on_modified_status_changed(bool modified_status) -{ - _impl->modified_status = modified_status; - _signal_modified_status_changed.emit(); -} - -void -Project::on_description_changed(const string& description) -{ - _impl->description = description; - _signal_description_changed.emit(); -} - -void -Project::on_notes_changed(const string& notes) -{ - _impl->notes = notes; - _signal_notes_changed.emit(); -} - diff --git a/src/Project.hpp b/src/Project.hpp deleted file mode 100644 index 15371f6..0000000 --- a/src/Project.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef LASH_PROJECT_HPP -#define LASH_PROJECT_HPP - -#include <string> -#include <list> - -#include <boost/shared_ptr.hpp> -#include <sigc++/signal.h> - -struct ProjectImpl; -class Client; - -struct LoadedProjectProperties { - bool modified_status; - std::string description; - std::string notes; -}; - -class Project { -public: - Project(const std::string& name, const LoadedProjectProperties& properties); - - ~Project(); - - void clear(); - - typedef std::list< boost::shared_ptr<Client> > Clients; - - const std::string& get_name() const; - const std::string& get_description() const; - const std::string& get_notes() const; - const Clients& get_clients() const; - bool get_modified_status() const; - - sigc::signal<void> _signal_renamed; - sigc::signal<void> _signal_modified_status_changed; - sigc::signal<void> _signal_description_changed; - sigc::signal<void> _signal_notes_changed; - - sigc::signal< void, boost::shared_ptr<Client> > _signal_client_added; - sigc::signal< void, boost::shared_ptr<Client> > _signal_client_removed; - - void on_name_changed(const std::string& name); - void on_modified_status_changed(bool modified_status); - void on_description_changed(const std::string& description); - void on_notes_changed(const std::string& notes); - void on_client_added(boost::shared_ptr<Client> client); - void on_client_removed(const std::string& id); - -private: - ProjectImpl* _impl; -}; - -#endif // LASH_PROJECT_HPP diff --git a/src/ProjectList.cpp b/src/ProjectList.cpp deleted file mode 100644 index ce8e26d..0000000 --- a/src/ProjectList.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <gtkmm/treemodel.h> -#include <gtkmm/treeview.h> -#include <gtkmm/treestore.h> -#include <gtkmm/menu.h> -#include <gtkmm/builder.h> -#include <gtkmm/menu_elems.h> - -#include "Client.hpp" -#include "LashProxy.hpp" -#include "Project.hpp" -#include "ProjectList.hpp" -#include "ProjectPropertiesDialog.hpp" -#include "Session.hpp" -#include "Widget.hpp" - -using boost::shared_ptr; -using std::string; - -struct ProjectList_column_record : public Gtk::TreeModel::ColumnRecord { - Gtk::TreeModelColumn<Glib::ustring> name; - Gtk::TreeModelColumn< shared_ptr<Project> > project; -}; - -struct ProjectListImpl : public sigc::trackable { - ProjectListImpl(Glib::RefPtr<Gtk::Builder> xml, - Patchage* app); - - void project_added(shared_ptr<Project> project); - void project_closed(shared_ptr<Project> project); - void project_renamed(Gtk::TreeModel::iterator iter); - void client_added(shared_ptr<Client> client, Gtk::TreeModel::iterator iter); - void client_removed(shared_ptr<Client> client, Gtk::TreeModel::iterator iter); - - bool on_button_press_event(GdkEventButton * event); - - void on_menu_popup_load_project(); - void on_menu_popup_save_all_projects(); - void on_menu_popup_save_project(shared_ptr<Project> project); - void on_menu_popup_close_project(shared_ptr<Project> project); - void on_menu_popup_project_properties(shared_ptr<Project> project); - void on_menu_popup_close_all_projects(); - - Patchage* _app; - Widget<Gtk::TreeView> _widget; - ProjectList_column_record _columns; - Glib::RefPtr<Gtk::TreeStore> _model; - Gtk::Menu _menu_popup; -}; - -ProjectList::ProjectList( - Patchage* app, - Session* session) -{ - _impl = new ProjectListImpl(app->xml(), app); - session->_signal_project_added.connect(mem_fun(_impl, &ProjectListImpl::project_added)); - session->_signal_project_closed.connect(mem_fun(_impl, &ProjectListImpl::project_closed)); -} - -ProjectList::~ProjectList() -{ - delete _impl; -} - -ProjectListImpl::ProjectListImpl(Glib::RefPtr<Gtk::Builder> xml, Patchage* app) - : _app(app) - , _widget(xml, "projects_list") -{ - _columns.add(_columns.name); - _columns.add(_columns.project); - - _model = Gtk::TreeStore::create(_columns); - _widget->set_model(_model); - - _widget->append_column("LASH projects", _columns.name); - - _menu_popup.accelerate(*_widget); - - _widget->signal_button_press_event().connect(sigc::mem_fun(*this, &ProjectListImpl::on_button_press_event), false); -} - -bool -ProjectListImpl::on_button_press_event(GdkEventButton* event) -{ - // Then do our custom stuff: - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Glib::RefPtr<Gtk::TreeView::Selection> selection = _widget->get_selection(); - - Gtk::TreeModel::Path path; - Gtk::TreeViewColumn * column_ptr; - int cell_x; - int cell_y; - - Gtk::Menu::MenuList& menulist = _menu_popup.items(); - - menulist.clear(); - - menulist.push_back(Gtk::Menu_Helpers::MenuElem("_Load project...", sigc::mem_fun(*this, &ProjectListImpl::on_menu_popup_load_project))); - - menulist.push_back(Gtk::Menu_Helpers::MenuElem("Save _all projects", sigc::mem_fun(*this, &ProjectListImpl::on_menu_popup_save_all_projects))); - - if (_widget->get_path_at_pos((int)event->x, (int)event->y, path, column_ptr, cell_x, cell_y)) { - selection->unselect_all(); - selection->select(path); - - Gtk::TreeIter iter = selection->get_selected(); - shared_ptr<Project> project = (*iter)[_columns.project]; - - if (project) { - const string& name = project->get_name(); - - menulist.push_back(Gtk::Menu_Helpers::MenuElem( - (string)"_Save project '" + name + "'", - sigc::bind( - sigc::mem_fun(*this, - &ProjectListImpl::on_menu_popup_save_project), - project))); - - menulist.push_back(Gtk::Menu_Helpers::MenuElem( - (string)"_Close project '" + name + "'", - sigc::bind( - sigc::mem_fun(*this, - &ProjectListImpl::on_menu_popup_close_project), - project))); - - menulist.push_back(Gtk::Menu_Helpers::MenuElem( - (string)"_Project '" + name + "' properties", - sigc::bind( - sigc::mem_fun(*this, - &ProjectListImpl::on_menu_popup_project_properties), - project))); - } - } else { - selection->unselect_all(); - } - - menulist.push_back(Gtk::Menu_Helpers::MenuElem("Cl_ose all projects", sigc::mem_fun(*this, &ProjectListImpl::on_menu_popup_close_all_projects))); - - _menu_popup.popup(event->button, event->time); - - return true; - } - - return false; -} - -void -ProjectListImpl::on_menu_popup_load_project() -{ - _app->show_load_project_dialog(); -} - -void -ProjectListImpl::on_menu_popup_save_all_projects() -{ - _app->lash_proxy()->save_all_projects(); -} - -void -ProjectListImpl::on_menu_popup_save_project(shared_ptr<Project> project) -{ - _app->lash_proxy()->save_project(project->get_name()); -} - -void -ProjectListImpl::on_menu_popup_close_project(shared_ptr<Project> project) -{ - _app->lash_proxy()->close_project(project->get_name()); -} - -void -ProjectListImpl::on_menu_popup_project_properties(shared_ptr<Project> project) -{ - ProjectPropertiesDialog dialog(_app->lash_proxy(), _app->xml()); - dialog.run(project); -} - -void -ProjectListImpl::on_menu_popup_close_all_projects() -{ - _app->lash_proxy()->close_all_projects(); -} - -void -ProjectListImpl::project_added( - shared_ptr<Project> project) -{ - Gtk::TreeModel::iterator iter; - Gtk::TreeModel::iterator child_iter; - Gtk::TreeModel::Row row; - string project_name = project->get_name(); - - if (project->get_modified_status()) { - project_name += " *"; - } - - iter = _model->append(); - row = *iter; - row[_columns.name] = project_name; - row[_columns.project] = project; - - project->_signal_renamed.connect( - bind(mem_fun(this, &ProjectListImpl::project_renamed), iter)); - project->_signal_modified_status_changed.connect( - bind(mem_fun(this, &ProjectListImpl::project_renamed), iter)); - project->_signal_client_added.connect( - bind(mem_fun(this, &ProjectListImpl::client_added), iter)); - project->_signal_client_removed.connect( - bind(mem_fun(this, &ProjectListImpl::client_removed), iter)); -} - -void -ProjectListImpl::project_closed( - shared_ptr<Project> project) -{ - shared_ptr<Project> temp_project; - Gtk::TreeModel::Children children = _model->children(); - Gtk::TreeModel::Children::iterator iter = children.begin(); - - while (iter != children.end()) { - Gtk::TreeModel::Row row = *iter; - - temp_project = row[_columns.project]; - - if (temp_project == project) { - _model->erase(iter); - return; - } - - iter++; - } -} - -void -ProjectListImpl::project_renamed( - Gtk::TreeModel::iterator iter) -{ - shared_ptr<Project> project; - - Gtk::TreeModel::Row row = *iter; - - project = row[_columns.project]; - string project_name = project->get_name(); - - if (project->get_modified_status()) - project_name += " *"; - - row[_columns.name] = project_name; -} - -void -ProjectListImpl::client_added( - shared_ptr<Client> client, - Gtk::TreeModel::iterator iter) -{ - Gtk::TreeModel::Path path = _model->get_path(iter); - Gtk::TreeModel::Row row = *iter; - - iter = _model->append(row.children()); - row = *iter; - row[_columns.name] = client->get_name(); - - _widget->expand_row(path, false); -} - -void -ProjectListImpl::client_removed( - shared_ptr<Client> client, - Gtk::TreeModel::iterator iter) -{ - if (!iter) - return; - - Gtk::TreeModel::Path path = _model->get_path(iter); - Gtk::TreeModel::Row row = *iter; - - Gtk::TreeNodeChildren childs = row.children(); - - for (Gtk::TreeModel::iterator child_iter = childs.begin(); child_iter; child_iter++) { - row = *child_iter; - - if (row[_columns.name] == client->get_name()) { - _widget->expand_row(path, false); - _model->erase(child_iter); - return; - } - } -} - -void -ProjectList::set_lash_available(bool lash_active) -{ - _impl->_widget->set_sensitive(lash_active); -} - diff --git a/src/ProjectList.hpp b/src/ProjectList.hpp deleted file mode 100644 index eed29ef..0000000 --- a/src/ProjectList.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_PROJECT_LIST_HPP -#define PATCHAGE_PROJECT_LIST_HPP - -struct ProjectListImpl; -class Patchage; -class Session; - -class ProjectList { -public: - ProjectList(Patchage* app, Session* session); - ~ProjectList(); - - void set_lash_available(bool lash_active); - -private: - ProjectListImpl* _impl; -}; - -#endif // PATCHAGE_PROJECT_LIST_HPP diff --git a/src/ProjectPropertiesDialog.cpp b/src/ProjectPropertiesDialog.cpp deleted file mode 100644 index 93c7a39..0000000 --- a/src/ProjectPropertiesDialog.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include <gtkmm/dialog.h> -#include <gtkmm/entry.h> -#include <gtkmm/textview.h> -#include <gtkmm/textbuffer.h> -#include <gtkmm/builder.h> - -#include "LashProxy.hpp" -#include "Patchage.hpp" -#include "Project.hpp" -#include "ProjectPropertiesDialog.hpp" -#include "Widget.hpp" - -using boost::shared_ptr; - -struct ProjectPropertiesDialogImpl { - ProjectPropertiesDialogImpl(LashProxy* proxy, Glib::RefPtr<Gtk::Builder> xml); - - LashProxy* _proxy; - Widget<Gtk::Dialog> _dialog; - Widget<Gtk::Entry> _name; - Widget<Gtk::Entry> _description; - Widget<Gtk::TextView> _notes; -}; - -ProjectPropertiesDialog::ProjectPropertiesDialog(LashProxy* proxy, - Glib::RefPtr<Gtk::Builder> xml) -{ - _impl = new ProjectPropertiesDialogImpl(proxy, xml); -} - -ProjectPropertiesDialog::~ProjectPropertiesDialog() -{ - delete _impl; -} - -void -ProjectPropertiesDialog::run(shared_ptr<Project> project) -{ - Glib::RefPtr<Gtk::TextBuffer> buffer; - int result; - - _impl->_name->set_text(project->get_name()); - - _impl->_description->set_text(project->get_description()); - - buffer = _impl->_notes->get_buffer(); - buffer->set_text(project->get_notes()); - - result = _impl->_dialog->run(); - if (result == 2) { - const std::string& old_name = project->get_name(); - const std::string& desc = _impl->_description->get_text(); - const std::string& notes = buffer->get_text(); - const std::string& name = _impl->_name->get_text(); - if (project->get_description() != desc) - _impl->_proxy->project_set_description(old_name, _impl->_description->get_text()); - if (project->get_notes() != notes) - _impl->_proxy->project_set_notes(old_name, buffer->get_text()); - if (old_name != name) - _impl->_proxy->project_rename(old_name, buffer->get_text()); - } - - _impl->_dialog->hide(); -} - -ProjectPropertiesDialogImpl::ProjectPropertiesDialogImpl( - LashProxy* proxy, - Glib::RefPtr<Gtk::Builder> xml) - : _proxy(proxy) - , _dialog(xml, "project_properties_dialog") - , _name(xml, "project_name") - , _description(xml, "project_description") - , _notes(xml, "project_notes") -{ -} - diff --git a/src/ProjectPropertiesDialog.hpp b/src/ProjectPropertiesDialog.hpp deleted file mode 100644 index 746c072..0000000 --- a/src/ProjectPropertiesDialog.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_PROJECT_PROPERTIES_DIALOG_HPP -#define PATCHAGE_PROJECT_PROPERTIES_DIALOG_HPP - -#include <boost/shared_ptr.hpp> - -struct ProjectPropertiesDialogImpl; -class Project; - -class ProjectPropertiesDialog { -public: - ProjectPropertiesDialog(LashProxy* proxy, Glib::RefPtr<Gtk::Builder> xml); - ~ProjectPropertiesDialog(); - - void run(boost::shared_ptr<Project> project); - -private: - ProjectPropertiesDialogImpl* _impl; -}; - -#endif // PATCHAGE_PROJECT_PROPERTIES_DIALOG_HPP diff --git a/src/Session.cpp b/src/Session.cpp deleted file mode 100644 index 3901c8b..0000000 --- a/src/Session.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "Client.hpp" -#include "Project.hpp" -#include "Session.hpp" - -using boost::shared_ptr; -using std::list; -using std::string; - -struct SessionImpl { - list< shared_ptr<Project> > projects; - list< shared_ptr<Client> > clients; -}; - -Session::Session() -{ - _impl = new SessionImpl; -} - -Session::~Session() -{ - delete _impl; -} - -void -Session::clear() -{ - shared_ptr<Project> project; - - _impl->clients.clear(); - - while (!_impl->projects.empty()) { - project = _impl->projects.front(); - _impl->projects.pop_front(); - project->clear(); - _signal_project_closed.emit(project); - } -} - -void -Session::project_add(shared_ptr<Project> project) -{ - _impl->projects.push_back(project); - - _signal_project_added.emit(project); -} - -shared_ptr<Project> -Session::find_project_by_name(const string& name) -{ - shared_ptr<Project> project; - for (list< shared_ptr<Project> >::iterator i = _impl->projects.begin(); - i != _impl->projects.end(); i++) - if ((*i)->get_name() == name) - return (*i); - - return shared_ptr<Project>(); -} - -void -Session::project_close(const string& project_name) -{ - shared_ptr<Project> project; - Project::Clients clients; - - for (list<shared_ptr<Project> >::iterator iter = _impl->projects.begin(); - iter != _impl->projects.end(); iter++) { - project = *iter; - - if (project->get_name() == project_name) { - _impl->projects.erase(iter); - _signal_project_closed.emit(project); - - // remove clients from session, if not removed already - clients = project->get_clients(); - for (Project::Clients::const_iterator i = clients.begin(); i != clients.end(); i++) - client_remove((*i)->get_id()); - - return; - } - } -} - -void -Session::client_add(shared_ptr<Client> client) -{ - _impl->clients.push_back(client); -} - -void -Session::client_remove(const string& id) -{ - for (list< shared_ptr<Client> >::iterator i = _impl->clients.begin(); - i != _impl->clients.end(); i++) { - if ((*i)->get_id() == id) { - _impl->clients.erase(i); - return; - } - } -} - -shared_ptr<Client> -Session::find_client_by_id(const string& id) -{ - for (list< shared_ptr<Client> >::iterator i = _impl->clients.begin(); - i != _impl->clients.end(); i++) - if ((*i)->get_id() == id) - return *i; - - return shared_ptr<Client>(); -} - diff --git a/src/Session.hpp b/src/Session.hpp deleted file mode 100644 index 0e9371f..0000000 --- a/src/Session.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* This file is part of Patchage. - * Copyright 2008 Nedko Arnaudov <nedko@arnaudov.name> - * - * Patchage 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. - * - * Patchage 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., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef PATCHAGE_SESSION_HPP -#define PATCHAGE_SESSION_HPP - -#include <string> -#include <boost/shared_ptr.hpp> - -struct SessionImpl; -class Project; -class Client; - -class Session -{ -public: - Session(); - ~Session(); - - void clear(); - - void project_add(boost::shared_ptr<Project> project); - void project_close(const std::string& project_name); - - boost::shared_ptr<Project> find_project_by_name(const std::string& name); - - void client_add(boost::shared_ptr<Client> client); - void client_remove(const std::string& id); - - boost::shared_ptr<Client> find_client_by_id(const std::string& id); - - sigc::signal< void, boost::shared_ptr<Project> > _signal_project_added; - sigc::signal< void, boost::shared_ptr<Project> > _signal_project_closed; - -private: - SessionImpl* _impl; -}; - -#endif // PATCHAGE_SESSION_HPP - diff --git a/src/patchage.ui b/src/patchage.ui index fe040d4..102f431 100644 --- a/src/patchage.ui +++ b/src/patchage.ui @@ -1,38 +1,94 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.16"/> - <!-- interface-naming-policy toplevel-contextual --> + <object class="GtkAboutDialog" id="about_win"> + <property name="can_focus">False</property> + <property name="destroy_with_parent">True</property> + <property name="type_hint">dialog</property> + <property name="transient_for">main_win</property> + <property name="program_name">Patchage</property> + <property name="version">@PATCHAGE_VERSION@</property> + <property name="copyright" translatable="yes">© 2005-2011 David Robillard +© 2008 Nedko Arnaudov</property> + <property name="comments" translatable="yes">A JACK, and ALSA front-end.</property> + <property name="website">http://drobilla.net/software/patchage</property> + <property name="license" translatable="yes">Patchage 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. + +Patchage 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 Patchage; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +</property> + <property name="authors">David Robillard <d@drobilla.net> +Nedko Arnaudov <nedko@arnaudov.name></property> + <property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property> + <property name="artists">Icon: + Lapo Calamandrei</property> + <property name="logo_icon_name">patchage</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + </object> + </child> + </object> <object class="GtkWindow" id="main_win"> + <property name="can_focus">False</property> <property name="border_width">1</property> <property name="title" translatable="yes">Patchage</property> <child> <object class="GtkVBox" id="main_vbox"> <property name="visible">True</property> - <property name="orientation">vertical</property> + <property name="can_focus">False</property> <child> <object class="GtkMenuBar" id="menubar"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkMenuItem" id="file_menu"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_File</property> <property name="use_underline">True</property> <child type="submenu"> <object class="GtkMenu" id="file_menu_menu"> + <property name="can_focus">False</property> <child> <object class="GtkImageMenuItem" id="menu_open_session"> <property name="label">gtk-open</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="O" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_open_session_menuitem_activate"/> + <signal name="activate" handler="on_open_session_menuitem_activate" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_save_session"> <property name="label">gtk-save</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="s" signal="activate" modifiers="GDK_CONTROL_MASK"/> @@ -40,7 +96,9 @@ </child> <child> <object class="GtkMenuItem" id="menu_save_close_session"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Save and _Close</property> <property name="use_underline">True</property> </object> @@ -48,24 +106,29 @@ <child> <object class="GtkImageMenuItem" id="menu_store_positions"> <property name="label">Save Positions</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_stock">False</property> - <signal name="activate" handler="on_save_settings1_activate"/> + <signal name="activate" handler="on_save_settings1_activate" swapped="no"/> </object> </child> <child> <object class="GtkSeparatorMenuItem" id="separator3"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_file_quit"> <property name="label">gtk-quit</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_quit1_activate"/> + <signal name="activate" handler="on_quit1_activate" swapped="no"/> </object> </child> </object> @@ -74,54 +137,66 @@ </child> <child> <object class="GtkMenuItem" id="menu_file_system"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_System</property> <property name="use_underline">True</property> <child type="submenu"> <object class="GtkMenu" id="file_system_menuitem_menu"> + <property name="can_focus">False</property> <child> <object class="GtkImageMenuItem" id="menu_jack_connect"> <property name="label">Connect to _Jack</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="J" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_menu_jack_connect_activate"/> + <signal name="activate" handler="on_menu_jack_connect_activate" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_jack_disconnect"> <property name="label">Disconnect from Jack</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> + <property name="can_focus">False</property> <property name="use_stock">False</property> <accelerator key="J" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_disconnect_from_jack1_activate"/> + <signal name="activate" handler="on_disconnect_from_jack1_activate" swapped="no"/> </object> </child> <child> <object class="GtkSeparatorMenuItem" id="separator4"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_alsa_connect"> <property name="label">Connect to _Alsa</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="A" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_menu_alsa_connect_activate"/> + <signal name="activate" handler="on_menu_alsa_connect_activate" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_alsa_disconnect"> <property name="label">Disconnect from ALSA</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="sensitive">False</property> + <property name="can_focus">False</property> <property name="use_stock">False</property> <accelerator key="A" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_menu_alsa_disconnect_activate"/> + <signal name="activate" handler="on_menu_alsa_disconnect_activate" swapped="no"/> </object> </child> </object> @@ -130,57 +205,61 @@ </child> <child> <object class="GtkMenuItem" id="view_menu"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_View</property> <property name="use_underline">True</property> <child type="submenu"> <object class="GtkMenu" id="view_menu_menu"> - <child> - <object class="GtkCheckMenuItem" id="menu_view_projects"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Projects</property> - <property name="use_underline">True</property> - <accelerator key="P" signal="activate" modifiers="GDK_CONTROL_MASK"/> - </object> - </child> + <property name="can_focus">False</property> <child> <object class="GtkCheckMenuItem" id="menu_view_messages"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_Messages</property> <property name="use_underline">True</property> <accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_messages1_activate"/> + <signal name="activate" handler="on_messages1_activate" swapped="no"/> </object> </child> <child> <object class="GtkCheckMenuItem" id="menu_view_statusbar"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_Statusbar</property> <property name="use_underline">True</property> <property name="active">True</property> <accelerator key="b" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_menu_view_toolbar_activate"/> + <signal name="activate" handler="on_menu_view_toolbar_activate" swapped="no"/> </object> </child> <child> <object class="GtkSeparatorMenuItem" id="menuitem1"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_zoom_in"> <property name="label">gtk-zoom-in</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/> <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/> + <accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_zoom_out"> <property name="label">gtk-zoom-out</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/> @@ -189,7 +268,9 @@ <child> <object class="GtkImageMenuItem" id="menu_zoom_normal"> <property name="label">gtk-zoom-100</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="0" signal="activate" modifiers="GDK_CONTROL_MASK"/> @@ -198,26 +279,31 @@ <child> <object class="GtkSeparatorMenuItem" id="menuitem2"> <property name="visible">True</property> + <property name="can_focus">False</property> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_view_refresh"> <property name="label">gtk-refresh</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="R" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_refresh2_activate"/> + <signal name="activate" handler="on_refresh2_activate" swapped="no"/> </object> </child> <child> <object class="GtkImageMenuItem" id="menu_view_arrange"> <property name="label">_Arrange</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="G" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_menu_view_arrange"/> + <signal name="activate" handler="on_menu_view_arrange" swapped="no"/> </object> </child> </object> @@ -226,18 +312,23 @@ </child> <child> <object class="GtkMenuItem" id="help_menu"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">_Help</property> <property name="use_underline">True</property> <child type="submenu"> <object class="GtkMenu" id="help_menu_menu"> + <property name="can_focus">False</property> <child> <object class="GtkImageMenuItem" id="menu_help_about"> <property name="label">gtk-about</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <signal name="activate" handler="on_about1_activate"/> + <signal name="activate" handler="on_about1_activate" swapped="no"/> </object> </child> </object> @@ -252,67 +343,41 @@ </packing> </child> <child> - <object class="GtkHPaned" id="hpaned1"> + <object class="GtkScrolledWindow" id="main_scrolledwin"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="position">204</property> - <property name="position_set">True</property> - <child> - <object class="GtkViewport" id="project_list_viewport"> - <property name="visible">True</property> - <property name="resize_mode">queue</property> - <child> - <object class="GtkTreeView" id="projects_list"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - </object> - <packing> - <property name="resize">False</property> - <property name="shrink">True</property> - </packing> - </child> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="shadow_type">in</property> <child> - <object class="GtkScrolledWindow" id="main_scrolledwin"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> - <property name="shadow_type">in</property> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="resize">True</property> - <property name="shrink">True</property> - </packing> + <placeholder/> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkStatusbar" id="statusbar"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">2</property> <child> <object class="GtkHBox" id="hbox1"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="spacing">12</property> <child> <object class="GtkHBox" id="hbox2"> <property name="visible">True</property> + <property name="can_focus">False</property> <child> <object class="GtkLabel" id="label10"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Latency: </property> </object> <packing> @@ -324,24 +389,31 @@ <child> <object class="GtkLabel" id="latency_frames_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">1024</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> <child> <object class="GtkLabel" id="frames_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes"> frames @ </property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">2</property> </packing> </child> <child> <object class="GtkLabel" id="sample_rate_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">48</property> </object> <packing> @@ -354,6 +426,7 @@ <child> <object class="GtkLabel" id="label9"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes"> kHz (</property> </object> <packing> @@ -365,40 +438,52 @@ <child> <object class="GtkLabel" id="latency_ms_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">21</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">5</property> </packing> </child> <child> <object class="GtkLabel" id="label11"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes"> ms)</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">6</property> </packing> </child> </object> <packing> <property name="expand">False</property> + <property name="fill">True</property> <property name="position">0</property> </packing> </child> <child> <object class="GtkProgressBar" id="main_xrun_progress"> <property name="visible">True</property> - <property name="show_text">True</property> + <property name="can_focus">False</property> <property name="pulse_step">0.10000000149</property> <property name="text" translatable="yes">0 Dropouts</property> + <property name="show_text">True</property> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> </object> <packing> + <property name="expand">True</property> + <property name="fill">True</property> <property name="padding">2</property> <property name="position">0</property> </packing> @@ -406,6 +491,7 @@ </object> <packing> <property name="expand">False</property> + <property name="fill">True</property> <property name="padding">1</property> <property name="position">2</property> </packing> @@ -413,49 +499,8 @@ </object> </child> </object> - <object class="GtkAboutDialog" id="about_win"> - <property name="destroy_with_parent">True</property> - <property name="type_hint">normal</property> - <property name="program_name">Patchage</property> - <property name="version">@PATCHAGE_VERSION@</property> - <property name="copyright" translatable="yes">© 2005-2010 David Robillard -© 2008 Nedko Arnaudov</property> - <property name="comments" translatable="yes">A LASH, JACK, and ALSA front-end.</property> - <property name="website">http://drobilla.net/software/patchage</property> - <property name="license" translatable="yes">Patchage 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. - -Patchage 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 Patchage; if not, write to the Free Software Foundation, Inc., -51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -</property> - <property name="authors">David Robillard <d@drobilla.net> -Nedko Arnaudov <nedko@arnaudov.name></property> - <property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property> - <property name="artists">Icon: - Lapo Calamandrei</property> - <property name="logo_icon_name">patchage</property> - <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox1"> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area1"/> - <packing> - <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - </child> - </object> <object class="GtkDialog" id="messages_win"> + <property name="can_focus">False</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> @@ -465,47 +510,26 @@ Nedko Arnaudov <nedko@arnaudov.name></property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox3"> + <object class="GtkBox" id="dialog-vbox3"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="spacing">2</property> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow2"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> - <property name="shadow_type">in</property> - <child> - <object class="GtkTextView" id="status_text"> - <property name="width_request">640</property> - <property name="height_request">480</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">False</property> - <property name="wrap_mode">word</property> - <property name="cursor_visible">False</property> - <property name="accepts_tab">False</property> - </object> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area3"> + <object class="GtkButtonBox" id="dialog-action_area3"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="layout_style">end</property> <child> <object class="GtkButton" id="messages_clear_but"> <property name="label">gtk-clear</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -517,12 +541,14 @@ Nedko Arnaudov <nedko@arnaudov.name></property> <child> <object class="GtkButton" id="messages_close_but"> <property name="label">gtk-close</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">False</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="use_action_appearance">False</property> <property name="use_stock">True</property> </object> <packing> @@ -534,261 +560,41 @@ Nedko Arnaudov <nedko@arnaudov.name></property> </object> <packing> <property name="expand">False</property> + <property name="fill">True</property> <property name="pack_type">end</property> <property name="position">0</property> </packing> </child> - </object> - </child> - <action-widgets> - <action-widget response="0">messages_clear_but</action-widget> - <action-widget response="0">messages_close_but</action-widget> - </action-widgets> - </object> - <object class="GtkDialog" id="load_project_dialog"> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="border_width">5</property> - <property name="title" translatable="yes">Load project</property> - <property name="modal">True</property> - <property name="window_position">center-on-parent</property> - <property name="type_hint">dialog</property> - <property name="transient_for">main_win</property> - <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox4"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">2</property> <child> - <object class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="width_request">400</property> - <property name="height_request">400</property> + <object class="GtkScrolledWindow" id="scrolledwindow2"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> - <child> - <object class="GtkTreeView" id="loadable_projects_list"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area4"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="load_project_cancel_button"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> + <property name="shadow_type">in</property> <child> - <object class="GtkButton" id="load_project_ok_button"> - <property name="label">gtk-ok</property> + <object class="GtkTextView" id="status_text"> + <property name="width_request">640</property> + <property name="height_request">480</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="use_stock">True</property> + <property name="editable">False</property> + <property name="wrap_mode">word</property> + <property name="cursor_visible">False</property> + <property name="accepts_tab">False</property> </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> </child> </object> <packing> <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="1">load_project_cancel_button</action-widget> - <action-widget response="2">load_project_ok_button</action-widget> - </action-widgets> - </object> - <object class="GtkDialog" id="project_properties_dialog"> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="border_width">5</property> - <property name="title" translatable="yes">Project properties</property> - <property name="modal">True</property> - <property name="window_position">center-on-parent</property> - <property name="type_hint">dialog</property> - <property name="transient_for">main_win</property> - <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox5"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">2</property> - <child> - <object class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">10</property> - <child> - <object class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkEntry" id="project_name"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label" translatable="yes"><b>Project name</b></property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkEntry" id="project_description"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label" translatable="yes"><b>Description</b></property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="frame3"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> - <child> - <object class="GtkTextView" id="project_notes"> - <property name="width_request">300</property> - <property name="height_request">200</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="label" translatable="yes"><b>Notes</b></property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="position">2</property> - </packing> - </child> - </object> - <packing> + <property name="fill">True</property> <property name="position">1</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area5"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="project_properties_cancel_button"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="project_properties_ok_button"> - <property name="label">gtk-ok</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> </object> </child> <action-widgets> - <action-widget response="1">project_properties_cancel_button</action-widget> - <action-widget response="2">project_properties_ok_button</action-widget> + <action-widget response="0">messages_clear_but</action-widget> + <action-widget response="0">messages_close_but</action-widget> </action-widgets> </object> </interface> @@ -33,8 +33,6 @@ def options(opt): opt.add_option('--no-jack-session', action='store_true', default=False, dest='no_jack_session', help="Do not build JACK session support") - opt.add_option('--no-lash', action='store_true', default=False, dest='no_lash', - help="Do not build Lash support") opt.add_option('--no-alsa', action='store_true', default=False, dest='no_alsa', help="Do not build Alsa Sequencer support") opt.add_option('--no-binloc', action='store_true', default=False, dest='no_binloc', @@ -90,10 +88,6 @@ def configure(conf): if not Options.options.no_alsa: autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA', mandatory=False) - # Use LASH if we have DBUS unless --no-lash - if not Options.options.no_lash and conf.is_defined('HAVE_DBUS_GLIB'): - autowaf.define(conf, 'HAVE_LASH', 1) - # Find files at binary location if we have dladdr unless --no-binloc if not Options.options.no_binloc and conf.is_defined('HAVE_DLADDR'): autowaf.define(conf, 'PATCHAGE_BINLOC', 1) @@ -114,7 +108,6 @@ def configure(conf): autowaf.display_msg(conf, "Install name", "'" + conf.env['APP_INSTALL_NAME'] + "'", 'CYAN') autowaf.display_msg(conf, "App human name", "'" + conf.env['APP_HUMAN_NAME'] + "'", 'CYAN') autowaf.display_msg(conf, "Jack (D-Bus)", conf.is_defined('HAVE_JACK_DBUS')) - autowaf.display_msg(conf, "LASH (D-Bus)", conf.is_defined('HAVE_LASH')) autowaf.display_msg(conf, "Jack (libjack)", conf.is_defined('PATCHAGE_LIBJACK')) autowaf.display_msg(conf, "Jack Session", conf.is_defined('PATCHAGE_JACK_SESSION')) autowaf.display_msg(conf, "Alsa Sequencer", conf.is_defined('HAVE_ALSA')) @@ -132,7 +125,6 @@ def build(bld): prog.install_path = '${BINDIR}' autowaf.use_lib(bld, prog, 'DBUS FLOWCANVAS DBUS_GLIB GTKMM GNOMECANVASMM GTHREAD RAUL') prog.source = ''' - src/Client.cpp src/Patchage.cpp src/PatchageCanvas.cpp src/PatchageEvent.cpp @@ -144,16 +136,7 @@ def build(bld): prog.source += ''' src/JackDbusDriver.cpp ''' - if bld.is_defined('HAVE_LASH'): - prog.source += ''' - src/LashProxy.cpp - src/LoadProjectDialog.cpp - src/Project.cpp - src/ProjectList.cpp - src/ProjectPropertiesDialog.cpp - src/Session.cpp - ''' - if bld.is_defined('HAVE_LASH') or bld.is_defined('HAVE_JACK_DBUS'): + if bld.is_defined('HAVE_JACK_DBUS'): prog.source += ' src/DBus.cpp ' if bld.is_defined('PATCHAGE_LIBJACK'): prog.source += ' src/JackDriver.cpp ' |