Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e1f069ec
Kaydet (Commit)
e1f069ec
authored
Eki 25, 1990
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Initial revision
üst
4de12876
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
0 deletions
+172
-0
Histogram.py
Lib/lib-stdwin/Histogram.py
+49
-0
Soundogram.py
Lib/lib-stdwin/Soundogram.py
+37
-0
Histogram.py
Lib/stdwin/Histogram.py
+49
-0
Soundogram.py
Lib/stdwin/Soundogram.py
+37
-0
No files found.
Lib/lib-stdwin/Histogram.py
0 → 100644
Dosyayı görüntüle @
e1f069ec
# Module 'Histogram'
from
Buttons
import
*
# A Histogram displays a histogram of numeric data.
# It reacts to resize events by resizing itself,
# leaving the same amount of space around the borders.
#
class
HistogramAppearance
()
=
LabelAppearance
():
#
def
define
(
self
,
(
win
,
bounds
,
ydata
,
scale
)):
self
.
init_appearance
(
win
,
bounds
)
self
.
ydata
=
ydata
self
.
scale
=
scale
# (min, max)
self
.
left_top
,
(
right
,
bottom
)
=
bounds
width
,
height
=
win
.
getwinsize
()
self
.
right_margin
=
width
-
right
self
.
bottom_margin
=
height
-
bottom
return
self
#
def
setdata
(
self
,
(
ydata
,
scale
)):
self
.
ydata
=
ydata
self
.
scale
=
scale
# (min, max)
self
.
win
.
change
(
self
.
bounds
)
#
def
drawit
(
self
,
d
):
ydata
=
self
.
ydata
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
min
,
max
=
self
.
scale
size
=
max
-
min
width
,
height
=
right
-
left
,
bottom
-
top
for
i
in
range
(
len
(
ydata
)):
h0
=
left
+
i
*
width
/
len
(
ydata
)
h1
=
left
+
(
i
+
1
)
*
width
/
len
(
ydata
)
v0
=
top
+
height
-
(
self
.
ydata
[
i
]
-
min
)
*
height
/
size
v1
=
top
+
height
d
.
paint
((
h0
,
v0
),
(
h1
,
v1
))
#
def
resize
(
self
):
width
,
height
=
self
.
win
.
getwinsize
()
right
=
width
-
self
.
right_margin
bottom
=
height
-
self
.
bottom_margin
self
.
setbounds
(
self
.
left_top
,
(
right
,
bottom
))
#
class
HistogramReactivity
()
=
NoReactivity
():
pass
class
Histogram
()
=
HistogramAppearance
(),
HistogramReactivity
():
pass
Lib/lib-stdwin/Soundogram.py
0 → 100644
Dosyayı görüntüle @
e1f069ec
# Module 'Soundogram'
import
audio
from
minmax
import
min
,
max
from
Histogram
import
Histogram
class
Soundogram
()
=
Histogram
():
#
def
define
(
self
,
(
win
,
chunk
)):
width
,
height
=
corner
=
win
.
getwinsize
()
bounds
=
(
0
,
0
),
corner
self
.
chunk
=
chunk
self
.
step
=
(
len
(
chunk
)
-
1
)
/
(
width
/
2
+
1
)
+
1
ydata
=
_make_ydata
(
chunk
,
self
.
step
)
return
Histogram
.
define
(
self
,
(
win
,
bounds
,
ydata
,
(
0
,
128
)))
#
def
setchunk
(
self
,
chunk
):
self
.
chunk
=
chunk
self
.
recompute
()
#
def
recompute
(
self
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
width
=
right
-
left
self
.
step
=
(
len
(
chunk
)
-
1
)
/
width
+
1
ydata
=
_make_ydata
(
chunk
,
self
.
step
)
self
.
setdata
(
ydata
,
(
0
,
128
))
#
def
_make_ydata
(
chunk
,
step
):
ydata
=
[]
for
i
in
range
(
0
,
len
(
chunk
),
step
):
piece
=
audio
.
chr2num
(
chunk
[
i
:
i
+
step
])
mi
,
ma
=
min
(
piece
),
max
(
piece
)
y
=
max
(
abs
(
mi
),
abs
(
ma
))
ydata
.
append
(
y
)
return
ydata
Lib/stdwin/Histogram.py
0 → 100755
Dosyayı görüntüle @
e1f069ec
# Module 'Histogram'
from
Buttons
import
*
# A Histogram displays a histogram of numeric data.
# It reacts to resize events by resizing itself,
# leaving the same amount of space around the borders.
#
class
HistogramAppearance
()
=
LabelAppearance
():
#
def
define
(
self
,
(
win
,
bounds
,
ydata
,
scale
)):
self
.
init_appearance
(
win
,
bounds
)
self
.
ydata
=
ydata
self
.
scale
=
scale
# (min, max)
self
.
left_top
,
(
right
,
bottom
)
=
bounds
width
,
height
=
win
.
getwinsize
()
self
.
right_margin
=
width
-
right
self
.
bottom_margin
=
height
-
bottom
return
self
#
def
setdata
(
self
,
(
ydata
,
scale
)):
self
.
ydata
=
ydata
self
.
scale
=
scale
# (min, max)
self
.
win
.
change
(
self
.
bounds
)
#
def
drawit
(
self
,
d
):
ydata
=
self
.
ydata
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
min
,
max
=
self
.
scale
size
=
max
-
min
width
,
height
=
right
-
left
,
bottom
-
top
for
i
in
range
(
len
(
ydata
)):
h0
=
left
+
i
*
width
/
len
(
ydata
)
h1
=
left
+
(
i
+
1
)
*
width
/
len
(
ydata
)
v0
=
top
+
height
-
(
self
.
ydata
[
i
]
-
min
)
*
height
/
size
v1
=
top
+
height
d
.
paint
((
h0
,
v0
),
(
h1
,
v1
))
#
def
resize
(
self
):
width
,
height
=
self
.
win
.
getwinsize
()
right
=
width
-
self
.
right_margin
bottom
=
height
-
self
.
bottom_margin
self
.
setbounds
(
self
.
left_top
,
(
right
,
bottom
))
#
class
HistogramReactivity
()
=
NoReactivity
():
pass
class
Histogram
()
=
HistogramAppearance
(),
HistogramReactivity
():
pass
Lib/stdwin/Soundogram.py
0 → 100755
Dosyayı görüntüle @
e1f069ec
# Module 'Soundogram'
import
audio
from
minmax
import
min
,
max
from
Histogram
import
Histogram
class
Soundogram
()
=
Histogram
():
#
def
define
(
self
,
(
win
,
chunk
)):
width
,
height
=
corner
=
win
.
getwinsize
()
bounds
=
(
0
,
0
),
corner
self
.
chunk
=
chunk
self
.
step
=
(
len
(
chunk
)
-
1
)
/
(
width
/
2
+
1
)
+
1
ydata
=
_make_ydata
(
chunk
,
self
.
step
)
return
Histogram
.
define
(
self
,
(
win
,
bounds
,
ydata
,
(
0
,
128
)))
#
def
setchunk
(
self
,
chunk
):
self
.
chunk
=
chunk
self
.
recompute
()
#
def
recompute
(
self
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
width
=
right
-
left
self
.
step
=
(
len
(
chunk
)
-
1
)
/
width
+
1
ydata
=
_make_ydata
(
chunk
,
self
.
step
)
self
.
setdata
(
ydata
,
(
0
,
128
))
#
def
_make_ydata
(
chunk
,
step
):
ydata
=
[]
for
i
in
range
(
0
,
len
(
chunk
),
step
):
piece
=
audio
.
chr2num
(
chunk
[
i
:
i
+
step
])
mi
,
ma
=
min
(
piece
),
max
(
piece
)
y
=
max
(
abs
(
mi
),
abs
(
ma
))
ydata
.
append
(
y
)
return
ydata
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment