diff --git a/gtk2_ardour/marker_inspector_dialog.cc b/gtk2_ardour/marker_inspector_dialog.cc new file mode 100644 index 0000000000..615340bb90 --- /dev/null +++ b/gtk2_ardour/marker_inspector_dialog.cc @@ -0,0 +1,52 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + 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 "marker_inspector_dialog.h" +#include "waves_button.h" +#include "i18n.h" + +using namespace Gtk; +using namespace Gtkmm2ext; +using namespace PBD; +using namespace Glib; + +MarkerInspectorDialog::MarkerInspectorDialog () + : WavesUI ("marker_inspector_dialog.xml", *this) + , _empty_panel (get_container ("empty_panel")) + , _inspector_panel (get_container ("inspector_panel")) + , _color_palette_button (get_waves_button ("color_palette_button")) + , _color_buttons_home (get_container ("color_buttons_home")) + , _info_panel_button (get_waves_button ("info_panel_button")) + , _info_panel_home (get_container ("info_panel_home")) + , _location_name (get_label ("location_name")) + , _program_change_button (get_waves_button ("program_change_button")) + , _marker (0) +{ + _init (); +} + +MarkerInspectorDialog::~MarkerInspectorDialog () +{ +} + +void +MarkerInspectorDialog::on_realize () +{ + Gtk::Window::on_realize(); + get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_TITLE)); +} diff --git a/gtk2_ardour/marker_inspector_dialog.h b/gtk2_ardour/marker_inspector_dialog.h new file mode 100644 index 0000000000..e73207bc47 --- /dev/null +++ b/gtk2_ardour/marker_inspector_dialog.h @@ -0,0 +1,61 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + 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 __gtk2_ardour_marker_inspector_dialog_h__ +#define __gtk2_ardour_marker_inspector_dialog_h__ + +#include +#include +#include +#include + +#include "ardour/session_handle.h" +#include "ardour/types.h" + +#include "waves_ui.h" +#include "pbd/signals.h" +#include "pbd/xml++.h" + +class WavesButton; +class Marker; + +class MarkerInspectorDialog : public Gtk::Window, public ARDOUR::SessionHandlePtr, public WavesUI { + public: + MarkerInspectorDialog (); + ~MarkerInspectorDialog (); + + protected: + void on_realize (); + + private: + Gtk::Container& _empty_panel; + Gtk::Container& _inspector_panel; + WavesButton& _color_palette_button; + Gtk::Container& _color_buttons_home; + + WavesButton& _info_panel_button; + Gtk::Container& _info_panel_home; + + Gtk::Label& _location_name; + WavesButton& _program_change_button; + +#include "marker_inspector_dialog.logic.h" +}; + +#endif /* __gtk2_ardour_marker_inspector_dialog_h__ */ diff --git a/gtk2_ardour/marker_inspector_dialog.logic.cc b/gtk2_ardour/marker_inspector_dialog.logic.cc new file mode 100644 index 0000000000..b245794920 --- /dev/null +++ b/gtk2_ardour/marker_inspector_dialog.logic.cc @@ -0,0 +1,68 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + 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 +#include +#include "ardour/location.h" + +#include "marker.h" +#include "marker_inspector_dialog.h" + +#include "dbg_msg.h" + +void +MarkerInspectorDialog::_init () +{ + set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY); + _color_palette_button.signal_clicked.connect (sigc::mem_fun (*this, &MarkerInspectorDialog::_color_palette_button_clicked)); + _info_panel_button.signal_clicked.connect (sigc::mem_fun (*this, &MarkerInspectorDialog::_info_panel_button_clicked)); + _program_change_button.signal_clicked.connect (sigc::mem_fun (*this, &MarkerInspectorDialog::_program_change_button_clicked)); +} + + +void MarkerInspectorDialog::set_marker (Marker* marker) +{ + _empty_panel.set_visible (!marker); + _inspector_panel.set_visible (marker); + _marker = marker; + if (_marker) { + _program_change_button.set_active (_marker->has_scene_change ()); + _location_name.set_text (_marker->name ()); + } +} + +void +MarkerInspectorDialog::_color_palette_button_clicked (WavesButton *button) +{ + _color_buttons_home.set_visible (_color_palette_button.active_state () == Gtkmm2ext::ExplicitActive); +} + +void +MarkerInspectorDialog::_info_panel_button_clicked (WavesButton *button) +{ + _info_panel_home.set_visible (_info_panel_button.active_state () == Gtkmm2ext::ExplicitActive); +} + +void +MarkerInspectorDialog::_program_change_button_clicked (WavesButton *button) +{ + if (_marker) { + _marker->set_has_scene_change (_program_change_button.active_state () == Gtkmm2ext::ExplicitActive); + } +} diff --git a/gtk2_ardour/marker_inspector_dialog.logic.h b/gtk2_ardour/marker_inspector_dialog.logic.h new file mode 100644 index 0000000000..4ecc124270 --- /dev/null +++ b/gtk2_ardour/marker_inspector_dialog.logic.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + 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. + +*/ + +// class TracksControlPanel : public WavesDialog { +public: + void set_marker (Marker* marker); + +protected: + +private: + Marker* _marker; + + void _init(); + void _color_palette_button_clicked (WavesButton *button); + void _info_panel_button_clicked (WavesButton *button); + void _program_change_button_clicked (WavesButton *button); + +//}; + diff --git a/gtk2_ardour/ui/marker_inspector_dialog.xml b/gtk2_ardour/ui/marker_inspector_dialog.xml new file mode 100644 index 0000000000..4d6146d590 --- /dev/null +++ b/gtk2_ardour/ui/marker_inspector_dialog.xml @@ -0,0 +1,186 @@ + + +