mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
added events: samplebank add, samplebank del, samplebank list, fx list, fx info, setup preview, get preview, fx details,fx chain, added sayVIMS utility, updated buildscripts
git-svn-id: svn://code.dyne.org/veejay/trunk@590 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
SUBDIRS = bio2jack libhash libvjmsg libvjmem
|
SUBDIRS = bio2jack libhash libvjmsg libvjmem
|
||||||
SUBDIRS += libvevo libplugger libvjnet libyuv libel libvjaudio vevosample veejay
|
SUBDIRS += libvevo libplugger libvjnet libyuv libel libvjaudio vevosample veejay
|
||||||
SUBDIRS += man
|
SUBDIRS += tools man
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -776,6 +776,7 @@ libel/Makefile
|
|||||||
bio2jack/Makefile
|
bio2jack/Makefile
|
||||||
vevosample/Makefile
|
vevosample/Makefile
|
||||||
veejay/Makefile
|
veejay/Makefile
|
||||||
|
tools/Makefile
|
||||||
man/Makefile
|
man/Makefile
|
||||||
veejay-config
|
veejay-config
|
||||||
veejay.pc
|
veejay.pc
|
||||||
|
|||||||
@@ -265,6 +265,39 @@ static void free_plugin(void *plugin)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *list_plugins()
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
int len = 0;
|
||||||
|
char *res = NULL;
|
||||||
|
for ( i = 0; i < index_; i ++ )
|
||||||
|
{
|
||||||
|
char *name = plug_get_name( i );
|
||||||
|
if(name)
|
||||||
|
{
|
||||||
|
len += strlen(name) + 1;
|
||||||
|
free(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(len <= 0 )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
res = (char*) malloc( len );
|
||||||
|
memset( res,0,len );
|
||||||
|
char *p = res;
|
||||||
|
for ( i = 0; i < index_; i ++ )
|
||||||
|
{
|
||||||
|
char *name = plug_get_name(i);
|
||||||
|
if(name)
|
||||||
|
{
|
||||||
|
sprintf(p, "%s:",name );
|
||||||
|
p += strlen(name) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static void free_plugins()
|
static void free_plugins()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -494,6 +527,158 @@ void plug_deactivate( void *instance )
|
|||||||
deinstantiate_plugin( instance );
|
deinstantiate_plugin( instance );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int linear_len( char **items )
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
int len = 0;
|
||||||
|
for( i = 0; items[i] != NULL ; i ++ )
|
||||||
|
len += strlen(items[i]);
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int memory_needed_for_port( void *port, const char *key )
|
||||||
|
{
|
||||||
|
void *subport = NULL;
|
||||||
|
int error = vevo_property_get( port , key, 0, &subport );
|
||||||
|
if( error != VEVO_NO_ERROR )
|
||||||
|
return 0;
|
||||||
|
char **items = vevo_sprintf_port( subport );
|
||||||
|
|
||||||
|
int len = linear_len(items);
|
||||||
|
int k = 0;
|
||||||
|
for( k = 0; items[k] != NULL; k ++ )
|
||||||
|
free(items[k]);
|
||||||
|
free(items);
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char * flatten_port( void *port, const char *key )
|
||||||
|
{
|
||||||
|
int len = memory_needed_for_port( port, key );
|
||||||
|
if( len <= 0 )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
char *res = (char*) malloc( len );
|
||||||
|
void *subport = NULL;
|
||||||
|
|
||||||
|
int error = vevo_property_get( port , key, 0, &subport );
|
||||||
|
if( error != VEVO_NO_ERROR )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
memset(res,0,len);
|
||||||
|
char **items = vevo_sprintf_port( subport );
|
||||||
|
int k = 0;
|
||||||
|
for( k = 0; items[k] != NULL; k ++ )
|
||||||
|
{
|
||||||
|
strncat(res, items[k],strlen(items[k]));
|
||||||
|
free(items[k]);
|
||||||
|
}
|
||||||
|
free(items);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *plug_describe( int fx_id )
|
||||||
|
{
|
||||||
|
void *plug = index_map_[fx_id];
|
||||||
|
if(!plug)
|
||||||
|
return NULL;
|
||||||
|
void *instance = NULL;
|
||||||
|
void *filter = NULL;
|
||||||
|
int pi = 0;
|
||||||
|
int po = 0;
|
||||||
|
int ci = 0;
|
||||||
|
int co = 0;
|
||||||
|
char *res = NULL;
|
||||||
|
char key[64];
|
||||||
|
int i;
|
||||||
|
int len = 0;
|
||||||
|
int error = 0;
|
||||||
|
|
||||||
|
error = vevo_property_get( plug, "num_inputs", 0, &ci );
|
||||||
|
error = vevo_property_get( plug, "num_params", 0, &pi );
|
||||||
|
error = vevo_property_get( plug, "num_out_params",0,&po );
|
||||||
|
error = vevo_property_get( plug, "num_outputs",0,&co );
|
||||||
|
error = vevo_property_get( plug, "instance", 0,&instance );
|
||||||
|
|
||||||
|
error = vevo_property_get( instance, "filters",0,&filter );
|
||||||
|
#ifdef STRICT_CHECKING
|
||||||
|
assert( error == VEVO_NO_ERROR );
|
||||||
|
#endif
|
||||||
|
//@ cannot handle multiple filters yet
|
||||||
|
char *maintainer = get_str_vevo( instance, "maintainer");
|
||||||
|
char *version = get_str_vevo( instance, "version" );
|
||||||
|
char *description = get_str_vevo( filter, "description" );
|
||||||
|
char *name = get_str_vevo( filter, "name");
|
||||||
|
char *author = get_str_vevo( filter, "author" );
|
||||||
|
char *license = get_str_vevo( filter, "license" );
|
||||||
|
char **in_params = NULL;
|
||||||
|
char **out_params = NULL;
|
||||||
|
if( pi > 0 )
|
||||||
|
{
|
||||||
|
in_params = (char*) malloc(sizeof(char*) * pi );
|
||||||
|
|
||||||
|
for( i = 0; i < pi; i ++ )
|
||||||
|
{
|
||||||
|
sprintf(key, "p%02d",i);
|
||||||
|
in_params[i] = flatten_port( plug , key );
|
||||||
|
len += strlen(in_params[i])+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( po > 0 )
|
||||||
|
{
|
||||||
|
out_params = (char*) malloc(sizeof(char*) * pi );
|
||||||
|
|
||||||
|
for( i = 0; i < pi; i ++ )
|
||||||
|
{
|
||||||
|
sprintf(key, "q%02d",i);
|
||||||
|
out_params[i] = flatten_port( plug , key );
|
||||||
|
len += strlen(out_params[i])+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
len += strlen( maintainer ) + 12;
|
||||||
|
len += strlen( version ) + 9;
|
||||||
|
len += strlen( description ) + 13;
|
||||||
|
len += strlen( name ) +6;
|
||||||
|
len += strlen( author )+8;
|
||||||
|
len += strlen( license )+9;
|
||||||
|
|
||||||
|
res = (char*) malloc(sizeof(char) * len + 150 );
|
||||||
|
memset(res,0,len);
|
||||||
|
|
||||||
|
sprintf( res,
|
||||||
|
"name=%s:description=%s:author=%s:maintainer=%s:license=%s:version=%s:",
|
||||||
|
name,description,author,maintainer,license,version );
|
||||||
|
|
||||||
|
char *p = res + strlen(res);
|
||||||
|
|
||||||
|
for( i = 0; i < pi ; i ++ )
|
||||||
|
{
|
||||||
|
sprintf(p, "p%02d=[%s]:", i, in_params[i] );
|
||||||
|
p += strlen(in_params[i]) + 7;
|
||||||
|
free(in_params[i]);
|
||||||
|
}
|
||||||
|
for( i = 0; i < po ; i ++ )
|
||||||
|
{
|
||||||
|
sprintf(p, "q%02d=[%s]:", i, out_params[i] );
|
||||||
|
p += strlen( out_params[i] ) + 7;
|
||||||
|
free(out_params[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(in_params);
|
||||||
|
free(out_params);
|
||||||
|
free(maintainer);
|
||||||
|
free(version);
|
||||||
|
free(description);
|
||||||
|
free(name);
|
||||||
|
free(author);
|
||||||
|
free(license);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void *plug_activate( int fx_id )
|
void *plug_activate( int fx_id )
|
||||||
{
|
{
|
||||||
if(!index_map_[fx_id] )
|
if(!index_map_[fx_id] )
|
||||||
|
|||||||
@@ -1893,6 +1893,8 @@ char *vevo_format_property( vevo_port_t *port, const char *key )
|
|||||||
token[0] = 's';
|
token[0] = 's';
|
||||||
break;
|
break;
|
||||||
case VEVO_ATOM_TYPE_VOIDPTR:
|
case VEVO_ATOM_TYPE_VOIDPTR:
|
||||||
|
token[0] = 'x';
|
||||||
|
break;
|
||||||
case VEVO_ATOM_TYPE_PORTPTR:
|
case VEVO_ATOM_TYPE_PORTPTR:
|
||||||
token[0] = 'p';
|
token[0] = 'p';
|
||||||
break;
|
break;
|
||||||
@@ -2185,11 +2187,13 @@ char *vevo_sprintf_property( vevo_port_t *port, const char *key )
|
|||||||
int nerr = 0;
|
int nerr = 0;
|
||||||
int size = PROP_MAX_LEN;
|
int size = PROP_MAX_LEN;
|
||||||
|
|
||||||
|
void *vport = NULL;
|
||||||
|
|
||||||
sprintf(res, "%s=", key );
|
sprintf(res, "%s=", key );
|
||||||
|
|
||||||
while( *format && nerr == 0)
|
while( *format && nerr == 0)
|
||||||
{
|
{
|
||||||
char tmp[256];
|
char tmp[1024];
|
||||||
bzero(tmp,256);
|
bzero(tmp,256);
|
||||||
switch(*format)
|
switch(*format)
|
||||||
{
|
{
|
||||||
@@ -2238,8 +2242,40 @@ char *vevo_sprintf_property( vevo_port_t *port, const char *key )
|
|||||||
}
|
}
|
||||||
str_val = NULL;
|
str_val = NULL;
|
||||||
break;
|
break;
|
||||||
|
case 'x':
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
tmp[0] = ':';
|
{
|
||||||
|
int num = 0;
|
||||||
|
if(n_elems == 0 )
|
||||||
|
{
|
||||||
|
error = vevo_property_get(port,key,0,&vport );
|
||||||
|
if(error == VEVO_NO_ERROR )
|
||||||
|
num = vevo_num_properties(vport);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( num > 0 )
|
||||||
|
{
|
||||||
|
char **pstr = vevo_sprintf_port( vport );
|
||||||
|
if(pstr)
|
||||||
|
{
|
||||||
|
int k;
|
||||||
|
|
||||||
|
sprintf(tmp, "[%s",key);
|
||||||
|
|
||||||
|
for( k = 0; pstr[k] != NULL; k ++ )
|
||||||
|
{
|
||||||
|
strncat(tmp, pstr[k], strlen(pstr[k]));
|
||||||
|
free(pstr[k]);
|
||||||
|
}
|
||||||
|
free(pstr);
|
||||||
|
|
||||||
|
int n = strlen(tmp);
|
||||||
|
tmp[n] =']';
|
||||||
|
tmp[n+1] = ':';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*format++;
|
*format++;
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ static void *veejay_software_playback_thread(void *arg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//@ Handle callbacks HERE
|
//@ Handle callbacks HERE
|
||||||
vj_event_update_remote( info );
|
// vj_event_update_remote( info );
|
||||||
|
|
||||||
|
|
||||||
settings->currently_processed_entry =
|
settings->currently_processed_entry =
|
||||||
@@ -1023,6 +1023,9 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
gettimeofday(&time_now, 0);
|
gettimeofday(&time_now, 0);
|
||||||
stats.tdiff = time_now.tv_sec - bs.timestamp.tv_sec +
|
stats.tdiff = time_now.tv_sec - bs.timestamp.tv_sec +
|
||||||
(time_now.tv_usec - bs.timestamp.tv_usec)*1.e-6;
|
(time_now.tv_usec - bs.timestamp.tv_usec)*1.e-6;
|
||||||
|
|
||||||
|
vj_event_update_remote( info );
|
||||||
|
|
||||||
} while (stats.tdiff > settings->spvf && (stats.nsync - first_free) < (1 - 1));
|
} while (stats.tdiff > settings->spvf && (stats.nsync - first_free) < (1 - 1));
|
||||||
|
|
||||||
#ifdef HAVE_JACK
|
#ifdef HAVE_JACK
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
/** \defgroup performer Performer
|
/** \defgroup performer Performer
|
||||||
*
|
*
|
||||||
* The performer is the central pool of audio and video frames.
|
* The performer is the central pool of audio and video frames.
|
||||||
* During initialization, the performer will allocate 4 linear
|
* During initialization, the performer will allocate a series of linear
|
||||||
* buffers, each buffer represents a plane. All buffers have
|
* buffers, each buffer represents a plane. All buffers have
|
||||||
* the same size. The performer tries to lock this memory to
|
* the same size. The performer tries to lock this memory to
|
||||||
* be resident in RAM, but continious if it fails.
|
* be resident in RAM, but continious if it fails.
|
||||||
@@ -68,11 +68,6 @@
|
|||||||
* the resulting output frame will be displayed. The current frame
|
* the resulting output frame will be displayed. The current frame
|
||||||
* is stored as input channel for the next entry to process.
|
* is stored as input channel for the next entry to process.
|
||||||
*
|
*
|
||||||
* If a plugin procesess data inplace, the linear buffer
|
|
||||||
* will be updated immediatly.
|
|
||||||
* If a plugin produces an output frame, it will be copied
|
|
||||||
* to the start of the linear buffer.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//! \typedef performer_t Performer runtime data
|
//! \typedef performer_t Performer runtime data
|
||||||
@@ -85,22 +80,22 @@ typedef struct
|
|||||||
VJFrame **fx_buffer; //<<! Chunks, pointer to resulting fx
|
VJFrame **fx_buffer; //<<! Chunks, pointer to resulting fx
|
||||||
VJFrame *preview_bw; //<<! Grayscale preview
|
VJFrame *preview_bw; //<<! Grayscale preview
|
||||||
VJFrame *preview_col; //<<! Color preview
|
VJFrame *preview_col; //<<! Color preview
|
||||||
VJFrame *display;
|
VJFrame *display; //<<! Pointer to last rendered frame
|
||||||
void *in_frames; //<<! Port, list of frames needed for this cycle
|
void *in_frames; //<<! Port, list of frames needed for this cycle
|
||||||
void *out_frames; //<<! Port, list of output frames accumulated
|
void *out_frames; //<<! Port, list of output frames accumulated
|
||||||
uint8_t *audio_buffer;
|
uint8_t *audio_buffer; //<<! Buffer used for audio data
|
||||||
AFrame **audio_buffers; //<<! Linear buffer, locked in RAM
|
AFrame **audio_buffers; //<<! Linear buffer, locked in RAM
|
||||||
void *resampler;
|
void *resampler; //<<! On the fly audio resampling
|
||||||
void *sampler; //<<! YUV sampler
|
void *sampler; //<<! YUV sampler
|
||||||
int sample_mode;
|
int sample_mode; //<<! YUV sample mode
|
||||||
int n_fb; //<<! Maximum number of Chunks
|
int n_fb; //<<! Maximum number of Chunks
|
||||||
int n_fetched; //<<! Total Chunks consumed
|
int n_fetched; //<<! Total Chunks consumed
|
||||||
int last;
|
int last; //<<! Last rendered entry
|
||||||
int dlast;
|
int dlast;
|
||||||
} performer_t;
|
} performer_t;
|
||||||
|
|
||||||
|
|
||||||
//! Allocate a new Chunk
|
//! Allocate a new Chunk depending on output pixel format
|
||||||
/**!
|
/**!
|
||||||
\param info Veejay Object
|
\param info Veejay Object
|
||||||
\param p0 Pointer to Plane 0
|
\param p0 Pointer to Plane 0
|
||||||
@@ -158,7 +153,7 @@ static VJFrame *performer_alloc_frame( veejay_t *info, uint8_t *p0, uint8_t *p1,
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Initialize Performer.
|
//! Initialize Performer. Initialize memory for audio and video rendering
|
||||||
/**!
|
/**!
|
||||||
\param info Veejay Object
|
\param info Veejay Object
|
||||||
\param max_fx Maximum Chunks
|
\param max_fx Maximum Chunks
|
||||||
@@ -324,7 +319,11 @@ void *performer_init( veejay_t *info, const int max_fb )
|
|||||||
|
|
||||||
return (void*) p;
|
return (void*) p;
|
||||||
}
|
}
|
||||||
|
//! Start audio task
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
\return Error code or audio rate
|
||||||
|
*/
|
||||||
long performer_audio_start( veejay_t *info )
|
long performer_audio_start( veejay_t *info )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_JACK
|
#ifdef HAVE_JACK
|
||||||
@@ -372,7 +371,10 @@ long performer_audio_start( veejay_t *info )
|
|||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
//! Continue playing audio
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
*/
|
||||||
void performer_audio_continue( veejay_t *info )
|
void performer_audio_continue( veejay_t *info )
|
||||||
{
|
{
|
||||||
performer_t *p = info->performer;
|
performer_t *p = info->performer;
|
||||||
@@ -382,7 +384,11 @@ void performer_audio_continue( veejay_t *info )
|
|||||||
vj_jack_continue( speed );
|
vj_jack_continue( speed );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Stop playing audio
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
\return Error code
|
||||||
|
*/
|
||||||
int performer_audio_stop( veejay_t *info )
|
int performer_audio_stop( veejay_t *info )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -401,6 +407,10 @@ int performer_audio_stop( veejay_t *info )
|
|||||||
info->audio = NO_AUDIO;
|
info->audio = NO_AUDIO;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
//! Reset audio buffers
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
*/
|
||||||
void performer_audio_restart( veejay_t *info )
|
void performer_audio_restart( veejay_t *info )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -535,7 +545,10 @@ static uint8_t *performer_fetch_audio_frames( veejay_t *info, int *gen_samples )
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
//! Record and encode video
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
*/
|
||||||
void performer_save_frame( veejay_t *info )
|
void performer_save_frame( veejay_t *info )
|
||||||
{
|
{
|
||||||
performer_t *p = (performer_t*) info->performer;
|
performer_t *p = (performer_t*) info->performer;
|
||||||
@@ -564,7 +577,12 @@ void performer_save_frame( veejay_t *info )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Grab audio frames
|
||||||
|
/**!
|
||||||
|
\param info Veejay Object
|
||||||
|
\param skipa Skip audio frames
|
||||||
|
\return Error code
|
||||||
|
*/
|
||||||
int performer_queue_audio_frame( veejay_t *info, int skipa )
|
int performer_queue_audio_frame( veejay_t *info, int skipa )
|
||||||
{
|
{
|
||||||
static uint8_t *buffer_ = NULL;
|
static uint8_t *buffer_ = NULL;
|
||||||
@@ -606,13 +624,6 @@ int performer_queue_audio_frame( veejay_t *info, int skipa )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Queue frame of current playing Sample
|
|
||||||
/**!
|
|
||||||
\param info Veejay Object
|
|
||||||
\param skip_incr Skip Increment
|
|
||||||
\return Error code
|
|
||||||
*/
|
|
||||||
|
|
||||||
//! Fetch all video frames needed for this run.
|
//! Fetch all video frames needed for this run.
|
||||||
/**
|
/**
|
||||||
\param info veejay_t
|
\param info veejay_t
|
||||||
@@ -658,6 +669,7 @@ static int performer_fetch_frames( veejay_t *info, void *samples_needed)
|
|||||||
return n_fetched;
|
return n_fetched;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void performer_down_scale_plane1x2( uint8_t *src_plane, unsigned int len, uint8_t *dst_plane)
|
static void performer_down_scale_plane1x2( uint8_t *src_plane, unsigned int len, uint8_t *dst_plane)
|
||||||
{
|
{
|
||||||
unsigned int k,n = 0;
|
unsigned int k,n = 0;
|
||||||
@@ -729,6 +741,14 @@ static void performer_preview_frame_color( VJFrame *src, VJFrame *dst, int reduc
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//! Configure preview image properties
|
||||||
|
/**
|
||||||
|
\param info veejay_t
|
||||||
|
\param p performer_t
|
||||||
|
\param reduce Reduce width x height
|
||||||
|
\param preview_mode Preview mode
|
||||||
|
\return Error code
|
||||||
|
*/
|
||||||
|
|
||||||
int performer_setup_preview( veejay_t *info, performer_t *p, int reduce, int preview_mode )
|
int performer_setup_preview( veejay_t *info, performer_t *p, int reduce, int preview_mode )
|
||||||
{
|
{
|
||||||
@@ -753,8 +773,10 @@ int performer_setup_preview( veejay_t *info, performer_t *p, int reduce, int pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( reduce < PREVIEW_50 || reduce > PREVIEW_125 )
|
if( reduce < PREVIEW_50 || reduce > PREVIEW_125 )
|
||||||
|
{
|
||||||
|
veejay_msg(VEEJAY_MSG_ERROR, "Wrong reduce value");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
settings->preview = preview_mode;
|
settings->preview = preview_mode;
|
||||||
info->preview_size = reduce;
|
info->preview_size = reduce;
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,17 @@ enum {
|
|||||||
VIMS_SAMPLE_START_RECORDER = 381,
|
VIMS_SAMPLE_START_RECORDER = 381,
|
||||||
VIMS_SAMPLE_STOP_RECORDER = 382,
|
VIMS_SAMPLE_STOP_RECORDER = 382,
|
||||||
|
|
||||||
|
VIMS_PERFORMER_SETUP_PREVIEW = 400,
|
||||||
|
VIMS_PERFORMER_GET_PREVIEW = 401,
|
||||||
|
|
||||||
|
VIMS_SAMPLEBANK_LIST = 402,
|
||||||
|
VIMS_SAMPLEBANK_ADD = 403,
|
||||||
|
VIMS_SAMPLEBANK_DEL = 404,
|
||||||
|
VIMS_FX_LIST = 405,
|
||||||
|
VIMS_FX_DETAILS = 406,
|
||||||
|
VIMS_FX_CURRENT_DETAILS = 407,
|
||||||
|
VIMS_FX_CHAIN = 408,
|
||||||
|
|
||||||
VIMS_GET_FRAME = 42,
|
VIMS_GET_FRAME = 42,
|
||||||
|
|
||||||
VIMS_SET_PORT = 650,
|
VIMS_SET_PORT = 650,
|
||||||
|
|||||||
@@ -1782,6 +1782,118 @@ void vj_event_el_add_video(void *ptr, const char format[], va_list ap)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vj_event_performer_configure_preview( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
int args[3];
|
||||||
|
char *s = NULL;
|
||||||
|
veejay_t *v = (veejay_t*) ptr;
|
||||||
|
P_A(args, s, format, ap);
|
||||||
|
|
||||||
|
int n = performer_setup_preview( v,
|
||||||
|
v->performer,
|
||||||
|
args[0],
|
||||||
|
args[1]);
|
||||||
|
if( n )
|
||||||
|
{
|
||||||
|
veejay_msg(VEEJAY_MSG_INFO, "Preview image configured");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vj_event_performer_get_preview_image( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
//write preview image to socket
|
||||||
|
}
|
||||||
|
|
||||||
|
void vj_event_samplebank_list( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
/* sample id, sample type */
|
||||||
|
char *data = samplebank_sprint_list();
|
||||||
|
veejay_msg(0,"list: '%s'", data );
|
||||||
|
free(data);
|
||||||
|
}
|
||||||
|
void vj_event_samplebank_add ( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
int args[3];
|
||||||
|
char s[1024];
|
||||||
|
veejay_t *v = (veejay_t*) ptr;
|
||||||
|
P_A(args, s, format, ap);
|
||||||
|
|
||||||
|
void *sample = sample_new( args[0] );
|
||||||
|
if( sample_open( sample, s, args[1], v->video_info ) <= 0 )
|
||||||
|
{
|
||||||
|
veejay_msg(0, "Unable to open '%s' as new sample", s);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int id = samplebank_add_sample(sample);
|
||||||
|
veejay_msg(0, "Added '%s' as new sample %d", s, id );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void vj_event_samplebank_del ( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
int args[3];
|
||||||
|
char *s = NULL;
|
||||||
|
veejay_t *v = (veejay_t*) ptr;
|
||||||
|
P_A(args, s, format, ap);
|
||||||
|
|
||||||
|
int current_playing = sample_get_key_ptr( v->current_sample );
|
||||||
|
|
||||||
|
if( args[0] == current_playing || args[0] == 0)
|
||||||
|
{
|
||||||
|
veejay_msg(0, "Cannot delete current playing sample");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( sample_delete( args[0] ) )
|
||||||
|
{
|
||||||
|
veejay_msg(VEEJAY_MSG_INFO, "Deleted sample %d", args[0] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
veejay_msg(VEEJAY_MSG_INFO, "Sample %d does not exist",args[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void vj_event_fx_list ( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
char *data = list_plugins();
|
||||||
|
veejay_msg(0,"list: '%s'", data );
|
||||||
|
free(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
void vj_event_fx_info ( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
|
||||||
|
int args[3];
|
||||||
|
char plug_name[1024];
|
||||||
|
veejay_t *v = (veejay_t*) ptr;
|
||||||
|
P_A(args, plug_name, format, ap);
|
||||||
|
int i;
|
||||||
|
int fx_id =
|
||||||
|
plug_get_fx_id_by_name( plug_name );
|
||||||
|
|
||||||
|
if( fx_id < 0 )
|
||||||
|
{
|
||||||
|
veejay_msg(0, "Plugin '%s' not loaded", plug_name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *str = plug_describe( fx_id );
|
||||||
|
|
||||||
|
printf( "\n\n%s\n\n", str );
|
||||||
|
|
||||||
|
free(str);
|
||||||
|
|
||||||
|
}
|
||||||
|
void vj_event_sample_fx_details(void *ptr, const char format[], va_list ap)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void vj_event_sample_fx_chain( void *ptr, const char format[], va_list ap )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void vj_event_sample_configure_recorder( void *ptr, const char format[], va_list ap )
|
void vj_event_sample_configure_recorder( void *ptr, const char format[], va_list ap )
|
||||||
{
|
{
|
||||||
int args[4];
|
int args[4];
|
||||||
|
|||||||
@@ -87,5 +87,14 @@ void vj_event_sample_configure_recorder( void *ptr, const char format[], va_list
|
|||||||
void vj_event_sample_start_recorder( void *ptr, const char format[], va_list ap );
|
void vj_event_sample_start_recorder( void *ptr, const char format[], va_list ap );
|
||||||
void vj_event_sample_stop_recorder( void *ptr, const char format[], va_list ap );
|
void vj_event_sample_stop_recorder( void *ptr, const char format[], va_list ap );
|
||||||
|
|
||||||
|
void vj_event_performer_configure_preview( void *ptr, const char format[], va_list ap);
|
||||||
|
void vj_event_performer_get_preview_image( void *ptr, const char format[], va_list ap);
|
||||||
|
|
||||||
|
void vj_event_samplebank_list( void *ptr, const char format[], va_list ap );
|
||||||
|
void vj_event_samplebank_add ( void *ptr, const char format[], va_list ap );
|
||||||
|
void vj_event_samplebank_del ( void *ptr, const char format[], va_list ap );
|
||||||
|
void vj_event_fx_list ( void *ptr, const char format[], va_list ap );
|
||||||
|
void vj_event_fx_info ( void *ptr, const char format[], va_list ap );
|
||||||
|
void vj_event_sample_fx_details(void *ptr, const char format[], va_list ap);
|
||||||
|
void vj_event_sample_fx_chain( void *ptr, const char format[], va_list ap);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -712,6 +712,29 @@ void vj_init_vevo_events(void)
|
|||||||
-1,
|
-1,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
|
index_map_[VIMS_PERFORMER_SETUP_PREVIEW] = _new_event(
|
||||||
|
"%d %d",
|
||||||
|
VIMS_PERFORMER_SETUP_PREVIEW,
|
||||||
|
"Configure preview image",
|
||||||
|
vj_event_performer_configure_preview,
|
||||||
|
2,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
"Preview mode",
|
||||||
|
0,
|
||||||
|
"Recude",
|
||||||
|
0,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_[VIMS_PERFORMER_GET_PREVIEW] = _new_event(
|
||||||
|
NULL,
|
||||||
|
VIMS_PERFORMER_GET_PREVIEW,
|
||||||
|
"Get preview image",
|
||||||
|
vj_event_performer_get_preview_image,
|
||||||
|
0,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
NULL,
|
||||||
|
NULL );
|
||||||
|
|
||||||
index_map_[VIMS_SAMPLE_CONFIGURE_RECORDER] = _new_event(
|
index_map_[VIMS_SAMPLE_CONFIGURE_RECORDER] = _new_event(
|
||||||
"%d %d %d %s",
|
"%d %d %d %s",
|
||||||
VIMS_SAMPLE_CONFIGURE_RECORDER,
|
VIMS_SAMPLE_CONFIGURE_RECORDER,
|
||||||
@@ -729,6 +752,86 @@ void vj_init_vevo_events(void)
|
|||||||
NULL,
|
NULL,
|
||||||
NULL );
|
NULL );
|
||||||
|
|
||||||
|
index_map_ [ VIMS_SAMPLEBANK_LIST ] = _new_event(
|
||||||
|
NULL,
|
||||||
|
VIMS_SAMPLEBANK_LIST,
|
||||||
|
"List samples in samplebank",
|
||||||
|
vj_event_samplebank_list,
|
||||||
|
0,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
NULL,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_ [ VIMS_SAMPLEBANK_ADD ] = _new_event(
|
||||||
|
"%d %d %s",
|
||||||
|
VIMS_SAMPLEBANK_ADD,
|
||||||
|
"Add file to samplebank",
|
||||||
|
vj_event_samplebank_add,
|
||||||
|
3,
|
||||||
|
VIMS_LONG_PARAMS | VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
"Type of sample",
|
||||||
|
0,
|
||||||
|
"Extra token",
|
||||||
|
0,
|
||||||
|
"Filename",
|
||||||
|
NULL,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_[ VIMS_SAMPLEBANK_DEL ] = _new_event(
|
||||||
|
"%d",
|
||||||
|
VIMS_SAMPLEBANK_DEL,
|
||||||
|
"Delete sample from samplebank",
|
||||||
|
vj_event_samplebank_del,
|
||||||
|
1,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
"Sample ID",
|
||||||
|
0,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_ [ VIMS_FX_LIST ] = _new_event(
|
||||||
|
NULL,
|
||||||
|
VIMS_FX_LIST,
|
||||||
|
"List all loaded plugins",
|
||||||
|
vj_event_fx_list,
|
||||||
|
0,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
NULL,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_[ VIMS_FX_DETAILS ] = _new_event(
|
||||||
|
"%s",
|
||||||
|
VIMS_FX_DETAILS,
|
||||||
|
"Get plugin information",
|
||||||
|
vj_event_fx_info,
|
||||||
|
1,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
"Plugin name",
|
||||||
|
NULL,
|
||||||
|
NULL );
|
||||||
|
index_map_[ VIMS_FX_CURRENT_DETAILS ] = _new_event(
|
||||||
|
"%d %d",
|
||||||
|
VIMS_FX_DETAILS,
|
||||||
|
"Get fx information on sample entry",
|
||||||
|
vj_event_sample_fx_details,
|
||||||
|
2,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
SAMPLE_ID_HELP,
|
||||||
|
0,
|
||||||
|
SAMPLE_FX_ENTRY_HELP,
|
||||||
|
0,
|
||||||
|
NULL );
|
||||||
|
|
||||||
|
index_map_[ VIMS_FX_CHAIN ] = _new_event(
|
||||||
|
"%d",
|
||||||
|
VIMS_FX_CHAIN,
|
||||||
|
"Get fx chain of sample",
|
||||||
|
vj_event_sample_fx_chain,
|
||||||
|
1,
|
||||||
|
VIMS_REQUIRE_ALL_PARAMS,
|
||||||
|
SAMPLE_ID_HELP,
|
||||||
|
0,
|
||||||
|
NULL );
|
||||||
|
|
||||||
index_map_ [ VIMS_SAMPLE_START_RECORDER ] = _new_event(
|
index_map_ [ VIMS_SAMPLE_START_RECORDER ] = _new_event(
|
||||||
"%d",
|
"%d",
|
||||||
VIMS_SAMPLE_START_RECORDER,
|
VIMS_SAMPLE_START_RECORDER,
|
||||||
|
|||||||
@@ -1122,6 +1122,37 @@ void samplebank_init()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *samplebank_sprint_list()
|
||||||
|
{
|
||||||
|
char *res = NULL;
|
||||||
|
int len = 0;
|
||||||
|
char **props = (char**) vevo_list_properties( sample_bank_ );
|
||||||
|
if(!props)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for( i = 0; props[i] != NULL ; i ++ )
|
||||||
|
{
|
||||||
|
if(props[i][0] == 's')
|
||||||
|
len += strlen( props[i] ) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = (char*) malloc(sizeof(char) * len );
|
||||||
|
memset(res,0,len);
|
||||||
|
|
||||||
|
char *p = res;
|
||||||
|
for( i = 0; props[i] != NULL ; i ++ )
|
||||||
|
{
|
||||||
|
if(props[i][0] == 's' )
|
||||||
|
{
|
||||||
|
sprintf(p, "%s:", props[i]);
|
||||||
|
p += strlen( props[i] ) + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void samplebank_free()
|
void samplebank_free()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user