diff --git a/veejay-ng/veejay/performer.c b/veejay-ng/veejay/performer.c index 0656b6dd..ef1d998e 100644 --- a/veejay-ng/veejay/performer.c +++ b/veejay-ng/veejay/performer.c @@ -541,11 +541,26 @@ void performer_save_frame( veejay_t *info ) performer_t *p = (performer_t*) info->performer; if(sample_is_recording( info->current_sample )) - sample_record_frame( + if(sample_record_frame( info->current_sample, p->display, NULL, - 0 ); + 0 )==2) + { + char *file = sample_get_recorded_file( info->current_sample ); + //@ open and add to samplelist + void *sample = sample_new( 0 ); + if( sample_open( sample, file ,0, info->video_info ) <= 0 ) + { + veejay_msg(0, "Unable to add recorded file '%s' to samplebank", file ); + } + else + { + int id = samplebank_add_sample(sample); + veejay_msg(0, "Added '%s' to samplebank as Sample %d", file, id ); + } + free(file); + } } diff --git a/veejay-ng/vevosample/vevosample.c b/veejay-ng/vevosample/vevosample.c index 543f9f1b..d2251edb 100644 --- a/veejay-ng/vevosample/vevosample.c +++ b/veejay-ng/vevosample/vevosample.c @@ -2693,6 +2693,7 @@ int sample_start_recorder( void *sample , sample_video_info_t *ps) ps->w, ps->h, ps->inter, ps->fps, ps->bps, ps->chans, ps->rate ); + if(!rec->fd ) { veejay_msg(VEEJAY_MSG_ERROR, "Unable to record to '%s'. Please (re)configure recorder", destination ); @@ -2704,6 +2705,8 @@ int sample_start_recorder( void *sample , sample_video_info_t *ps) rec->nf = 0; rec->rec = 1; + free(destination); + return VEVO_NO_ERROR; } @@ -2716,6 +2719,13 @@ int sample_is_recording( void *sample ) return 0; } +char * sample_get_recorded_file( void *sample ) +{ + sample_runtime_data *srd = (sample_runtime_data*) sample; + char *destination = get_str_vevo( srd->info_port,"filename"); + return destination; +} + int sample_stop_recorder( void *sample ) { sample_runtime_data *srd = (sample_runtime_data*) sample; @@ -2784,7 +2794,7 @@ int sample_record_frame( void *sample, VJFrame *frame, uint8_t *audio_buffer, in { veejay_msg(VEEJAY_MSG_INFO, "Done recording"); sample_stop_recorder(sample); - return 1; + return 2; } sit->rec = (double) (1.0/rec->tf) * rec->nf; diff --git a/veejay-ng/vevosample/vevosample.h b/veejay-ng/vevosample/vevosample.h index 3237e92a..58a4c6bf 100644 --- a/veejay-ng/vevosample/vevosample.h +++ b/veejay-ng/vevosample/vevosample.h @@ -131,4 +131,7 @@ int sample_stop_recorder( void *sample ); int sample_record_frame( void *sample, VJFrame *frame, uint8_t *audio_buffer, int a_len ); +char * sample_get_recorded_file( void *sample ); + + #endif