diff --git a/veejay-current/veejay-client/share/reloaded_classic.glade b/veejay-current/veejay-client/share/reloaded_classic.glade index e94da750..efe15483 100644 --- a/veejay-current/veejay-client/share/reloaded_classic.glade +++ b/veejay-current/veejay-client/share/reloaded_classic.glade @@ -7927,7 +7927,7 @@ MLZO - 80 + 60 True True True @@ -7947,6 +7947,7 @@ MLZO + 60 True True True @@ -7955,10 +7956,11 @@ MLZO GTK_UPDATE_CONTINUOUS False 0 0 0 0 0 0 + 0 - True + False True diff --git a/veejay-current/veejay-client/src/callback.c b/veejay-current/veejay-client/src/callback.c index 83719de7..910828df 100644 --- a/veejay-current/veejay-client/src/callback.c +++ b/veejay-current/veejay-client/src/callback.c @@ -1007,38 +1007,18 @@ void on_button_sample_recordstart_clicked(GtkWidget *widget, gpointer user_data) { int base = sample_calctime(); n_frames = base * dur_val; - n_frames = 0; } else { n_frames = dur_val; } - gsize br=0; gsize bw=0; - gchar *utftext = (gchar*) get_text( "entry_samplename"); - gchar *text = (utftext != NULL ? g_locale_from_utf8( utftext, -1, &br, &bw,NULL) : NULL); - if(text != NULL) - { - int i = 0; - while( text[i] != '\0' ) - { - if( !isalnum( text[i] )) - { - error_dialog("Error", "Only alpha numeric characters are allowed"); - if( text) free(text); - return; - } - i++; - } - multi_vims( VIMS_SAMPLE_SET_DESCRIPTION, "%d %s", 0, text ); - g_free(text); - } - if(format != NULL) { multi_vims( VIMS_RECORD_DATAFORMAT,"%s", format ); } + multi_vims( VIMS_SAMPLE_REC_START, "%d %d", n_frames, @@ -1047,10 +1027,12 @@ void on_button_sample_recordstart_clicked(GtkWidget *widget, gpointer user_data) vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SAMPLE_REC_START, n_frames, autoplay ); gchar *time1 = format_time(n_frames,info->el.fps); - vj_msg(VEEJAY_MSG_INFO,"Record duration: %s", - time1); + if( autoplay ) { + vj_msg(VEEJAY_MSG_INFO, "Recording %s from current sample, autoplaying new sample when finished.",time1); + } else { + vj_msg(VEEJAY_MSG_INFO,"Recording %s from current sample",time1); + } g_free(time1); - g_free(format); } diff --git a/veejay-current/veejay-client/src/utils.c b/veejay-current/veejay-client/src/utils.c index bb7a1b33..cee53110 100644 --- a/veejay-current/veejay-client/src/utils.c +++ b/veejay-current/veejay-client/src/utils.c @@ -18,8 +18,11 @@ */ #include #include +#include +#include #include #include + #include #include @@ -52,18 +55,16 @@ int status_to_arr( char *status, int *array ) return n; } -char *format_time(int pos, float fps) + +char *format_time(int pos, double fps) { + static char temp[256]; MPEG_timecode_t tc; - veejay_memset(&tc, 0,sizeof(MPEG_timecode_t)); - char *tmp = (char*) vj_malloc( 20 ); - y4m_ratio_t ratio = mpeg_conform_framerate( fps ); - int n = mpeg_framerate_code( ratio ); - - mpeg_timecode(&tc, pos, n, fps ); - - snprintf(tmp, 20, "%2d:%2.2d:%2.2d:%2.2d", - tc.h, tc.m, tc.s, tc.f ); - return tmp; + mpeg_timecode(&tc, + pos, + mpeg_framerate_code(mpeg_conform_framerate(fps)), + fps ); + sprintf(temp, "%d:%2.2d:%2.2d:%2.2d",tc.h, tc.m, tc.s, tc.f ); + return strdup(temp); } diff --git a/veejay-current/veejay-client/src/utils.h b/veejay-current/veejay-client/src/utils.h index 6a4a73da..3caa2745 100644 --- a/veejay-current/veejay-client/src/utils.h +++ b/veejay-current/veejay-client/src/utils.h @@ -20,6 +20,6 @@ #ifndef GVRUTILS #define GVRUTILS int status_to_arr( char *status, int *array ); -char *format_time( int pos , float fps); +char *format_time( int pos , double fps); #endif diff --git a/veejay-current/veejay-client/src/vj-api.c b/veejay-current/veejay-client/src/vj-api.c index cdb110c0..f61cc2f6 100644 --- a/veejay-current/veejay-client/src/vj-api.c +++ b/veejay-current/veejay-client/src/vj-api.c @@ -611,7 +611,9 @@ GtkWidget *glade_xml_get_widget_( GladeXML *m, const char *name ) GtkWidget *widget = glade_xml_get_widget( m , name ); if(!widget) { +#ifdef STRICT_CHECKING veejay_msg(0,"Missing widget: %s %s ",__FUNCTION__,name); +#endif return NULL; } #ifdef STRICT_CHECKING @@ -918,10 +920,10 @@ static void set_tooltip(const char *name, const char *text) { GtkWidget *w = glade_xml_get_widget_(info->main_window,name); if(!w) { +#ifdef STRICT_CHECKING veejay_msg(0, "Widget '%s' not found",name); +#endif return; - - } gtk_widget_set_tooltip_text( w,text ); } @@ -2737,7 +2739,7 @@ static void update_record_tab(int pm) { update_spin_value( "spin_streamduration" , 1 ); gint n_frames = get_nums( "spin_streamduration" ); - gchar *time = format_time(n_frames, info->el.fps); + gchar *time = format_time(n_frames, (double) info->el.fps); update_label_str( "label_streamrecord_duration", time ); g_free(time); } @@ -2746,7 +2748,7 @@ static void update_record_tab(int pm) update_spin_value( "spin_sampleduration", 1 ); // combo_samplecodec gint n_frames = sample_calctime(); - gchar *time = format_time( n_frames,info->el.fps ); + gchar *time = format_time( n_frames,(double) info->el.fps ); update_label_str( "label_samplerecord_duration", time ); g_free(time); } @@ -2820,7 +2822,7 @@ static void update_current_slot(int *history, int pm, int last_pm) } - gchar *time = format_time( info->status_frame,info->el.fps ); + gchar *time = format_time( info->status_frame,(double)info->el.fps ); update_label_str( "label_curtime", time ); g_free(time); @@ -2851,7 +2853,7 @@ static void update_current_slot(int *history, int pm, int last_pm) } } gchar *dur = format_time( info->status_tokens[SAMPLE_MARKER_END] - info->status_tokens[SAMPLE_MARKER_START], - info->el.fps ); + (double)info->el.fps ); update_label_str( "label_markerduration", dur ); g_free(dur); } @@ -4879,7 +4881,6 @@ static void reload_editlist_contents() if(nl < 0 || nl >= num_files) { - printf("exceed max files\n"); return; } int file_len = _el_get_nframes( nl ); @@ -4969,6 +4970,9 @@ static void load_editlist_info() update_spin_value( "screenshot_height", info->el.height ); info->el.fps = fps; +#ifdef STRICT_CHECKING + assert( info->el.fps > 0 ); +#endif info->el.num_files = dum[0]; snprintf( tmp, sizeof(tmp)-1, "%s", ( values[2] == 0 ? "progressive" : (values[2] == 1 ? "top first" : "bottom first" ) ) ); @@ -5050,18 +5054,10 @@ static void enable_widget_(const char *name, const char *s, int line) static gchar *format_selection_time(int start, int end) { - MPEG_timecode_t tc; - veejay_memset( &tc, 0,sizeof(tc)); - if( (end-start) <= 0) - veejay_memset( &tc, 0, sizeof(tc)); - else - mpeg_timecode( &tc, (end-start), mpeg_framerate_code( - mpeg_conform_framerate( info->el.fps ) ), info->el.fps ); - - gchar *tmp = g_new( gchar, 20); - snprintf( tmp, 20, "%2d:%2.2d:%2.2d:%2.2d", - tc.h, tc.m, tc.s, tc.f ); - return tmp; + double fps = (double) info->el.fps; + int pos = (end-start); + + return format_time( pos, fps ); } @@ -5689,7 +5685,7 @@ static void update_globalinfo(int *history, int pm, int last_pm) if( total_frames_ != history_frames_ || total_frames_ != (int) timeline_get_length(TIMELINE_SELECTION(info->tl))) { - gchar *time = format_time( total_frames_, info->el.fps ); + gchar *time = format_time( total_frames_,(double) info->el.fps ); if( pm == MODE_STREAM ) { update_spin_value( "stream_length", info->status_tokens[SAMPLE_MARKER_END] ); @@ -5728,7 +5724,7 @@ static void update_globalinfo(int *history, int pm, int last_pm) info->status_frame = info->status_tokens[FRAME_NUM]; timeline_set_pos( info->tl, (gdouble) info->status_frame ); - gchar *current_time_ = format_time( info->status_frame,info->el.fps ); + gchar *current_time_ = format_time( info->status_frame, (double) info->el.fps ); update_label_i( "label_curframe", info->status_frame ,1 ); update_label_str( "label_curtime", current_time_ ); update_label_str( "label_sampleposition", current_time_);