summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniels <niels@dyne.org>2015-08-03 16:05:06 (GMT)
committer niels <niels@dyne.org>2015-08-03 16:05:06 (GMT)
commitd44da859de7a8dd0fcedbae0086cd17a7fc691da (patch)
treebab70d6e5a1051539953647ce003721f665df25c
parent521b8e53b8d0da1d7084311c355f3e062ff0dc5a (diff)
add button to fx anim to clear the selected parameter path, added vims 151
-rw-r--r--veejay-current/veejay-client/share/gveejay.reloaded.glade26
-rw-r--r--veejay-current/veejay-client/src/callback.c6
-rw-r--r--veejay-current/veejay-server/veejay/vims.h1
-rw-r--r--veejay-current/veejay-server/veejay/vj-event.c15
-rw-r--r--veejay-current/veejay-server/veejay/vj-event.h1
-rw-r--r--veejay-current/veejay-server/veejay/vj-eventman.c14
-rw-r--r--veejay-current/veejay-server/veejay/vjkf.c48
-rw-r--r--veejay-current/veejay-server/veejay/vjkf.h3
8 files changed, 109 insertions, 5 deletions
diff --git a/veejay-current/veejay-client/share/gveejay.reloaded.glade b/veejay-current/veejay-client/share/gveejay.reloaded.glade
index 856d662..c54215e 100644
--- a/veejay-current/veejay-client/share/gveejay.reloaded.glade
+++ b/veejay-current/veejay-client/share/gveejay.reloaded.glade
@@ -3773,7 +3773,7 @@
<widget class="GtkImage" id="image532">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="pixbuf">icon_clear.png</property>
+ <property name="pixbuf">icon_clearall.png</property>
</widget>
</child>
</widget>
@@ -3782,7 +3782,29 @@
<property name="fill">True</property>
<property name="position">2</property>
</packing>
- </child>
+ </child>
+ <child>
+ <widget class="GtkButton" id="curve_clear_parameter">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip" translatable="yes">Clear selected parameter</property>
+ <signal name="clicked" handler="on_curve_clear_parameter_clicked" />
+ <child>
+ <widget class="GtkImage" id="image2521">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">icon_clear.png</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+
</widget>
<packing>
<property name="expand">True</property>
diff --git a/veejay-current/veejay-client/src/callback.c b/veejay-current/veejay-client/src/callback.c
index ebdb12f..3a301d6 100644
--- a/veejay-current/veejay-client/src/callback.c
+++ b/veejay-current/veejay-client/src/callback.c
@@ -2190,6 +2190,12 @@ void on_sync_correction_clicked( GtkWidget *w, gpointer data )
vj_midi_learning_vims_msg( info->midi, NULL, VIMS_SYNC_CORRECTION, status );
}
+void on_curve_clear_parameter_clicked( GtkWidget *widget, gpointer user_data )
+{
+ multi_vims( VIMS_SAMPLE_KF_CLEAR, "%d %d", info->uc.selected_chain_entry, info->uc.selected_parameter_id );
+ info->uc.reload_hint[HINT_KF] = 1;
+}
+
void on_curve_buttonstore_clicked(GtkWidget *widget, gpointer user_data )
{
int i = info->uc.selected_chain_entry;
diff --git a/veejay-current/veejay-server/veejay/vims.h b/veejay-current/veejay-server/veejay/vims.h
index 8e36428..ec098c8 100644
--- a/veejay-current/veejay-server/veejay/vims.h
+++ b/veejay-current/veejay-server/veejay/vims.h
@@ -140,6 +140,7 @@ enum {
VIMS_BUNDLE_CAPTURE = 86,
VIMS_SET_SAMPLE_START = 150,
VIMS_SET_SAMPLE_END = 151,
+ VIMS_SAMPLE_KF_CLEAR = 152,
VIMS_SAMPLE_NEW = 100,
VIMS_SAMPLE_SELECT = 101,
VIMS_SAMPLE_DEL = 120,
diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c
index 0bc1e6b..4e58478 100644
--- a/veejay-current/veejay-server/veejay/vj-event.c
+++ b/veejay-current/veejay-server/veejay/vj-event.c
@@ -9985,7 +9985,22 @@ void vj_event_reset_kf( void *ptr, const char format[], va_list ap )
{
vj_tag_chain_reset_kf( v->uc->sample_id, args[0] );
}
+}
+
+void vj_event_del_keyframes( void *ptr, const char format[], va_list ap )
+{
+ int args[3];
+ veejay_t *v = (veejay_t*)ptr;
+ P_A(args,NULL,format,ap);
+
+ if(SAMPLE_PLAYING(v))
+ {
+ keyframe_clear_entry( v->uc->sample_id, args[0], args[1], 1 );
+ }
+ else if (STREAM_PLAYING(v)) {
+ keyframe_clear_entry( v->uc->sample_id, args[0], args[1], 0 );
+ }
}
static void *select_dict( veejay_t *v , int n )
diff --git a/veejay-current/veejay-server/veejay/vj-event.h b/veejay-current/veejay-server/veejay/vj-event.h
index 38f1f5e..315b1d4 100644
--- a/veejay-current/veejay-server/veejay/vj-event.h
+++ b/veejay-current/veejay-server/veejay/vj-event.h
@@ -287,6 +287,7 @@ void vj_event_set_framerate( void *ptr, const char format[], va_list ap );
void vj_event_sync_correction( void *ptr,const char format[], va_list ap );
void vj_event_get_keyframes( void *ptr, const char format[], va_list ap );
void vj_event_set_kf_status( void *ptr, const char format[], va_list ap );
+void vj_event_del_keyframes( void *ptr, const char format[], va_list ap );
void vj_event_reset_kf( void *ptr, const char format[], va_list ap);
void vj_event_sample_sequencer_active( void *ptr, const char format[], va_list ap );
void vj_event_get_sample_sequences( void *ptr, const char format[], va_list ap );
diff --git a/veejay-current/veejay-server/veejay/vj-eventman.c b/veejay-current/veejay-server/veejay/vj-eventman.c
index 8e1c67f..4a1365e 100644
--- a/veejay-current/veejay-server/veejay/vj-eventman.c
+++ b/veejay-current/veejay-server/veejay/vj-eventman.c
@@ -682,6 +682,20 @@ void vj_init_vevo_events(void)
0,
NULL );
+ index_map_[VIMS_SAMPLE_KF_CLEAR] = _new_event(
+ "%d %d",
+ VIMS_SAMPLE_KF_CLEAR,
+ "Clear Animted FX parameter",
+ vj_event_del_keyframes,
+ 2,
+ VIMS_REQUIRE_ALL_PARAMS,
+ "Entry ID",
+ 0,
+ "Parameter ID",
+ 0,
+ NULL );
+
+
index_map_[VIMS_SET_SAMPLE_END] = _new_event(
NULL,
VIMS_SET_SAMPLE_END,
diff --git a/veejay-current/veejay-server/veejay/vjkf.c b/veejay-current/veejay-server/veejay/vjkf.c
index 7dc3158..f15e5b8 100644
--- a/veejay-current/veejay-server/veejay/vjkf.c
+++ b/veejay-current/veejay-server/veejay/vjkf.c
@@ -144,6 +144,50 @@ unsigned char *keyframe_pack( void *port, int parameter_id, int entry_id, int *r
return result;
}
+void keyframe_clear_entry( int lookup, int fx_entry, int parameter_id, int is_sample )
+{
+ int start = 0;
+ int end = 0;
+ int type = 0;
+ int i;
+
+ void *port = NULL;
+
+ if( is_sample ) {
+ port = sample_get_kf_port( lookup, fx_entry );
+ } else {
+ port = vj_tag_get_kf_port( lookup, fx_entry );
+ }
+
+ if( port == NULL ) {
+ veejay_msg(0, "FX Entry %d does not have animated parameters", fx_entry );
+ return;
+ }
+
+ char *k_s = extract_ ( "start", parameter_id );
+ char *k_e = extract_ ( "end", parameter_id );
+ char *k_t = extract_ ( "type", parameter_id );
+
+ vevo_property_get( port, k_s, 0, &start );
+ vevo_property_get( port, k_e, 0, &end );
+ vevo_property_get( port, k_t, 0,&type );
+
+ for(i = start ; i <= end; i ++ )
+ {
+ char *key = keyframe_id( parameter_id, i );
+ vevo_property_del( port, key );
+ free(key);
+ }
+
+ vevo_property_del( port, k_s );
+ vevo_property_del( port, k_e );
+ vevo_property_del( port, k_t );
+
+ free(k_s);
+ free(k_e);
+ free(k_t);
+}
+
int keyframe_unpack( unsigned char *in, int len, int *entry, int lookup, int is_sample )
{
int i;
@@ -210,12 +254,12 @@ int keyframe_get_tokens( void *port, int parameter_id, int *start, int *end, in
free(k_s); free(k_e); free(k_t);
return 0;
}
- if( vevo_property_get( port, "end", 0, end ) != VEVO_NO_ERROR )
+ if( vevo_property_get( port, k_e, 0, end ) != VEVO_NO_ERROR )
{
free(k_s); free(k_e); free(k_t);
return 0;
}
- if( vevo_property_get( port, "type", 0, type ) != VEVO_NO_ERROR )
+ if( vevo_property_get( port, k_t, 0, type ) != VEVO_NO_ERROR )
{
free(k_s); free(k_e); free(k_t);
return 0;
diff --git a/veejay-current/veejay-server/veejay/vjkf.h b/veejay-current/veejay-server/veejay/vjkf.h
index b5065b7..f2a23c5 100644
--- a/veejay-current/veejay-server/veejay/vjkf.h
+++ b/veejay-current/veejay-server/veejay/vjkf.h
@@ -27,8 +27,9 @@ int keyframe_unpack( unsigned char *in, int len, int *entry, int lookup, int ta
int keyframe_get_tokens( void *port, int parameter_id, int *start, int *end, int *type );
+void keyframe_clear_entry( int lookup, int fx_entry, int parameter_id, int is_sample );
-int keyframe_xml_pack( xmlNodePtr node, void *port, int parameter_id );
+int keyframe_xml_pack( xmlNodePtr node, void *port, int parameter_id );
int keyframe_xml_unpack( xmlDocPtr doc, xmlNodePtr node, void *port );