/* This file is part of Patchage. * Copyright (C) 2007-2009 Dave Robillard * * 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_PATCHAGE_HPP #define PATCHAGE_PATCHAGE_HPP #include #include #include #include #include #include "patchage-config.h" #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; } class Patchage { public: Patchage(int argc, char** argv); ~Patchage(); boost::shared_ptr canvas() const { return _canvas; } Gtk::Window* window() { return _main_win.get(); } StateManager* state_manager() const { return _state_manager; } JackDriver* jack_driver() const { return _jack_driver; } #ifdef HAVE_ALSA AlsaDriver* alsa_driver() const { return _alsa_driver; } #endif #if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS) DBus* dbus() const { return _dbus; } #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 xml() { return _xml; } void attach(); void quit() { _main_win->hide(); } void refresh(); inline void queue_refresh() { _refresh = true; } inline void driver_detached() { _driver_detached = true; } void clear_load(); void info_msg(const std::string& msg); void error_msg(const std::string& msg); void status_msg(const std::string& msg); void update_state(); void store_window_location(); void enqueue_resize(boost::shared_ptr module); void flush_resize(); protected: void connect_widgets(); void on_arrange(); void on_help_about(); void on_messages_clear(); void on_messages_close(); bool on_messages_delete(GdkEventAny*); void on_quit(); void on_show_messages(); void on_show_projects(); void on_store_positions(); void on_view_toolbar(); bool on_scroll(GdkEventScroll* ev); void zoom(double z); bool idle_callback(); bool update_load(); void update_toolbar(); void buffer_size_changed(); Glib::RefPtr _xml; #if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS) DBus* _dbus; #endif #ifdef HAVE_LASH LashProxy* _lash_proxy; ProjectList* _project_list; Session* _session; #endif #ifdef HAVE_ALSA AlsaDriver* _alsa_driver; bool _alsa_driver_autoattach; void menu_alsa_connect(); void menu_alsa_disconnect(); #endif boost::shared_ptr _canvas; std::set< boost::shared_ptr > _pending_resize; JackDriver* _jack_driver; StateManager* _state_manager; Gtk::Main* _gtk_main; std::string _settings_filename; bool _attach; bool _driver_detached; bool _refresh; bool _enable_refresh; Widget _about_win; Widget _buffer_size_combo; Widget _clear_load_but; Widget _main_scrolledwin; Widget _main_win; Widget _main_xrun_progress; Widget _menu_alsa_connect; Widget _menu_alsa_disconnect; Widget _menu_file_quit; Widget _menu_help_about; Widget _menu_jack_connect; Widget _menu_jack_disconnect; Widget _menu_open_session; Widget _menu_store_positions; Widget _menu_view_arrange; Widget _menu_view_messages; Widget _menu_view_projects; Widget _menu_view_refresh; Widget _menu_view_toolbar; Widget _messages_clear_but; Widget _messages_close_but; Widget _messages_win; Widget _project_list_viewport; Widget _sample_rate_label; Widget _status_text; Widget _toolbar; Widget _zoom_full_but; Widget _zoom_normal_but; }; #endif // PATCHAGE_PATCHAGE_HPP