(re)enable navigation by up/down/left/right keys in Viewer and Composer 
windows...

left/right is mapped to 1 second leapse, up/down to 10 second ... this nicelly 
compliments the numerical keypad keys for moving around content.

bye
andraz

diff -ru --exclude-from exclude hvirtual-svn/cinelerra/cwindowgui.C hvirtual-2.1/cinelerra/cwindowgui.C
--- hvirtual-svn/cinelerra/cwindowgui.C	2007-01-06 12:26:19.000000000 +0100
+++ hvirtual-2.1/cinelerra/cwindowgui.C	2007-02-11 12:56:08.000000000 +0100
@@ -724,6 +724,7 @@
 	this->mwindow = mwindow;
 	this->cwindow = cwindow;
 	set_precision(0.00001);
+	set_pagination(1.0, 10.0);
 }
 
 CWindowSlider::~CWindowSlider()
diff -ru --exclude-from exclude hvirtual-svn/cinelerra/vwindowgui.C hvirtual-2.1/cinelerra/vwindowgui.C
--- hvirtual-svn/cinelerra/vwindowgui.C	2007-01-06 12:26:19.000000000 +0100
+++ hvirtual-2.1/cinelerra/vwindowgui.C	2007-02-11 12:56:11.000000000 +0100
@@ -675,6 +675,7 @@
 	this->vwindow = vwindow;
 	this->gui = gui;
 	set_precision(0.00001);
+	set_pagination(1.0, 10.0);
 }
 
 VWindowSlider::~VWindowSlider()
diff -ru --exclude-from exclude hvirtual-svn/guicast/bcslider.C hvirtual-2.1/guicast/bcslider.C
--- hvirtual-svn/guicast/bcslider.C	2006-10-12 12:08:14.000000000 +0200
+++ hvirtual-2.1/guicast/bcslider.C	2007-02-11 12:52:43.000000000 +0100
@@ -206,11 +206,11 @@
 	switch(get_keypress())
 	{
 		case UP:
-			increase_value();
+			increase_value_big();
 			result = 1;
 			break;
 		case DOWN:
-			decrease_value();
+			decrease_value_big();
 			result = 1;
 			break;
 		case LEFT:
@@ -456,6 +456,22 @@
 
 int BC_ISlider::decrease_value()
 {
+	value-=10;
+	if(value < minvalue) value = minvalue;
+	button_pixel = value_to_pixel();
+	return 0;
+}
+
+int BC_ISlider::increase_value_big()
+{
+	value+=10;
+	if(value > maxvalue) value = maxvalue;
+	button_pixel = value_to_pixel();
+	return 0;
+}
+
+int BC_ISlider::decrease_value_big()
+{
 	value--;
 	if(value < minvalue) value = minvalue;
 	button_pixel = value_to_pixel();
@@ -544,6 +560,8 @@
 	this->maxvalue = maxvalue;
 	this->value = value;
 	this->precision = 0.1;
+	this->small_change = 0.1;
+	this->big_change = 1.0;
 }
 
 int BC_FSlider::value_to_pixel()
@@ -604,7 +622,7 @@
 
 int BC_FSlider::increase_value()
 {
-	value += precision;
+	value += small_change;
 	if(value > maxvalue) value = maxvalue;
 	button_pixel = value_to_pixel();
 	return 0;
@@ -612,7 +630,23 @@
 
 int BC_FSlider::decrease_value()
 {
-	value -= precision;
+	value -= small_change;
+	if(value < minvalue) value = minvalue;
+	button_pixel = value_to_pixel();
+	return 0;
+}
+
+int BC_FSlider::increase_value_big()
+{
+	value += big_change;
+	if(value > maxvalue) value = maxvalue;
+	button_pixel = value_to_pixel();
+	return 0;
+}
+
+int BC_FSlider::decrease_value_big()
+{
+	value -= big_change;
 	if(value < minvalue) value = minvalue;
 	button_pixel = value_to_pixel();
 	return 0;
@@ -678,6 +712,12 @@
 	this->precision = value;
 }
 
+void BC_FSlider::set_pagination(float small_change, float big_change)
+{
+	this->small_change = small_change;
+	this->big_change = big_change;
+}
+
 
 
 BC_PercentageSlider::BC_PercentageSlider(int x, 
@@ -709,22 +749,3 @@
 	return caption;
 }
 
-int BC_PercentageSlider::increase_value()
-{
-	value += precision;
-	if(value > maxvalue) value = maxvalue;
-	button_pixel = value_to_pixel();
-//printf("BC_PercentageSlider::increase_value %f\n", value);
-	return 0;
-}
-
-int BC_PercentageSlider::decrease_value()
-{
-	value -= precision;
-	if(value < minvalue) value = minvalue;
-	button_pixel = value_to_pixel();
-//printf("BC_PercentageSlider::decrease_value %f\n", value);
-	return 0;
-}
-
-
diff -ru --exclude-from exclude hvirtual-svn/guicast/bcslider.h hvirtual-2.1/guicast/bcslider.h
--- hvirtual-svn/guicast/bcslider.h	2006-10-12 12:08:15.000000000 +0200
+++ hvirtual-2.1/guicast/bcslider.h	2007-02-11 12:53:56.000000000 +0100
@@ -44,6 +44,8 @@
 	int deactivate();
 	virtual int increase_value() { return 0; };
 	virtual int decrease_value() { return 0; };
+	virtual int increase_value_big() { return 0; };
+	virtual int decrease_value_big() { return 0; };
 	virtual char* get_caption() { return caption; };
 
 private:
@@ -100,6 +102,8 @@
 	int64_t get_length();
 	int increase_value();
 	int decrease_value();
+	int increase_value_big();
+	int decrease_value_big();
 	virtual int handle_event();
 	virtual char* get_caption();
 
@@ -133,8 +137,11 @@
 	float get_length();
 	virtual int increase_value();
 	virtual int decrease_value();
+	virtual int increase_value_big();
+	virtual int decrease_value_big();
 	virtual char* get_caption();
 	void set_precision(float value);
+	void set_pagination(float small_change, float big_change);
 
 private:
 	int value_to_pixel();
@@ -142,6 +149,7 @@
 	int update_selection(int cursor_x, int cursor_y);
 	float minvalue, maxvalue, value;
 	float precision;
+	float small_change, big_change;
 };
 
 class BC_PercentageSlider : public BC_FSlider
@@ -158,8 +166,6 @@
 			int use_caption = 0,
 			VFrame **data = 0);
 
-	virtual int increase_value();
-	virtual int decrease_value();
 	char* get_caption();
 private:
 };

Reply via email to