Exemplo n.º 1
0
uint8_t  DIA_blendRemoval(BLEND_REMOVER_PARAM *mosaic)
{
  GtkWidget *dialog;
  uint8_t ret=0;

        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        
        SPIN_SET(spinbuttonTreshold,threshold);
        SPIN_SET(spinbuttonNoise,noise);
        SPIN_SET(spinbuttonIdentical,identical);
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(WID(checkbuttonShow)),mosaic->show);

        if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
                {
                        ret=1;
                        SPIN_GET(spinbuttonTreshold,threshold);
                        SPIN_GET(spinbuttonNoise,noise);
                        SPIN_GET(spinbuttonIdentical,identical);
                        mosaic->show=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(WID(checkbuttonShow)));
                }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        return ret;

}
Exemplo n.º 2
0
uint8_t DIA_dnr(uint32_t *llock,uint32_t *lthresh, uint32_t *clock,
			uint32_t *cthresh, uint32_t *scene)
{
GtkWidget *dialog;

	uint8_t ret=0;

	dialog=create_dialog1();
	gtk_transient(dialog);
	SETSPIN(spin_lumalock,*llock);
	SETSPIN(spin_lumathresh,*lthresh);
	SETSPIN(spin_chromalock,*clock);
	SETSPIN(spin_chromathresh,*cthresh);
	SETSPIN(spin_scene,*scene);

	ret=0;
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{
		GETSPIN(spin_lumalock,*llock);
		GETSPIN(spin_lumathresh,*lthresh);
		GETSPIN(spin_chromalock,*clock);
		GETSPIN(spin_chromathresh,*cthresh);
		GETSPIN(spin_scene,*scene);
			ret=1;
	}

	gtk_widget_destroy(dialog);

	return ret;

}
uint8_t DIA_resizeWiz(RESWIZ_FORMAT *format, RESWIZ_AR *source, RESWIZ_AR *destination)
{
uint8_t r=0;
GtkWidget *dialog=create_dialog1();
        
        

        // Initialize
#define COMBINE(x,y) gtk_combo_box_set_active(GTK_COMBO_BOX(WID(x)),(int)*y)

                COMBINE(comboboxSource,source);
                COMBINE(comboboxFinal,destination);
                COMBINE(comboboxTarget,format);

        gtk_register_dialog(dialog);
        if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
        {
                r=1;
#undef COMBINE
#define COMBINE(x) gtk_combo_box_get_active(GTK_COMBO_BOX(WID(x)));
                *format=(RESWIZ_FORMAT) COMBINE(comboboxTarget);
                *source=(RESWIZ_AR)     COMBINE(comboboxSource);
                *destination=(RESWIZ_AR)COMBINE(comboboxFinal);

        }


        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        return r;
}
Exemplo n.º 4
0
//	Return 1 if resume, 0 if ignore
//
uint8_t DIA_quota( char * msg )
{
	uint8_t ret=2;
	GtkWidget *dialog;
	
	while(ret==2)
	{
		dialog=create_dialog1(msg);
		//  gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(button1), GTK_RESPONSE_CANCEL);
		//  gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(button2), GTK_RESPONSE_OK);
		//gtk_transient(dialog);
		int i=gtk_dialog_run(GTK_DIALOG(dialog));
		switch(i)
		{
			case GTK_RESPONSE_OK:
				ret=0;	// ignore
				break;
			case GTK_RESPONSE_CANCEL:
				ret=1;	// resume
				break;
			default:
				ret=2;	// continnue;
				break;
		}
		gtk_widget_destroy(dialog);
	};
	return ret;
}
Exemplo n.º 5
0
uint8_t DIA_getMSmooth(MSMOOTH_PARAM *param)
{
GtkWidget *dialog;
int ret=0;
	dialog=create_dialog1();
	
	// Update
	
	CHECK_SET(checkbuttonHQ,highq);
	CHECK_SET(checkbuttonShowMask,showmask);
	
	SPIN_SET(spinbuttonThresh,threshold);
	SPIN_SET(spinbuttonStrength,strength);
	gtk_register_dialog(dialog);
	
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{
		CHECK_GET(checkbuttonHQ,highq);
		CHECK_GET(checkbuttonShowMask,showmask);
		SPIN_GET(spinbuttonThresh,threshold);
		SPIN_GET(spinbuttonStrength,strength);		
		ret=1;
	
	}
        gtk_unregister_dialog(dialog);
	gtk_widget_destroy(dialog);
	return ret;

}
Exemplo n.º 6
0
uint8_t ADMVideoLargeMedian::configure(AVDMGenericVideoStream * instream)
{
    UNUSED_ARG(instream);
    UNUSED_ARG(instream);
    GtkWidget *dialog;
    uint8_t ret=0;

	dialog=create_dialog1();

	if(_param->luma) STOGGLE(luma);
	if(_param->chroma) STOGGLE(chroma);

        gtk_register_dialog(dialog);
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{

		_param->luma	= GTOGGLE(luma);
		_param->chroma= GTOGGLE(chroma);
		ret=1;

	}
        gtk_unregister_dialog(dialog);
	gtk_widget_destroy(dialog);
	return ret;

}
Exemplo n.º 7
0
uint8_t DIA_mjpegCodecSetting( int *qual, int *swap )
{

	uint8_t ret=0;
	GtkWidget *dialog;
	
	dialog=create_dialog1();
	gtk_transient(dialog);
	#define SET(a,b) if(*b) 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog,#a)),1);
	#define GET(a,b)	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog,#a)))) \
							{ *b=1;;} else *b=0;
	SET(checkbuttonUV,swap);
	gtk_adjustment_set_value( GTK_ADJUSTMENT(hscaleAdj),(  gdouble  ) *qual );
	
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{
		
			GET(checkbuttonUV,swap);
			*qual=(int)floor(GTK_ADJUSTMENT(hscaleAdj)->value);
			ret=1;
	
	}
	
	gtk_widget_destroy(dialog);
	
	return ret;
}   
Exemplo n.º 8
0
/* =================================
            Filter Preview
   ================================= */
