removed no-longer-used Editor::track_canvas_motion()

Conflicts:
	gtk2_ardour/editor.h
This commit is contained in:
Paul Davis 2014-06-26 15:04:59 -04:00
parent e99734f07a
commit 2f77f2bc69
13 changed files with 40 additions and 61 deletions

View file

@ -731,10 +731,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void parameter_changed (std::string);
void ui_parameter_changed (std::string);
bool track_canvas_motion (GdkEvent*);
Gtk::EventBox& time_bars_event_box;
Gtk::VBox& time_bars_vbox;
Gtk::EventBox& time_bars_event_box;
Gtk::VBox& time_bars_vbox;
ArdourCanvas::Pixbuf *logo_item;
#if 0

View file

@ -30,6 +30,7 @@
#include "canvas/canvas.h"
#include "canvas/text.h"
#include "canvas/scroll_group.h"
#include "editor.h"
#include "keyboard.h"
@ -199,16 +200,6 @@ Editor::track_canvas_motion_notify_event (GdkEventMotion */*event*/)
return false;
}
bool
Editor::track_canvas_motion (GdkEvent *ev)
{
if (_verbose_cursor->visible ()) {
_verbose_cursor->set_position (ev->motion.x + 10, ev->motion.y + 10);
}
return false;
}
bool
Editor::typed_event (ArdourCanvas::Item* item, GdkEvent *event, ItemType type)
{

View file

@ -453,11 +453,7 @@ Drag::show_verbose_cursor_text (string const & text)
setting.
*/
_editor->verbose_cursor()->set (
text,
_drags->current_pointer_x() + 10,
_drags->current_pointer_y() + 10
);
_editor->verbose_cursor()->set (text);
}
boost::shared_ptr<Region>
@ -2029,7 +2025,7 @@ VideoTimeLineDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
Timecode::Time timecode;
_editor->session()->sample_to_timecode(abs(_startdrag_video_offset), timecode, true /* use_offset */, false /* use_subframes */ );
snprintf (buf, sizeof (buf), "Video Start:\n%c%02" PRId32 ":%02" PRId32 ":%02" PRId32 ":%02" PRId32, (_startdrag_video_offset<0?'-':' '), timecode.hours, timecode.minutes, timecode.seconds, timecode.frames);
_editor->verbose_cursor()->set(buf, event->button.x + 10, event->button.y + 10);
_editor->verbose_cursor()->set(buf);
_editor->verbose_cursor()->show ();
}
@ -2079,7 +2075,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
, _("Diff:"),
(dt<0?'-':' '), timediff.hours, timediff.minutes, timediff.seconds, timediff.frames
);
_editor->verbose_cursor()->set(buf, event->button.x + 10, event->button.y + 10);
_editor->verbose_cursor()->set(buf);
_editor->verbose_cursor()->show ();
}
@ -3519,8 +3515,7 @@ ControlPointDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/)
_point->line().start_drag_single (_point, _fixed_grab_x, fraction);
_editor->verbose_cursor()->set (_point->line().get_verbose_cursor_string (fraction),
event->button.x + 10, event->button.y + 10);
_editor->verbose_cursor()->set (_point->line().get_verbose_cursor_string (fraction));
_editor->verbose_cursor()->show ();
@ -3668,8 +3663,7 @@ LineDrag::start_grab (GdkEvent* event, Gdk::Cursor* /*cursor*/)
_line->start_drag_line (before, after, fraction);
_editor->verbose_cursor()->set (_line->get_verbose_cursor_string (fraction),
event->button.x + 10, event->button.y + 10);
_editor->verbose_cursor()->set (_line->get_verbose_cursor_string (fraction));
_editor->verbose_cursor()->show ();
}

View file

@ -1738,16 +1738,9 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
cp->show ();
double at_x, at_y;
at_x = cp->get_x();
at_y = cp->get_y ();
cp->i2w (at_x, at_y);
at_x += 10.0;
at_y += 10.0;
fraction = 1.0 - (cp->get_y() / cp->line().height());
_verbose_cursor->set (cp->line().get_verbose_cursor_string (fraction), at_x, at_y);
_verbose_cursor->set (cp->line().get_verbose_cursor_string (fraction));
_verbose_cursor->show ();
}
break;
@ -2036,7 +2029,6 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from
return false;
}
track_canvas_motion (event);
return true;
}

View file

@ -22,6 +22,7 @@
#endif
#include "session_dialog.h"
#include "utils.h"
#include "i18n.h"
using namespace std;

View file

@ -55,7 +55,7 @@
struct RecentSessionsSorter {
bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
return cmp_nocase(a.first, b.first) == -1;
return ARDOUR::cmp_nocase(a.first, b.first) == -1;
}
};

View file

