~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_dialog/DIA_clean.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-12-15 17:13:20 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061215171320-w79pvpehxx2fr217
Tags: 1:2.3.0-0.0ubuntu1
* Merge from debian-multimedia.org, remaining Ubuntu change:
  - desktop file,
  - no support for ccache and make -j.
* Closes Ubuntu: #69614.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          ADM_guiClean.cpp  -  description
 
3
                             -------------------
 
4
    begin                : Sun Apr 14 2002
 
5
    copyright            : (C) 2002 by mean
 
6
    email                : fixounet@free.fr
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
#include "config.h"
 
18
 
 
19
 /*
 
20
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 
21
 */
 
22
#include <stdio.h>
 
23
#include <stdlib.h>
 
24
#include <string.h>
 
25
 
 
26
#include <math.h>
 
27
 
 
28
#include <gtk/gtk.h>
 
29
#include <time.h>
 
30
#include <sys/time.h>
 
31
 
 
32
#include <ADM_assert.h>
 
33
#include "fourcc.h"
 
34
#include "avio.hxx"
 
35
#include "avi_vars.h"
 
36
#ifdef HAVE_ENCODER
 
37
 
 
38
 
 
39
#include "ADM_editor/ADM_edit.hxx"
 
40
#include "ADM_video/ADM_genvideo.hxx"
 
41
#include "ADM_video/ADM_vidClean.h"
 
42
 
 
43
 
 
44
 
 
45
static int getSmoothParams(     uint32_t *w,uint32_t    *w2);
 
46
static GtkWidget  *create_dialog1 (void);
 
47
 
 
48
static GtkObject *blend_adj;
 
49
static GtkObject *radius_adj;
 
50
 
 
51
 
 
52
uint8_t AVDMVideoSmooth::configure( AVDMGenericVideoStream *instream)
 
53
{
 
54
UNUSED_ARG(instream);
 
55
 
 
56
SMOOTH_PARAMS *par;
 
57
        
 
58
//      par=_param;
 
59
        //return((uint8_t)getSmoothParams(&par->radius,&par->blend));
 
60
        return 1;
 
61
#warning FIXME , CODE REMOVED AMD64/GCC4
 
62
}
 
63
 
 
64
#if 0
 
65
//
 
66
//      Get crop parameters from GUI
 
67
//                         left, right, top, down , initial size
 
68
//
 
69
int getSmoothParams(    uint32_t *radius,uint32_t       *stre)
 
70
{
 
71
static  GtkWidget *resi;
 
72
uint32_t        ir,is;
 
73
int             r=0;
 
74
 
 
75
                ir=*radius;
 
76
                is=*stre;
 
77
 
 
78
                resi=create_dialog1();
 
79
                gtk_widget_show(resi);
 
80
                gtk_adjustment_set_value( GTK_ADJUSTMENT(blend_adj),(  gdouble  ) is );
 
81
                gtk_adjustment_set_value( GTK_ADJUSTMENT(radius_adj),(  gdouble  ) ir*2 );
 
82
 
 
83
                int response;
 
84
                response=gtk_dialog_run(GTK_DIALOG(dialog));
 
85
 
 
86
                if(response==GTK_REPLY_OK)
 
87
                {
 
88
                        *radius= (uint32_t)floor(GTK_ADJUSTMENT(radius_adj)->value);
 
89
                        *radius=*radius/2;
 
90
                        *stre=is;
 
91
                        r=1;
 
92
                }
 
93
                gtk_widget_destroy(resi);
 
94
                return r;
 
95
}
 
96
//
 
97
//
 
98
//
 
99
//
 
100
 
 
101
 
 
102
GtkWidget*
 
103
create_dialog1 (void)
 
104
{
 
105
  GtkWidget *dialog1;
 
106
  GtkWidget *dialog_vbox1;
 
107
  GtkWidget *vbox1;
 
108
  GtkWidget *accellabel1;
 
109
  GtkWidget *hscale1;
 
110
  GtkWidget *label1;
 
111
  GtkWidget *hscale2;
 
112
  GtkWidget *dialog_action_area1;
 
113
  GtkWidget *hbox1;
 
114
  GtkWidget *button_ok;
 
115
  GtkWidget *button_ko;
 
116
  GtkWidget *button_preview;
 
117
 
 
118
  dialog1 = gtk_dialog_new ();
 
119
  gtk_object_set_data (GTK_OBJECT (dialog1), "dialog1", dialog1);
 
120
  gtk_window_set_title (GTK_WINDOW (dialog1), "Clean smoother");
 
121
  gtk_window_set_policy (GTK_WINDOW (dialog1), TRUE, TRUE, FALSE);
 
122
   gtk_window_set_modal(GTK_WINDOW(dialog1), TRUE);
 
123
  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
 
124
  gtk_object_set_data (GTK_OBJECT (dialog1), "dialog_vbox1", dialog_vbox1);
 
125
 
 
126
  gtk_widget_show (dialog_vbox1);
 
127
 
 
128
  vbox1 = gtk_vbox_new (FALSE, 0);
 
129
  gtk_widget_ref (vbox1);
 
130
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "vbox1", vbox1,
 
131
                            (GtkDestroyNotify) gtk_widget_unref);
 
