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,41 +56,43 @@ 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; }
virtual void set_height (double) = 0;
virtual void set_samples_per_unit (double);
virtual bool set_duration (nframes_t, void*);
void move (double xdelta, double ydelta); void set_valid (bool yn) { valid = yn; }
void raise (); virtual void set_height (double) = 0;
void raise_to_top (); virtual void set_samples_per_unit (double);
void lower (); virtual bool set_duration (nframes_t, void*);
void lower_to_bottom ();
bool set_position(nframes_t pos, void* src, double* delta = 0); void move (double xdelta, double ydelta);
void fake_set_opaque (bool yn);
virtual void show_region_editor () = 0; void raise ();
virtual void hide_region_editor(); void raise_to_top ();
void lower ();
void lower_to_bottom ();
virtual void region_changed (ARDOUR::Change); bool set_position(nframes_t pos, void* src, double* delta = 0);
void fake_set_opaque (bool yn);
virtual GhostRegion* add_ghost (AutomationTimeAxisView&) = 0; virtual void show_region_editor () = 0;
void remove_ghost (GhostRegion*); virtual void hide_region_editor();
uint32_t get_fill_color (); virtual void region_changed (ARDOUR::Change);
virtual void entered () {} virtual GhostRegion* add_ghost (AutomationTimeAxisView&) = 0;
virtual void exited () {} void remove_ghost (GhostRegion*);
static sigc::signal<void,RegionView*> RegionViewGoingAway; uint32_t get_fill_color ();
sigc::signal<void> GoingAway;
virtual void entered () {}
virtual void exited () {}
static sigc::signal<void,RegionView*> RegionViewGoingAway;
sigc::signal<void> GoingAway;
protected: protected:
/** Allows derived types to specify their visibility requirements /** Allows derived types to specify their visibility requirements
* to the TimeAxisViewItem parent class * to the TimeAxisViewItem parent class
*/ */
RegionView (ArdourCanvas::Group *, RegionView (ArdourCanvas::Group *,

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