2007-02-07 07:57:53 +02:00
|
|
|
/* This file is part of Patchage.
|
|
|
|
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
|
2008-06-15 11:50:12 +03:00
|
|
|
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
|
2006-06-09 05:18:57 +03:00
|
|
|
*
|
2006-10-02 23:56:28 +03:00
|
|
|
* Patchage is free software; you can redistribute it and/or modify it under the
|
2006-06-09 05:18:57 +03:00
|
|
|
* 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.
|
|
|
|
*
|
2006-10-02 23:56:28 +03:00
|
|
|
* Patchage is distributed in the hope that it will be useful, but WITHOUT ANY
|
2006-06-09 05:18:57 +03:00
|
|
|
* 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.,
|
2007-04-06 07:29:27 +03:00
|
|
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2006-06-09 05:18:57 +03:00
|
|
|
*/
|
|
|
|
|
2008-03-16 19:08:02 +02:00
|
|
|
#ifndef PATCHAGE_PATCHAGE_HPP
|
|
|
|
#define PATCHAGE_PATCHAGE_HPP
|
2006-06-09 05:18:57 +03:00
|
|
|
|
|
|
|
#include <string>
|
2006-10-04 01:24:22 +03:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2006-06-09 05:18:57 +03:00
|
|
|
#include <libgnomecanvasmm.h>
|
2007-12-20 02:52:10 +02:00
|
|
|
#include <libglademm/xml.h>
|
2008-10-03 04:10:58 +03:00
|
|
|
#include "config.h"
|
2007-12-20 04:04:55 +02:00
|
|
|
#include "Widget.hpp"
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2008-08-02 15:31:43 +03:00
|
|
|
#include "PatchagePort.hpp"
|
|
|
|
|
2007-06-06 05:51:08 +03:00
|
|
|
class PatchageCanvas;
|
2008-08-02 12:54:14 +03:00
|
|
|
class a2j_proxy;
|
2008-06-18 04:05:03 +03:00
|
|
|
class jack_proxy;
|
2008-06-13 03:30:22 +03:00
|
|
|
class lash_proxy;
|
2006-06-09 05:18:57 +03:00
|
|
|
class StateManager;
|
2008-06-15 11:50:12 +03:00
|
|
|
class project_list;
|
2008-07-03 22:55:43 +03:00
|
|
|
class session;
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2008-01-02 06:14:26 +02:00
|
|
|
class Patchage {
|
2006-06-09 05:18:57 +03:00
|
|
|
public:
|
|
|
|
Patchage(int argc, char** argv);
|
|
|
|
~Patchage();
|
|
|
|
|
2007-07-05 06:06:59 +03:00
|
|
|
boost::shared_ptr<PatchageCanvas> canvas() const { return _canvas; }
|
2006-10-04 01:24:22 +03:00
|
|
|
|
2007-12-20 04:04:55 +02:00
|
|
|
Gtk::Window* window() { return _main_win.get(); }
|
|
|
|
|
2007-07-05 06:06:59 +03:00
|
|
|
StateManager* state_manager() const { return _state_manager; }
|
2008-06-18 04:05:03 +03:00
|
|
|
|
2007-12-20 04:04:55 +02:00
|
|
|
void quit() { _main_win->hide(); }
|
2008-06-18 04:05:03 +03:00
|
|
|
|
|
|
|
void connect(boost::shared_ptr<PatchagePort> p1, boost::shared_ptr<PatchagePort> p2);
|
|
|
|
void disconnect(boost::shared_ptr<PatchagePort> p1, boost::shared_ptr<PatchagePort> p2);
|
|
|
|
|
2007-12-20 02:52:10 +02:00
|
|
|
void refresh();
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2007-01-01 08:30:55 +02:00
|
|
|
void clear_load();
|
2008-08-22 06:26:33 +03:00
|
|
|
void info_msg(const std::string& msg);
|
|
|
|
void error_msg(const std::string& msg);
|
|
|
|
void status_msg(const std::string& msg);
|
2007-12-20 02:52:10 +02:00
|
|
|
void update_state();
|
2008-01-02 19:10:26 +02:00
|
|
|
void store_window_location();
|
2008-08-22 06:26:33 +03:00
|
|
|
|
2008-06-15 16:24:12 +03:00
|
|
|
void set_lash_availability(bool lash_active);
|
2008-09-13 12:41:35 +03:00
|
|
|
void set_a2j_status(unsigned int status);
|
2008-06-15 16:24:12 +03:00
|
|
|
|
2008-06-18 22:54:06 +03:00
|
|
|
void load_project_ask();
|
2008-06-16 05:00:13 +03:00
|
|
|
void load_project(const std::string& project_name);
|
2008-06-15 23:55:45 +03:00
|
|
|
void save_all_projects();
|
|
|
|
void save_project(const std::string& project_name);
|
|
|
|
void close_project(const std::string& project_name);
|
|
|
|
void close_all_projects();
|
|
|
|
|
2008-08-02 15:31:43 +03:00
|
|
|
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();
|
|
|
|
|
2006-06-09 05:18:57 +03:00
|
|
|
protected:
|
2007-01-01 08:30:55 +02:00
|
|
|
void connect_widgets();
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2007-12-20 04:04:55 +02:00
|
|
|
void on_arrange();
|
|
|
|
void on_help_about();
|
2008-01-06 00:50:01 +02:00
|
|
|
void on_messages_clear();
|
|
|
|
void on_messages_close();
|
|
|
|
bool on_messages_delete(GdkEventAny*);
|
2007-12-20 04:04:55 +02:00
|
|
|
void on_quit();
|
|
|
|
void on_show_messages();
|
2008-08-22 06:26:33 +03:00
|
|
|
void on_show_projects();
|
2007-12-20 04:04:55 +02:00
|
|
|
void on_store_positions();
|
|
|
|
void on_view_toolbar();
|
2008-06-09 18:54:13 +03:00
|
|
|
bool on_scroll(GdkEventScroll* ev);
|
2007-12-20 04:04:55 +02:00
|
|
|
|
2006-10-02 23:56:28 +03:00
|
|
|
void zoom(double z);
|
2006-06-09 05:18:57 +03:00
|
|
|
bool idle_callback();
|
2008-06-11 23:53:35 +03:00
|
|
|
void update_load();
|
2007-01-01 08:30:55 +02:00
|
|
|
void update_toolbar();
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2008-06-11 23:53:35 +03:00
|
|
|
void jack_status_changed(bool started);
|
|
|
|
|
2007-01-01 08:30:55 +02:00
|
|
|
void buffer_size_changed();
|
2008-08-02 17:13:39 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
get_port_jack_names(
|
|
|
|
boost::shared_ptr<PatchagePort> port,
|
|
|
|
std::string& jack_client_name,
|
|
|
|
std::string& jack_port_name);
|
2007-01-01 08:30:55 +02:00
|
|
|
|
2008-08-02 20:07:04 +03:00
|
|
|
boost::shared_ptr<PatchagePort>
|
|
|
|
lookup_port(
|
|
|
|
const char * jack_client_name,
|
|
|
|
const char * jack_port_name);
|
|
|
|
|
2007-06-06 05:51:08 +03:00
|
|
|
boost::shared_ptr<PatchageCanvas> _canvas;
|
2006-10-04 01:24:22 +03:00
|
|
|
|
2008-08-02 12:54:14 +03:00
|
|
|
a2j_proxy * _a2j;
|
2008-09-08 05:47:27 +03:00
|
|
|
jack_proxy * _jack;
|
2008-07-03 22:55:43 +03:00
|
|
|
session * _session;
|
2008-06-13 03:30:22 +03:00
|
|
|
lash_proxy * _lash;
|
2008-06-15 11:50:12 +03:00
|
|
|
project_list * _project_list;
|
2008-09-08 05:47:27 +03:00
|
|
|
StateManager * _state_manager;
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2007-02-07 05:22:42 +02:00
|
|
|
Gtk::Main* _gtk_main;
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2007-12-20 01:46:11 +02:00
|
|
|
std::string _settings_filename;
|
2008-06-12 00:37:48 +03:00
|
|
|
float _max_dsp_load;
|
2006-06-09 05:18:57 +03:00
|
|
|
|
2007-12-20 04:04:55 +02:00
|
|
|
Widget<Gtk::AboutDialog> _about_win;
|
|
|
|
Widget<Gtk::ComboBox> _buffer_size_combo;
|
|
|
|
Widget<Gtk::ToolButton> _clear_load_but;
|
|
|
|
Widget<Gtk::ScrolledWindow> _main_scrolledwin;
|
|
|
|
Widget<Gtk::Window> _main_win;
|
|
|
|
Widget<Gtk::ProgressBar> _main_xrun_progress;
|
2008-09-13 12:20:38 +03:00
|
|
|
Widget<Gtk::Label> _main_a2j_status_label;
|
|
|
|
Widget<Gtk::Label> _main_lash_status_label;
|
2007-12-20 04:04:55 +02:00
|
|
|
Widget<Gtk::MenuItem> _menu_file_quit;
|
|
|
|
Widget<Gtk::MenuItem> _menu_help_about;
|
2008-06-11 23:53:35 +03:00
|
|
|
Widget<Gtk::MenuItem> _menu_jack_start;
|
|
|
|
Widget<Gtk::MenuItem> _menu_jack_stop;
|
2008-09-13 15:26:22 +03:00
|
|
|
Widget<Gtk::MenuItem> _menu_a2j_start;
|
|
|
|
Widget<Gtk::MenuItem> _menu_a2j_stop;
|
2008-09-13 22:12:40 +03:00
|
|
|
Widget<Gtk::MenuItem> _menu_lash_activate;
|
|
|
|
Widget<Gtk::MenuItem> _menu_lash_deactivate;
|
2008-09-08 05:47:27 +03:00
|
|
|
Widget<Gtk::MenuItem> _menu_load_project;
|
|
|
|
Widget<Gtk::MenuItem> _menu_save_all_projects;
|
|
|
|
Widget<Gtk::MenuItem> _menu_close_all_projects;
|
2008-06-11 23:53:35 +03:00
|
|
|
Widget<Gtk::MenuItem> _menu_store_positions;
|
2007-12-20 04:04:55 +02:00
|
|
|
Widget<Gtk::MenuItem> _menu_view_arrange;
|
|
|
|
Widget<Gtk::CheckMenuItem> _menu_view_messages;
|
2008-08-22 06:26:33 +03:00
|
|
|
Widget<Gtk::CheckMenuItem> _menu_view_projects;
|
2007-12-20 04:04:55 +02:00
|
|
|
Widget<Gtk::MenuItem> _menu_view_refresh;
|
|
|
|
Widget<Gtk::CheckMenuItem> _menu_view_toolbar;
|
2008-01-06 00:50:01 +02:00
|
|
|
Widget<Gtk::Button> _messages_clear_but;
|
|
|
|
Widget<Gtk::Button> _messages_close_but;
|
2008-08-22 06:26:33 +03:00
|
|
|
Widget<Gtk::Dialog> _messages_win;
|
|
|
|
Widget<Gtk::Viewport> _project_list_viewport;
|
2007-12-20 04:04:55 +02:00
|
|
|
Widget<Gtk::Label> _sample_rate_label;
|
|
|
|
Widget<Gtk::TextView> _status_text;
|
|
|
|
Widget<Gtk::Toolbar> _toolbar;
|
|
|
|
Widget<Gtk::ToolButton> _zoom_full_but;
|
|
|
|
Widget<Gtk::ToolButton> _zoom_normal_but;
|
2006-06-09 05:18:57 +03:00
|
|
|
};
|
|
|
|
|
2008-03-16 19:08:02 +02:00
|
|
|
#endif // PATCHAGE_PATCHAGE_HPP
|