mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 22:30:06 +01:00
add recorded samples to samplebank
git-svn-id: svn://code.dyne.org/veejay/trunk@589 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user