mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-19 14:19:58 +01:00
Dont tell veejay to set framerate at startup, take-out usleep in previewthread, disconnect ui when 2/10 fail.
git-svn-id: svn://code.dyne.org/veejay/trunk@1396 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
@@ -2002,9 +2002,12 @@ void on_frameratenormal_clicked( GtkWidget *w, gpointer data )
|
|||||||
|
|
||||||
void on_framerate_value_changed( GtkWidget *w, gpointer data )
|
void on_framerate_value_changed( GtkWidget *w, gpointer data )
|
||||||
{
|
{
|
||||||
gdouble slider_val = GTK_ADJUSTMENT(GTK_RANGE(w)->adjustment)->value;
|
if(info->status_lock)
|
||||||
int value = (int)(100.0 * slider_val);
|
return;
|
||||||
multi_vims( VIMS_FRAMERATE, "%d", value );
|
|
||||||
|
gdouble slider_val = GTK_ADJUSTMENT(GTK_RANGE(w)->adjustment)->value;
|
||||||
|
int value = (int)(100.0 * slider_val);
|
||||||
|
multi_vims( VIMS_FRAMERATE, "%d", value );
|
||||||
vj_midi_learning_vims_simple( info->midi, "framerate", VIMS_FRAMERATE );
|
vj_midi_learning_vims_simple( info->midi, "framerate", VIMS_FRAMERATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ static int veejay_get_image_data(veejay_preview_t *vp, veejay_track_t *v )
|
|||||||
res = recvvims( v, 7, &bw, v->data_buffer );
|
res = recvvims( v, 7, &bw, v->data_buffer );
|
||||||
if( res <= 0 || bw <= 0 )
|
if( res <= 0 || bw <= 0 )
|
||||||
{
|
{
|
||||||
veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image");
|
veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image! Only got %d bytes", bw);
|
||||||
v->have_frame = 0;
|
v->have_frame = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -540,19 +540,24 @@ static int gvr_preview_process_status( veejay_preview_t *vp, veejay_track_t *v )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fail_connection = 0;
|
static int fail_connection = 0;
|
||||||
|
static int continue_anyway = 0;
|
||||||
static int gvr_preview_process_image( veejay_preview_t *vp, veejay_track_t *v )
|
static int gvr_preview_process_image( veejay_preview_t *vp, veejay_track_t *v )
|
||||||
{
|
{
|
||||||
if( veejay_get_image_data( vp, v ) == 0 ) {
|
if( veejay_get_image_data( vp, v ) == 0 ) {
|
||||||
//@ settle
|
//@ settle
|
||||||
usleep(200000);
|
|
||||||
fail_connection ++;
|
fail_connection ++;
|
||||||
if( fail_connection > 2 ) {
|
if( fail_connection > 2 ) {
|
||||||
fail_connection = 0;
|
fail_connection = 0; //@ fail 2 out of 10 images and we break connection
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
continue_anyway = (continue_anyway + 1) % 10;
|
||||||
|
if(continue_anyway == 0)
|
||||||
|
fail_connection = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7101,12 +7101,14 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vj_msg(VEEJAY_MSG_INFO, "New connection with Veejay running on %s port %d",
|
vj_msg(VEEJAY_MSG_INFO, "New connection with Veejay running on %s port %d",
|
||||||
(group_name == NULL ? hostname : group_name), port_num );
|
(group_name == NULL ? hostname : group_name), port_num );
|
||||||
|
|
||||||
veejay_msg(VEEJAY_MSG_INFO, "Connection established with %s:%d (Track 0)",hostname,port_num);
|
veejay_msg(VEEJAY_MSG_INFO, "Connection established with %s:%d (Track 0)",hostname,port_num);
|
||||||
|
|
||||||
load_editlist_info();
|
load_editlist_info();
|
||||||
|
info->status_lock = 1;
|
||||||
|
|
||||||
update_slider_value( "framerate", info->el.fps, 0 );
|
update_slider_value( "framerate", info->el.fps, 0 );
|
||||||
|
|
||||||
@@ -7129,6 +7131,7 @@ int vj_gui_reconnect(char *hostname,char *group_name, int port_num)
|
|||||||
update_label_str( "label_hostnamex", (hostname == NULL ? group_name: hostname ) );
|
update_label_str( "label_hostnamex", (hostname == NULL ? group_name: hostname ) );
|
||||||
update_label_i( "label_portx",port_num,0);
|
update_label_i( "label_portx",port_num,0);
|
||||||
|
|
||||||
|
info->status_lock = 0;
|
||||||
|
|
||||||
multitrack_configure( info->mt,
|
multitrack_configure( info->mt,
|
||||||
info->el.fps, info->el.width, info->el.height, &preview_box_w_, &preview_box_h_ );
|
info->el.fps, info->el.width, info->el.height, &preview_box_w_, &preview_box_h_ );
|
||||||
|
|||||||
Reference in New Issue
Block a user