13
0

make rec-regions insensitive to events; fix up diskrate dialog text

git-svn-id: svn://localhost/ardour2/trunk@1626 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-03-19 14:45:34 +00:00
parent 84bbdb9a1d
commit 36d88c8e49
6 changed files with 78 additions and 32 deletions

View File

@ -2379,7 +2379,7 @@ ARDOUR_UI::disk_overrun_handler ()
if (!have_disk_speed_dialog_displayed) { if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true; have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor, X_("diskrate dialog"), _("\ MessageDialog* msg = new MessageDialog (*editor, _("\
The disk system on your computer\n\ The disk system on your computer\n\
was not able to keep up with Ardour.\n\ was not able to keep up with Ardour.\n\
\n\ \n\

View File

@ -179,6 +179,15 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wai
region_view->set_amplitude_above_axis(_amplitude_above_axis); region_view->set_amplitude_above_axis(_amplitude_above_axis);
region_views.push_front (region_view); region_views.push_front (region_view);
/* if its the special single-sample length that we use for rec-regions, make it
insensitive to events
*/
if (region->length() == 1) {
region_view->set_sensitive (false);
}
/* if this was the first one, then lets query the waveform scale and shape. /* if this was the first one, then lets query the waveform scale and shape.
otherwise, we set it to the current value */ otherwise, we set it to the current value */

View File

@ -214,7 +214,11 @@ Editor::typed_event (ArdourCanvas::Item* item, GdkEvent *event, ItemType type)
bool bool
Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, RegionView *rv) Editor::canvas_region_view_event (GdkEvent *event, ArdourCanvas::Item* item, RegionView *rv)
{ {
gint ret = FALSE; bool ret = false;
if (!rv->sensitive ()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
@ -330,6 +334,10 @@ Editor::canvas_fade_in_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRe
{ {
/* we handle only button 3 press/release events */ /* we handle only button 3 press/release events */
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
clicked_regionview = rv; clicked_regionview = rv;
@ -362,6 +370,10 @@ Editor::canvas_fade_in_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
{ {
bool ret = false; bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:
@ -401,6 +413,10 @@ Editor::canvas_fade_out_event (GdkEvent *event, ArdourCanvas::Item* item, AudioR
{ {
/* we handle only button 3 press/release events */ /* we handle only button 3 press/release events */
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
clicked_regionview = rv; clicked_regionview = rv;
@ -433,6 +449,10 @@ Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
{ {
bool ret = false; bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:
@ -703,6 +723,10 @@ Editor::canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::
{ {
bool ret = false; bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:
@ -739,6 +763,10 @@ Editor::canvas_region_view_name_event (GdkEvent *event, ArdourCanvas::Item* item
{ {
bool ret = false; bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) { switch (event->type) {
case GDK_BUTTON_PRESS: case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS: case GDK_2BUTTON_PRESS:

View File

@ -56,6 +56,8 @@ class RegionView : public TimeAxisViewItem
boost::shared_ptr<ARDOUR::Region> region() const { return _region; } boost::shared_ptr<ARDOUR::Region> region() const { return _region; }
bool is_valid() const { return valid; } bool is_valid() const { return valid; }
void set_valid (bool yn) { valid = yn; } void set_valid (bool yn) { valid = yn; }
virtual void set_height (double) = 0; virtual void set_height (double) = 0;

View File

@ -136,6 +136,7 @@ TimeAxisViewItem::init (const string& it_name, double spu, Gdk::Color& base_colo
min_item_duration = 0 ; min_item_duration = 0 ;
show_vestigial = true; show_vestigial = true;
visibility = vis; visibility = vis;
_sensitive = true;
if (duration == 0) { if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ; warning << "Time Axis Item Duration == 0" << endl ;

View File

@ -177,6 +177,9 @@ class TimeAxisViewItem : public Selectable
*/ */
virtual void set_should_show_selection (bool yn) ; virtual void set_should_show_selection (bool yn) ;
void set_sensitive (bool yn) { _sensitive = yn; }
bool sensitive () const { return _sensitive; }
//---------------------------------------------------------------------------------------// //---------------------------------------------------------------------------------------//
// Parent Component Methods // Parent Component Methods
@ -413,6 +416,9 @@ class TimeAxisViewItem : public Selectable
/** should the item show its selected status */ /** should the item show its selected status */
bool should_show_selection; bool should_show_selection;
/** should the item respond to events */
bool _sensitive;
/** /**
* The unique item name of this Item * The unique item name of this Item
* Each item upon a time axis must have a unique id * Each item upon a time axis must have a unique id