1 /* abGate - LV2 Noise Gate Plugin 2 * 3 * Copyright 2011 Antanas Bružas 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 3 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free 17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 */ 19 20 #include <iostream> 21 22 #include <gtkmm/alignment.h> 23 #include <gtkmm/comboboxentrytext.h> 24 #include <gtkmm/messagedialog.h> 25 #include <gtkmm/fixed.h> 26 27 #include "presets.h" 28 29 #define FILE_NAME "/.abGate/presets.xml" 30 31 #ifndef MAIN_WINDOW_WIDGET 32 #define MAIN_WINDOW_WIDGET 33 class main_window; 34 #endif 35 36 using namespace Glib; 37 using namespace Gtk; 38 using namespace std; 39 40 class preset_widget: public Alignment { 41 public: 42 preset_widget(main_window *m_win, void (*set_parameters)(main_window *main_w, float th, float at, float ho, float de, float ra), 43 void (*get_parameters)(main_window *main_w, float &th, float &at, float &ho, float &de, float &ra)); 44 45 virtual ~preset_widget(); 46 virtual void load_combo_list(); 47 48 protected: 49 HBox m_box; 50 Fixed m_fix; 51 Button load_button, save_button, delete_button; 52 ComboBoxEntryText preset_combo; 53 Label presets_label; 54 55 virtual void load_clicked(); 56 virtual void save_clicked(); 57 virtual void delete_clicked(); 58 59 void (*global_set)(main_window *m_w, float th, float at, float ho, float de, float ra); 60 void (*global_get)(main_window *m_w, float &th, float &at, float &ho, float &de, float &ra); 61 62 float th, at, ho, de, ra; 63 string home_dir, dir; 64 main_window *main_win; 65 }; 66