[Summary] Adding ZOOM TOOL actions.

[git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 464697]
This commit is contained in:
Valeriy Kamyshniy 2014-05-30 04:43:38 -05:00 committed by Paul Davis
parent 371d82ffc9
commit b25e95ef60
5 changed files with 66 additions and 16 deletions

View file

@ -250,6 +250,8 @@ Editor::Editor ()
, _tool_marker_button (get_waves_button ("tool_marker_button"))
, _tool_zoom_button (get_waves_button ("tool_zoom_button"))
, _tool_arrow_button (get_waves_button ("tool_arrow_button"))
, _temporal_zoom_adjustment (get_adjustment ("temporal_zoom_adjustment"))
, _vertical_zoom_adjustment (get_adjustment ("vertical_zoom_adjustment"))
#ifdef TOP_MENUBAR
/*
* This is needed for OS X primarily
@ -2964,8 +2966,9 @@ Editor::setup_toolbar ()
_zoom_box.pack_start (zoom_out_full_button, false, false);
_zoom_box.pack_start (zoom_focus_selector, false, false);
} else {
mode_box->pack_start (zoom_out_button, false, false);
mode_box->pack_start (zoom_in_button, false, false);
_temporal_zoom_adjustment.signal_value_changed().connect (mem_fun (*this, &Editor::temporal_zoom_by_slider));
_vertical_zoom_adjustment.signal_value_changed().connect (mem_fun (*this, &Editor::vertical_zoom_by_slider));
ZoomChanged.connect (sigc::mem_fun (*this, &Editor::update_temporal_zoom_slider));
}
/* Track zoom buttons */
@ -3087,8 +3090,10 @@ Editor::setup_toolbar ()
hbox->show_all ();
toolbar_base.set_name ("ToolBarBase");
toolbar_base.add (toolbar_hbox);
if (!ARDOUR::Profile->get_trx()) {
toolbar_base.set_name ("ToolBarBase");
toolbar_base.add (toolbar_hbox);
}
_toolbar_viewport.add (toolbar_base);
/* stick to the required height but allow width to vary if there's not enough room */

View file

@ -1216,6 +1216,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void temporal_zoom (framecnt_t samples_per_pixel);
void temporal_zoom_by_frame (framepos_t start, framepos_t end);
void temporal_zoom_to_frame (bool coarser, framepos_t frame);
void temporal_zoom_by_slider ();
void update_temporal_zoom_slider ();
void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
void insert_region_list_selection (float times);
@ -1596,6 +1598,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
WavesButton& _tool_arrow_button;
ArdourButton mouse_gain_button;
WavesButton& _tool_zoom_button;
Gtk::Adjustment& _temporal_zoom_adjustment;
Gtk::Adjustment& _vertical_zoom_adjustment;
ArdourButton mouse_timefx_button;
ArdourButton mouse_audition_button;
@ -2012,6 +2017,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void fit_tracks (TrackViewList &);
void fit_selected_tracks ();
void set_track_height (Height);
void vertical_zoom_by_slider();
void remove_tracks ();
void toggle_tracks_active ();

View file

@ -92,6 +92,7 @@
#include "utils.h"
#include "i18n.h"
#include "dbg_msg.h"
using namespace std;
using namespace ARDOUR;
@ -1753,6 +1754,25 @@ Editor::temporal_zoom_to_frame (bool coarser, framepos_t frame)
reposition_and_zoom (new_leftmost, new_fpp);
}
void
Editor::temporal_zoom_by_slider ()
{
temporal_zoom (_temporal_zoom_adjustment.get_value());
}
void
Editor::update_temporal_zoom_slider ()
{
double value = samples_per_pixel;
if ( value < _temporal_zoom_adjustment.get_lower ()) {
value = _temporal_zoom_adjustment.get_lower ();
} else if ( value > _temporal_zoom_adjustment.get_upper ()) {
value = _temporal_zoom_adjustment.get_upper ();
}
_temporal_zoom_adjustment.set_value(samples_per_pixel);
}
bool
Editor::choose_new_marker_name(string &name) {
@ -6456,6 +6476,14 @@ Editor::set_track_height (Height h)
}
}
void
Editor::vertical_zoom_by_slider()
{
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->set_height (_vertical_zoom_adjustment.get_value()*22);
}
}
void
Editor::toggle_tracks_active ()
{

View file

@ -123,19 +123,30 @@
activeicon="tool_zoom_active"
prelighticon="tool_zoom_prelight"/>
<HBox box.pack="end" spacing ="1">
<Adjustment id="zoom_fader"/>
<Fader facesource="vertical_zoom_fader_face.png"
<Adjustment id="temporal_zoom_adjustment"
minvalue="1"
maxvalue="536870912"
initialvalue="20"
step="20"
pageincrement="20"/>
<Adjustment id="vertical_zoom_adjustment"
minvalue="1"
maxvalue="40"
initialvalue="1"
step="1"
pageincrement="1"/>
<Fader adjustment="vertical_zoom_adjustment"
facesource="vertical_zoom_fader_face.png"
handlesource="zoom_fader_handle.png"
activehandlesource="zoom_fader_handle_active.png"
adjustment="zoom_fader"
minposx="20"
minposy="13"
maxposx="66"
maxposy="13"/>
<Fader facesource="horizontal_zoom_fader_face.png"
<Fader adjustment="temporal_zoom_adjustment"
facesource="horizontal_zoom_fader_face.png"
handlesource="zoom_fader_handle.png"
activehandlesource="zoom_fader_handle_active.png"
adjustment="zoom_fader"
minposx="20"
minposy="13"
maxposx="66"

View file

@ -6,12 +6,12 @@
#include <gtkmm.h>
#include "waves_ui.h"
class WavesWindow : public Gtk::Window { public: WavesWindow (Gtk::WindowType window_type); WavesWindow (Gtk::WindowType window_type, std::string layout_script); Gtk::VBox& get_vbox (char* id) { return _children.get_vbox (id); }
Gtk::HBox& get_hbox (char* id) { return _children.get_hbox (id); }
Gtk::Layout& get_layout (char* id) { return _children.get_layout (id); }
Gtk::Label& get_label (char* id) { return _children.get_label (id); }
Gtk::ComboBoxText& get_combo_box_text (char* id) { return _children.get_combo_box_text (id); }
WavesButton& get_waves_button (char* id) { return _children.get_waves_button (id); }
class WavesWindow : public Gtk::Window { public: WavesWindow (Gtk::WindowType window_type); WavesWindow (Gtk::WindowType window_type, std::string layout_script); Gtk::VBox& get_vbox (const char* id) { return _children.get_vbox (id); }
Gtk::HBox& get_hbox (const char* id) { return _children.get_hbox (id); }
Gtk::Layout& get_layout (const char* id) { return _children.get_layout (id); }
Gtk::Label& get_label (const char* id) { return _children.get_label (id); }
Gtk::ComboBoxText& get_combo_box_text (const char* id) { return _children.get_combo_box_text (id); }
WavesButton& get_waves_button (const char* id) { return _children.get_waves_button (id); }
Gtk::Adjustment& get_adjustment (const char* id) { return _children.get_adjustment (id); }
private: WavesUI::WidgetMap _children; };
#endif // __waves_window_h__