@ -163,7 +163,7 @@ DeviceConnectionControl& TracksControlPanel::add_device_capture_control(std::str
{
std::string device_capture_name("");
std::string pattern(audio_capture_name_prefix);
remove_pattern_from_string(port_name, pattern, device_capture_name);
ARDOUR::remove_pattern_from_string(port_name, pattern, device_capture_name);
DeviceConnectionControl &capture_control = *manage (new DeviceConnectionControl(device_capture_name, active, capture_number, track_name));
@ -180,7 +180,7 @@ DeviceConnectionControl& TracksControlPanel::add_device_playback_control(std::st
{
std::string device_playback_name("");
std::string pattern(audio_playback_name_prefix);
remove_pattern_from_string(port_name, pattern, device_playback_name);
ARDOUR::remove_pattern_from_string(port_name, pattern, device_playback_name);
DeviceConnectionControl &playback_control = *manage (new DeviceConnectionControl(device_playback_name, active, playback_number));
@ -726,7 +726,7 @@ TracksControlPanel::populate_sample_rate_combo()
std::vector<std::string> s;
for (std::vector<float>::const_iterator x = sample_rates.begin(); x != sample_rates.end(); ++x) {
s.push_back (rate_as_string (*x));
s.push_back (ARDOUR_UI_UTILS::rate_as_string (*x));
}
{
@ -736,7 +736,7 @@ TracksControlPanel::populate_sample_rate_combo()
_sample_rate_combo.set_sensitive (s.size() > 1);
if (!s.empty() ) {
std::string active_sr = rate_as_string(EngineStateController::instance()->get_current_sample_rate() );
std::string active_sr = ARDOUR_UI_UTILS::rate_as_string(EngineStateController::instance()->get_current_sample_rate() );
_sample_rate_combo.set_active_text(active_sr);
}
}
@ -798,7 +798,7 @@ TracksControlPanel::populate_input_channels()
std::string port_name("");
std::string pattern(audio_capture_name_prefix);
remove_pattern_from_string(input_iter->name, pattern, port_name);
ARDOUR::remove_pattern_from_string(input_iter->name, pattern, port_name);
number = number_count++;
@ -862,8 +862,8 @@ TracksControlPanel::populate_midi_ports()
for (state_iter = midi_input_states.begin(); state_iter != midi_input_states.end(); ++state_iter) {
// strip the device name from input port name
std::string device_name("");
remove_pattern_from_string(state_iter->name, midi_port_name_prefix, device_name);
remove_pattern_from_string(device_name, midi_capture_suffix, device_name);
ARDOUR::remove_pattern_from_string(state_iter->name, midi_port_name_prefix, device_name);
ARDOUR::remove_pattern_from_string(device_name, midi_capture_suffix, device_name);
MidiDeviceDescriptor device_descriptor(device_name);
device_descriptor.capture_name = state_iter->name;
@ -875,8 +875,8 @@ TracksControlPanel::populate_midi_ports()
for (state_iter = midi_output_states.begin(); state_iter != midi_output_states.end(); ++state_iter){
// strip the device name from input port name
std::string device_name("");
remove_pattern_from_string(state_iter->name, midi_port_name_prefix, device_name);
remove_pattern_from_string(device_name, midi_playback_suffix, device_name);
ARDOUR::remove_pattern_from_string(state_iter->name, midi_port_name_prefix, device_name);
ARDOUR::remove_pattern_from_string(device_name, midi_playback_suffix, device_name);
// check if we already have descriptor for this device
MidiDeviceDescriptor device_descriptor(device_name);
@ -1186,7 +1186,7 @@ TracksControlPanel::sample_rate_changed()
// set _ignore_changes flag to ignore changes in combo-box callbacks
PBD::Unwinder<uint32_t> protect_ignore_changes (_ignore_changes, _ignore_changes + 1);
// restore previous buffer size value in combo box
std::string sample_rate_str = rate_as_string (EngineStateController::instance()->get_current_sample_rate() );
std::string sample_rate_str = ARDOUR_UI_UTILS::rate_as_string (EngineStateController::instance()->get_current_sample_rate() );
_sample_rate_combo.set_active_text(sample_rate_str);
}

View file

@ -58,10 +58,9 @@ VerboseCursor::canvas_item () const
/** Set the contents and position of the cursor. Coordinates are in window space
*/
void
VerboseCursor::set (string const & text, double x, double y)
VerboseCursor::set (string const & text)
{
set_text (text);
set_position (x, y);
}
void
@ -159,7 +158,7 @@ VerboseCursor::set_time (framepos_t frame, double x, double y)
break;
}
set (buf, x, y);
set (buf);
}
void
@ -245,7 +244,7 @@ VerboseCursor::set_duration (framepos_t start, framepos_t end, double x, double
break;
}
set (buf, x, y);
set (buf);
}
void

View file

@ -33,7 +33,7 @@ public:
void set_color (uint32_t);
void set (std::string const &, double, double);
void set (std::string const &);
void set_text (std::string const &);
void set_position (double, double);
void set_time (framepos_t, double, double);

View file

@ -53,7 +53,7 @@ WavesButton::WavesButton ()
, _right_border_width (0)
, _bottom_border_width (0)
{
ColorsChanged.connect (sigc::mem_fun (*this, &WavesButton::color_handler));
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &WavesButton::color_handler));
}
WavesButton::WavesButton (const std::string& str)

View file

@ -40,6 +40,7 @@
using namespace Gtkmm2ext;
using namespace PBD;
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
WavesDialog::WavesDialog (std::string layout_script_file, bool modal, bool use_seperator)
: Gtk::Dialog ("", modal, use_seperator)

View file

@ -28,6 +28,7 @@
using namespace PBD;
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
std::map<std::string, const XMLTree*> WavesUI::__xml_tree_cache;

View file

@ -763,17 +763,19 @@ ARDOUR::slider_position_to_gain_with_max (double g, double max_gain)
return slider_position_to_gain (g * max_gain/2.0);
}
bool remove_pattern_from_string(const std::string& in_str, const std::string& pattern, std::string& out_str) {
bool
ARDOUR::remove_pattern_from_string(const std::string& in_str, const std::string& pattern, std::string& out_str)
{
out_str.assign(in_str);
size_t pos = in_str.find(pattern);
if ( pos != std::string::npos ) {
out_str.erase(pos, pattern.length() );
return true;
} else {
return false;
}
out_str.assign(in_str);
size_t pos = in_str.find(pattern);
if ( pos != std::string::npos ) {
out_str.erase(pos, pattern.length() );
return true;
} else {
return false;
}
}
extern "C" {