uint8_t DIA_filterPreview(const char *captionText, AVDMGenericVideoStream *videoStream, uint32_t frame)
{
	ADM_assert(frame <= videoStream->getInfo()->nb_frames);

	GtkWidget *hbuttonbox1, *buttonOk, *scale;

	dialog = create_dialog1();
	
	scale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 110, 1, 10, 0)));
	gtk_widget_show (scale);
	gtk_box_pack_start (GTK_BOX(WID(vbox1)), scale, FALSE, TRUE, 0);

	hbuttonbox1 = gtk_hbutton_box_new ();
	gtk_widget_show (hbuttonbox1);
	gtk_box_pack_start (GTK_BOX(WID(vbox1)), hbuttonbox1, FALSE, TRUE, 0);
	gtk_button_box_set_layout (GTK_BUTTON_BOX(hbuttonbox1), GTK_BUTTONBOX_END);

	buttonOk = gtk_button_new_from_stock ("gtk-ok");
	gtk_widget_show(buttonOk);
	gtk_container_add (GTK_CONTAINER(hbuttonbox1), buttonOk);
	GTK_WIDGET_SET_FLAGS (buttonOk, GTK_CAN_DEFAULT);

	GLADE_HOOKUP_OBJECT (dialog, scale, "scale");
	GLADE_HOOKUP_OBJECT(dialog, hbuttonbox1, "hbuttonbox1");
	GLADE_HOOKUP_OBJECT(dialog, buttonOk, "buttonOk");	
	
	gtk_register_dialog(dialog);

	if (captionText)
		gtk_window_set_title(GTK_WINDOW(dialog), captionText);

	uint32_t width, height;

	width = videoStream->getInfo()->width;
	height = videoStream->getInfo()->height;

	gtk_signal_connect(GTK_OBJECT(WID(scale)), "value_changed", GTK_SIGNAL_FUNC(seekablePreview_frame_changed), NULL);
	gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event", GTK_SIGNAL_FUNC(seekablePreview_draw), NULL);
	gtk_dialog_add_action_widget(GTK_DIALOG(dialog), WID(buttonOk), GTK_RESPONSE_OK);

	gtk_widget_show(dialog);

	seekablePreview = new flySeekablePreview(width, height, videoStream, WID(drawingarea1), WID(scale));
	seekablePreview->process();
	seekablePreview->sliderSet(frame);
	seekablePreview->sliderChanged();

	int response;

	while((response = gtk_dialog_run(GTK_DIALOG(dialog))) == GTK_RESPONSE_APPLY)
	{
		seekablePreview_draw();
	}

	gtk_unregister_dialog(dialog);
	gtk_widget_destroy(dialog);
	delete seekablePreview;

	return (response == GTK_RESPONSE_OK);
}
Exemplo n.º 9
0
//*************************************************************
// Short cut for filter preview
// It is a modal blocking display of the datas given as arg
//*************************************************************
void GUI_PreviewShow(uint32_t w, uint32_t h, uint8_t *data)
{
                if(rgb_render)
                {
                        printf("\n Warning rgb render not null...\n");
                        delete [] rgb_render;
                        delete [] rgb_alternate;
                        rgb_alternate=NULL;
                        rgb_render=NULL;
                }
                ADM_assert(rgb_render=new uint8_t [w*h*4]);
                ADM_assert(rgb_alternate=new uint8_t [w*h*4]);
                uw=w;
                uh=h;
                rgbConv.reset(w,h); 
                dialog=create_dialog1();
                gtk_register_dialog(dialog);
                gtk_widget_set_usize (lookup_widget(dialog,"drawingarea1"),w,h);
                rgbConv.scale(data,rgb_render);
                gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
                       GTK_SIGNAL_FUNC(previewRender),    NULL);
                gtk_dialog_run(GTK_DIALOG(dialog));
                gtk_unregister_dialog(dialog);
                gtk_widget_destroy(dialog);
                delete [] rgb_render;
                delete [] rgb_alternate;
                rgb_alternate=NULL;
                rgb_render=NULL;
}
Exemplo n.º 10
0
uint8_t DIA_getDecombDecimate(DECIMATE_PARAM *param)
{
GtkWidget *dialog;
int ret=0;
	dialog=create_dialog1();
	
	// Update
	
	gtk_write_entry_float(WID(entryThresh),param->threshold);
	gtk_write_entry_float(WID(entry2),param->threshold2);
	
	MENU_SET(optionmenu1,mode);
	MENU_SET(optionmenu2,quality);
	SPIN_SET(spinbuttonCycle,cycle);
	
	gtk_register_dialog(dialog);
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{
		MENU_GET(optionmenu1,mode);
		MENU_GET(optionmenu2,quality);
		SPIN_GET(spinbuttonCycle,cycle);
		#define RD_ENTRY(x,y) {param->y=gtk_read_entry_float(WID(x));}
		RD_ENTRY(entryThresh,threshold);
		RD_ENTRY(entry2,threshold2);
		ret=1;
	
	}
        gtk_unregister_dialog(dialog);
	gtk_widget_destroy(dialog);
	return ret;
}
Exemplo n.º 11
0
DIA_progressIndexing::DIA_progressIndexing(char *name)
{
        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        gtk_label_set_text(GTK_LABEL(WID(labelName)),name);
        gtk_widget_show(dialog);

}
Exemplo n.º 12
0
int bsv_init(const char* config_path)
{
	config_win_ptr	= create_dialog1();
	if( !config_win_ptr ) {
		return -1;
	}

	return 0;
}
Exemplo n.º 13
0
DIA_working::DIA_working( void )
{
	GtkWidget *dialog;

	dialog=create_dialog1();
	gtk_transient(dialog);
	_priv=(void *)_priv;
	postCtor();
}
Exemplo n.º 14
0
uint8_t DIA_pipe(char **cmd,char **param)
{
	GtkWidget *dialog;

	char *str;
	uint8_t ret=0;

	gint r;

#define FILL_ENTRY(widget_name,value) {		 \
gtk_editable_delete_text(GTK_EDITABLE(lookup_widget(dialog,#widget_name)), 0,-1);\
gtk_editable_insert_text(GTK_EDITABLE(lookup_widget(dialog,#widget_name)), str, strlen(str), &r);}

	dialog=create_dialog1();
	gtk_transient(dialog);
	*cmd=NULL;
	*param=NULL;

	if(!prefs->get(PIPE_CMD,&str)) str=NULL;
	if(str)
	{
		FILL_ENTRY(entryName,left);
	}
	if(!prefs->get(PIPE_PARAM,&str)) str=NULL;
	if(str)
	{
		FILL_ENTRY(entryParam,left);
	}

	ret=0;
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{

		// gchar *s;
		// uint32_t val1;
#define READ_ENTRY(widget_name)   gtk_editable_get_chars(GTK_EDITABLE (lookup_widget(dialog,#widget_name)), 0, -1);

			str=READ_ENTRY(entryName);
			if(strlen(str))
			{
				*cmd=ADM_strdup(str);;
				prefs->set(PIPE_CMD,str);
			}
			str=READ_ENTRY(entryName);
			if(strlen(str))
			{
				*param=ADM_strdup(str);;
				prefs->set(PIPE_PARAM,str);
			}
			ret=1;
	}

	gtk_widget_destroy(dialog);

	return ret;

}
Exemplo n.º 15
0
uint8_t DIA_contrast(AVDMGenericVideoStream *in,CONTRAST_PARAM *param)
{
  
   uint32_t width,height;
      uint8_t ret=0;
        // Allocate space for green-ised video
        width=in->getInfo()->width;
        height=in->getInfo()->height;

        dialog=create_dialog1();
		gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
									GTK_RESPONSE_OK,
									GTK_RESPONSE_CANCEL,
									-1);
        gtk_register_dialog(dialog);
        gtk_window_set_title (GTK_WINDOW (dialog), QT_TR_NOOP("Contrast"));
        gtk_widget_show(dialog);	
        
          // and value changed
#define CNX(x,y) gtk_signal_connect(GTK_OBJECT(WID(x)), y, GTK_SIGNAL_FUNC(gui_update), (void *) (1));

        CNX (checkLuma, "toggled");
        CNX (checkbuttonU, "toggled");
        CNX (checkbuttonV, "toggled");
        
        
        CNX (hscaleContrast, "value_changed");
        CNX (hscaleContrast, "drag_data_received");
      
        CNX (hscaleBright, "value_changed");
        CNX (hscaleBright, "drag_data_received");
        gtk_signal_connect(GTK_OBJECT(WID(hscale1)), "value_changed",GTK_SIGNAL_FUNC(frame_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
            GTK_SIGNAL_FUNC(gui_draw),
            NULL);


          
        myCrop=new flyContrast( width, height,in,WID(drawingarea1),WID(hscale1));
        memcpy(&(myCrop->param),param,sizeof(CONTRAST_PARAM));
        myCrop->upload();
        myCrop->sliderChanged();
        ret=0;
        int response;
        response=gtk_dialog_run(GTK_DIALOG(dialog));

        if(response==GTK_RESPONSE_OK)
        {
            myCrop->download();
            memcpy(param,&(myCrop->param),sizeof(CONTRAST_PARAM));
            ret=1;
        }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        delete myCrop;
        return ret;
}
Exemplo n.º 16
0
/**
      \fn DIA_srtPos
      \brief Dialog that handles subtitle size and position
*/
int DIA_srtPos(AVDMGenericVideoStream *in,uint32_t *size,uint32_t *position)
{
  uint8_t ret=0;
  
        uint32_t width,height;

        // Allocate space for green-ised video
        width=in->getInfo()->width;
        height=in->getInfo()->height;

        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        gtk_window_set_title (GTK_WINDOW (dialog), QT_TR_NOOP("Subtitle Size and Position"));
        gtk_widget_show(dialog);
	
        myCrop=new flySrtPos( width, height,in,WID(drawingarea1),WID(hscale1));
        myCrop->param.fontSize=*size;
        myCrop->param.position=*position;

        gtk_range_set_range(GTK_RANGE(WID(vscale1)),0,height-1);

        myCrop->upload();
        myCrop->sliderChanged();
        
        gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
            GTK_SIGNAL_FUNC(gui_draw),
            NULL);
        
        gtk_signal_connect (GTK_OBJECT(WID( spinbutton1)), "value_changed",
                    GTK_SIGNAL_FUNC (gui_update),
                    NULL);
        
         gtk_signal_connect (GTK_OBJECT(WID( hscale1)), "value_changed",
                    GTK_SIGNAL_FUNC (slider_update),
                    NULL);

          gtk_signal_connect (GTK_OBJECT(WID( vscale1)), "value_changed",
                    GTK_SIGNAL_FUNC (gui_update),
                    NULL);
       
        ret=0;
        int response;
        response=gtk_dialog_run(GTK_DIALOG(dialog));

        if(response==GTK_RESPONSE_OK)
        {
            myCrop->download();
            *size=myCrop->param.fontSize;
            *position=myCrop->param.position;
            ret=1;
        }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        delete myCrop;
        return ret;
}
Exemplo n.º 17
0
/**
	DiampegIndexer :
				mpegFile returns a pointer to the mpeg to index 's name
				indexFile rreturns a pointer to index name
				aid : audio id (C0--C7 for mpeg, 0--7 for AC3)
				already : if set to 1, use the prefilled entries

*/
int  DIA_mpegIndexer(char **mpegFile,char **indexFile,int *aid,int already)
{
    uint8_t ret=0;

    uint8_t	one_more_time=0;



    dialog=create_dialog1(one_more_time);
    gtk_transient(dialog);
    if(already)
    {
        gtk_label_set_text(GTK_LABEL(lookup_widget(dialog,"label_index")),_indexName);
        gtk_label_set_text(GTK_LABEL(lookup_widget(dialog,"labelmpeg")),_mpegName);

    }

#define CONNECT(A,B)  gtk_signal_connect (GTK_OBJECT(lookup_widget(dialog,#A)), "clicked", \
		      GTK_SIGNAL_FUNC (B), (void *) NULL);

    CONNECT(button_mpeg,on_callback_mpeg);
    CONNECT(button_index,on_callback_index);
    CONNECT(button_scan,on_callback_scan);

    if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
    {
        *indexFile=_indexName;
        *mpegFile=_mpegName;
        // now grab AC3/mpeg ?
        *aid=0;
        if(TRUE==gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
                                              (lookup_widget(dialog,"radiobutton_mpeg"))))
        {
            *aid+=0xC0;
            *aid+=getRangeInMenu(optionmenuM);
        }
        if(TRUE==gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
                                              (lookup_widget(dialog,"radiobutton1"))))
        {
            *aid+=0xA0;
            *aid+=getRangeInMenu(optionmenuL);
        }
        if(TRUE==gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
                                              (lookup_widget(dialog,"radiobutton_ac3"))))
        {

            *aid+=getRangeInMenu(optionmenuA);
        }
        ret=1;

    }

    gtk_widget_destroy(dialog);

    return ret;
}
Exemplo n.º 18
0
//___________________________________________________________
uint8_t DIA_videoCodec( SelectCodecType *codec )
{
#define CONFIGURE 99
        uint8_t ret=0;
        SelectCodecType old=*codec;
        uint32_t nb;
        GtkWidget *widget[30];
        const char *name[30];
        GtkWidget *dialog;
        
        nb=encoderGetNbEncoder();
        
        dialog=create_dialog1();
        	
        gtk_register_dialog(dialog);
        COMPRES_PARAMS *desc=videoCodecGetDescriptor (*codec);
        if(!desc) return 0;
        
        // now set the input one
        int memo=0;
        for(uint32_t i=0;i<nb;i++)
        {
                name[i]=encoderGetIndexedName(i);
                gtk_combo_box_append_text      (GTK_COMBO_BOX (WID(combobox1)),name[i]);
                if(videoCodecGetDescriptorByIndex (i)==desc) memo=i;
        }
        gtk_combo_box_set_active(GTK_COMBO_BOX (WID(combobox1)),memo);
        gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonConf),CONFIGURE);
        int running=1;
        while(running)
          switch(gtk_dialog_run(GTK_DIALOG(dialog)))
        {
          case GTK_RESPONSE_OK:
          	{
                  ret=1;
                    int s=gtk_combo_box_get_active(GTK_COMBO_BOX (WID(combobox1)));
                    COMPRES_PARAMS *nw=videoCodecGetDescriptorByIndex (s);
                    *codec=nw->codec;
                    running=0;
                  break;
                }
          case CONFIGURE:
          {
            int s=gtk_combo_box_get_active(GTK_COMBO_BOX (WID(combobox1)));
            COMPRES_PARAMS *nw=videoCodecGetDescriptorByIndex (s);
            if(nw->configure) nw->configure(nw);
            break;
          }
          default:
                running=0;
                break;
        }
        gtk_widget_destroy(dialog);
        gtk_unregister_dialog(dialog);
        return ret;
} 
Exemplo n.º 19
0
void DIA_previewInit(uint32_t width, uint32_t height)
{
	dialog = create_dialog1();
	gtk_widget_set_usize(WID(drawingarea1), width, height);

	gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event", GTK_SIGNAL_FUNC(preview_draw), NULL);
	gtk_widget_show(dialog);

	preview = new flyPreview(width, height, WID(drawingarea1));
}
Exemplo n.º 20
0
DIA_working::DIA_working( const char *title )
{
GtkWidget *dialog;

	dialog=create_dialog1();
	gtk_transient(dialog);
	_priv=(void *)dialog;;
	gtk_window_set_title (GTK_WINDOW (dialog), title);
	postCtor();
}
Exemplo n.º 21
0
/**
 * 		\fn DIA_getEQ2Param
 * 		\brief flyDialogGtk handling the mplayer EQ2 user Interface dialog.
 */
