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) {
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\
was not able to keep up with Ardour.\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_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.
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
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) {
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 */
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
clicked_regionview = rv;
@ -362,6 +370,10 @@ Editor::canvas_fade_in_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
{
bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_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 */
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
clicked_regionview = rv;
@ -433,6 +449,10 @@ Editor::canvas_fade_out_handle_event (GdkEvent *event, ArdourCanvas::Item* item,
{
bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
@ -703,6 +723,10 @@ Editor::canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::
{
bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
@ -739,6 +763,10 @@ Editor::canvas_region_view_name_event (GdkEvent *event, ArdourCanvas::Item* item
{
bool ret = false;
if (!rv->sensitive()) {
return false;
}
switch (event->type) {
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:

View File

@ -56,41 +56,43 @@ class RegionView : public TimeAxisViewItem
boost::shared_ptr<ARDOUR::Region> region() const { return _region; }
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; }
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 raise ();
void raise_to_top ();
void lower ();
void lower_to_bottom ();
void raise ();
void raise_to_top ();
void lower ();
void lower_to_bottom ();
bool set_position(nframes_t pos, void* src, double* delta = 0);
void fake_set_opaque (bool yn);
virtual void show_region_editor () = 0;
virtual void hide_region_editor();
virtual void region_changed (ARDOUR::Change);
virtual GhostRegion* add_ghost (AutomationTimeAxisView&) = 0;
void remove_ghost (GhostRegion*);
uint32_t get_fill_color ();
virtual void entered () {}
virtual void exited () {}
static sigc::signal<void,RegionView*> RegionViewGoingAway;
sigc::signal<void> GoingAway;
bool set_position(nframes_t pos, void* src, double* delta = 0);
void fake_set_opaque (bool yn);
virtual void show_region_editor () = 0;
virtual void hide_region_editor();
virtual void region_changed (ARDOUR::Change);
virtual GhostRegion* add_ghost (AutomationTimeAxisView&) = 0;
void remove_ghost (GhostRegion*);
uint32_t get_fill_color ();
virtual void entered () {}
virtual void exited () {}
static sigc::signal<void,RegionView*> RegionViewGoingAway;
sigc::signal<void> GoingAway;
protected:
/** Allows derived types to specify their visibility requirements
/** Allows derived types to specify their visibility requirements
* to the TimeAxisViewItem parent class
*/
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 ;
show_vestigial = true;
visibility = vis;
_sensitive = true;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ;

View File

@ -176,6 +176,9 @@ class TimeAxisViewItem : public Selectable
* @param yn true if this item should show its selected status
*/
virtual void set_should_show_selection (bool yn) ;
void set_sensitive (bool yn) { _sensitive = yn; }
bool sensitive () const { return _sensitive; }
//---------------------------------------------------------------------------------------//
// Parent Component Methods
@ -412,6 +415,9 @@ class TimeAxisViewItem : public Selectable
/** should the item show its selected status */
bool should_show_selection;
/** should the item respond to events */
bool _sensitive;
/**
* The unique item name of this Item