rev |
line source |
pankso@286
|
1 #!/bin/sh
|
pankso@31
|
2 #
|
pankso@286
|
3 # Gtkdialog box to burn CD or DVD using Wodim with basic options. Burnbox
|
pankso@286
|
4 # can burn ISO images, blank rewritable CD or create audio CD with WAV.
|
pankso@286
|
5 #
|
pankso@286
|
6 # (c) - SliTaz GNU/Linux 2009 - GNU GPL v3
|
jozee@345
|
7
|
jozee@345
|
8 # Authors : Christophe Lincoln <pankso@slitaz.org>
|
jozee@345
|
9 # Rohit Joshi <jozee@slitaz.org>
|
pankso@31
|
10 #
|
jozee@438
|
11 VERSION=20100315
|
jozee@345
|
12 TMPDIR="/tmp/burn-cd"
|
jozee@345
|
13
|
jozee@345
|
14 chk_install()
|
jozee@345
|
15 {
|
jozee@345
|
16 for pkg in $@
|
jozee@345
|
17 do
|
jozee@345
|
18 if [ ! -d /var/lib/tazpkg/installed/${pkg} ]; then
|
jozee@345
|
19 UNINSTALLED="$UNINSTALLED $pkg"
|
jozee@345
|
20 fi
|
jozee@345
|
21 done
|
jozee@345
|
22 if [ ! "$UNINSTALLED" = "" ] ; then
|
jozee@438
|
23 xterm -geometry 80x16 -title "INSTALL PACKAGE" \
|
paul@394
|
24 -e "echo -n \"This option depends on $UNINSTALLED. Please install and try again..\"; sleep 4;"
|
jozee@345
|
25 fi
|
jozee@345
|
26 }
|
pankso@31
|
27
|
jozee@438
|
28 # Auto Install DEPENDS and/or SUGGESTED
|
jozee@438
|
29 install()
|
jozee@438
|
30 {
|
jozee@438
|
31 #echo "pkgs to install: $1"
|
jozee@438
|
32 for pkg in $1 ; do
|
jozee@438
|
33 # Avoid reinstall
|
jozee@438
|
34 if [ ! -d /var/lib/tazpkg/installed/"$pkg" ]; then
|
jozee@438
|
35 xterm -geometry 80x16 -title "INSTALL PACKAGE" \
|
jozee@438
|
36 -e " echo \"This option depends on $pkg. Installing $pkg as root: \" ; subox tazpkg get-install $pkg --forced; sleep 2;
|
jozee@438
|
37 echo -e \"----\nPress ENTER to close and PROCEED with decoding...\"; read i; exit 0; "
|
jozee@438
|
38 fi
|
jozee@438
|
39 done
|
jozee@438
|
40
|
jozee@438
|
41 }
|
jozee@438
|
42
|
jozee@366
|
43
|
jozee@366
|
44 # Check read write permission for device.
|
jozee@366
|
45 chk_rw_permissions()
|
jozee@366
|
46 {
|
jozee@438
|
47 xterm -geometry 80x16 -title "Check Permission" \
|
jozee@366
|
48 -e '
|
jozee@366
|
49 if [ ! -r "$DEVICE" -o ! -w "$DEVICE" ]; then
|
jozee@438
|
50 echo "You dont have read write permission for $DEVICE; "
|
jozee@438
|
51 echo "Add yourself to group cdrom: addgroup tux cdrom"
|
jozee@366
|
52 else
|
paul@394
|
53 echo "You have read write permission for $DEVICE. You can proceed to burn."
|
jozee@366
|
54 fi
|
jozee@366
|
55 sleep 3;
|
jozee@366
|
56 '
|
jozee@366
|
57 }
|
jozee@366
|
58
|
pankso@286
|
59 # Display audio cd size.
|
pankso@286
|
60 audio_cd_stats()
|
pankso@286
|
61 {
|
jozee@345
|
62 AUDIO_CD_SIZE=`du -m $TMPDIR | awk '{print $1}'`
|
jozee@345
|
63 TRACK_NB=`ls -1 $TMPDIR | wc -l`
|
jozee@438
|
64 echo -n "Total $TRACK_NB tracks: $AUDIO_CD_SIZE Mb"
|
jozee@345
|
65 }
|
jozee@345
|
66
|
jozee@366
|
67
|
pankso@286
|
68 decode_ogg()
|
pankso@286
|
69 {
|
jozee@345
|
70 if ls $TMPDIR | grep -q .ogg; then
|
jozee@345
|
71 cd $TMPDIR
|
jozee@438
|
72 xterm -geometry 80x16 -title "Oggdec" \
|
pankso@286
|
73 -e 'for i in *.ogg; do oggdec "$i" && rm "$i"; done; sleep 2'
|
pankso@286
|
74 fi
|
pankso@286
|
75 }
|
pankso@286
|
76
|
jozee@345
|
77 decode_mp3()
|
jozee@345
|
78 {
|
jozee@345
|
79
|
jozee@345
|
80 if ls $TMPDIR | grep -q .mp3; then
|
jozee@345
|
81 cd $TMPDIR
|
jozee@438
|
82 install "mpg123"
|
jozee@438
|
83
|
jozee@438
|
84 xterm -geometry 80x16 -title "mpg123" \
|
jozee@345
|
85 -e 'for file in *.mp3; do
|
jozee@438
|
86 mpg123 --rate 44100 --stereo --buffer 3072 --resync -w `basename "$file" .mp3`.wav "$file" && rm -f "$file";
|
jozee@438
|
87 done; sleep 2'
|
jozee@345
|
88 fi
|
jozee@345
|
89 }
|
jozee@345
|
90
|
jozee@345
|
91 decode_video()
|
jozee@345
|
92 {
|
jozee@345
|
93 # convert videos into a VCD/SVCD/DVD compatible mpg video format
|
jozee@345
|
94 if ls $TMPDIR | grep -q ".avi\|.mov\|.wmv\|.flv" ; then
|
jozee@345
|
95 cd $TMPDIR
|
jozee@438
|
96 install "ffmpeg"
|
jozee@345
|
97
|
jozee@438
|
98 xterm -geometry 80x16 -title "ffmpeg" \
|
jozee@345
|
99 -e ' echo -n "Select target type (pal-vcd ntsc-vcd pal-svcd ntsc-svcd pal-dvd ntsc-dvd) "; read TARGET_OPTIONS
|
jozee@345
|
100 for file in *.avi *.wmv *.mov *.flv; do
|
jozee@345
|
101 ext=`echo "${file##*.}"`
|
jozee@345
|
102 output_file=`basename "$file" .$ext`.mpg
|
jozee@345
|
103 ffmpeg -i "$file" -target "$TARGET_OPTIONS" "$output_file" && rm "$file";
|
jozee@345
|
104 done; sleep 2;
|
jozee@345
|
105 '
|
jozee@345
|
106 fi
|
jozee@345
|
107
|
jozee@345
|
108
|
jozee@345
|
109 }
|
jozee@345
|
110
|
jozee@345
|
111 # convert spaces in filename with _ and remove special characters "()'&" {}\! and translate uppercase to lowercase
|
jozee@345
|
112 fix_filename()
|
jozee@345
|
113 {
|
jozee@345
|
114 ls /tmp/burn-cd/* | while read file
|
jozee@345
|
115 do
|
jozee@345
|
116 mv "$file" `echo $file | tr ' ' '_' | tr -d '[{}(),\!&]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/_-_/_/g' `
|
jozee@345
|
117 done
|
jozee@345
|
118
|
jozee@345
|
119 }
|
jozee@345
|
120
|
pankso@286
|
121 # We must think about " space " between directory/track and
|
pankso@286
|
122 # filter directory copy to avoid copying other files than audio.
|
pankso@286
|
123 # Only burning non-compressed wav format is supported directly.
|
jozee@345
|
124
|
pankso@286
|
125 copy_audio_file()
|
pankso@286
|
126 {
|
pankso@286
|
127 if ls "$NEW_TRACK" | grep -q .ogg; then
|
jozee@345
|
128 cp "${NEW_TRACK%.ogg}.ogg" $TMPDIR
|
jozee@345
|
129 fix_filename
|
jozee@345
|
130 decode_ogg
|
jozee@345
|
131 elif ls "$NEW_TRACK" | grep -q ".[m\|M][p\|P]3"; then
|
jozee@345
|
132 # cp "${NEW_TRACK%.mp3}.mp3" $TMPDIR
|
jozee@345
|
133 cp "$NEW_TRACK" "$TMPDIR"
|
jozee@345
|
134 fix_filename
|
jozee@345
|
135 decode_mp3
|
pankso@286
|
136 else
|
jozee@345
|
137 cp "${NEW_TRACK%.wav}.wav" $TMPDIR
|
pankso@286
|
138 fi
|
pankso@286
|
139 }
|
jozee@345
|
140
|
jozee@345
|
141
|
pankso@286
|
142 copy_audio_dir()
|
pankso@286
|
143 {
|
jozee@345
|
144
|
jozee@345
|
145 for i in .wav .ogg .mp3
|
pankso@286
|
146 do
|
jozee@345
|
147 cp "$NEW_DIR"/*$i $TMPDIR 2>/dev/null
|
pankso@286
|
148 done
|
jozee@345
|
149 fix_filename
|
jozee@345
|
150 decode_ogg
|
jozee@345
|
151 decode_mp3
|
pankso@286
|
152 }
|
pankso@286
|
153
|
jozee@345
|
154 # Only burning mpg video format is supported directly. MPEG-1 video for vcd and MPEG-2 for svcd and dvd
|
jozee@345
|
155 copy_video_file()
|
jozee@345
|
156 {
|
jozee@345
|
157 if ls "$NEW_TRACK" | grep -q ".mpg\|.mpeg"; then
|
jozee@345
|
158 cp "${NEW_TRACK%.mp*}.mpg" $TMPDIR
|
jozee@345
|
159 elif ls "$NEW_TRACK" | grep -q ".avi\|.mov\|.wmv\|.flv"; then
|
jozee@345
|
160 ext=`echo "${NEW_TRACK##*.}"`
|
jozee@345
|
161 cp "${NEW_TRACK%.$ext}.$ext" $TMPDIR
|
jozee@345
|
162 fix_filename
|
jozee@345
|
163 if "$CHECKBOX_DECODE" ; then decode_video ; fi
|
jozee@345
|
164 else
|
jozee@345
|
165 echo "mpg format supported"
|
jozee@345
|
166 fi
|
jozee@345
|
167 }
|
jozee@345
|
168
|
jozee@345
|
169 copy_video_dir()
|
jozee@345
|
170 {
|
jozee@345
|
171 for i in .mpg .avi .mov .wmv .mpeg .flv
|
jozee@345
|
172 do
|
jozee@345
|
173 cp "$NEW_DIR"/*$i $TMPDIR 2>/dev/null
|
jozee@345
|
174 done
|
jozee@345
|
175 fix_filename
|
jozee@345
|
176 if "$CHECKBOX_DECODE" ; then decode_video ; fi
|
jozee@345
|
177 }
|
jozee@345
|
178
|
jozee@345
|
179 copy_file()
|
jozee@345
|
180 {
|
jozee@345
|
181 case "$BURN_MODE" in
|
jozee@345
|
182 audio-cd)
|
jozee@345
|
183 copy_audio_file ;;
|
jozee@345
|
184 vcd|svcd|video-dvd)
|
jozee@345
|
185 copy_video_file ;;
|
jozee@345
|
186 *)
|
jozee@345
|
187 cp "$NEW_TRACK" $TMPDIR ; fix_filename ;;
|
jozee@345
|
188 esac
|
jozee@345
|
189
|
jozee@345
|
190 }
|
jozee@345
|
191
|
jozee@345
|
192 copy_dir()
|
jozee@345
|
193 {
|
jozee@345
|
194 case "$BURN_MODE" in
|
jozee@345
|
195 audio-cd)
|
jozee@345
|
196 copy_audio_dir ;;
|
jozee@345
|
197 vcd|svcd|video-dvd)
|
jozee@345
|
198 copy_video_dir ;;
|
jozee@345
|
199 *)
|
jozee@345
|
200 cp "$NEW_DIR" $TMPDIR 2>/dev/null
|
jozee@345
|
201 fix_filename ;;
|
jozee@345
|
202 esac
|
jozee@345
|
203 }
|
jozee@345
|
204 # =====ISO=====
|
pankso@286
|
205 burn_iso()
|
pankso@286
|
206 {
|
jozee@438
|
207 xterm -geometry 80x16 -title "Wodim" \
|
pascal@499
|
208 -e "wodim -v speed=$SPEED dev=$DEVICE $OPTIONS '$ISO_IMAGE'; sleep 4
|
jozee@366
|
209 "
|
pankso@286
|
210 }
|
jozee@345
|
211 # =====AUDIO=====
|
pankso@286
|
212 # Use -pad to avoid file size error.
|
pankso@286
|
213 burn_audio()
|
pankso@286
|
214 {
|
jozee@438
|
215
|
jozee@438
|
216 install "cdrkit"
|
jozee@438
|
217 xterm -geometry 80x16 -title "Wodim:AUDIO" \
|
jozee@345
|
218 -e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;
|
jozee@366
|
219 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -audio $TMPDIR/*.wav; sleep 4
|
jozee@366
|
220
|
jozee@345
|
221 "
|
jozee@345
|
222 }
|
jozee@345
|
223 # =====DATA=====
|
jozee@345
|
224 burn_cddata()
|
jozee@345
|
225 {
|
jozee@438
|
226
|
jozee@438
|
227 install "cdrkit"
|
jozee@438
|
228
|
jozee@438
|
229 xterm -geometry 80x16 -title "Wodim:CD DATA" \
|
jozee@345
|
230 -e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;
|
jozee@366
|
231 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao -data $TMPDIR/*; sleep 4
|
jozee@366
|
232
|
jozee@345
|
233 "
|
jozee@366
|
234
|
pankso@286
|
235 }
|
pankso@286
|
236
|
jozee@345
|
237 burn_dvddata()
|
jozee@345
|
238 {
|
jozee@366
|
239 # For multisession support, remove --dvd-compat option
|
jozee@438
|
240 install "dvd+rw-tools"
|
jozee@438
|
241
|
jozee@438
|
242 xterm -geometry 80x16 -title "growisofs:DVD DATA" \
|
jozee@345
|
243 -e " echo \"BURN TYPE SELECTED = $BURN_MODE \"; sleep 1;
|
jozee@345
|
244 # no iso-file available
|
jozee@345
|
245 growisofs -dvd-compat -speed=$SPEED -pad -J -r -f -Z $DEVICE $TMPDIR/*; sleep 4
|
jozee@345
|
246 "
|
jozee@345
|
247 }
|
jozee@345
|
248
|
jozee@345
|
249 # ====VIDEO=====
|
jozee@345
|
250 burn_dvdvideo()
|
jozee@345
|
251 {
|
jozee@438
|
252
|
jozee@438
|
253 install "dvd+rw-tools"
|
jozee@345
|
254
|
jozee@345
|
255 # current assumption: compatible dvd-video format
|
jozee@438
|
256 xterm -geometry 80x16 -title "growisofs:DVD VIDEO" \
|
jozee@345
|
257 -e " echo \"BURN TYPE SELECTED = $BURN_MODE\"; sleep 1;
|
jozee@345
|
258 growisofs -dvd-video -udf -pad -J -r -f -Z $DEVICE -speed=$SPEED $TMPDIR/*; sleep 2
|
jozee@345
|
259 "
|
jozee@438
|
260
|
jozee@345
|
261 }
|
jozee@366
|
262
|
jozee@345
|
263 burn_vcd()
|
jozee@345
|
264 {
|
jozee@438
|
265
|
jozee@438
|
266 install "vcdimager"
|
jozee@438
|
267
|
jozee@438
|
268 mkdir -p $TMPDIR/vcd
|
jozee@438
|
269 xterm -geometry 80x16 -title "vcdimager:VCD" \
|
jozee@345
|
270 -e " echo \"BURN TYPE SELECTED = $BURN_MODE $UNINSTALLED \"; sleep 1;
|
jozee@438
|
271 vcdimager -t vcd2 -l VCD -c $TMPDIR/vcd/vcd.cue -b $TMPDIR/vcd/vcd.bin $TMPDIR/*.mpg; sleep 2;
|
jozee@345
|
272 # cdrdao write --device $DEVICE $TMPDIR/vcd/vcd.cue; sleep 2
|
jozee@345
|
273 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao cuefile=$TMPDIR/vcd/vcd.cue ; sleep 2
|
jozee@345
|
274 "
|
jozee@438
|
275
|
jozee@345
|
276
|
jozee@345
|
277 }
|
jozee@345
|
278
|
jozee@345
|
279 burn_svcd()
|
jozee@345
|
280 {
|
jozee@438
|
281
|
jozee@438
|
282 install "vcdimager"
|
jozee@438
|
283
|
jozee@438
|
284 mkdir -p $TMPDIR/svcd
|
jozee@438
|
285 xterm -geometry 80x16 -title "vcdimager:SVCD" \
|
jozee@345
|
286 -e " echo \"BURN TYPE SELECTED = $BURN_MODE\"
|
jozee@345
|
287 vcdimager -t svcd -l SVCD -c $TMPDIR/svcd/svcd.cue -b $TMPDIR/svcd/svcd.bin $TMPDIR/*.mpg; sleep 2;
|
jozee@345
|
288 # cdrdao write --device $DEVICE $TMPDIR/svcd/svcd.cue; sleep 2;
|
jozee@345
|
289 wodim -v speed=$SPEED dev=$DEVICE $OPTIONS -pad -dao cuefile=$TMPDIR/svcd/svcd.cue ; sleep 2
|
jozee@345
|
290 "
|
jozee@438
|
291
|
jozee@345
|
292 }
|
jozee@345
|
293
|
jozee@345
|
294 # =====CLONE=====
|
jozee@366
|
295
|
jozee@345
|
296 rip_disc()
|
jozee@345
|
297 {
|
jozee@345
|
298 SUGGESTED="cdrkit-isoinfo"
|
jozee@345
|
299 if ! "$CHECKBOX_FOLDER" ; then SAVE_DISC="/tmp/burn-cd" ; fi
|
jozee@345
|
300 if [ -d /var/lib/tazpkg/installed/${SUGGESTED} ]; then
|
jozee@438
|
301 xterm -geometry 80x16 -title "dd" \
|
jozee@366
|
302 -e ' echo "RIPPING DISC $DEVICE AT $SAVE_DISC..."
|
jozee@345
|
303 COUNT=`isoinfo -d -i $DEVICE | grep "^Volume size is:" | cut -d " " -f 4`
|
jozee@345
|
304 BLOCK=`isoinfo -d -i $DEVICE | grep "^Logical block size is:" | cut -d " " -f 5`
|
jozee@345
|
305 dd if=$DEVICE of=$SAVE_DISC/image.iso bs=$BLOCK count=$COUNT; sleep 4
|
jozee@366
|
306 sleep 2;
|
jozee@366
|
307 # eject ;
|
jozee@366
|
308 '
|
jozee@345
|
309 else
|
jozee@438
|
310 xterm -geometry 80x16 -title "dd" \
|
paul@394
|
311 -e ' echo "Though you dont have the cdrkit-isoinfo package installed, \
|
paul@394
|
312 you can still rip but it may be slower."
|
paul@394
|
313 echo -n "Would you like to continue (y/N)? : "; read ans
|
jozee@345
|
314 if [ "$ans" = "y" ]; then
|
jozee@366
|
315 echo "RIPPING DISC $DEVICE AT $SAVE_DISC...."
|
jozee@345
|
316 dd if=$DEVICE of=$SAVE_DISC/image.iso;
|
jozee@345
|
317 sleep 2;
|
jozee@366
|
318 #eject ;
|
jozee@345
|
319 fi
|
jozee@366
|
320 '
|
jozee@345
|
321 fi
|
jozee@345
|
322 if ! "$CHECKBOX_FOLDER" ; then
|
jozee@345
|
323 ISO_IMAGE="/tmp/burn-cd/image.iso"
|
jozee@438
|
324 xterm -geometry 80x16 -title "dd" \
|
jozee@366
|
325 -e ' echo -e " ---Please insert EMPTY DISC at $DEVICE ---\n ---press ENTER to continue..." && read close;'
|
jozee@345
|
326 burn_iso
|
jozee@345
|
327 fi
|
jozee@345
|
328 }
|
jozee@345
|
329
|
jozee@345
|
330 blank_dvd()
|
jozee@345
|
331 {
|
jozee@438
|
332 xterm -geometry 80x16 -title "growisofs:DVD ERASE" \
|
jozee@345
|
333 -e "growisofs -Z $DEVICE=/dev/zero"
|
jozee@345
|
334 }
|
jozee@345
|
335
|
jozee@345
|
336 burn_disc()
|
jozee@345
|
337 {
|
jozee@345
|
338 case "$BURN_MODE" in
|
jozee@345
|
339 audio*)
|
jozee@345
|
340 burn_audio ;;
|
jozee@345
|
341 data-cd*)
|
jozee@345
|
342 burn_cddata ;;
|
jozee@345
|
343 data-dvd*)
|
jozee@345
|
344 burn_dvddata;;
|
jozee@345
|
345 video*)
|
jozee@345
|
346 burn_dvdvideo;;
|
jozee@345
|
347 vcd*)
|
jozee@345
|
348 burn_vcd;;
|
jozee@345
|
349 svcd*)
|
jozee@345
|
350 burn_svcd;;
|
jozee@345
|
351 esac
|
jozee@345
|
352
|
jozee@345
|
353 }
|
jozee@366
|
354
|
jozee@438
|
355 track_list()
|
jozee@438
|
356 {
|
jozee@438
|
357 for file in `ls $TMPDIR` ; do
|
jozee@438
|
358 track_size=`du -m $TMPDIR/$file | awk '{print $1}'`
|
jozee@438
|
359 echo "$file | $track_size"
|
jozee@438
|
360 done
|
jozee@438
|
361 }
|
jozee@438
|
362
|
jozee@438
|
363 export BIN=$0
|
pankso@286
|
364 # Main GTK interface
|
pankso@286
|
365 MAIN_DIALOG='
|
pankso@286
|
366 <window title="SliTaz - Burnbox" icon-name="drive-optical">
|
pankso@286
|
367 <vbox>
|
pankso@286
|
368
|
jozee@438
|
369 <notebook labels=" Burn CD/DVD (Audio,Video,Data)| Backup Disc| Burn ISO | Help/Settings">
|
pankso@286
|
370
|
pankso@286
|
371 <vbox>
|
pankso@286
|
372 <tree icon_name="audio-x-generic">
|
pankso@286
|
373 <width>500</width><height>200</height>
|
pankso@286
|
374 <variable>TRACKS_LIST</variable>
|
jozee@438
|
375 <label>Track name (Double-click to remove a track) | Track Size (Mb)</label>
|
jozee@438
|
376 <input>$BIN track_list</input>
|
jozee@345
|
377 <action>rm "/tmp/burn-cd/$TRACKS_LIST"</action>
|
pankso@286
|
378 <action>refresh:TRACKS_LIST</action>
|
pankso@286
|
379 <action>refresh:TRACKS_SIZE</action>
|
pankso@286
|
380 </tree>'
|
jozee@438
|
381
|
jozee@345
|
382 # Select burn audio-cd, data-cd, dvd-video or vcd/svcd
|
jozee@345
|
383 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@345
|
384 <frame>
|
jozee@345
|
385 <hbox>
|
jozee@345
|
386 <text>
|
jozee@366
|
387 <label> Select Burn type: </label>
|
jozee@345
|
388 </text>
|
jozee@345
|
389 <combobox>'
|
jozee@345
|
390 tmp2="${MAIN_DIALOG}"
|
jozee@345
|
391 for i in audio-cd data-cd data-dvd video-dvd vcd svcd; do
|
jozee@345
|
392 [ "$i" = "$BURN_MODE" ] || tmp2="$tmp2<item>$i</item>"
|
jozee@345
|
393 done
|
jozee@345
|
394 tmp3='
|
jozee@345
|
395 <variable>BURN_MODE</variable>
|
jozee@345
|
396 </combobox>
|
jozee@345
|
397 <checkbox>
|
jozee@345
|
398 <label> Enable decoding video</label>
|
jozee@345
|
399 <variable>CHECKBOX_DECODE</variable>
|
jozee@345
|
400 <default>true</default>
|
jozee@345
|
401 </checkbox>
|
jozee@345
|
402 </hbox>
|
jozee@345
|
403 '
|
jozee@345
|
404 MAIN_DIALOG="$tmp2$tmp3"
|
pankso@286
|
405 # Select, add and burn audio buttons.
|
pankso@286
|
406 MAIN_DIALOG=${MAIN_DIALOG}"
|
pankso@286
|
407 <hbox>
|
pankso@286
|
408 <text>
|
jozee@345
|
409 <label> File: </label>
|
pankso@286
|
410 </text>
|
pankso@286
|
411 <entry accept=\"filename\">
|
jozee@345
|
412 <label>Select an Audio/Video/data track</label>
|
pankso@286
|
413 <variable>NEW_TRACK</variable>
|
pankso@286
|
414 </entry>
|
pankso@286
|
415 <button>
|
jozee@366
|
416 <label>Browse</label>
|
pankso@286
|
417 <input file stock=\"gtk-open\"></input>
|
pankso@286
|
418 <action type=\"fileselect\">NEW_TRACK</action>
|
pankso@286
|
419 </button>
|
pankso@286
|
420 <button>
|
pankso@286
|
421 <label>Add</label>
|
pankso@286
|
422 <input file stock=\"gtk-add\"></input>
|
jozee@345
|
423 <action>$0 copy_file</action>
|
pankso@286
|
424 <action>refresh:TRACKS_LIST</action>
|
jozee@345
|
425 <action>refresh:TRACKS_SIZE</action>
|
pankso@286
|
426 </button>
|
pankso@286
|
427 </hbox>
|
pankso@286
|
428 <hbox>
|
pankso@286
|
429 <text>
|
jozee@345
|
430 <label> Folder:</label>
|
pankso@286
|
431 </text>
|
pankso@286
|
432 <entry accept=\"directory\">
|
jozee@345
|
433 <label>Select an Audio/Video/Data track</label>
|
pankso@286
|
434 <variable>NEW_DIR</variable>
|
pankso@286
|
435 </entry>
|
pankso@286
|
436 <button>
|
jozee@366
|
437 <label>Browse</label>
|
pankso@286
|
438 <input file stock=\"gtk-open\"></input>
|
pankso@286
|
439 <action type=\"fileselect\">NEW_DIR</action>
|
pankso@286
|
440 </button>
|
pankso@286
|
441 <button>
|
pankso@286
|
442 <label>Add</label>
|
pankso@286
|
443 <input file stock=\"gtk-add\"></input>
|
jozee@345
|
444 <action>$0 copy_dir</action>
|
pankso@286
|
445 <action>refresh:TRACKS_LIST</action>
|
jozee@345
|
446
|
pankso@286
|
447 <action>refresh:TRACKS_SIZE</action>
|
pankso@286
|
448 </button>
|
jozee@345
|
449 </hbox>"
|
jozee@345
|
450
|
jozee@345
|
451 MAIN_DIALOG=${MAIN_DIALOG}"
|
pankso@286
|
452 <hbox>
|
pankso@286
|
453 <text>
|
pankso@286
|
454 <variable>TRACKS_SIZE</variable>
|
pankso@286
|
455 <input>$0 audio_cd_stats</input>
|
pankso@286
|
456 </text>
|
pankso@286
|
457 <button>
|
pankso@286
|
458 <label>Clean</label>
|
pankso@286
|
459 <input file stock=\"gtk-clear\"></input>
|
jozee@345
|
460 <action>rm -rf $TMPDIR/*</action>
|
pankso@286
|
461 <action>refresh:TRACKS_LIST</action>
|
pankso@286
|
462 <action>refresh:TRACKS_SIZE</action>
|
pankso@286
|
463 <action>clear:NEW_TRACK</action>
|
pankso@286
|
464 <action>clear:NEW_DIR</action>
|
pankso@286
|
465 </button>
|
pankso@286
|
466 <button>
|
jozee@366
|
467 <label>Burn disc</label>
|
pankso@286
|
468 <input file icon=\"forward\"></input>
|
jozee@345
|
469 <action>$0 burn_disc</action>
|
pankso@286
|
470 </button>
|
pankso@286
|
471 </hbox>
|
jozee@345
|
472 </frame>
|
jozee@345
|
473 </vbox> "
|
jozee@438
|
474
|
jozee@438
|
475 # Backup CD
|
jozee@438
|
476 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
477 <vbox>
|
jozee@438
|
478
|
jozee@438
|
479 <text use-markup="true">
|
jozee@438
|
480 <label>
|
jozee@438
|
481 "
|
jozee@438
|
482 <b>Choose either the Data or the Audio CD backup frame </b>
|
jozee@438
|
483 "
|
jozee@438
|
484 </label>
|
jozee@438
|
485 </text>
|
jozee@438
|
486
|
jozee@438
|
487 <frame Data CD/DVD backup >
|
jozee@438
|
488 <text>
|
jozee@438
|
489 <label>
|
jozee@438
|
490 " "
|
jozee@438
|
491 </label>
|
jozee@438
|
492 </text>
|
jozee@438
|
493 <checkbox>
|
jozee@438
|
494 <label>Save backup on Hard Disk Folder (Unselect to backup on CD disc)</label>
|
jozee@438
|
495 <variable>CHECKBOX_FOLDER</variable>
|
jozee@438
|
496 <default>true</default>
|
jozee@438
|
497 <action>if true enable:SAVE_DISC</action>
|
jozee@438
|
498 <action>if true enable:OPENBUTTON</action>
|
jozee@438
|
499 <action>if false disable:SAVE_DISC</action>
|
jozee@438
|
500 <action>if false disable:OPENBUTTON</action>
|
jozee@438
|
501 </checkbox>
|
jozee@438
|
502 <hbox>
|
jozee@438
|
503 <text use-markup="true">
|
jozee@438
|
504 <label>" Backup Folder Path:"</label>
|
jozee@438
|
505 </text>
|
jozee@438
|
506 <entry accept="directory">
|
jozee@438
|
507 <label>Select a folder to save cloned disc to</label>
|
jozee@438
|
508 <variable>SAVE_DISC</variable>
|
jozee@438
|
509 </entry>
|
jozee@438
|
510 <button>
|
jozee@438
|
511 <label>Browse</label>
|
jozee@438
|
512 <input file stock="gtk-open"></input>
|
jozee@438
|
513 <variable>OPENBUTTON</variable>
|
jozee@438
|
514 <action type="fileselect">SAVE_DISC</action>
|
jozee@438
|
515 </button>
|
jozee@438
|
516 </hbox>
|
jozee@438
|
517 '
|
jozee@438
|
518 # Burn backup button.
|
jozee@438
|
519 MAIN_DIALOG=${MAIN_DIALOG}"
|
jozee@438
|
520 <hbox>
|
jozee@438
|
521 <text>
|
jozee@438
|
522 <label>\"Proceed to backup your data CD: \" </label>
|
jozee@438
|
523 </text>
|
jozee@438
|
524 <button>
|
jozee@438
|
525 <label>Backup DataCD</label>
|
jozee@438
|
526 <variable>DATA_RIP</variable>
|
jozee@438
|
527 <input file icon=\"forward\"></input>
|
jozee@438
|
528 <action>$0 rip_disc</action>
|
jozee@438
|
529 </button>
|
jozee@438
|
530 </hbox>
|
jozee@438
|
531 </frame>"
|
jozee@438
|
532 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
533 <frame Audio CD backup>
|
jozee@438
|
534 <text>
|
jozee@438
|
535 <label>
|
jozee@438
|
536 " "
|
jozee@438
|
537 </label>
|
jozee@438
|
538 </text>
|
jozee@438
|
539 <hbox>
|
jozee@438
|
540 <text>
|
jozee@438
|
541 <label> "Proceed to clone your audio CD:"</label>
|
jozee@438
|
542 </text>
|
jozee@438
|
543 <button>
|
jozee@438
|
544 <label> Backup AudioCD</label>
|
jozee@438
|
545 <variable>AUDIO_RIP</variable>
|
jozee@438
|
546 <input file icon="forward"></input>
|
jozee@438
|
547 <action>asunder</action>
|
jozee@438
|
548 </button>
|
jozee@438
|
549 </hbox>
|
jozee@438
|
550 </frame>
|
jozee@438
|
551
|
jozee@438
|
552 </vbox>'
|
jozee@438
|
553
|
jozee@438
|
554 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
555 <vbox>
|
jozee@438
|
556 <text use-markup="true">
|
jozee@438
|
557 <label>
|
jozee@438
|
558 "
|
jozee@438
|
559 "
|
jozee@438
|
560 </label>
|
jozee@438
|
561 </text>
|
jozee@438
|
562 <frame Select ISO and burn>
|
jozee@438
|
563 <hbox>
|
jozee@438
|
564 <text>
|
jozee@438
|
565 <label>
|
jozee@438
|
566 " "
|
jozee@438
|
567 </label>
|
jozee@438
|
568 </text>
|
jozee@438
|
569 <text use-markup="true">
|
jozee@438
|
570 <label>"<b>ISO path:</b>"</label>
|
jozee@438
|
571 </text>
|
jozee@438
|
572 <entry>
|
jozee@438
|
573 <variable>ISO_IMAGE</variable>
|
jozee@438
|
574 </entry>
|
jozee@438
|
575 <button>
|
jozee@438
|
576 <label>Browse</label>
|
jozee@438
|
577 <input file stock="gtk-open"></input>
|
jozee@438
|
578 <action type="fileselect">ISO_IMAGE</action>
|
jozee@438
|
579 </button>
|
jozee@438
|
580 </hbox>
|
jozee@438
|
581 '
|
jozee@438
|
582 # Burn iso button.
|
jozee@438
|
583 MAIN_DIALOG=${MAIN_DIALOG}"
|
jozee@438
|
584 <hbox>
|
jozee@438
|
585 <button>
|
jozee@438
|
586 <label>Burn ISO</label>
|
jozee@438
|
587 <input file icon=\"forward\"></input>
|
jozee@438
|
588 <action>$0 burn_iso</action>
|
jozee@438
|
589 </button>
|
jozee@438
|
590 </hbox>
|
jozee@438
|
591 </frame>
|
jozee@438
|
592 </vbox>"
|
jozee@438
|
593
|
jozee@438
|
594
|
jozee@438
|
595
|
jozee@345
|
596 #
|
jozee@345
|
597 #
|
jozee@345
|
598 # tmp3=
|
jozee@438
|
599 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
600 <vbox>
|
jozee@438
|
601 <frame Information>
|
jozee@438
|
602
|
jozee@438
|
603 <text width_request="250" use-markup="true">
|
jozee@438
|
604 <label>
|
paul@454
|
605 "Burnbox burns ISOs, backs up CD/DVDs, burns data CD/DVDs, audio CDs and video CDs (VCD/SVCD)
|
jozee@438
|
606 "
|
jozee@438
|
607 </label>
|
jozee@438
|
608 </text>
|
jozee@438
|
609 <hbox>
|
jozee@438
|
610 <text use-markup="true">
|
jozee@438
|
611 <label> "<b> Please consult HELP file if needed: </b>" </label>
|
jozee@438
|
612 </text>
|
jozee@438
|
613 <button>
|
jozee@438
|
614 <input file icon="help"></input>
|
jozee@478
|
615 <action> browser /usr/share/doc/slitaz-tools/burnbox.html </action>
|
jozee@438
|
616 </button>
|
jozee@438
|
617 </hbox>
|
jozee@438
|
618
|
jozee@438
|
619 </frame>
|
jozee@438
|
620 <frame Settings>
|
jozee@438
|
621 <text>
|
jozee@438
|
622 <label>
|
jozee@438
|
623 "Before burning, please verify/change device writer settings below if needed.
|
jozee@438
|
624 "
|
jozee@438
|
625 </label>
|
jozee@438
|
626 </text>
|
jozee@438
|
627
|
jozee@438
|
628 <hbox>
|
jozee@438
|
629 <text use-markup="true">
|
jozee@438
|
630 <label>"<b>Device: </b>"</label>
|
jozee@438
|
631 </text>
|
jozee@438
|
632 <entry>
|
jozee@438
|
633 <default>/dev/cdrom</default>
|
jozee@438
|
634 <variable>DEVICE</variable>
|
jozee@438
|
635 </entry>
|
jozee@438
|
636 </hbox>
|
jozee@438
|
637 <hbox>
|
jozee@438
|
638 <text use-markup="true">
|
jozee@438
|
639 <label>"<b>Speed: </b>"</label>
|
jozee@438
|
640 </text>
|
jozee@438
|
641 <entry>
|
jozee@438
|
642 <input>cat /proc/sys/dev/cdrom/info | grep "drive speed" | cut -f 3</input>
|
jozee@438
|
643 <variable>SPEED</variable>
|
jozee@438
|
644 </entry>
|
jozee@438
|
645 </hbox>
|
jozee@438
|
646 <hbox>
|
jozee@438
|
647 <text use-markup="true">
|
jozee@438
|
648 <label>"<b>Options: </b>"</label>
|
jozee@438
|
649 </text>
|
jozee@438
|
650 <entry>
|
jozee@438
|
651 <default>-eject -multi</default>
|
jozee@438
|
652 <variable>OPTIONS</variable>
|
jozee@438
|
653 </entry>
|
jozee@438
|
654 <button>
|
jozee@438
|
655 <input file icon="help"></input>
|
jozee@438
|
656 <action>xterm -sb -geometry 95x25 -title "wodim help" -e "wodim --help ; echo -e \"----\nENTER to continue...\" && read close"</action>
|
jozee@438
|
657 </button>
|
jozee@438
|
658 </hbox> '
|
jozee@438
|
659
|
jozee@438
|
660 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
661 </frame>
|
jozee@438
|
662 <frame Blank CD/DVD-RW>
|
jozee@438
|
663 <hbox>
|
jozee@438
|
664 <text use-markup="true">
|
jozee@438
|
665 <label>"<b>Option: </b>"</label>
|
jozee@438
|
666 </text>
|
jozee@438
|
667 <entry>
|
jozee@438
|
668 <variable>BLANK_OPTS</variable>
|
jozee@438
|
669 <default>fast</default>
|
jozee@438
|
670 </entry>
|
jozee@438
|
671 <button>
|
jozee@438
|
672 <input file icon="help"></input>
|
jozee@438
|
673 <action>xterm -geometry 80x16 -title "wodim blank=help" -e "wodim blank=help ; echo -e \"----\nENTER to continue...\" && read close"</action>
|
jozee@438
|
674 </button>
|
jozee@438
|
675 <button>
|
jozee@438
|
676 <label>Blank disc</label>
|
jozee@438
|
677 <input file icon="forward"></input>
|
jozee@438
|
678 <action>xterm -title "Wodim" -e "wodim -v -blank=$BLANK_OPTS dev=$DEVICE; sleep 2"</action>
|
jozee@438
|
679 </button>
|
jozee@438
|
680 </hbox>
|
jozee@438
|
681 </frame>
|
jozee@438
|
682 </vbox>'
|
pankso@286
|
683 export MAIN_DIALOG=${MAIN_DIALOG}'
|
pankso@286
|
684
|
jozee@438
|
685 </notebook>'
|
jozee@438
|
686 MAIN_DIALOG=${MAIN_DIALOG}"<hbox>
|
jozee@438
|
687 <button>
|
jozee@438
|
688 <input file icon=\"dialog-information\"></input>
|
jozee@438
|
689 <label> Check Permissions for Device</label>
|
jozee@438
|
690 <action>$0 chk_rw_permissions</action>
|
jozee@438
|
691 </button>
|
jozee@438
|
692 "
|
jozee@438
|
693 MAIN_DIALOG=${MAIN_DIALOG}'
|
jozee@438
|
694 <button>
|
pankso@286
|
695 <label>Exit</label>
|
pankso@286
|
696 <input file icon="exit"></input>
|
pankso@286
|
697 <action type="exit">Exit</action>
|
pankso@286
|
698 </button>
|
pankso@286
|
699 </hbox>
|
pankso@286
|
700
|
pankso@286
|
701 </vbox>
|
pankso@38
|
702 </window>
|
pankso@31
|
703 '
|
pankso@31
|
704
|
pankso@286
|
705 # Script can be called with an arg to exec a function.
|
pankso@286
|
706 if [ -n "$1" ]; then
|
pankso@286
|
707 $1
|
pankso@286
|
708 else
|
jozee@345
|
709 mkdir -p $TMPDIR
|
pankso@286
|
710 gtkdialog --center --program=MAIN_DIALOG >/dev/null
|
jozee@345
|
711 rm -rf $TMPDIR
|
pankso@286
|
712 fi
|
pankso@31
|
713
|
pankso@31
|
714 exit 0
|