Canvas refactoring
* disable state manager and patchage canvas compilation * disable jack_proxy patchbay interaction with Patchage class * remove unused transport methods form jack_proxy * build with debug symbols * use canvas widget through the new code path
This commit is contained in:
parent
aea1b7bd19
commit
36f9173e13
|
@ -38,22 +38,22 @@
|
|||
|
||||
#include "jack_proxy.hpp"
|
||||
#include "Patchage.hpp"
|
||||
#include "PatchageCanvas.hpp"
|
||||
#include "StateManager.hpp"
|
||||
#include "lash_proxy.hpp"
|
||||
#include "project_list.hpp"
|
||||
#include "session.hpp"
|
||||
#include "globals.hpp"
|
||||
#include "a2j_proxy.hpp"
|
||||
#include "PatchageModule.hpp"
|
||||
#include "dbus_helpers.h"
|
||||
#include "load_projects_dialog.hpp"
|
||||
#include "graph_canvas.h"
|
||||
|
||||
Patchage * g_app;
|
||||
|
||||
#define LOG_TO_STD
|
||||
//#define LOG_TO_STATUS
|
||||
|
||||
graph_canvas_handle g_jack_graph_canvas;
|
||||
|
||||
/* Gtk helpers (resize combo boxes) */
|
||||
|
||||
static void
|
||||
|
@ -118,10 +118,7 @@ Patchage::Patchage(int argc, char** argv)
|
|||
{
|
||||
g_app = this;
|
||||
|
||||
_settings_filename = getenv("HOME");
|
||||
_settings_filename += "/.gladishrc";
|
||||
_state_manager = new StateManager();
|
||||
//_canvas = boost::shared_ptr<PatchageCanvas>(new PatchageCanvas(this, 1600*2, 1200*2));
|
||||
graph_canvas_create(1600 * 2, 1200 * 2, &g_jack_graph_canvas);
|
||||
|
||||
while (argc > 0) {
|
||||
if (!strcmp(*argv, "--help")) {
|
||||
|
@ -142,7 +139,8 @@ Patchage::Patchage(int argc, char** argv)
|
|||
|
||||
gtkmm_set_width_for_given_text(*_buffer_size_combo, "4096 frames", 40);
|
||||
|
||||
// _main_scrolledwin->add(*_canvas);
|
||||
_main_scrolledwin->add(*Glib::wrap(canvas_get_widget(graph_canvas_get_canvas(g_jack_graph_canvas))));
|
||||
|
||||
// _canvas->scroll_to(static_cast<int>(_canvas->width()/2 - 320),
|
||||
// static_cast<int>(_canvas->height()/2 - 240)); // FIXME: hardcoded
|
||||
|
||||
|
@ -168,8 +166,6 @@ Patchage::Patchage(int argc, char** argv)
|
|||
_menu_close_all_projects->signal_activate().connect(
|
||||
sigc::mem_fun(this, &Patchage::close_all_projects));
|
||||
|
||||
_menu_store_positions->signal_activate().connect(
|
||||
sigc::mem_fun(this, &Patchage::on_store_positions));
|
||||
_menu_file_quit->signal_activate().connect(
|
||||
sigc::mem_fun(this, &Patchage::on_quit));
|
||||
_menu_view_refresh->signal_activate().connect(
|
||||
|
@ -182,20 +178,10 @@ Patchage::Patchage(int argc, char** argv)
|
|||
sigc::mem_fun(this, &Patchage::on_show_projects));
|
||||
_menu_help_about->signal_activate().connect(
|
||||
sigc::mem_fun(this, &Patchage::on_help_about));
|
||||
|
||||
// _canvas->show();
|
||||
_main_win->present();
|
||||
|
||||
_state_manager->load(_settings_filename);
|
||||
|
||||
_main_win->resize(
|
||||
static_cast<int>(_state_manager->get_window_size().x),
|
||||
static_cast<int>(_state_manager->get_window_size().y));
|
||||
|
||||
_main_win->move(
|
||||
static_cast<int>(_state_manager->get_window_location().x),
|
||||
static_cast<int>(_state_manager->get_window_location().y));
|
||||
|
||||
Glib::wrap(canvas_get_widget(graph_canvas_get_canvas(g_jack_graph_canvas)))->show();
|
||||
_main_win->present();
|
||||
|
||||
_about_win->set_transient_for(*_main_win);
|
||||
|
||||
_a2j = new a2j_proxy;
|
||||
|
@ -239,7 +225,6 @@ Patchage::~Patchage()
|
|||
delete _lash;
|
||||
delete _project_list;
|
||||
delete _session;
|
||||
delete _state_manager;
|
||||
delete _a2j;
|
||||
|
||||
_about_win.destroy();
|
||||
|
@ -303,7 +288,6 @@ Patchage::update_load()
|
|||
void
|
||||
Patchage::zoom(double z)
|
||||
{
|
||||
_state_manager->set_zoom(z);
|
||||
// _canvas->set_zoom(z);
|
||||
}
|
||||
|
||||
|
@ -323,26 +307,6 @@ Patchage::refresh()
|
|||
// }
|
||||
}
|
||||
|
||||
|
||||
/** Update the stored window location and size in the StateManager (in memory).
|
||||
*/
|
||||
void
|
||||
Patchage::store_window_location()
|
||||
{
|
||||
int loc_x, loc_y, size_x, size_y;
|
||||
_main_win->get_position(loc_x, loc_y);
|
||||
_main_win->get_size(size_x, size_y);
|
||||
Coord window_location;
|
||||
window_location.x = loc_x;
|
||||
window_location.y = loc_y;
|
||||
Coord window_size;
|
||||
window_size.x = size_x;
|
||||
window_size.y = size_y;
|
||||
_state_manager->set_window_location(window_location);
|
||||
_state_manager->set_window_size(window_size);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Patchage::clear_load()
|
||||
{
|
||||
|
@ -454,15 +418,6 @@ Patchage::on_show_projects()
|
|||
_project_list_viewport->hide();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Patchage::on_store_positions()
|
||||
{
|
||||
store_window_location();
|
||||
_state_manager->save(_settings_filename);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Patchage::on_view_toolbar()
|
||||
{
|
||||
|
@ -596,6 +551,7 @@ Patchage::close_all_projects()
|
|||
_lash->close_all_projects();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
Patchage::on_port_added(
|
||||
const char * jack_client_name,
|
||||
|
@ -604,7 +560,6 @@ Patchage::on_port_added(
|
|||
bool is_input,
|
||||
bool is_terminal)
|
||||
{
|
||||
#if 0
|
||||
bool is_a2j_mapped;
|
||||
std::string canvas_client_name;
|
||||
std::string canvas_port_name;
|
||||
|
@ -664,10 +619,8 @@ Patchage::on_port_added(
|
|||
module->add_port(port);
|
||||
|
||||
module->resize();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
boost::shared_ptr<PatchagePort>
|
||||
Patchage::lookup_port(
|
||||
const char * jack_client_name,
|
||||
|
@ -680,14 +633,12 @@ Patchage::lookup_port(
|
|||
|
||||
return _canvas->get_port(jack_client_name, jack_port_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Patchage::on_port_removed(
|
||||
const char * jack_client_name,
|
||||
const char * jack_port_name)
|
||||
{
|
||||
#if 0
|
||||
boost::shared_ptr<PatchagePort> port = lookup_port(jack_client_name, jack_port_name);
|
||||
if (!port) {
|
||||
error_msg(str(boost::format("Unable to remove unknown port '%s':'%s'") % jack_client_name % jack_port_name));
|
||||
|
@ -706,7 +657,6 @@ Patchage::on_port_removed(
|
|||
} else {
|
||||
module->resize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -716,7 +666,6 @@ Patchage::on_ports_connected(
|
|||
const char * jack_client2_name,
|
||||
const char * jack_port2_name)
|
||||
{
|
||||
#if 0
|
||||
boost::shared_ptr<PatchagePort> port1 = lookup_port(jack_client1_name, jack_port1_name);
|
||||
if (!port1) {
|
||||
error_msg((std::string)"Unable to connect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'");
|
||||
|
@ -730,7 +679,6 @@ Patchage::on_ports_connected(
|
|||
}
|
||||
|
||||
_canvas->add_connection(port1, port2, port1->color() + 0x22222200);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -740,7 +688,6 @@ Patchage::on_ports_disconnected(
|
|||
const char * jack_client2_name,
|
||||
const char * jack_port2_name)
|
||||
{
|
||||
#if 0
|
||||
boost::shared_ptr<PatchagePort> port1 = lookup_port(jack_client1_name, jack_port1_name);
|
||||
if (!port1) {
|
||||
error_msg((std::string)"Unable to disconnect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'");
|
||||
|
@ -754,10 +701,8 @@ Patchage::on_ports_disconnected(
|
|||
}
|
||||
|
||||
_canvas->remove_connection(port1, port2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
static
|
||||
bool
|
||||
port_type_match(
|
||||
|
@ -766,7 +711,6 @@ port_type_match(
|
|||
{
|
||||
return port1->type == port2->type;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Patchage::get_port_jack_names(
|
||||
|
@ -774,7 +718,6 @@ Patchage::get_port_jack_names(
|
|||
std::string& jack_client_name,
|
||||
std::string& jack_port_name)
|
||||
{
|
||||
#if 0
|
||||
if (port->is_a2j_mapped)
|
||||
{
|
||||
jack_client_name = _a2j->get_jack_client_name();
|
||||
|
@ -785,7 +728,6 @@ Patchage::get_port_jack_names(
|
|||
jack_client_name = port->module().lock()->name();
|
||||
jack_port_name = port->name();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -793,7 +735,6 @@ Patchage::connect(
|
|||
boost::shared_ptr<PatchagePort> port1,
|
||||
boost::shared_ptr<PatchagePort> port2)
|
||||
{
|
||||
#if 0
|
||||
std::string jack_client1_name;
|
||||
std::string jack_port1_name;
|
||||
std::string jack_client2_name;
|
||||
|
@ -814,7 +755,6 @@ Patchage::connect(
|
|||
{
|
||||
status_msg("ERROR: Attempt to connect ports with mismatched types");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -822,7 +762,6 @@ Patchage::disconnect(
|
|||
boost::shared_ptr<PatchagePort> port1,
|
||||
boost::shared_ptr<PatchagePort> port2)
|
||||
{
|
||||
#if 0
|
||||
std::string jack_client1_name;
|
||||
std::string jack_port1_name;
|
||||
std::string jack_client2_name;
|
||||
|
@ -843,7 +782,6 @@ Patchage::disconnect(
|
|||
{
|
||||
status_msg("ERROR: Attempt to disconnect ports with mismatched types");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Destroy all JACK (canvas) ports.
|
||||
|
@ -851,7 +789,6 @@ Patchage::disconnect(
|
|||
void
|
||||
Patchage::clear_canvas()
|
||||
{
|
||||
#if 0
|
||||
ItemList modules = _canvas->items(); // copy
|
||||
for (ItemList::iterator m = modules.begin(); m != modules.end(); ++m) {
|
||||
shared_ptr<Module> module = dynamic_pointer_cast<Module>(*m);
|
||||
|
@ -873,12 +810,11 @@ Patchage::clear_canvas()
|
|||
else
|
||||
module->resize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
Patchage::is_canvas_empty()
|
||||
{
|
||||
// return _canvas->items().empty();
|
||||
return false;
|
||||
return _canvas->items().empty();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
|
||||
*
|
||||
**************************************************************************
|
||||
|
@ -31,13 +31,11 @@
|
|||
#include "common.h"
|
||||
#include "Widget.hpp"
|
||||
#include <gtkmm.h>
|
||||
#include "PatchagePort.hpp"
|
||||
|
||||
class PatchageCanvas;
|
||||
class a2j_proxy;
|
||||
class jack_proxy;
|
||||
class lash_proxy;
|
||||
class StateManager;
|
||||
class project_list;
|
||||
class session;
|
||||
|
||||
|
@ -46,17 +44,10 @@ public:
|
|||
Patchage(int argc, char** argv);
|
||||
~Patchage();
|
||||
|
||||
boost::shared_ptr<PatchageCanvas> canvas() const { return _canvas; }
|
||||
|
||||
Gtk::Window* window() { return _main_win.get(); }
|
||||
|
||||
StateManager* state_manager() const { return _state_manager; }
|
||||
|
||||
void quit() { _main_win->hide(); }
|
||||
|
||||
void connect(boost::shared_ptr<PatchagePort> p1, boost::shared_ptr<PatchagePort> p2);
|
||||
void disconnect(boost::shared_ptr<PatchagePort> p1, boost::shared_ptr<PatchagePort> p2);
|
||||
|
||||
void refresh();
|
||||
|
||||
void clear_load();
|
||||
|
@ -64,7 +55,6 @@ public:
|
|||
void error_msg(const std::string& msg);
|
||||
void status_msg(const std::string& msg);
|
||||
void update_state();
|
||||
void store_window_location();
|
||||
|
||||
void set_studio_availability(bool available);
|
||||
void set_a2j_status(unsigned int status);
|
||||
|
@ -76,39 +66,6 @@ public:
|
|||
void close_project(const std::string& project_name);
|
||||
void close_all_projects();
|
||||
|
||||
void
|
||||
on_port_added(
|
||||
const char * client_name,
|
||||
const char * port_name,
|
||||
PortType port_type,
|
||||
bool is_input,
|
||||
bool is_terminal);
|
||||
|
||||
void
|
||||
on_port_removed(
|
||||
const char * client_name,
|
||||
const char * port_name);
|
||||
|
||||
void
|
||||
on_ports_connected(
|
||||
const char * client1_name,
|
||||
const char * port1_name,
|
||||
const char * client2_name,
|
||||
const char * port2_name);
|
||||
|
||||
void
|
||||
on_ports_disconnected(
|
||||
const char * client1_name,
|
||||
const char * port1_name,
|
||||
const char * client2_name,
|
||||
const char * port2_name);
|
||||
|
||||
void
|
||||
clear_canvas();
|
||||
|
||||
bool
|
||||
is_canvas_empty();
|
||||
|
||||
protected:
|
||||
void connect_widgets();
|
||||
|
||||
|
@ -116,7 +73,6 @@ protected:
|
|||
void on_help_about();
|
||||
void on_quit();
|
||||
void on_show_projects();
|
||||
void on_store_positions();
|
||||
void on_view_toolbar();
|
||||
bool on_scroll(GdkEventScroll* ev);
|
||||
|
||||
|
@ -129,6 +85,7 @@ protected:
|
|||
|
||||
void buffer_size_changed();
|
||||
|
||||
#if 0
|
||||
void
|
||||
get_port_jack_names(
|
||||
boost::shared_ptr<PatchagePort> port,
|
||||
|
@ -139,19 +96,16 @@ protected:
|
|||
lookup_port(
|
||||
const char * jack_client_name,
|
||||
const char * jack_port_name);
|
||||
|
||||
boost::shared_ptr<PatchageCanvas> _canvas;
|
||||
#endif
|
||||
|
||||
a2j_proxy * _a2j;
|
||||
jack_proxy * _jack;
|
||||
session * _session;
|
||||
lash_proxy * _lash;
|
||||
project_list * _project_list;
|
||||
StateManager * _state_manager;
|
||||
|
||||
Gtk::Main* _gtk_main;
|
||||
|
||||
std::string _settings_filename;
|
||||
float _max_dsp_load;
|
||||
|
||||
Widget<Gtk::AboutDialog> _about_win;
|
||||
|
|
|
@ -30,20 +30,42 @@
|
|||
|
||||
#include "canvas.h"
|
||||
|
||||
struct canvas
|
||||
{
|
||||
FlowCanvas::Canvas * flowcanvas_ptr;
|
||||
};
|
||||
|
||||
bool
|
||||
canvas_create(
|
||||
int width,
|
||||
int height,
|
||||
canvas_handle * canvas_handle_ptr)
|
||||
{
|
||||
return false;
|
||||
struct canvas * canvas_ptr;
|
||||
|
||||
canvas_ptr = new canvas;
|
||||
canvas_ptr->flowcanvas_ptr = new FlowCanvas::Canvas(width, height);
|
||||
|
||||
*canvas_handle_ptr = (canvas_handle)canvas_ptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
#define canvas_ptr ((struct canvas *)canvas)
|
||||
|
||||
GtkWidget *
|
||||
canvas_get_widget(
|
||||
canvas_handle canvas)
|
||||
{
|
||||
return ((Gtk::Widget *)canvas_ptr->flowcanvas_ptr)->gobj();
|
||||
}
|
||||
|
||||
void
|
||||
canvas_destroy(
|
||||
canvas_handle canvas)
|
||||
{
|
||||
return false;
|
||||
delete canvas_ptr->flowcanvas_ptr;
|
||||
delete canvas_ptr;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#ifndef CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED
|
||||
#define CANVAS_H__BE110B39_CB54_47C2_A5B2_FFB3BA7CDA6D__INCLUDED
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "common.h"
|
||||
|
||||
typedef struct canvas_tag { int unused; } * canvas_handle;
|
||||
|
@ -46,7 +47,11 @@ canvas_create(
|
|||
int height,
|
||||
canvas_handle * canvas_handle_ptr);
|
||||
|
||||
bool
|
||||
GtkWidget *
|
||||
canvas_get_widget(
|
||||
canvas_handle canvas);
|
||||
|
||||
void
|
||||
canvas_destroy(
|
||||
canvas_handle canvas);
|
||||
|
||||
|
|
|
@ -42,8 +42,6 @@
|
|||
#include <boost/format.hpp>
|
||||
#endif
|
||||
|
||||
#include "canvas.h"
|
||||
|
||||
enum ModuleType { Input, Output, InputOutput };
|
||||
|
||||
#endif /* #ifndef COMMON_H__15E63B7A_8350_4ABD_B04C_592158354949__INCLUDED */
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#ifndef GRAPH_H__61D1ED56_E33B_4F50_B45B_F520979E8AA7__INCLUDED
|
||||
#define GRAPH_H__61D1ED56_E33B_4F50_B45B_F520979E8AA7__INCLUDED
|
||||
|
||||
#include "common.h"
|
||||
|
||||
typedef struct graph_tag { int unused; } * graph_handle;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains implementation of graph canvas object
|
||||
**************************************************************************
|
||||
*
|
||||
* LADI Session Handler is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* LADI Session Handler is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
|
||||
* or write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "graph_canvas.h"
|
||||
|
||||
struct graph_canvas
|
||||
{
|
||||
graph_handle graph;
|
||||
canvas_handle canvas;
|
||||
};
|
||||
|
||||
bool
|
||||
graph_canvas_create(
|
||||
int width,
|
||||
int height,
|
||||
graph_canvas_handle * graph_canvas_handle_ptr)
|
||||
{
|
||||
struct graph_canvas * graph_canvas_ptr;
|
||||
|
||||
graph_canvas_ptr = malloc(sizeof(struct graph_canvas));
|
||||
if (graph_canvas_ptr == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!canvas_create(width, height, &graph_canvas_ptr->canvas))
|
||||
{
|
||||
free(graph_canvas_ptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
graph_canvas_ptr->graph = NULL;
|
||||
|
||||
*graph_canvas_handle_ptr = (graph_canvas_handle)graph_canvas_ptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#define graph_canvas_ptr ((struct graph_canvas *)graph_canvas)
|
||||
|
||||
void
|
||||
graph_canvas_destroy(
|
||||
graph_canvas_handle graph_canvas)
|
||||
{
|
||||
if (graph_canvas_ptr->graph != NULL)
|
||||
{
|
||||
graph_canvas_detach(graph_canvas);
|
||||
}
|
||||
|
||||
free(graph_canvas_ptr);
|
||||
}
|
||||
|
||||
bool
|
||||
graph_canvas_attach(
|
||||
graph_canvas_handle graph_canvas,
|
||||
graph_handle graph)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
graph_canvas_detach(
|
||||
graph_canvas_handle graph_canvas)
|
||||
{
|
||||
}
|
||||
|
||||
canvas_handle
|
||||
graph_canvas_get_canvas(
|
||||
graph_canvas_handle graph_canvas)
|
||||
{
|
||||
return graph_canvas_ptr->canvas;
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains interface to graph canvas object
|
||||
**************************************************************************
|
||||
*
|
||||
* LADI Session Handler is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* LADI Session Handler is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
|
||||
* or write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef GRAPH_CANVAS_H__F145C6FA_633C_4E64_9117_ED301618B587__INCLUDED
|
||||
#define GRAPH_CANVAS_H__F145C6FA_633C_4E64_9117_ED301618B587__INCLUDED
|
||||
|
||||
#include "graph.h"
|
||||
#include "canvas.h"
|
||||
|
||||
typedef struct graph_canvas_tag { int unused; } * graph_canvas_handle;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if 0
|
||||
} /* Adjust editor indent */
|
||||
#endif
|
||||
|
||||
bool
|
||||
graph_canvas_create(
|
||||
int width,
|
||||
int height,
|
||||
graph_canvas_handle * graph_canvas_ptr);
|
||||
|
||||
void
|
||||
graph_canvas_destroy(
|
||||
graph_canvas_handle graph_canvas);
|
||||
|
||||
bool
|
||||
graph_canvas_attach(
|
||||
graph_canvas_handle graph_canvas,
|
||||
graph_handle graph);
|
||||
|
||||
void
|
||||
graph_canvas_detach(
|
||||
graph_canvas_handle graph_canvas);
|
||||
|
||||
canvas_handle
|
||||
graph_canvas_get_canvas(
|
||||
graph_canvas_handle graph_canvas);
|
||||
|
||||
#if 0
|
||||
{ /* Adjust editor indent */
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef GRAPH_CANVAS_H__F145C6FA_633C_4E64_9117_ED301618B587__INCLUDED */
|
|
@ -68,8 +68,6 @@ jack_proxy::jack_proxy(Patchage* app)
|
|||
if (!_server_responding) {
|
||||
return;
|
||||
}
|
||||
|
||||
refresh(); // the initial refresh
|
||||
}
|
||||
|
||||
|
||||
|
@ -257,92 +255,6 @@ jack_proxy::stop_server()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::on_port_added(
|
||||
dbus_uint64_t client_id,
|
||||
const char * client_name,
|
||||
dbus_uint64_t port_id,
|
||||
const char * port_name,
|
||||
dbus_uint32_t port_flags,
|
||||
dbus_uint32_t port_type)
|
||||
{
|
||||
PortType local_port_type;
|
||||
|
||||
switch (port_type) {
|
||||
case JACKDBUS_PORT_TYPE_AUDIO:
|
||||
local_port_type = JACK_AUDIO;
|
||||
break;
|
||||
case JACKDBUS_PORT_TYPE_MIDI:
|
||||
local_port_type = JACK_MIDI;
|
||||
break;
|
||||
default:
|
||||
error_msg("Unknown JACK D-Bus port type");
|
||||
return;
|
||||
}
|
||||
|
||||
_app->on_port_added(
|
||||
client_name,
|
||||
port_name,
|
||||
local_port_type,
|
||||
port_flags & JACKDBUS_PORT_FLAG_INPUT,
|
||||
port_flags & JACKDBUS_PORT_FLAG_TERMINAL);
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::on_port_removed(
|
||||
dbus_uint64_t client_id,
|
||||
const char * client_name,
|
||||
dbus_uint64_t port_id,
|
||||
const char * port_name)
|
||||
{
|
||||
_app->on_port_removed(client_name, port_name);
|
||||
|
||||
if (_app->is_canvas_empty())
|
||||
{
|
||||
if (_server_started)
|
||||
{
|
||||
signal_stopped.emit();
|
||||
}
|
||||
|
||||
_server_started = false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::on_ports_connected(
|
||||
dbus_uint64_t connection_id,
|
||||
dbus_uint64_t client1_id,
|
||||
const char* client1_name,
|
||||
dbus_uint64_t port1_id,
|
||||
const char* port1_name,
|
||||
dbus_uint64_t client2_id,
|
||||
const char* client2_name,
|
||||
dbus_uint64_t port2_id,
|
||||
const char* port2_name)
|
||||
{
|
||||
_app->on_ports_connected(client1_name, port1_name, client2_name, port2_name);
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::on_ports_disconnected(
|
||||
dbus_uint64_t connection_id,
|
||||
dbus_uint64_t client1_id,
|
||||
const char* client1_name,
|
||||
dbus_uint64_t port1_id,
|
||||
const char* port1_name,
|
||||
dbus_uint64_t client2_id,
|
||||
const char* client2_name,
|
||||
dbus_uint64_t port2_id,
|
||||
const char* port2_name)
|
||||
{
|
||||
_app->on_ports_disconnected(client1_name, port1_name, client2_name, port2_name);
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::refresh()
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t
|
||||
jack_proxy::buffer_size()
|
||||
{
|
||||
|
@ -503,26 +415,6 @@ jack_proxy::get_dsp_load()
|
|||
return load;
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::start_transport()
|
||||
{
|
||||
//info_msg(__func__);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
jack_proxy::stop_transport()
|
||||
{
|
||||
//info_msg(__func__);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
jack_proxy::rewind_transport()
|
||||
{
|
||||
//info_msg(__func__);
|
||||
}
|
||||
|
||||
void
|
||||
jack_proxy::error_msg(const std::string& msg) const
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains interface to code that interfaces JACK through D-Bus
|
||||
|
@ -42,8 +42,6 @@ public:
|
|||
bool is_started();
|
||||
bool is_realtime();
|
||||
|
||||
void refresh();
|
||||
|
||||
bool
|
||||
connect(
|
||||
const char * client1_name,
|
||||
|
@ -58,10 +56,6 @@ public:
|
|||
const char * client2_name,
|
||||
const char * port2_name);
|
||||
|
||||
void start_transport();
|
||||
void stop_transport();
|
||||
void rewind_transport();
|
||||
|
||||
void reset_xruns();
|
||||
|
||||
uint32_t buffer_size();
|
||||
|
@ -89,46 +83,6 @@ private:
|
|||
void error_msg(const std::string& msg) const;
|
||||
void info_msg(const std::string& msg) const;
|
||||
|
||||
void
|
||||
on_port_added(
|
||||
dbus_uint64_t client_id,
|
||||
const char * client_name,
|
||||
dbus_uint64_t port_id,
|
||||
const char * port_name,
|
||||
dbus_uint32_t port_flags,
|
||||
dbus_uint32_t port_type);
|
||||
|
||||
void
|
||||
on_port_removed(
|
||||
dbus_uint64_t client_id,
|
||||
const char * client_name,
|
||||
dbus_uint64_t port_id,
|
||||
const char * port_name);
|
||||
|
||||
void
|
||||
on_ports_connected(
|
||||
dbus_uint64_t connection_id,
|
||||
dbus_uint64_t client1_id,
|
||||
const char * client1_name,
|
||||
dbus_uint64_t port1_id,
|
||||
const char * port1_name,
|
||||
dbus_uint64_t client2_id,
|
||||
const char * client2_name,
|
||||
dbus_uint64_t port2_id,
|
||||
const char * port2_name);
|
||||
|
||||
void
|
||||
on_ports_disconnected(
|
||||
dbus_uint64_t connection_id,
|
||||
dbus_uint64_t client1_id,
|
||||
const char * client1_name,
|
||||
dbus_uint64_t port1_id,
|
||||
const char * port1_name,
|
||||
dbus_uint64_t client2_id,
|
||||
const char * client2_name,
|
||||
dbus_uint64_t port2_id,
|
||||
const char * port2_name);
|
||||
|
||||
bool
|
||||
call(
|
||||
bool response_expected,
|
||||
|
@ -141,8 +95,6 @@ private:
|
|||
void
|
||||
update_attached();
|
||||
|
||||
void refresh_internal(bool force);
|
||||
|
||||
static
|
||||
DBusHandlerResult
|
||||
dbus_message_hook(
|
||||
|
|
6
wscript
6
wscript
|
@ -112,6 +112,7 @@ def configure(conf):
|
|||
conf.check_tool('boost')
|
||||
conf.check_boost()
|
||||
|
||||
add_cflag(conf, '-g')
|
||||
add_cflag(conf, '-Wall')
|
||||
add_cflag(conf, '-Werror')
|
||||
|
||||
|
@ -258,8 +259,8 @@ def build(bld):
|
|||
for source in [
|
||||
'main.cpp',
|
||||
'Patchage.cpp',
|
||||
'PatchageCanvas.cpp',
|
||||
'StateManager.cpp',
|
||||
#'PatchageCanvas.cpp',
|
||||
#'StateManager.cpp',
|
||||
'jack_proxy.cpp',
|
||||
'lash_client.cpp',
|
||||
'lash_proxy.cpp',
|
||||
|
@ -272,6 +273,7 @@ def build(bld):
|
|||
'dbus_helpers.c',
|
||||
'canvas.cpp',
|
||||
'graph.c',
|
||||
'graph_canvas.c',
|
||||
]:
|
||||
gladish.source.append(os.path.join("gui", source))
|
||||
|
||||
|
|
Loading…
Reference in New Issue