132
  gtk_widget_show (vbox1);
 
133
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
 
134
 
 
135
  accellabel1 = gtk_accel_label_new ("Diameter");
 
136
  gtk_widget_ref (accellabel1);
 
137
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "accellabel1", accellabel1,
 
138
                            (GtkDestroyNotify) gtk_widget_unref);
 
139
  gtk_widget_show (accellabel1);
 
140
  gtk_box_pack_start (GTK_BOX (vbox1), accellabel1, FALSE, FALSE, 0);
 
141
 
 
142
  radius_adj=gtk_adjustment_new (2, 2, 10, 1, 1, 1);
 
143
 
 
144
  hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (radius_adj));
 
145
  gtk_widget_ref (hscale1);
 
146
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "hscale1", hscale1,
 
147
                            (GtkDestroyNotify) gtk_widget_unref);
 
148
  gtk_widget_show (hscale1);
 
149
  gtk_box_pack_start (GTK_BOX (vbox1), hscale1, TRUE, TRUE, 0);
 
150
 
 
151
  gtk_scale_set_digits(GTK_SCALE(hscale1),0);
 
152
 
 
153
  label1 = gtk_label_new ("Blend amount");
 
154
  gtk_widget_ref (label1);
 
155
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "label1", label1,
 
156
                            (GtkDestroyNotify) gtk_widget_unref);
 
157
  gtk_widget_show (label1);
 
158
  gtk_box_pack_start (GTK_BOX (vbox1), label1, FALSE, FALSE, 0);
 
159
 
 
160
  blend_adj= gtk_adjustment_new (1, 1, 10, 1, 1, 1);
 
161
  hscale2 = gtk_hscale_new (GTK_ADJUSTMENT (blend_adj));
 
162
  gtk_widget_ref (hscale2);
 
163
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "hscale2", hscale2,
 
164
                            (GtkDestroyNotify) gtk_widget_unref);
 
165
   gtk_scale_set_digits(GTK_SCALE(hscale2),0);
 
166
 
 
167
  gtk_widget_show (hscale2);
 
168
  gtk_box_pack_start (GTK_BOX (vbox1), hscale2, TRUE, TRUE, 0);
 
169
 
 
170
  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
 
171
  gtk_object_set_data (GTK_OBJECT (dialog1), "dialog_action_area1", dialog_action_area1);
 
172
  gtk_widget_show (dialog_action_area1);
 
173
  gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 10);
 
174
 
 
175
  hbox1 = gtk_hbox_new (FALSE, 0);
 
176
  gtk_widget_ref (hbox1);
 
177
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "hbox1", hbox1,
 
178
                            (GtkDestroyNotify) gtk_widget_unref);
 
179
  gtk_widget_show (hbox1);
 
180
  gtk_box_pack_start (GTK_BOX (dialog_action_area1), hbox1, TRUE, TRUE, 0);
 
181
 
 
182
  button_ok = gtk_button_new_with_label ("OK");
 
183
  gtk_widget_ref (button_ok);
 
184
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "button_ok", button_ok,
 
185
                            (GtkDestroyNotify) gtk_widget_unref);
 
186
  gtk_widget_show (button_ok);
 
187
  gtk_box_pack_start (GTK_BOX (hbox1), button_ok, FALSE, FALSE, 0);
 
188
 
 
189
  button_ko = gtk_button_new_with_label ("Cancel");
 
190
  gtk_widget_ref (button_ko);
 
191
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "button_ko", button_ko,
 
192
                            (GtkDestroyNotify) gtk_widget_unref);
 
193
  gtk_widget_show (button_ko);
 
194
  gtk_box_pack_start (GTK_BOX (hbox1), button_ko, FALSE, FALSE, 0);
 
195
 
 
196
  button_preview = gtk_button_new_with_label ("Preview");
 
197
  gtk_widget_ref (button_preview);
 
198
  gtk_object_set_data_full (GTK_OBJECT (dialog1), "button_preview", button_preview,
 
199
                            (GtkDestroyNotify) gtk_widget_unref);
 
200
  gtk_widget_show (button_preview);
 
201
  gtk_box_pack_start (GTK_BOX (hbox1), button_preview, TRUE, FALSE, 0);
 
202
 
 
203
  gtk_signal_connect (GTK_OBJECT (button_ok), "clicked",
 
204
                      GTK_SIGNAL_FUNC (gui_ok),
 
205
                      (void *)1);
 
206
  gtk_signal_connect (GTK_OBJECT (button_ko), "clicked",
 
207
                      GTK_SIGNAL_FUNC (gui_ok),
 
208
                      (void *)0);
 
209
 
 
210
 
 
211
 
 
212
  return dialog1;
 
213
}
 
214
 
 
215
#endif
 
216
#endif 
 
217