mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-20 14:50:01 +01:00
Fix timer function, fix slow slider in classic reloaded, fix loop recording
git-svn-id: svn://code.dyne.org/veejay/trunk@1231 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -7927,7 +7927,7 @@ MLZO</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHScale" id="speed_slider">
|
||||
<property name="width_request">80</property>
|
||||
<property name="width_request">60</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_value">True</property>
|
||||
@@ -7947,6 +7947,7 @@ MLZO</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHScale" id="slow_slider">
|
||||
<property name="width_request">60</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="draw_value">True</property>
|
||||
@@ -7955,10 +7956,11 @@ MLZO</property>
|
||||
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
|
||||
<property name="inverted">False</property>
|
||||
<property name="adjustment">0 0 0 0 0 0</property>
|
||||
<signal name="value_changed" handler="on_slow_slider_value_changed" last_modification_time="Sun, 30 Nov 2008 19:29:07 GMT"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,11 @@
|
||||
*/
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <mjpeg/yuv4mpeg_intern.h>
|
||||
#include <mjpeg/yuv4mpeg.h>
|
||||
#include <mjpeg/mpegconsts.h>
|
||||
#include <mjpeg/mpegtimecode.h>
|
||||
|
||||
#include <veejay/vjmem.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 );
|
||||
double fps = (double) info->el.fps;
|
||||
int pos = (end-start);
|
||||
|
||||
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;
|
||||
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_);
|
||||
|
||||
Reference in New Issue
Block a user