İsminden de anlaşılacağı üzere mp3(wav vs.da keser) kesme programı. mIRC ile daha önce yazıldığını düşünmediğim/görmediğim, boş vaktimde can sıkıntısından bir anda aklıma gelen ve geldiğine pişman olduğum, uzattıkça uzatıp en sonunda tamam deyip yayımlamaya karar verdiğim snippet-dan bozma showcase/addon-dur kısacası.
Program dili ingilizce-dir. "Sen bir Türk kodlayıcısı olarak neden Türkçe yazmıyorsun kardeşim?!" şeklinde soran/soracak arkadaşlara şimdiden zamanla inşallah oda olur deyip tanıtıma geçiyorum(en sevmediğim kısım burası ne yazıkki)
Kod, pc-win üzerinde yazılmıştır. Herhangi bir dll(yapılandırma dosyası), com/run vb. yani external çalışan veya gerek duyan bir bölümü yoktur.
Kullanımı basittir. Şöyleki;
Open MP3 butonundan mp3 dosyasını seçiyorsunuz, sonra Play butonu ile mp3 dosyasını yürütüp(play edip) Begin butonu ile kesilecekbaşlangıç kısmını belirliyorsunuz. Devamında End butonu ile bitiş kısmını belirleyip, İster Ply Slc. butonu ile kesilen kısmı play ediyorsunuz veya gerek yok deyip Save Slc. butonu ile kesilen kısmı belirttiğiniz klasör gövdesine kayıt ediyorsunuz. Son olarak istersen reset butonu ile aralıkları(seçilen kısımları) sıfırlayabilirsin.
Yok ben görsellikle iş yapmak istemiyorum diyorsanız;
Yapımcısı: L4roXyL
NOT: bu kod irc kodlarıdır mirc scriptinizde çalısır
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
# programme: MP3 Cutter v1.0b ;
# written by: l4roxyl - (Hasan AYDENİZ) ;
# visit scripting: http://www.mircscripting.net ;
# contact: l4roxyl[at]mircscripting[dot]net ;
# use manual: /mp3cut - sample: /mp3cut 00:37 01:45 ;
# use pcwin programme: /mp3cut ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
on *:load: {
var %_e echo -acp info ***
%_e MP3 Cutter v1.0b loaded.
%_e Use: $_m(b) $+ /mp3cut [] []
%_e Sample manual: $_m(b) $+ /mp3cut 00:25 00:45
%_e Visit scripting site: $_m(b) $+ http://www.mircscripting.net
mp3cut
}
alias _m {
if ($isid) {
if (!$1) return @mp3
if ($1 = i) return $insong
if ($1 = mx) return $mouse.x
if ($1 = my) return $mouse.y
if ($1 = _ip) return $insong.pos
if ($1 = _il) return $insong.length
if ($1 = b) returnex $chr(2) $+ $2-
if ($1 = _in_pos) return $time($int($calc($insong.pos / 1000)),nn:ss)
if ($1 = _in_inl) return $int($calc($insong.pos * 300 / $insong.length))
if ($1 = _in_l) return $int($calc($iif($sound($2).length,$v1,$insong.length) / 1000))
if ($1 = _vl) return v $int($round($calc($vol(mp3) / 65535 * 100),0)) $+ $str($chr(160),10)
}
if ($1 = dt) drawtext $2-
if ($1 = _h) hadd -m _begin $2-
if ($1 = dr) drawrect -r $+ $iif($2 = f,f @MP3 $3-,$chr(32) @MP3 $2-)
if ($1 = w1) $iif($input(Just select Begin & End time!,wo,Warning!) = $true,return,return)
if ($1 = w2) $iif($input(Not to remark begin time!,wo,Warning!) = $true,return,return)
if ($1 = w3) $iif($input(Now playing MP3! $+ $crlf $+ Are you sure select a new MP3?,yqd,Select a new MP3) = $false,return)
if ($1 = w4) $iif($input(Not playing to file.,wo,Warning!) = $true,return,return)
if ($1 = w5) $iif($input(Not selected MP3 save dir!,wo,Warning!) = $true,return,return)
if ($1 = w6) $iif($input(Not selected file.,wo,Warning!) = $true,return,return)
if ($1 = w7) $iif($input(This not sound file!,wo,Warning!) = $true,noop,noop)
}
alias _rect {
var %_r = return
if ($inrect($1,$2,5,25,60,20)) %_r 5 25
if ($inrect($1,$2,5,95,60,20)) %_r 5 95
if ($inrect($1,$2,85,95,60,20)) %_r 85 95
if ($inrect($1,$2,165,95,60,20)) %_r 165 95
if ($inrect($1,$2,245,95,60,20)) %_r 245 95
if ($inrect($1,$2,5,55,30,20)) %_r 5 55 30 20
if ($inrect($1,$2,315,105,10,10)) %_r 315 105 10 10
if ($inrect($1,$2,330,105,10,10)) %_r 330 105 10 10
if ($inrect($1,$2,5,80,30,10) && $hget(_begin,b)) { %_r 5 80 30 10 }
}
alias _cn if (!$insong) { _m w4 | halt }
alias _c if ($1 = rf) return 15790320 | if ($1 = rs) return 10526880
alias _wo {
if (!$regex($right($nopath($1-),3),/^(mp3|wav|mid)$/gi)) {
_m w7
if ($window(@mp3)) {
_m dt -rb @MP3 0 $_c(rf) Verdana 9 75 29 Not selected mp3 file. (yet)
_dsg
$(%_s = )
splay stop
}
halt
}
}
alias _ps {
_m dr f $_c(rs) 1 5 55 30 20
_m dt -ro @MP3 0 Verdana $iif($1 = play,9 9 59,16 16 55) $1
}
alias _in {
if (!$insong.pos) {
$iif($input(This sound file ruined! Use manual with this song. $+ $&
$crlf $+ /mp3cut ,wo,Warning!) = $true,mp3cut,mp3cut)
mp3cut
}
}
alias _secs {
if ($insong && $window(@mp3)) {
var %z = $time($int($calc($_m(_il) / 1000)),nn:ss), %x = $_m(_in_pos), %? = $_m(_in_inl)
_m dt -rbo @MP3 0 $_c(rf) Verdana 9 271 75 %x / %z
_m dr f $iif(%?,0,$_c(rs)) 1 40 62 $iif(%?,%?,300) 5
}
else { .timer_secs off | _ps Play | _m dr f $_c(rs) 1 40 62 300 5 }
}
alias _ply_slc {
var %? = $_m(_in_inl),%- = $calc($hget(_begin,e_t) * 1000), %x = $int($calc($_m(_ip) / 1000))
var %l = $time($calc($hget(_begin,e_t) - %x),nn:ss),%_d = _m dt -rbo @MP3 0 $_c(rf) Verdana 9
%_d 205 75 Ply: %l /
%_d 271 75 $_m(_in_pos)
_m dr f 0 1 $calc(%? +40) 62 1 5
if ($_m(_ip) > %-) { .timer_ply_s -p | splay pause }
}
alias -l _mov {
var %dx = $calc($mouse.dx -$2),%dy = $calc($mouse.dy -$3)
if ($window($1)) window $v1 %dx %dy
$iif($mouse.key & 1,.timer $+ $ticks -m 1 0 _mov $1-)
}
alias _vol_ud {
vol -wmp $calc($vol(mp3) $2 $1)
_m dt -rbo @MP3 0 $_c(rf) Verdana 8 315 94 $_m(_vl)
$iif($mouse.key & 1,.timer $+ $ticks -m 1 60 _vol_ud $1-)
}
alias _pback {
var %_tt = $2-3, %_f = $1, %_fb = $lof($1)
var %_sc = $_m(_in_l,%_f)
var %_one_s = $calc(%_fb / %_sc)
var %_last = $round($calc(%_one_s * $2),0) $round($calc(%_one_s * $3),0)
var %_total = $calc($token(%_last,2,32) - $token(%_last,1,32))
bread %_f %_last &d
bwrite $4 1 %_total &d
}
alias _dsg {
$iif($hget(_begin),hfree $v1)
.timer_secs off
.timer_ply_s off
drawfill -r @MP3 $_c(rf) $_c(rf) 0 0
var %_dt = _m dt -ro @MP3 0 Verdana
_m dt -rob @MP3 0 $_c(rf) Verdana 8 315 94 $_m(_vl)
_m dr f $_c(rf) 1 195 77 200 10 40 68 300 8 5 80 50 10 40 62 300 5
_m dr f $_c(rs) 1 $&
0 0 350 20 $&
5 25 60 20 $&
5 55 30 20 $&
40 62 300 5 $&
5 95 60 20 $&
85 95 60 20 $&
165 95 60 20 $&
245 95 60 20 $&
315 105 10 10 $&
330 105 10 10 $&
325 6 8 8 $&
335 6 8 8
%_dt 9 6 5 MP3 Cutter v1.0b
%_dt 9 9 29 Open MP3
%_dt 9 9 59 Play
%_dt 9 19 99 Begin
%_dt 9 103 99 End
%_dt 9 174 99 Play Slc.
%_dt 9 253 99 Save Slc.
%_dt 9 317 98 _
%_dt 9 331 103 +
%_dt 9 327 5 $chr(4)
%_dt 9 335 4 $chr(215)
}
alias mp3cut {
if (!$isdir($mircdircutter)) mkdir Cutter
if ($1) {
var %_w = echo -eac info *** MP3 Cutter info: $_m(b) $+ $!1-2( $+ $1-2 / invalid format) - $&
Sample: $_m(b) $+ /mp3cut 01:10 02:15 $_m(b),%_d1 = $duration($1), %_d2 = $duration($2)
if (!$regex($1-2,/^(\d{2}:\d{2}\s\d{2}:\d{2})$)) { %_w | return }
if (%_d2 < %_d1 || %_d1 = %_d2) { %_w | return }
var %_mf = $sfile(*.mp3,Select MP3 File,Select)
if (!%_mf) {
$token(%_w,1-7,32) $_m(b) $+ Not select mp3 file!
return
}
else {
_wo %_mf
if ($_m(_in_l,%_s) < %_d1 || $_m(_in_l,%_s) < %_d2) {
$token(%_w,1-7,32) $_m(b) $+ File length small with entered time!
return
}
$iif($window(@mp3),window -c @mp3)
var %_n = $nopath(%_mf),%_t = $ticks
_pback $shortfn(%_mf) $duration($1) $duration($2) $shortfn($mircdircutter) $+ Cutter_ $+ $regsubex(%_n,/(\s)/g,_)
$iif($input(MP3 cut successfully completed! $&
$+ $crlf $+ Procress Time: $calc($ticks - %_t) $&
$+ ms.,io,Completed!) = $true,run $mircdircutter,return)
return
}
}
$(%_s = )
$(%_ = 245 95)
splay stop
vol -wmp 32767.5
$iif($window($_m),window -c $v1)
window -paCk0w0dB +b @MP3 -1 -1 350 125 - - - - $mircexe
titlebar $_m Cutter v1.0b
_dsg
_m dt -r @MP3 0 Verdana 9 75 29 Not selected mp3 file.
}
menu @MP3 {
leave:if (%_ != 5 80 30 10) { _m dr $_c(rs) 1 %_ 60 20 }
mouse: {
var %_; = _m dt -rbo @MP3 $_c(rf) $_c(rs) Verdana 9, $&
%_;; _m dt -rbo @MP3 0 $_c(rs) Verdana 9 , %_st = $str($chr(160),2)
;-
if ($inrect($_m(mx),$_m(my),325,6,8,8)) %_; 327 5 $chr(4)
else %_;; $token(%_;,2,38) 327 5 $chr(4)
if ($inrect($_m(mx),$_m(my),335,6,8,8)) %_; 335 4 $chr(215)
else %_;; 335 4 $chr(215)
;-
if ($inrect($_m(mx),$_m(my),40,62,300,5) && %_s) {
$iif($hget(_ml),hfree _ml)
var %k = $time($int($calc(($sound(%_s).length / 300 * ($_m(mx) -40)) /1000)),nn:ss)
_m dt -rb $menu 0 $_c(rf) Verdana 8 $iif($_m(mx) >= 309,309,$_m(mx)) 50 $&
$+($chr(160),$iif($_m(mx) != 340,%k,$time($calc($_m(_il) / 1000),nn:ss)),%_st)
}
else {
_m dr f $_c(rf) 1 40 50 305 10
}
if ($_rect($_m(mx),$_m(my))) {
$(%_ = $v1)
_m dr 0 1 %_ 60 20
}
else {
if (%_ = 5 80 30 10 && !$hget(_begin)) { _m dr $_c(rf) 1 %_ | return }
if (%_) _m dr $_c(rs) 1 %_ 60 20
}
}
sclick: {
if ($inrect($_m(mx),$_m(my),0,0,350,20)) {
_mov $menu $calc($mouse.dx - $window($menu).x) $calc($mouse.dy - $window($menu).y)
}
if ($inrect($_m(mx),$_m(my),325,6,8,8)) window -n $_m
if ($inrect($_m(mx),$_m(my),335,6,8,8)) {
window -c $_m
%_s =
splay stop
.timer_secs off
.timer_ply_s off
}
if ($inrect($_m(mx),$_m(my),5,95,60,20)) {
_cn
if (!$timer(_ply_s)) {
var %? = $_m(_in_inl), %x = $_m(_in_pos)
_m dr f $_c(rf) 1 37 68 300 8
_m dr f $rgb(255,0,0) 1 $calc(%? +39) 68 1 5
_m dt -rbo @MP3 0 $_c(rs) Verdana 9 19 99 %x
_m dr f $_c(rs) 1 5 80 30 10
_m dt -ro @MP3 0 Verdana 9 7 78 reset
_m _h b $calc(%? +39)
_m _h b_t $int($calc($_m(_ip) / 1000))
if ($hget(_begin,e_t)) hdel _begin e_t
return
}
}
if ($inrect($_m(mx),$_m(my),85,95,60,20)) {
_cn
if (!$hget(_begin,b)) {
_m w2
return
}
var %? = $_m(_in_inl), %x = $_m(_in_pos)
if ($hget(_begin,b) < $calc(%? +39)) {
_m _h e $v2
_m _h e_t $int($calc($_m(_ip) / 1000))
_m dr f $_c(rf) 1 40 68 300 8
_m dt -rbo @MP3 0 $_c(rs) Verdana 9 103 99 %x
_m dr f $rgb(255,0,0) 1 $hget(_begin,e) 68 1 5 $iif($hget(_begin,b),$v1 68 1 5)
_m dr f $rgb(255,0,0) 1 $iif($hget(_begin,b),$v1) 70 $iif($hget(_begin,e),$calc($v1 - $hget(_begin,b))) 1
}
}
if ($inrect($_m(mx),$_m(my),165,95,60,20)) {
if ($hget(_begin,b_t) && $hget(_begin,e_t)) {
if (!$timer(_secs)) .timer_secs -m 0 10 _secs
_m dr f $_c(rs) 1 40 62 300 5
.timer_secs -p
hadd -m _sp $ticks
splay $shortfn(%_s) $calc($hget(_begin,b_t) * 1000)
var %? = $_m(_in_inl)
.timer_ply_s -m 0 10 _ply_slc
_ps Play
}
else _m w1
}
if ($inrect($_m(mx),$_m(my),5,25,60,20)) {
if ($insong) { _m w3 }
$(%_s = $sfile(*.mp3,Select MP3 File,Select))
_m dr f $_c(rf) 1 67 25 300 20
if (%_s) {
splay stop
_dsg
_wo %_s
var %f = $shortfn(%_s), %t = $time($_m(_in_l,%_s),nn:ss), %sf = $nopath(%_s)
_m dt -rbo @MP3 0 $_c(rf) Verdana 9 271 75 00:00 / %t
_m dt -rbp @MP3 0 $_c(rf) Verdana 9 75 29 $_m(b) $+ $&
Selected file: $_m(b) $+ $iif($len(%sf) >= 30,$left(%sf,30) $+ ..,%sf)
}
else {
splay stop
_dsg
_m dt -rb @MP3 0 $_c(rf) Verdana 9 75 29 Not selected mp3 file. (yet)
}
}
if ($inrect($_m(mx),$_m(my),5,55,30,20)) {
if (!%_s) _m w6
else {
$iif($hget(_sp),hfree _sp)
_m dr f $_c(rf) 1 195 77 70 10
_m dr f $_c(rs) 1 40 62 300 5
if ($timer(_ply_s)) {
.timer_ply_s off
.timer_secs -r
splay resume
_ps ıı
return
}
if (!$insong || $insong.pause) {
splay $iif($insong.pause,resume) $shortfn(%_s)
.timer 1 2 _in
_ps ıı
if ($timer(_secs).pause) {
.timer_secs -r
_ps ıı
}
elseif !$timer(_secs) { .timer_secs -m 0 10 _secs }
}
elseif (!$timer(_secs).pause) {
splay pause
.timer_secs -p
_secs
_ps Play
}
}
}
if ($inrect($_m(mx),$_m(my),5,80,30,10)) {
if ($hget(_begin,b)) {
_m dt -rbo @MP3 0 $_c(rs) Verdana 9 19 99 Begin
_m dt -rbo @MP3 0 $_c(rs) Verdana 9 103 99 End $+ $str($chr(160),4)
_m dr f $_c(rf) 1 40 68 300 8 5 80 50 10 195 77 70 10
.timer_ply_s off
if ($timer(_secs).pause) { .timer_secs -r | splay resume | _ps ıı }
$iif($hget(_begin),hfree _begin)
$iif($hget(_sp),hfree _sp)
}
}
if ($inrect($_m(mx),$_m(my),245,95,60,20)) {
if ($hget(_begin,b) && $hget(_begin,e)) {
var %_dir = $sdir($mircdir,Select a dir?)
if (!%_dir) { _m w5 }
else {
var %_f = $nopath(%_s),%_t = $ticks
_pback $shortfn(%_s) $hget(_begin,b_t) $hget(_begin,e_t) %_dir $+ Cutter_ $+ $regsubex(%_f,/(\s)/g,_)
$iif($input(MP3 cut successfully completed! $&
$+ $crlf $+ Procress Time: $calc($ticks - %_t) $&
$+ ms.,io,Completed!) = $true,run %_dir,return)
}
}
else _m w1
}
if ($inrect($_m(mx),$_m(my),330,105,10,10)) {
if ($vol(mp3) < 65535) _vol_ud 655 +
}
if ($inrect($_m(mx),$_m(my),315,105,10,10)) {
if ($vol(mp3) > 0) _vol_ud 655 -
}
if ($inrect($_m(mx),$_m(my),40,62,300,5)) {
if ($insong) {
var %? = $_m(_in_inl),%_mx = $calc($_m(mx) -39), $&
%_drf = _m dr f $_c(rs) 1 $_m(mx) 62 $calc(340 - $_m(mx)) 5, $&
%_sp = splay seek $int($calc($_m(_il) / 300 * %_mx))
if ($hget(_sp)) {
if ($mouse.x < $hget(_begin,e) && $mouse.x > $hget(_begin,b)) {
%_sp
splay resume
$iif($timer(_ply_s).pause,.timer_ply_s -r)
_m dr f 0 1 $hget(_begin,b) 62 $iif(%?,%?,300) 5
%_drf
return
}
}
elseif (!$hget(_sp)) {
%_sp
_m dr f 0 1 40 62 $iif(%?,%?,300) 5
%_drf
}
}
}
}
}
0 yorum: