diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 62916e2f09..4e474661cc 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -105,10 +105,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) preroll_clock (X_("preroll"), false, X_("PreRollClock"), true, true), postroll_clock (X_("postroll"), false, X_("PostRollClock"), true, true), - /* adjuster table */ - - adjuster_table (3, 3), - /* preroll stuff */ preroll_button (_("pre\nroll")), @@ -795,8 +791,6 @@ ARDOUR_UI::ask_about_saving_session (const string & what) window.set_resizable (false); window.show_all (); - save_the_session = 0; - window.set_keep_above (true); window.present (); @@ -1127,33 +1121,6 @@ ARDOUR_UI::open_recent_session () } } -bool -ARDOUR_UI::filter_ardour_session_dirs (const FileFilter::Info& info) -{ - struct stat statbuf; - - if (stat (info.filename.c_str(), &statbuf) != 0) { - return false; - } - - if (!S_ISDIR(statbuf.st_mode)) { - return false; - } - - // XXX Portability - - string session_file = info.filename; - session_file += '/'; - session_file += Glib::path_get_basename (info.filename); - session_file += ".ardour"; - - if (stat (session_file.c_str(), &statbuf) != 0) { - return false; - } - - return S_ISREG (statbuf.st_mode); -} - bool ARDOUR_UI::check_audioengine () { @@ -1862,17 +1829,6 @@ ARDOUR_UI::save_state_canfail (string name) return 0; } -void -ARDOUR_UI::restore_state (string name) -{ - if (session) { - if (name.length() == 0) { - name = session->name(); - } - session->restore_state (name); - } -} - void ARDOUR_UI::primary_clock_value_changed () { @@ -1897,37 +1853,6 @@ ARDOUR_UI::secondary_clock_value_changed () } } -void -ARDOUR_UI::rec_enable_button_blink (bool onoff, AudioDiskstream *dstream, Widget *w) -{ - if (session && dstream && dstream->record_enabled()) { - - Session::RecordState rs; - - rs = session->record_status (); - - switch (rs) { - case Session::Disabled: - case Session::Enabled: - if (w->get_state() != STATE_SELECTED) { - w->set_state (STATE_SELECTED); - } - break; - - case Session::Recording: - if (w->get_state() != STATE_ACTIVE) { - w->set_state (STATE_ACTIVE); - } - break; - } - - } else { - if (w->get_state() != STATE_NORMAL) { - w->set_state (STATE_NORMAL); - } - } -} - void ARDOUR_UI::transport_rec_enable_blink (bool onoff) { diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 605cb97700..e71740134a 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -148,7 +148,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI int save_state_canfail (string state_name = ""); void save_state (const string & state_name = ""); - void restore_state (string state_name = ""); static double gain_to_slider_position (ARDOUR::gain_t g); static ARDOUR::gain_t slider_position_to_gain (double pos); @@ -176,12 +175,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI static sigc::signal SuperRapidScreenUpdate; static sigc::signal Clock; - /* this is a helper function to centralize the (complex) logic for - blinking rec-enable buttons. - */ - - void rec_enable_button_blink (bool onoff, ARDOUR::AudioDiskstream *, Gtk::Widget *w); - void name_io_setup (ARDOUR::AudioEngine&, string&, ARDOUR::IO& io, bool in); static gint hide_and_quit (GdkEventAny *ev, ArdourDialog *); @@ -284,10 +277,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void goto_editor_window (); void goto_mixer_window (); - - Gtk::Table adjuster_table; - Gtk::Frame adjuster_frame; - Gtk::Fixed adjuster_base; GlobalClickBox *online_control_button; vector online_control_strings; @@ -298,9 +287,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI Gtk::ToggleButton preroll_button; Gtk::ToggleButton postroll_button; - Gtk::Table transport_table; - Gtk::Table option_table; - int setup_windows (); void setup_transport (); void setup_clock (); @@ -313,7 +299,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void finish(); int ask_about_saving_session (const string & why); - int save_the_session; /* periodic safety backup, to be precise */ gint autosave_session(); @@ -351,7 +336,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void manage_window (Gtk::Window&); AudioClock big_clock; - Gtk::Frame big_clock_frame; Gtk::Window* big_clock_window; void update_transport_clocks (nframes_t pos); @@ -682,9 +666,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI Gtk::MenuItem* jack_reconnect_item; Gtk::Menu* jack_bufsize_menu; - int make_session_clean (); - bool filter_ardour_session_dirs (const Gtk::FileFilter::Info&); - Glib::RefPtr common_actions; void editor_realized (); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 3b4ba9e5ff..ae3b7decdb 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -732,8 +732,6 @@ class Editor : public PublicEditor vector region_boundary_cache; void build_region_boundary_cache (); - Gtk::VBox trackview_vpacker; - Gtk::HBox top_hbox; Gtk::HBox bottom_hbox; diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index 1a6a6ecc73..f22b0f2967 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -119,10 +119,6 @@ class RouteUI : public virtual AxisView int set_color_from_route (); - sigc::connection blink_connection; - - void rec_enable_button_blink (bool onoff, ARDOUR::AudioDiskstream *, Gtk::Widget *w); - void remove_this_route (); static gint idle_remove_this_route (RouteUI *); diff --git a/libs/gtkmm2ext/SConscript b/libs/gtkmm2ext/SConscript index ddeabdccdd..8c5d926493 100644 --- a/libs/gtkmm2ext/SConscript +++ b/libs/gtkmm2ext/SConscript @@ -47,9 +47,7 @@ fastmeter.cc focus_entry.cc grouped_buttons.cc gtk_ui.cc -hexentry.cc idle_adjustment.cc -pathlist.cc pixfader.cc pixscroller.cc popup.cc diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index 31239e79df..cf75e59e8b 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -65,7 +65,6 @@ UI::UI (string namestr, int *argc, char ***argv) : AbstractUI (namestr, true) { theMain = new Main (argc, argv); - tips = new Tooltips; _active = false; _auto_display_errors = true; diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h index dbc6e6d611..e114693aee 100644 --- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h +++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -153,7 +152,6 @@ class UI : public Receiver, public AbstractUI static pthread_t gui_thread; bool _active; Gtk::Main *theMain; - Gtk::Tooltips *tips; TextViewer *errors; Glib::RefPtr error_ptag; Glib::RefPtr error_mtag; diff --git a/libs/gtkmm2ext/gtkmm2ext/hexentry.h b/libs/gtkmm2ext/gtkmm2ext/hexentry.h deleted file mode 100644 index 410f54274e..0000000000 --- a/libs/gtkmm2ext/gtkmm2ext/hexentry.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 1999 Paul Barton-Davis - - This program 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. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef __gtkmm2ext_hexentry_h__ -#define __gtkmm2ext_hexentry_h__ - -#include - -namespace Gtkmm2ext { - -class HexEntry : public Gtk::Entry - -{ - public: - /* Take a byte-level representation of a series of hexadecimal - values and use them to set the displayed text of the entry. - Eg. if hexbuf[0] = 0xff and hexbuf[1] = 0xa1 and buflen = 2, - then the text will be set to "ff a1". - */ - - void set_hex (unsigned char *hexbuf, unsigned int buflen); - - /* puts byte-level representation of current entry text - into hexbuf, and returns number of bytes written there. - - NOTE: this will release the existing memory pointed to - by hexbuf if buflen indicates that it is not long enough - to hold the new representation, and hexbuf is not zero. - - If the returned length is zero, the contents of hexbuf - are undefined. - */ - - unsigned int get_hex (unsigned char *hexbuf, size_t buflen); - - private: - bool on_key_press_event (GdkEventKey *); -}; - -} /* namespace */ - -#endif /* __gtkmm2ext_hexentry_h__ */ diff --git a/libs/gtkmm2ext/gtkmm2ext/pathlist.h b/libs/gtkmm2ext/gtkmm2ext/pathlist.h deleted file mode 100644 index f4a5973d5a..0000000000 --- a/libs/gtkmm2ext/gtkmm2ext/pathlist.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (C) 2006 Paul Davis - - This program 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. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef __gtkmm2ext_pathlist_h__ -#define __gtkmm2ext_pathlist_h__ - -#include -#include - -#include - -namespace Gtkmm2ext { - -class PathList : public Gtk::VBox -{ - public: - PathList (); - ~PathList () {}; - - std::vector get_paths (); - void set_paths (std::vector paths); - - sigc::signal PathsUpdated; - - protected: - Gtk::Button add_btn; - Gtk::Button subtract_btn; - - void add_btn_clicked (); - void subtract_btn_clicked (); - - private: - struct PathColumns : public Gtk::TreeModel::ColumnRecord { - PathColumns() { add (paths); } - Gtk::TreeModelColumn paths; - }; - PathColumns path_columns; - - Glib::RefPtr _store; - Gtk::TreeView _view; - - void selection_changed (); -}; - -} // namespace Gtkmm2ext - -#endif // __gtkmm2ext_pathlist_h__ diff --git a/libs/gtkmm2ext/hexentry.cc b/libs/gtkmm2ext/hexentry.cc deleted file mode 100644 index 9862cac435..0000000000 --- a/libs/gtkmm2ext/hexentry.cc +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright (C) 2000 Paul Barton-Davis - - This program 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. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ -*/ - -#include /* for sprintf, sigh ... */ -#include -#include - -#include -#include - -using namespace std; -using namespace Gtkmm2ext; - -bool -HexEntry::on_key_press_event (GdkEventKey *ev) - -{ - if ((ev->keyval >= GDK_a && ev->keyval <= GDK_f) || - (ev->keyval >= GDK_A && ev->keyval <= GDK_A) || - (ev->keyval >= GDK_0 && ev->keyval <= GDK_9) || - ev->keyval == GDK_space || - ev->keyval == GDK_Tab || - ev->keyval == GDK_Return || - ev->keyval == GDK_BackSpace || - ev->keyval == GDK_Delete) { - return Gtk::Entry::on_key_press_event (ev); - } else { - gdk_beep (); - return FALSE; - } -} - - -void -HexEntry::set_hex (unsigned char *msg, unsigned int len) - -{ - /* create a textual representation of the MIDI message */ - - if (msg && len) { - char *rep; - - rep = new char[(len * 3) + 1]; - for (size_t i = 0; i < len; i++) { - sprintf (&rep[i*3], "%02x ", msg[i]); - } - rep[len * 3] = '\0'; - set_text (rep); - delete [] rep; - } else { - set_text (""); - } -} - -unsigned int -HexEntry::get_hex (unsigned char *hexbuf, size_t buflen) - -{ - int fetched_len; - char buf[3]; - string text = get_text(); - string::size_type length = text.length (); - string::size_type offset; - - fetched_len = 0; - buf[2] = '\0'; - offset = 0; - - while (1) { - offset = text.find_first_of ("abcdef0123456789", offset); - - if (offset == string::npos) { - break; - } - - /* grab two characters, but no more */ - - buf[0] = text[offset]; - - if (offset < length - 1) { - buf[1] = text[offset+1]; - offset += 2; - } else { - buf[1] = '\0'; - offset += 1; - } - - hexbuf[fetched_len++] = (char) strtol (buf, 0, 16); - } - - return fetched_len; -} - - diff --git a/libs/gtkmm2ext/pathlist.cc b/libs/gtkmm2ext/pathlist.cc deleted file mode 100644 index 7b3448ed5f..0000000000 --- a/libs/gtkmm2ext/pathlist.cc +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2006 Paul Davis - - This program 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. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include - -#include "i18n.h" - -using namespace std; -using namespace Gtkmm2ext; - -PathList::PathList () - : - add_btn(_("+")), - subtract_btn(_("-")), - path_columns(), - _store(Gtk::ListStore::create(path_columns)), - _view(_store) -{ - _view.append_column(_("Paths"), path_columns.paths); - _view.set_size_request(-1, 100); - _view.set_headers_visible (false); - - Gtk::ScrolledWindow* scroll = manage(new Gtk::ScrolledWindow); - scroll->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - scroll->add(_view); - - add (*scroll); - - Gtk::HBox* btn_box = manage(new Gtk::HBox); - btn_box->add(add_btn); - btn_box->add(subtract_btn); - - add (*btn_box); - - add_btn.signal_clicked().connect (mem_fun(*this, &PathList::add_btn_clicked)); - subtract_btn.signal_clicked().connect (mem_fun(*this, &PathList::subtract_btn_clicked)); - _view.get_selection()->signal_changed().connect (mem_fun(*this, &PathList::selection_changed)); -} - -vector -PathList::get_paths () -{ - vector paths; - - Gtk::TreeModel::Children children(_store->children()); - - for (Gtk::TreeIter iter = children.begin(); iter != children.end(); ++iter) { - Gtk::ListStore::Row row = *iter; - - paths.push_back(row[path_columns.paths]); - } - - return paths; -} - -void -PathList::set_paths (vector paths) -{ - _store->clear(); - - for (vector::iterator i = paths.begin(); i != paths.end(); ++i) { - Gtk::ListStore::iterator iter = _store->append(); - Gtk::ListStore::Row row = *iter; - row[path_columns.paths] = *i; - } -} - -void -PathList::add_btn_clicked () -{ - Gtk::FileChooserDialog path_chooser (_("Path Chooser"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); - - path_chooser.add_button (Gtk::Stock::ADD, Gtk::RESPONSE_OK); - path_chooser.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - - int result = path_chooser.run (); - - if (result == Gtk::RESPONSE_OK) { - string pathname = path_chooser.get_filename(); - - if (pathname.length ()) { - Gtk::ListStore::iterator iter = _store->append (); - Gtk::ListStore::Row row = *iter; - row[path_columns.paths] = pathname; - - PathsUpdated (); // EMIT_SIGNAL - } - } -} - -void -PathList::subtract_btn_clicked () -{ - Gtk::ListStore::iterator iter = _view.get_selection()->get_selected(); - _store->erase (iter); - - PathsUpdated (); // EMIT_SIGNAL -} - -void -PathList::selection_changed () -{ - if (_view.get_selection()->count_selected_rows ()) { - subtract_btn.set_sensitive (true); - } else { - subtract_btn.set_sensitive (false); - } -}