/* This file is part of Patchage. * Copyright 2007-2014 David 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 3 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 Patchage. If not, see . */ #ifndef PATCHAGE_PATCHAGE_HPP #define PATCHAGE_PATCHAGE_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "patchage_config.h" #include "Widget.hpp" #include "Legend.hpp" class AlsaDriver; class JackDriver; class PatchageCanvas; class Configuration; namespace Ganv { class Module; } class Patchage { public: Patchage(int argc, char** argv); ~Patchage(); const boost::shared_ptr& canvas() const { return _canvas; } Gtk::Window* window() { return _main_win.get(); } Configuration* conf() const { return _conf; } JackDriver* jack_driver() const { return _jack_driver; } #ifdef HAVE_ALSA AlsaDriver* alsa_driver() const { return _alsa_driver; } #endif #ifdef PATCHAGE_JACK_SESSION void show_open_session_dialog(); void show_save_session_dialog(); void show_save_close_session_dialog(); #endif Glib::RefPtr xml() { return _xml; } void attach(); void save(); void quit() { _main_win->hide(); } void refresh(); inline void queue_refresh() { _refresh = true; } inline void driver_detached() { _driver_detached = true; } void info_msg(const std::string& msg); void error_msg(const std::string& msg); void warning_msg(const std::string& msg); void update_state(); void store_window_location(); bool show_human_names() const { return _menu_view_human_names->get_active(); } bool sort_ports() const { return _menu_view_sort_ports->get_active(); } protected: class BufferSizeColumns : public Gtk::TreeModel::ColumnRecord { public: BufferSizeColumns() { add(label); } Gtk::TreeModelColumn label; }; void connect_widgets(); void on_arrange(); void on_sprung_layout_toggled(); void on_help_about(); void on_quit(); void on_export_image(); void on_view_messages(); void on_view_toolbar(); void on_store_positions(); void on_view_human_names(); void on_view_sort_ports(); void on_zoom_in(); void on_zoom_out(); void on_zoom_normal(); void on_zoom_full(); void on_increase_font_size(); void on_decrease_font_size(); void on_normal_font_size(); void on_legend_color_change(int id, const std::string& label, uint32_t rgba); void on_messages_resized(Gtk::Allocation& alloc); bool on_scroll(GdkEventScroll* ev); void zoom(double z); bool idle_callback(); void clear_load(); bool update_load(); void update_toolbar(); void buffer_size_changed(); Glib::RefPtr _xml; #ifdef HAVE_ALSA AlsaDriver* _alsa_driver; void menu_alsa_connect(); void menu_alsa_disconnect(); #endif #ifdef PATCHAGE_JACK_SESSION void save_session(bool close); #endif boost::shared_ptr _canvas; JackDriver* _jack_driver; Configuration* _conf; Gtk::Main* _gtk_main; BufferSizeColumns _buf_size_columns; Widget _about_win; Widget _main_scrolledwin; Widget _main_win; Widget _main_vbox; Widget _menubar; Widget _menu_alsa_connect; Widget _menu_alsa_disconnect; Widget _menu_file_quit; Widget _menu_export_image; Widget _menu_help_about; Widget _menu_jack_connect; Widget _menu_jack_disconnect; Widget _menu_open_session; Widget _menu_save_session; Widget _menu_save_close_session; Widget _menu_view_arrange; Widget _menu_view_sprung_layout; Widget _menu_view_messages; Widget _menu_view_toolbar; Widget _menu_view_refresh; Widget _menu_view_human_names; Widget _menu_view_sort_ports; Widget _menu_zoom_in; Widget _menu_zoom_out; Widget _menu_zoom_normal; Widget _menu_zoom_full; Widget _menu_increase_font_size; Widget _menu_decrease_font_size; Widget _menu_normal_font_size; Widget _toolbar; Widget _clear_load_but; Widget _xrun_progress; Widget _buf_size_combo; Widget _latency_label; Widget _legend_alignment; Widget _main_paned; Widget _log_scrolledwindow; Widget _status_text; Legend* _legend; Glib::RefPtr _error_tag; Glib::RefPtr _warning_tag; bool _pane_initialized; bool _attach; bool _driver_detached; bool _refresh; bool _enable_refresh; bool _jack_driver_autoattach; #ifdef HAVE_ALSA bool _alsa_driver_autoattach; #endif }; #endif // PATCHAGE_PATCHAGE_HPP