uint8_t DIA_getEQ2Param(Eq2_Param *param, AVDMGenericVideoStream *in)
{
uint8_t r=0;
uint32_t w,h;
        // Allocate space for green-ised video
        w=in->getInfo()->width;
        h=in->getInfo()->height;

        dialog=create_dialog1();
		gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
											GTK_RESPONSE_OK,
											GTK_RESPONSE_CANCEL,
											-1);
        gtk_register_dialog(dialog);
        gtk_widget_show(dialog);	
        
        myCrop=new flyEq2( w, h,in,WID(drawingarea1),WID(hscale1));
        memcpy(&(myCrop->param),param,sizeof(Eq2_Param));
        myCrop->upload();
        myCrop->sliderChanged();
        myCrop->update();
        
        int ret=0;
        int response;
        //-----------------------
        
#define HCONECT(x)  gtk_signal_connect(GTK_OBJECT(WID(hscale##x)), "value_changed",GTK_SIGNAL_FUNC(eq2_changed),   NULL);

        HCONECT(Brightness);
        HCONECT(Saturation);
        HCONECT(Contrast);

        HCONECT(Gamma);        
        HCONECT(GammaWeight);
        HCONECT(GammaR);
        HCONECT(GammaG);
        HCONECT(GammaB);
        gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event", GTK_SIGNAL_FUNC(draw),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(hscale1)), "value_changed",GTK_SIGNAL_FUNC(frame_changed),   NULL);
        //-----------------------
        response=gtk_dialog_run(GTK_DIALOG(dialog));

        if(response==GTK_RESPONSE_OK)
        {
            myCrop->download();
            memcpy(param,&(myCrop->param),sizeof(Eq2_Param));
            ret=1;
        }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        delete myCrop;
        myCrop=NULL;
        return ret;

}
Exemplo n.º 22
0
void GUI_encoderStart( void )
{
      	window=create_dialog1();
       	tobedestroyed=0;
       gtk_widget_show(window);
       timestart=getTime(0);
       lastTime=timestart;
       lastFrame=0;
       fps_average=0;
       UI_purge();
       UI_iconify();
}
Exemplo n.º 23
0
int bsv_init(const char* config_path)
{
	config_win_ptr	= create_dialog1();
	file_select_ptr	= create_fileselection1();
	if( !config_win_ptr || !file_select_ptr ) {
		sprintf(errstr.Error, "bsv_init: Error: Could not create dialog\n");
		return -1;
	}

	c_load(config_path);

	return 0;
}
Exemplo n.º 24
0
DIA_progressIndexing::DIA_progressIndexing(const char *name)
{
        dialog=create_dialog1();
        gtk_register_dialog(dialog);
        gtk_label_set_text(GTK_LABEL(WID(labelName)),name);
        gtk_widget_show(dialog);
        clock.reset();
        aborted=0;
        abted=0;
	_nextUpdate=0;
        gtk_signal_connect(GTK_OBJECT(dialog), "delete_event",
                       GTK_SIGNAL_FUNC(on_destroy_abort), (void *) this);

}
Exemplo n.º 25
0
void DIA_StartBusyDialog( void )
{
        
        busy=create_dialog1();
        gtk_signal_connect(GTK_OBJECT(busy), "delete_event",
                      GTK_SIGNAL_FUNC(on_destroy_abort), (void *) NULL);
        gtk_register_dialog(busy);
        gtk_widget_show(busy);
        
        UI_purge();
        
        ADM_usleep(500);
	
}
Exemplo n.º 26
0
uint8_t DIA_getPartial(PARTIAL_CONFIG *param,AVDMGenericVideoStream *son,AVDMGenericVideoStream *previous)
{
  
    GtkWidget *dialog;
    int ret=0,done=0;
    dialog=create_dialog1();
        
    // Update
    SPIN_SET(spinbuttonStart,_start);
    SPIN_SET(spinbuttonSize,_end);
    gtk_dialog_add_action_widget (GTK_DIALOG (dialog), WID(buttonConf), F_CONF);
    // Run
    gtk_register_dialog(dialog);
    while(!done)
    {
      switch(gtk_dialog_run(GTK_DIALOG(dialog)))
      {
          case F_CONF:
              printf("Poof\n");
              son->configure(previous);
              break;
          case GTK_RESPONSE_OK:
            {
              uint32_t s,e;
                s=SGET(spinbuttonStart);
                e=SGET(spinbuttonSize);
                if(e<s)
                {
                  GUI_Error_HIG("Bad parameters","The end frame must be after the start frame !"); 
                }
                else
                {
                  param->_start=s;
                  param->_end=e;
                  done=1;
                  ret=1;
                }
              }
                break;
            default:
              done=1;
              break;
                
        }
    }
    gtk_unregister_dialog(dialog);
    gtk_widget_destroy(dialog);
    return ret;
}
Exemplo n.º 27
0
//
//      Video is in YV12 Colorspace
//
//
uint8_t DIA_getASharp(ASHARP_PARAM *param, AVDMGenericVideoStream *in)
{
      uint32_t width,height;
      uint8_t ret=0;
        // Allocate space for green-ised video
        width=in->getInfo()->width;
        height=in->getInfo()->height;

        dialog=create_dialog1();
		gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),
									GTK_RESPONSE_OK,
									GTK_RESPONSE_CANCEL,
									-1);
        gtk_register_dialog(dialog);
        gtk_window_set_title (GTK_WINDOW (dialog), QT_TR_NOOP("ASHARP"));
        gtk_widget_show(dialog);

        gtk_signal_connect(GTK_OBJECT(WID(drawingarea1)), "expose_event",
            GTK_SIGNAL_FUNC(draw),
            NULL);
