summaryrefslogtreecommitdiff
path: root/src/nanolight.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nanolight.c')
-rw-r--r--src/nanolight.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nanolight.c b/src/nanolight.c
index cffa48c..a9b3eab 100644
--- a/src/nanolight.c
+++ b/src/nanolight.c
@@ -344,6 +344,27 @@ static void update_mouse_orientation(struct nanolight *nl)
}
+static void home_value(struct nanolight *nl)
+{
+ int i;
+ for ( i=0; i<nl->n_sel; i++ ) {
+
+ struct fixture *fix = &nl->fixtures[nl->selection[i]];
+ int n;
+
+ if ( nl->mouse_orientation ) {
+ if ( find_attribute(fix, ATT_PAN, &n) ) {
+ fix->attr_vals[n] = fix->cls->attrs[n].home;
+ }
+ if ( find_attribute(fix, ATT_TILT, &n) ) {
+ fix->attr_vals[n] = fix->cls->attrs[n].home;
+ }
+ }
+
+ }
+}
+
+
static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, struct nanolight *nl)
{
gboolean r;
@@ -389,6 +410,11 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, struct nanoligh
claim = 1;
break;
+ case GDK_KEY_Home :
+ home_value(nl);
+ claim = 1;
+ break;
+
case GDK_KEY_F1 :
update_mouse_orientation(nl);
claim = 1;
@@ -485,14 +511,17 @@ int main(int argc, char *argv[])
cls.attrs[0].cls = ATT_INTENSITY;
cls.attrs[0].props = 0;
cls.attrs[0].addr_offset = 50;
+ cls.attrs[0].home = 0;
cls.attrs[1].cls = ATT_PAN;
cls.attrs[1].props = ATTR_16BIT;
cls.attrs[1].addr_offset = 0;
+ cls.attrs[1].home = 32768;
cls.attrs[2].cls = ATT_TILT;
cls.attrs[2].props = ATTR_16BIT;
cls.attrs[2].addr_offset = 2;
+ cls.attrs[2].home = 32768;
nl.fixture_width = 80.0;
nl.fixtures = NULL;