summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniels <niels@dyne.org>2015-08-03 09:45:36 (GMT)
committer niels <niels@dyne.org>2015-08-03 09:45:36 (GMT)
commit23779a3a3b874bfbf3de0a5af8411e485e39aa40 (patch)
tree490a9925fe47add328e5cc71c6c584c0dc566ea1
parent980e0dc6edd32f44c1ede53d1b1aa0314737eda0 (diff)
add button to fx chain to render image effects on mixing sources, added shift + number modifier to select banks (affects french keyb), save and load sub render option
-rw-r--r--veejay-current/veejay-client/share/gveejay.reloaded.glade23
-rw-r--r--veejay-current/veejay-client/src/callback.c5
-rw-r--r--veejay-current/veejay-server/libsample/sampleadm.c32
-rw-r--r--veejay-current/veejay-server/libsample/sampleadm.h3
-rw-r--r--veejay-current/veejay-server/libstream/vj-tag.c23
-rw-r--r--veejay-current/veejay-server/libstream/vj-tag.h3
-rw-r--r--veejay-current/veejay-server/veejay/vims.h1
-rw-r--r--veejay-current/veejay-server/veejay/vj-event.c60
-rw-r--r--veejay-current/veejay-server/veejay/vj-event.h2
-rw-r--r--veejay-current/veejay-server/veejay/vj-eventman.c12
-rw-r--r--veejay-current/veejay-server/veejay/vj-perform.c29
11 files changed, 180 insertions, 13 deletions
diff --git a/veejay-current/veejay-client/share/gveejay.reloaded.glade b/veejay-current/veejay-client/share/gveejay.reloaded.glade
index 7e1a905..c68a8fa 100644
--- a/veejay-current/veejay-client/share/gveejay.reloaded.glade
+++ b/veejay-current/veejay-client/share/gveejay.reloaded.glade
@@ -10605,7 +10605,28 @@ YUV (current)</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="padding">100</property>
+ <property name="padding">60</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="toggle_subrender">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip" translatable="yes">Enable/Disable rendering of image effects on mixing sources</property>
+ <signal name="clicked" handler="toggle_subrender_clicked" />
+ <child>
+ <widget class="GtkImage" id="image591">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">icon_render.png</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
diff --git a/veejay-current/veejay-client/src/callback.c b/veejay-current/veejay-client/src/callback.c
index df3693d..4493d55 100644
--- a/veejay-current/veejay-client/src/callback.c
+++ b/veejay-current/veejay-client/src/callback.c
@@ -125,6 +125,11 @@ void on_videobar_value_changed(GtkWidget *widget, gpointer user_data)
}
}
+void toggle_subrender_clicked(GtkWidget *widget, gpointer user_data)
+{
+ multi_vims( VIMS_SUB_RENDER,"%d",0);
+}
+
void on_button_001_clicked(GtkWidget *widget, gpointer user_data)
{
single_vims( VIMS_SET_PLAIN_MODE );
diff --git a/veejay-current/veejay-server/libsample/sampleadm.c b/veejay-current/veejay-server/libsample/sampleadm.c
index 9f8c715..2091993 100644
--- a/veejay-current/veejay-server/libsample/sampleadm.c
+++ b/veejay-current/veejay-server/libsample/sampleadm.c
@@ -1882,12 +1882,27 @@ int sample_set_loops2(int s1, int nr_of_loops)
return 1;
}
+int sample_get_subrender(int s1)
+{
+ sample_info *sample = sample_get(s1);
+ if(!sample)
+ return 0;
+ return sample->subrender;
+}
+
+void sample_set_subrender(int s1, int status )
+{
+ sample_info *sample = sample_get(s1);
+ if(sample)
+ sample->subrender = status;
+}
+
int sample_get_sub_audio(int s1)
{
sample_info *sample;
sample = sample_get(s1);
if (!sample)
- return -1;
+ return -1;
return sample->sub_audio;
}
@@ -3095,6 +3110,17 @@ xmlNodePtr ParseSample(xmlDocPtr doc, xmlNodePtr cur, sample_info * skel,void *e
}
if(xmlTemp) xmlFree(xmlTemp);
}
+
+ if (!xmlStrcmp(cur->name, (const xmlChar *) "subrender")) {
+ xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
+ chTemp = UTF8toLAT1(xmlTemp);
+ if (chTemp) {
+ sample_set_subrender(skel->sample_id, atoi(chTemp));
+ free(chTemp);
+ }
+ if(xmlTemp) xmlFree(xmlTemp);
+ }
+
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_MAXLOOPS)) {
xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
chTemp = UTF8toLAT1(xmlTemp);
@@ -3604,6 +3630,10 @@ void CreateSample(xmlNodePtr node, sample_info * sample, void *font)
xmlNewChild(node,NULL,(const xmlChar *) XMLTAG_LASTENTRY,
(const xmlChar *)buffer);
+ sprintf(buffer, "%d", sample->subrender );
+ xmlNewChild(node, NULL, (const xmlChar*) "subrender",
+ (const xmlChar*) buffer );
+
vj_font_xml_pack( node, font );
diff --git a/veejay-current/veejay-server/libsample/sampleadm.h b/veejay-current/veejay-server/libsample/sampleadm.h
index bb1eebb..1d382aa 100644
--- a/veejay-current/veejay-server/libsample/sampleadm.h
+++ b/veejay-current/veejay-server/libsample/sampleadm.h
@@ -171,6 +171,7 @@ typedef struct sample_info_t {
void *viewport_config;
void *viewport;
long resume_pos;
+ int subrender;
} sample_info;
#define SAMPLE_YUV420_BUFSIZE 16
@@ -209,6 +210,8 @@ extern int sample_set_marker(int s1, int start, int end);
extern int sample_get_longest(int sample_id);
extern int sample_get_playmode(int s1);
extern int sample_set_playmode(int s1, int playmode);
+extern int sample_get_subrender(int s1);
+extern void sample_set_subrender(int s1, int status);
extern int sample_get_loops(int s1);
extern int sample_get_loops2(int s1);
extern int sample_get_next(int s1);
diff --git a/veejay-current/veejay-server/libstream/vj-tag.c b/veejay-current/veejay-server/libstream/vj-tag.c
index 2732a3a..84f7c00 100644
--- a/veejay-current/veejay-server/libstream/vj-tag.c
+++ b/veejay-current/veejay-server/libstream/vj-tag.c
@@ -2554,6 +2554,22 @@ int vj_tag_get_active(int t1)
return tag->active;
}
+int vj_tag_get_subrender(int t1)
+{
+ vj_tag *tag = vj_tag_get(t1);
+ if(!tag)
+ return -1;
+ return tag->subrender;
+}
+
+void vj_tag_set_subrender(int t1, int status)
+{
+ vj_tag *tag = vj_tag_get(t1);
+ if(!tag)
+ return;
+ tag->subrender = status;
+}
+
int vj_tag_set_chain_channel(int t1, int position, int channel)
{
vj_tag *tag = vj_tag_get(t1);
@@ -3947,7 +3963,7 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon
char *extra_data = NULL;
int col[3] = {0,0,0};
int fader_active=0, fader_val=0, fader_dir=0, opacity=0, nframes=0;
-
+ int subrender = 0;
xmlNodePtr fx[32];
veejay_memset( fx, 0, sizeof(fx));
int k = 0;
@@ -3994,6 +4010,8 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon
if (!xmlStrcmp(cur->name, (const xmlChar*) "calibration" ))
cali = cur->xmlChildrenNode;
+ if (!xmlStrcmp(cur->name, (const xmlChar*) "subrender" ))
+ subrender = tag_get_int_xml(doc,cur,(const xmlChar*) "subrender" );
if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_EFFECTS)) {
fx[k] = cur->xmlChildrenNode;
@@ -4181,6 +4199,9 @@ void tagCreateStream(xmlNodePtr node, vj_tag *tag, void *font, void *vp)
sprintf(buffer, "%s", tag->source_name );
xmlNewChild(node,NULL,(const xmlChar*) "source_file", (const xmlChar*) buffer );
+ sprintf(buffer, "%d" ,tag->subrender);
+ xmlNewChild(node,NULL,(const xmlChar*) "subrender", (const xmlChar*) buffer );
+
if(tag->extra )
{
sprintf(buffer, "%s", (char*)tag->extra );
diff --git a/veejay-current/veejay-server/libstream/vj-tag.h b/veejay-current/veejay-server/libstream/vj-tag.h
index 44aea6d..a16f5eb 100644
--- a/veejay-current/veejay-server/libstream/vj-tag.h
+++ b/veejay-current/veejay-server/libstream/vj-tag.h
@@ -129,6 +129,7 @@ typedef struct {
double *lfv;
int cali_duration;
void *generator;
+ int subrender;
} vj_tag;
#define V4L_BLACKFRAME 1
@@ -170,6 +171,8 @@ int vj_tag_get_effect(int t1, int position);
void *vj_tag_get_plugin( int t1, int position, void *ptr );
+int vj_tag_get_subrender(int t1);
+void vj_tag_set_subrender(int t1, int status);
int vj_tag_size();
diff --git a/veejay-current/veejay-server/veejay/vims.h b/veejay-current/veejay-server/veejay/vims.h
index 76d48eb..8e36428 100644
--- a/veejay-current/veejay-server/veejay/vims.h
+++ b/veejay-current/veejay-server/veejay/vims.h
@@ -102,6 +102,7 @@ enum {
VIMS_CALI_IMAGE = 332,
VIMS_SYNC_CORRECTION = 334,
VIMS_FRAMERATE = 335,
+ VIMS_SUB_RENDER = 336,
VIMS_VIDEO_PLAY_FORWARD = 10,
VIMS_VIDEO_PLAY_BACKWARD = 11,
VIMS_VIDEO_PLAY_STOP = 12,
diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c
index 0d334e4..0bc1e6b 100644
--- a/veejay-current/veejay-server/veejay/vj-event.c
+++ b/veejay-current/veejay-server/veejay/vj-event.c
@@ -276,6 +276,17 @@ static struct { /* hardcoded keyboard layout (the default keys) */
{ VIMS_SELECT_BANK, SDLK_7, VIMS_MOD_NONE, "7" },
{ VIMS_SELECT_BANK, SDLK_8, VIMS_MOD_NONE, "8" },
{ VIMS_SELECT_BANK, SDLK_9, VIMS_MOD_NONE, "9" },
+//@ FIXME test this
+ { VIMS_SELECT_BANK, SDLK_1, VIMS_MOD_SHIFT, "1" },
+ { VIMS_SELECT_BANK, SDLK_2, VIMS_MOD_SHIFT, "2" },
+ { VIMS_SELECT_BANK, SDLK_3, VIMS_MOD_SHIFT, "3" },
+ { VIMS_SELECT_BANK, SDLK_4, VIMS_MOD_SHIFT, "4" },
+ { VIMS_SELECT_BANK, SDLK_5, VIMS_MOD_SHIFT, "5" },
+ { VIMS_SELECT_BANK, SDLK_6, VIMS_MOD_SHIFT, "6" },
+ { VIMS_SELECT_BANK, SDLK_7, VIMS_MOD_SHIFT, "7" },
+ { VIMS_SELECT_BANK, SDLK_8, VIMS_MOD_SHIFT, "8" },
+ { VIMS_SELECT_BANK, SDLK_9, VIMS_MOD_SHIFT, "9" },
+
{ VIMS_SELECT_ID, SDLK_F1, VIMS_MOD_NONE, "1" },
{ VIMS_SELECT_ID, SDLK_F2, VIMS_MOD_NONE, "2" },
{ VIMS_SELECT_ID, SDLK_F3, VIMS_MOD_NONE, "3" },
@@ -2765,6 +2776,55 @@ void vj_event_play_norestart( void *ptr, const char format[], va_list ap )
}
+void vj_event_sub_render( void *ptr, const char format[], va_list ap )
+{
+ int args[2];
+ veejay_t *v = (veejay_t*) ptr;
+ char *s = NULL;
+ P_A(args,s,format,ap);
+
+ if( SAMPLE_PLAYING(v)) {
+ if(args[0] == -1)
+ args[0] = sample_size() - 1;
+
+ if( args[0] == 0)
+ args[0] = v->uc->sample_id;
+
+ int cur = sample_get_subrender(args[0]);
+ if( cur == 0 ) {
+ cur = 1;
+ }
+ else {
+ cur = 0;
+ }
+
+ sample_set_subrender(args[0], cur);
+
+ veejay_msg(VEEJAY_MSG_INFO, "%s rendering of mixing sources",
+ ( sample_get_subrender(args[0]) == 1 ? "Enabled" : "Disabled" ));
+ }
+ if( STREAM_PLAYING(v)) {
+
+ if( args[0] == 0 )
+ args[0] = v->uc->sample_id;
+
+ if(args[0] == -1)
+ args[0] = vj_tag_size()-1;
+
+ int cur = vj_tag_get_subrender(args[0]);
+ if( cur == 0 ) {
+ cur = 1;
+ }
+ else {
+ cur = 0;
+ }
+
+ vj_tag_set_subrender(args[0], cur);
+ veejay_msg(VEEJAY_MSG_INFO, "%s rendering of mixing sources",
+ ( vj_tag_get_subrender(args[0]) == 1 ? "Enabled" : "Disabled" ));
+ }
+}
+
void vj_event_set_play_mode_go(void *ptr, const char format[], va_list ap)
{
int args[2];
diff --git a/veejay-current/veejay-server/veejay/vj-event.h b/veejay-current/veejay-server/veejay/vj-event.h
index f67374a..38f1f5e 100644
--- a/veejay-current/veejay-server/veejay/vj-event.h
+++ b/veejay-current/veejay-server/veejay/vj-event.h
@@ -307,4 +307,6 @@ void vj_event_v4l_blackframe( void *ptr, const char format[], va_list ap );
void vj_event_cali_write_file( void *ptr, const char format[], va_list ap );
void vj_event_stream_new_cali( void *ptr, const char format[], va_list ap );
void vj_event_get_cali_image ( void *ptr, const char format[], va_list ap );
+void vj_event_sub_render( void *ptr, const char format[], va_list ap );
+
#endif
diff --git a/veejay-current/veejay-server/veejay/vj-eventman.c b/veejay-current/veejay-server/veejay/vj-eventman.c
index 7998da3..8e1c67f 100644
--- a/veejay-current/veejay-server/veejay/vj-eventman.c
+++ b/veejay-current/veejay-server/veejay/vj-eventman.c
@@ -2439,6 +2439,18 @@ void vj_init_vevo_events(void)
VIMS_ALLOW_ANY,
NULL );
+ index_map_[ VIMS_SUB_RENDER ] = _new_event(
+ "%d",
+ VIMS_SUB_RENDER,
+ "Render image effects on mixing source",
+ vj_event_sub_render,
+ 1,
+ VIMS_ALLOW_ANY,
+ SAMPLE_ID_HELP,
+ 0,
+ NULL );
+
+
index_map_[ VIMS_CONTINUOUS_PLAY ] = _new_event(
"%d",
diff --git a/veejay-current/veejay-server/veejay/vj-perform.c b/veejay-current/veejay-server/veejay/vj-perform.c
index 1fd2430..03b65e9 100644
--- a/veejay-current/veejay-server/veejay/vj-perform.c
+++ b/veejay-current/veejay-server/veejay/vj-perform.c
@@ -2043,12 +2043,16 @@ static void vj_perform_tag_render_chain_entry(veejay_t *info, int chain_entry)
int done = 0;
int do_ssm = vj_perform_preprocess_has_ssm( info, sub_id, source);
- if(do_ssm >= 0 ) {
- if( (frames[1]->ssm == 0 && do_ssm == 0) || (frames[1]->ssm == 1 && do_ssm == 1 ) || (frames[1]->ssm == 0 && do_ssm == 1 )) {
+ int subrender = vj_tag_get_subrender( info->uc->sample_id );
+
+ if( subrender ) {
+
+ // if(do_ssm >= 0 ) {
+ // if( (frames[1]->ssm == 0 && do_ssm == 0) || (frames[1]->ssm == 1 && do_ssm == 1 ) || (frames[1]->ssm == 0 && do_ssm == 1 )) {
//@ call render now
frames[1]->ssm = vj_perform_preprocess_secundary( info, sub_id,source,sub_mode,chain_entry, frames, frameinfo );
done = 1;
- }
+ // }
}
@@ -2165,13 +2169,15 @@ static int vj_perform_preprocess_secundary( veejay_t *info, int id, int mode,int
if( ef ) continue;
if( sm ) {
if( !ssm ) {
- chroma_supersample( settings->sample_mode,F[0],F[0]->data );
+ if(a.ssm == 0 )
+ chroma_supersample( settings->sample_mode,F[0],F[0]->data );
F[0]->ssm = 1;
frame_buffer[chain_entry]->ssm = 1;
ssm = 1;
}
} else if ( ssm ) {
- chroma_subsample( settings->sample_mode,F[0],F[0]->data);
+ if(a.ssm == 1 )
+ chroma_subsample( settings->sample_mode,F[0],F[0]->data);
F[0]->ssm = 0;
frame_buffer[chain_entry]->ssm = 1;
ssm = 0;
@@ -2287,13 +2293,16 @@ static void vj_perform_render_chain_entry(veejay_t *info, int chain_entry)
int done = 0;
int do_ssm = vj_perform_preprocess_has_ssm( info, sub_id, source);
- if(do_ssm >= 0 ) {
- if( (frames[1]->ssm == 0 && do_ssm == 0) || (frames[1]->ssm == 1 && do_ssm == 1 )
- || (frames[1]->ssm == 0 && do_ssm == 1 )) {
+ int subrender = sample_get_subrender( info->uc->sample_id );
+
+ if( subrender ) {
+ // if(do_ssm >= 0 ) {
+ // if( (frames[1]->ssm == 0 && do_ssm == 0) || (frames[1]->ssm == 1 && do_ssm == 1 )
+ /// || (frames[1]->ssm == 0 && do_ssm == 1 )) {
//@ call render now
frames[1]->ssm = vj_perform_preprocess_secundary( info, sub_id,source,sub_mode,chain_entry, frames, frameinfo );
done = 1;
- }
+ // }
}
if( chain_entry >= 1) {
@@ -2322,7 +2331,7 @@ static void vj_perform_render_chain_entry(veejay_t *info, int chain_entry)
if(!done && do_ssm >= 0) {
if( (do_ssm == 1 && frames[1]->ssm == 1) || (do_ssm == 0 && frames[1]->ssm == 0) ) {
vj_perform_preprocess_secundary( info, sub_id,source,sub_mode,chain_entry, frames, frameinfo );
-
+ //FIXME possible dead code
}
}
}