diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-31 13:11:55 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-31 13:11:55 +0000 |
commit | 4c7b6e1b1bf9e33cf5df5e0a270ad763bb32aea3 (patch) | |
tree | e6bac9f8f4bab6866b49a83cb5438041c1c7f2a6 | |
parent | 0d266d57eb16eff46dfa6bd22d2e75b86fb42fda (diff) |
minor mootcher fixes; change "Analyze .." to "Spectral Analysis" where applicable; make separate actions be appropriately sensitive to the edit point
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3198 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/actions.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/actions.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_freesound_mootcher.cc | 13 | ||||
-rw-r--r-- | svn_revision.h | 2 |
10 files changed, 56 insertions, 15 deletions
diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index eb0fd0a868..f6adbf3c92 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -52,6 +52,7 @@ vector<RefPtr<Gtk::Action> > ActionManager::point_selection_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::time_selection_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::line_selection_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::playlist_selection_sensitive_actions; +vector<RefPtr<Gtk::Action> > ActionManager::mouse_edit_point_requires_canvas_actions; vector<RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions; vector<RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions; diff --git a/gtk2_ardour/actions.h b/gtk2_ardour/actions.h index eeb4368032..832403f01f 100644 --- a/gtk2_ardour/actions.h +++ b/gtk2_ardour/actions.h @@ -51,6 +51,7 @@ class ActionManager static std::vector<Glib::RefPtr<Gtk::Action> > time_selection_sensitive_actions; static std::vector<Glib::RefPtr<Gtk::Action> > line_selection_sensitive_actions; static std::vector<Glib::RefPtr<Gtk::Action> > playlist_selection_sensitive_actions; + static std::vector<Glib::RefPtr<Gtk::Action> > mouse_edit_point_requires_canvas_actions; static std::vector<Glib::RefPtr<Gtk::Action> > range_sensitive_actions; static std::vector<Glib::RefPtr<Gtk::Action> > transport_sensitive_actions; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index b971071acd..c8f7e3e5ba 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1776,7 +1776,7 @@ Editor::add_region_context_items (AudioStreamView* sv, boost::shared_ptr<Region> items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection))); #ifdef FFT_ANALYSIS - items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection))); + items.push_back (MenuElem (_("Spectral Analysis"), mem_fun(*this, &Editor::analyze_region_selection))); #endif items.push_back (SeparatorElem()); @@ -1945,7 +1945,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& items) #ifdef FFT_ANALYSIS items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Analyze range"), mem_fun(*this, &Editor::analyze_range_selection))); + items.push_back (MenuElem (_("Spectral Analysis"), mem_fun(*this, &Editor::analyze_range_selection))); #endif items.push_back (SeparatorElem()); @@ -2228,6 +2228,15 @@ Editor::set_edit_point_preference (EditPoint ep, bool force) Glib::RefPtr<RadioAction>::cast_dynamic(act)->set_active (true); } + nframes64_t foo; + bool in_track_canvas; + + if (!mouse_frame (foo, in_track_canvas)) { + in_track_canvas = false; + } + + reset_canvas_action_sensitivity (in_track_canvas); + instant_save (); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 6122807fb6..2d7ce4c10d 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2051,13 +2051,15 @@ public: void ensure_entered_track_selected (bool op_acts_on_objects = false); bool clear_entered_track; - gint left_track_canvas (GdkEventCrossing*); + bool left_track_canvas (GdkEventCrossing*); + bool entered_track_canvas (GdkEventCrossing*); void set_entered_track (TimeAxisView*); void set_entered_regionview (RegionView*); gint left_automation_track (); bool _new_regionviews_show_envelope; + void reset_canvas_action_sensitivity (bool); void toggle_gain_envelope_visibility (); void toggle_gain_envelope_active (); void reset_region_gain_envelopes (); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 3d50486b5a..520f5205c6 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -440,16 +440,16 @@ Editor::register_actions () act = ActionManager::register_action (editor_actions, "editor-separate", _("Separate"), mem_fun(*this, &Editor::separate_region_from_selection)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "separate-from-punch", _("Separate Using Punch Range"), mem_fun(*this, &Editor::separate_region_from_punch)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "separate-from-loop", _("Separate Using Loop Range"), mem_fun(*this, &Editor::separate_region_from_loop)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::session_sensitive_actions.push_back (act); - ActionManager::region_selection_sensitive_actions.push_back (act); + ActionManager::mouse_edit_point_requires_canvas_actions.push_back (act); act = ActionManager::register_action (editor_actions, "editor-cut", _("Cut"), mem_fun(*this, &Editor::cut)); ActionManager::session_sensitive_actions.push_back (act); /* Note: for now, editor-delete does the exact same thing as editor-cut */ @@ -1656,3 +1656,16 @@ Editor::reset_focus () { track_canvas->grab_focus(); } + +void +Editor::reset_canvas_action_sensitivity (bool onoff) +{ + if (_edit_point != EditAtMouse) { + onoff = true; + } + + for (vector<Glib::RefPtr<Action> >::iterator x = ActionManager::mouse_edit_point_requires_canvas_actions.begin(); + x != ActionManager::mouse_edit_point_requires_canvas_actions.end(); ++x) { + (*x)->set_sensitive (onoff); + } +} diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 68faff59b8..0ee579f927 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -116,6 +116,7 @@ Editor::initialize_canvas () track_canvas->set_name ("EditorMainCanvas"); track_canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK|Gdk::SCROLL_MASK); track_canvas->signal_leave_notify_event().connect (mem_fun(*this, &Editor::left_track_canvas)); + track_canvas->signal_enter_notify_event().connect (mem_fun(*this, &Editor::entered_track_canvas)); track_canvas->set_flags (CAN_FOCUS); /* set up drag-n-drop */ @@ -779,11 +780,19 @@ Editor::stop_canvas_autoscroll () autoscroll_active = false; } -gint +bool Editor::left_track_canvas (GdkEventCrossing *ev) { set_entered_track (0); set_entered_regionview (0); + reset_canvas_action_sensitivity (false); + return false; +} + +bool +Editor::entered_track_canvas (GdkEventCrossing *ev) +{ + reset_canvas_action_sensitivity (true); return FALSE; } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index b3343c42c3..aec6f72387 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -77,6 +77,10 @@ Editor::mouse_frame (nframes64_t& where, bool& in_track_canvas) const Gdk::ModifierType mask; Glib::RefPtr<Gdk::Window> canvas_window = const_cast<Editor*>(this)->track_canvas->get_window(); Glib::RefPtr<const Gdk::Window> pointer_window; + + if (!canvas_window) { + return false; + } pointer_window = canvas_window->get_pointer (x, y, mask); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 335851ec49..be3f5f77f6 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2768,6 +2768,7 @@ Editor::separate_region_from_selection () to allow discontiguous operation, since get_edit_op_range() currently returns a single range. */ + if (mouse_mode == MouseRange && !selection->time.empty()) { separate_regions_between (selection->time); diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc index f7af1c1905..6c62939493 100644 --- a/gtk2_ardour/sfdb_freesound_mootcher.cc +++ b/gtk2_ardour/sfdb_freesound_mootcher.cc @@ -51,7 +51,7 @@ //------------------------------------------------------------------------
Mootcher:: Mootcher(const char *saveLocation)
: curl( NULL )
- , connection( NULL )
+ , connection( 0 )
{
changeWorkingDir(saveLocation);
};
@@ -108,7 +108,7 @@ size_t Mootcher::WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void //------------------------------------------------------------------------
void Mootcher::toLog(std::string input)
{
-//printf("%s\n", input.c_str());// for debugging
+printf("%s\n", input.c_str());// for debugging
}
@@ -135,7 +135,7 @@ int Mootcher::doLogin(std::string login, std::string password) struct MemoryStruct xml_page;
xml_page.memory = NULL;
- xml_page.size = NULL;
+ xml_page.size = 0;
// create the post message from the login and password
std::string postMessage;
@@ -191,9 +191,10 @@ int Mootcher::doLogin(std::string login, std::string password) if(xml_page.memory){
free( xml_page.memory );
xml_page.memory = NULL;
- xml_page.size = NULL;
+ xml_page.size = 0;
}
+ std::cerr << "Login was cool, connection = " << connection << std::endl;
return connection;
}
else return 3; // will be returned if a curl related problem ocurrs
@@ -203,7 +204,7 @@ std::string Mootcher::searchText(std::string word) {
struct MemoryStruct xml_page;
xml_page.memory = NULL;
- xml_page.size = NULL;
+ xml_page.size = 0;
std::string result;
@@ -252,7 +253,7 @@ std::string Mootcher::searchText(std::string word) if(xml_page.memory){
free( xml_page.memory );
xml_page.memory = NULL;
- xml_page.size = NULL;
+ xml_page.size = 0;
}
}
diff --git a/svn_revision.h b/svn_revision.h index 4037ed50ba..0918e1be2b 100644 --- a/svn_revision.h +++ b/svn_revision.h @@ -1,4 +1,4 @@ #ifndef __ardour_svn_revision_h__ #define __ardour_svn_revision_h__ -static const char* ardour_svn_revision = "3186"; +static const char* ardour_svn_revision = "3187"; #endif |