X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fpage_status.c;h=1047ec6bf8cd87d90ef2b028a7b52f0634f915a8;hb=5a44a194cba7a21fd18990f7041c864f78d2b793;hp=1ca948788910c6cdbeb917c0a7f21ffb734d176f;hpb=a3add8d78fbe7c397316520f7e5edf84a8a516ca;p=rugen diff --git a/src/page_status.c b/src/page_status.c index 1ca9487..1047ec6 100644 --- a/src/page_status.c +++ b/src/page_status.c @@ -43,6 +43,7 @@ typedef struct guint context; int unit; int count; + struct page_t *parent_page; } *page_status, page_status_t; @@ -67,22 +68,29 @@ static char* status_to_text( mvcp_status status ) return "unknown"; } +static void format_status_string(char* buf, int size, mvcp_status status , char* sep) +{ + char tc1[12], tc2[12], tc3[12]; + + snprintf( buf, size, + "[%s]%sIN:%s%sPOS:%s%sOUT:%s%s%s%s", + status_to_text( status ), sep, + frames2tc(status->in, status->fps, tc1), sep, + frames2tc(status->position, status->fps, tc2), sep, + frames2tc(status->out, status->fps, tc3), sep, + status->clip, sep + ); + +} + static int show_status( page_status this, mvcp_status status ) { GtkWidget *widget = this_page_get_widget( ( page )this ); char temp[ 1024 ] = ""; char temp2[ 1024 ]; char label_name[ 256 ]; - char tc1[12], tc2[12], tc3[12]; - - sprintf( temp, "[%s] IN:%s POS:%s OUT:%s %s", - status_to_text( status ), - frames2tc(status->in, status->fps, tc1), - frames2tc(status->position, status->fps, tc2), - frames2tc(status->out, status->fps, tc3), - status->clip - ); + format_status_string(temp, sizeof(temp), status , "\n"); sprintf( label_name, "label_unit_%d", status->unit ); gdk_threads_enter(); @@ -90,6 +98,7 @@ static int show_status( page_status this, mvcp_status status ) gtk_label_set_text( GTK_LABEL( widget ), temp ); if ( status->unit == dv1394app_get_selected_unit( this->app ) ) { + format_status_string(temp, sizeof(temp), status , " "); sprintf( temp2, "U%d - %s", status->unit, temp ); widget = lookup_widget( dv1394app_get_widget( this->app ), "statusbar" ); gtk_statusbar_pop( GTK_STATUSBAR( widget ), this->context ); @@ -261,7 +270,7 @@ static GtkWidget *this_page_get_widget( page super ) { page_status this = ( page_status )super; if ( this->widget == NULL ) - this->widget = create_page_status( ); + this->widget = this->parent_page->get_widget(this->parent_page); return this->widget; } @@ -305,12 +314,13 @@ static void this_page_close( page super ) free( this ); } -page page_status_init( dv1394app app ) +page page_status_init( dv1394app app, struct page_t *parent_page ) { page_status this = calloc( 1, sizeof( page_status_t ) ); int index = 0; GtkWidget *widget; - + + this->parent_page = parent_page; this->parent.get_widget = this_page_get_widget; this->parent.get_toolbar_info = this_page_get_toolbar_info; this->parent.on_connect = this_page_on_connect;