diff --git a/veejay-current/veejay-client/share/gveejay.reloaded.glade b/veejay-current/veejay-client/share/gveejay.reloaded.glade index 011b94a0..b11302ad 100644 --- a/veejay-current/veejay-client/share/gveejay.reloaded.glade +++ b/veejay-current/veejay-client/share/gveejay.reloaded.glade @@ -1378,7 +1378,16 @@ False - + + + + True + Append samplelist + True + + + + Load actionfile diff --git a/veejay-current/veejay-client/share/reloaded_classic.glade b/veejay-current/veejay-client/share/reloaded_classic.glade index 11fb4d64..69c056f4 100644 --- a/veejay-current/veejay-client/share/reloaded_classic.glade +++ b/veejay-current/veejay-client/share/reloaded_classic.glade @@ -382,6 +382,15 @@ + + + True + Append samplelist + True + + + + True diff --git a/veejay-current/veejay-client/src/callback.c b/veejay-current/veejay-client/src/callback.c index 50359d12..c2d9b276 100644 --- a/veejay-current/veejay-client/src/callback.c +++ b/veejay-current/veejay-client/src/callback.c @@ -1331,7 +1331,16 @@ void on_button_samplelist_open_clicked(GtkWidget *widget, gpointer user_data) g_free(filename ); } } - +void on_button_samplelist_append_clicked(GtkWidget *widget, gpointer user_data) +{ + gint erase_all = 0; + gchar *filename = dialog_open_file( "Append a samplelist",1); + if(filename) + { + multi_vims( VIMS_SAMPLE_LOAD_SAMPLELIST, "%s", filename ); + g_free(filename ); + } +} void on_veejay_expander_activate(GtkWidget *exp, gpointer user_data) { } diff --git a/veejay-current/veejay-client/src/vj-api.c b/veejay-current/veejay-client/src/vj-api.c index 5ece7fbf..a33f6852 100644 --- a/veejay-current/veejay-client/src/vj-api.c +++ b/veejay-current/veejay-client/src/vj-api.c @@ -1590,7 +1590,7 @@ void about_dialog() }; const gchar *web = { - "http://www.veejayhq.net | http://veejay.dyne.org" + "http://www.veejayhq.net" }; char blob[1024]; @@ -5997,21 +5997,20 @@ static void update_globalinfo(int *history, int pm, int last_pm) if( info->status_tokens[SEQ_ACT] != history[SEQ_ACT] ) { info->uc.reload_hint[HINT_SEQ_ACT] = 1; - - if(info->status_tokens[SEQ_ACT]== 0 ) - set_toggle_button( "seqactive" , 0 ); - else - set_toggle_button( "seqactive", 1 ); } if( info->status_tokens[SEQ_CUR] != history[SEQ_CUR] ) { int in = info->status_tokens[SEQ_CUR]; + if( in ) { + set_toggle_button( "seqactive" , 1 ); + } else { + set_toggle_button( "seqactive" , 0 ); + } if(info->sequence_playing >= 0) indicate_sequence( FALSE, info->sequencer_view->gui_slot[ info->sequence_playing ] ); info->sequence_playing = in; indicate_sequence( TRUE, info->sequencer_view->gui_slot[ info->sequence_playing ] ); } - total_frames_ = (pm == MODE_STREAM ? info->status_tokens[SAMPLE_MARKER_END] : info->status_tokens[TOTAL_FRAMES] ); gint history_frames_ = (pm == MODE_STREAM ? history[SAMPLE_MARKER_END] : history[TOTAL_FRAMES] ); diff --git a/veejay-current/veejay-server/libel/lav_io.c b/veejay-current/veejay-server/libel/lav_io.c index 4263ba78..e69f8d0d 100644 --- a/veejay-current/veejay-server/libel/lav_io.c +++ b/veejay-current/veejay-server/libel/lav_io.c @@ -471,7 +471,6 @@ int lav_close(lav_file_t *lav_file) case 'b': if( lav_file->dv_fd ) { - veejay_msg(VEEJAY_MSG_DEBUG,"\tClosing raw dv file"); ret = rawdv_close(lav_file->dv_fd); } break; @@ -480,7 +479,6 @@ int lav_close(lav_file_t *lav_file) case 'x': if( lav_file->picture ) { - veejay_msg(VEEJAY_MSG_DEBUG,"\tClosing image file"); vj_picture_cleanup( lav_file->picture ); ret = 1; } @@ -490,7 +488,6 @@ int lav_close(lav_file_t *lav_file) case 'q': if( lav_file->qt_fd ) { - veejay_msg(VEEJAY_MSG_DEBUG, "\tClosing Quicktime file"); ret = quicktime_close( lav_file->qt_fd ); } break; @@ -498,7 +495,6 @@ int lav_close(lav_file_t *lav_file) default: if( lav_file->avi_fd ) { - veejay_msg(VEEJAY_MSG_DEBUG, "\tClosing AVI file"); ret = AVI_close(lav_file->avi_fd); } break; diff --git a/veejay-current/veejay-server/libel/vj-el.c b/veejay-current/veejay-server/libel/vj-el.c index 5b466a27..179130f0 100644 --- a/veejay-current/veejay-server/libel/vj-el.c +++ b/veejay-current/veejay-server/libel/vj-el.c @@ -421,13 +421,9 @@ void vj_el_setup_cache( editlist *el ) if(!el->cache && !never_cache_) { int n_slots = mem_chunk_ / el->max_frame_size; - if( el->video_frames > n_slots) + if( el->video_frames < n_slots) { - veejay_msg(VEEJAY_MSG_DEBUG, "Too many frames; not caching this EDL to memory. Create shorter samples or increase memory cache size"); - } - else - { - veejay_msg(VEEJAY_MSG_DEBUG, "EditList caches at most %d slots (chunk=%d, framesize=%d)", n_slots, mem_chunk_, el->max_frame_size ); + veejay_msg(VEEJAY_MSG_DEBUG, "Good, can load this sample entirely into memory... (%d slots, chunk=%d, framesize=%d)", n_slots, mem_chunk_, el->max_frame_size ); el->cache = init_cache( n_slots ); } } diff --git a/veejay-current/veejay-server/libsample/sampleadm.c b/veejay-current/veejay-server/libsample/sampleadm.c index 07c9687c..45e19780 100644 --- a/veejay-current/veejay-server/libsample/sampleadm.c +++ b/veejay-current/veejay-server/libsample/sampleadm.c @@ -280,7 +280,7 @@ static int _new_id() sample_info *sample_skeleton_new(long startFrame, long endFrame) { - char tmp_file[32]; + char tmp_file[128]; sample_info *si; int i, j; @@ -917,7 +917,6 @@ int sample_del(int sample_id) avail_num[next_avail_num] = sample_id; next_avail_num++; hash_delete_free(SampleHash, sample_node); - veejay_msg(VEEJAY_MSG_DEBUG, "Deleted sample %d",sample_id ); return 1; } @@ -2894,7 +2893,7 @@ void LoadCurrentPlaying( xmlDocPtr doc, xmlNodePtr cur , int *id, int *mode ) } -void LoadSequences( xmlDocPtr doc, xmlNodePtr cur, void *seq ) +void LoadSequences( xmlDocPtr doc, xmlNodePtr cur, void *seq, int n_samples ) { seq_t *s = (seq_t*) seq; @@ -2902,6 +2901,11 @@ void LoadSequences( xmlDocPtr doc, xmlNodePtr cur, void *seq ) xmlChar *xmlTemp = NULL; unsigned char *chTemp = NULL; + int tmp_seq[MAX_SEQUENCES]; + int tmp_idx = 0; + + veejay_memset( &tmp_seq, 0, sizeof(tmp_seq)); + while (cur != NULL) { if (!xmlStrcmp(cur->name, (const xmlChar *) "SEQ_ID")) { @@ -2909,8 +2913,10 @@ void LoadSequences( xmlDocPtr doc, xmlNodePtr cur, void *seq ) chTemp = UTF8toLAT1(xmlTemp); if (chTemp) { int id = atoi( chTemp ); - s->samples[ s->size ] = id; - s->size ++; + if( tmp_idx < MAX_SEQUENCES && id > 0 ) { + tmp_seq[ tmp_idx ] = id; + tmp_idx ++; + } free(chTemp); } if( xmlTemp ) @@ -2919,6 +2925,23 @@ void LoadSequences( xmlDocPtr doc, xmlNodePtr cur, void *seq ) cur = cur->next; } + if( tmp_idx == 0 ) + return; + + if( s->size == 0 ) { + veejay_memcpy( s->samples, &tmp_seq, tmp_idx * sizeof(int)); + s->size = tmp_idx; + return; + } + + if( (s->size + tmp_idx ) < MAX_SEQUENCES ) { + for( i = 0; i < tmp_idx; i ++ ) { + s->samples[ s->size + i ] = tmp_seq[ i ] + n_samples; + } + s->size = s->size + tmp_idx; + } else { + veejay_msg(VEEJAY_MSG_DEBUG, "Can't load this sequence, sequence bank is full."); + } } /************************************************************************************************* @@ -2936,19 +2959,17 @@ xmlNodePtr ParseSample(xmlDocPtr doc, xmlNodePtr cur, sample_info * skel,void *e xmlNodePtr subs = NULL; if(!sample_read_edl( skel )) { - veejay_msg(VEEJAY_MSG_WARNING, "No saved edit decision list '%s' for sample %d", skel->edit_list_file, skel->sample_id ); - if( el == NULL || ((editlist*)el)->video_frames <= 2 ) { - veejay_msg(VEEJAY_MSG_WARNING, "Plainmode is dummy !"); - } - veejay_msg(VEEJAY_MSG_WARNING, "Using plainmode to play sample %d", skel->sample_id ); skel->edit_list = NULL; } + if(!skel->edit_list) { + veejay_msg(VEEJAY_MSG_DEBUG, "Sample %d has inherited EDL from plain mode", skel->sample_id ); skel->edit_list = el; skel->soft_edl = 1; } else { skel->soft_edl = 0; + veejay_msg(VEEJAY_MSG_DEBUG, "Sample %d has own EDL (%p)", skel->sample_id, el ); } while (cur != NULL) { if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_SAMPLEID)) { @@ -3341,7 +3362,7 @@ int sample_readFromFile(char *sampleFile, void *vp, void *seq, void *font, void } if( !xmlStrcmp( cur->name, (const xmlChar *) "SEQUENCE" )) { - LoadSequences( doc, cur->xmlChildrenNode,seq ); + LoadSequences( doc, cur->xmlChildrenNode,seq, start_at ); } if( !xmlStrcmp( cur->name, (const xmlChar*) "stream" )) { @@ -3481,7 +3502,7 @@ void SaveCurrentPlaying( xmlNodePtr node, int id, int mode ) void CreateSample(xmlNodePtr node, sample_info * sample, void *font) { - char buffer[100]; + char buffer[1024]; xmlNodePtr childnode; sprintf(buffer, "%d", sample->sample_id); diff --git a/veejay-current/veejay-server/veejay/liblavplayvj.c b/veejay-current/veejay-server/veejay/liblavplayvj.c index 1a5af2fd..642a0b3e 100644 --- a/veejay-current/veejay-server/veejay/liblavplayvj.c +++ b/veejay-current/veejay-server/veejay/liblavplayvj.c @@ -1119,7 +1119,7 @@ void veejay_pipe_write_status(veejay_t * info) RANDMODE_SAMPLE) pm = VJ_PLAYBACK_MODE_PATTERN; if( sample_chain_sprint_status - (info->uc->sample_id,cache_used,info->seq->active,info->seq->current,info->real_fps,settings->current_frame_num, pm, total_slots,info->seq->rec_id,curfps,settings->cycle_count[0],settings->cycle_count[1],mstatus,info->status_what ) != 0) + (info->uc->sample_id,cache_used,info->seq->size,info->seq->current,info->real_fps,settings->current_frame_num, pm, total_slots,info->seq->rec_id,curfps,settings->cycle_count[0],settings->cycle_count[1],mstatus,info->status_what ) != 0) { veejay_msg(VEEJAY_MSG_ERROR, "Fatal error, tried to collect properties of invalid sample"); veejay_change_state( info, LAVPLAY_STATE_STOP ); @@ -1156,7 +1156,7 @@ void veejay_pipe_write_status(veejay_t * info) mstatus); break; case VJ_PLAYBACK_MODE_TAG: - if( vj_tag_sprint_status( info->uc->sample_id,cache_used,info->seq->active,info->seq->current, info->real_fps, + if( vj_tag_sprint_status( info->uc->sample_id,cache_used,info->seq->size,info->seq->current, info->real_fps, settings->current_frame_num, info->uc->playback_mode,total_slots,curfps,settings->cycle_count[0],settings->cycle_count[1],mstatus, info->status_what ) != 0 ) { veejay_msg(VEEJAY_MSG_ERROR, "Invalid status!"); diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c index 2a4746c2..eadccc6f 100644 --- a/veejay-current/veejay-server/veejay/vj-event.c +++ b/veejay-current/veejay-server/veejay/vj-event.c @@ -3261,7 +3261,7 @@ void vj_event_sample_new(void *ptr, const char format[], va_list ap) editlist *el = veejay_edit_copy_to_new( v, E, args[0],args[1] ); if(!el) { - veejay_msg(VEEJAY_MSG_ERROR, "Cant copy EDL"); + veejay_msg(VEEJAY_MSG_ERROR, "Cannot copy EDL"); return; } int start = 0; @@ -3277,7 +3277,7 @@ void vj_event_sample_new(void *ptr, const char format[], va_list ap) if(sample_store(skel)==0) { - veejay_msg(VEEJAY_MSG_INFO, "Created new sample [%d] with EDL", skel->sample_id); + veejay_msg(VEEJAY_MSG_INFO, "Created new sample [%d]", skel->sample_id); new_id = skel->sample_id; } @@ -4460,6 +4460,14 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) return; } + + int format_ = _recorder_format; + if(format_==-1) + { + veejay_msg(VEEJAY_MSG_ERROR,"Select a video codec first"); + return; + } + veejay_memset(tmp,0,255); veejay_memset(prefix,0,150); @@ -4476,7 +4484,6 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) } else { - v->seq->rec_id = v->uc->sample_id; sprintf( prefix, "sequence_"); } } @@ -4484,8 +4491,6 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) if(!veejay_create_temp_file(prefix, tmp)) { veejay_msg(VEEJAY_MSG_ERROR, "Unable to create temporary file, Record aborted." ); - if(v->seq->rec_id && v->seq->active) - v->seq->rec_id = 0; return; } @@ -4503,24 +4508,14 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) args[0] += sample_get_longest( v->seq->samples[i] ); } } - veejay_msg(VEEJAY_MSG_DEBUG, "\tRecording %d frames", args[0]); - } - - int format_ = _recorder_format; - if(format_==-1) - { - veejay_msg(VEEJAY_MSG_ERROR,"Select a video codec first"); - if(v->seq->active && v->seq->rec_id ) - v->seq->rec_id = 0; - return; + veejay_msg(VEEJAY_MSG_DEBUG, "\tRecording %d frames (sequencer is %s)", args[0], + (v->seq->active ? "active" : "inactive")); } + if(args[0] <= 1 ) { veejay_msg(VEEJAY_MSG_ERROR, "Cowardly refusing to record less then 2 frames"); - if(v->seq->active && v->seq->rec_id ) - v->seq->rec_id = 0; - return; } @@ -4559,12 +4554,15 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) int start_at = 0; for( i = 0; i < MAX_SEQUENCES; i ++ ) { - if ( sample_exists( v->seq->samples[i] )) + if( sample_exists( v->seq->samples[i] )) { start_at = v->seq->samples[i]; break; } } + + v->seq->rec_id = v->uc->sample_id; + if( start_at == v->uc->sample_id ) veejay_set_frame(v,sample_get_startFrame(v->uc->sample_id)); else @@ -4573,6 +4571,7 @@ void vj_event_sample_rec_start( void *ptr, const char format[], va_list ap) else { veejay_set_frame(v, sample_get_startFrame(v->uc->sample_id)); + v->seq->rec_id = 0; } } @@ -4590,7 +4589,7 @@ void vj_event_sample_rec_stop(void *ptr, const char format[], va_list ap) if( sample_stop_encoder( stop_sample ) == 1 ) { - char avi_file[255]; + char avi_file[1024]; v->settings->sample_record = 0; if( sample_get_encoded_file( stop_sample, avi_file) <= 0 ) { @@ -4609,8 +4608,7 @@ void vj_event_sample_rec_stop(void *ptr, const char format[], va_list ap) sample_reset_encoder( stop_sample ); s->sample_record = 0; s->sample_record_id = 0; - if(v->seq->active && v->seq->rec_id ) - v->seq->rec_id = 0; + v->seq->rec_id = 0; if(s->sample_record_switch) { s->sample_record_switch = 0; @@ -4847,8 +4845,13 @@ void vj_event_sample_clear_all(void *ptr, const char format[], va_list ap) veejay_change_playback_mode( v, VJ_PLAYBACK_MODE_PLAIN, 0 ); } } + sample_del_all(v->edit_list); - veejay_msg(VEEJAY_MSG_INFO, "Deleted all samples (%d remaining)",sample_size()); + veejay_memset(v->seq->samples, 0, sizeof(int) * MAX_SEQUENCES ); + v->seq->active = 0; + v->seq->size = 0; + + veejay_msg(VEEJAY_MSG_INFO, "Deleted all samples."); }