//
        gtk_signal_connect(GTK_OBJECT(WID(hscale1)), "value_changed",GTK_SIGNAL_FUNC(frame_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonT)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonD)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_signal_connect(GTK_OBJECT(WID(spinbuttonB)), "value_changed",GTK_SIGNAL_FUNC(hue_changed),   NULL);
        gtk_widget_show(dialog);

          
        myCrop=new flyASharp( width, height,in,WID(drawingarea1),WID(hscale1));
        memcpy(&(myCrop->param),param,sizeof(ASHARP_PARAM));
        myCrop->upload();
        myCrop->sliderChanged();
        ret=0;
        int response;
        response=gtk_dialog_run(GTK_DIALOG(dialog));

        if(response==GTK_RESPONSE_OK)
        {
            myCrop->download();
            memcpy(param,&(myCrop->param),sizeof(ASHARP_PARAM));
            ret=1;
        }
        gtk_unregister_dialog(dialog);
        gtk_widget_destroy(dialog);
        delete myCrop;
        return ret;
}
Exemplo n.º 28
0
//
//      Get crop parameters from GUI
//                         left, right, top, down , initial size
//
int getSmoothParams(	uint32_t *radius,uint32_t 	*stre)
{
//char 	string[50];
//gchar   *str;
static 	GtkWidget *resi;
//int 	ret;
uint32_t 	ir,is;

		ir=*radius;
		is=*stre;

		do
		{
			croplock=0;
			resi=create_dialog1();				
	  		gtk_widget_show(resi);

     		  	gtk_adjustment_set_value( GTK_ADJUSTMENT(blend_adj),(  gdouble  ) is );
    			gtk_signal_emit_by_name (GTK_OBJECT (blend_adj), "changed");
            		  	gtk_adjustment_set_value( GTK_ADJUSTMENT(radius_adj),(  gdouble  ) ir*2 );
    			gtk_signal_emit_by_name (GTK_OBJECT (radius_adj), "changed");

		while(!croplock)
		{
			gtk_main_iteration();
		}
		// now check parameters
		//
		if(1==croplock) //         ok button
		{
    			*radius= (uint32_t)floor(GTK_ADJUSTMENT(radius_adj)->value);
       		*radius=*radius/2;
       		*stre=is;
		}
		// cancel button
		if(croplock!=-1)
		{
		 	gtk_widget_destroy(resi);
		}
	}while(!croplock);
	// exit ok
	if(croplock==1)
	{
		return 1;
	}
  return 0;
}
Exemplo n.º 29
0
uint8_t DIA_RecentFiles( char **name )
{

uint8_t ret=0;
uint32_t nb_item;
const char **names;
GtkTreeIter   iter;

	dialog=create_dialog1();
	gtk_transient(dialog);
	tree=lookup_widget(dialog,"treeview1");
	gtk_signal_connect (GTK_OBJECT (lookup_widget(dialog,"treeview1")),
				"row-activated", 
				GTK_SIGNAL_FUNC (on_action), 
				(void *)dialog);
	names=prefs->get_lastfiles();
// count
	for( nb_item=0;nb_item<4;nb_item++)
	{
		if(!names[nb_item]) break;
	}
//	printf("\n found %d old files \n",nb_item);
	if(!nb_item) return 0;
	for (uint32_t i = 0; i < nb_item; i++)
    	{
		gtk_list_store_append (store, &iter);
     		gtk_list_store_set (store, &iter,0,names[i],-1);
//		printf("\n appending %s\n",names[i]);
    	}

	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{
	uint32_t sel;
	
		if( (ret=getSelectionNumber(nb_item,tree  , store,&sel)))
		{
			*name=(char *)names[sel];
		}
	}
	gtk_widget_destroy(dialog);

	return ret;
}
Exemplo n.º 30
0
uint8_t DIA_lame(char **lame)
{
	GtkWidget *dialog;

	char *str;
	uint8_t ret=0;

	gint r;

#define FILL_ENTRY(widget_name,value) {		 \
gtk_editable_delete_text(GTK_EDITABLE(lookup_widget(dialog,#widget_name)), 0,-1);\
gtk_editable_insert_text(GTK_EDITABLE(lookup_widget(dialog,#widget_name)), str, strlen(str), &r);}

	dialog=create_dialog1();
	gtk_transient(dialog);
	*lame=NULL;

	if(!prefs->get(LAME_CLI,&str)) str=NULL;
	if(str)
	{
		FILL_ENTRY(entry1,left);
	}
	ret=0;
	if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
	{

#define READ_ENTRY(widget_name)   gtk_editable_get_chars(GTK_EDITABLE (lookup_widget(dialog,#widget_name)), 0, -1);

			str=READ_ENTRY(entry1);
			if(strlen(str))
			{
				*lame=ADM_strdup(str);;
				prefs->set(LAME_CLI,str);
			}
			ret=1;
	}

	gtk_widget_destroy(dialog);

	return ret;

}