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
36ddc9e3
Kaydet (Commit)
36ddc9e3
authored
Eki 31, 1990
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Initial revision
üst
6acc1b53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
226 additions
and
0 deletions
+226
-0
StripChart.py
Lib/lib-stdwin/StripChart.py
+67
-0
VUMeter.py
Lib/lib-stdwin/VUMeter.py
+46
-0
StripChart.py
Lib/stdwin/StripChart.py
+67
-0
VUMeter.py
Lib/stdwin/VUMeter.py
+46
-0
No files found.
Lib/lib-stdwin/StripChart.py
0 → 100644
Dosyayı görüntüle @
36ddc9e3
# Module 'StripChart'
import
rect
from
Buttons
import
*
from
Resize
import
*
class
StripChart
()
=
LabelAppearance
(),
NoReactivity
(),
NoResize
():
#
def
define
(
self
,
(
win
,
bounds
,
scale
)):
self
.
init_appearance
(
win
,
bounds
)
self
.
init_reactivity
()
self
.
init_resize
()
self
.
ydata
=
[]
self
.
scale
=
scale
self
.
resetbounds
()
return
self
#
def
setbounds
(
self
,
bounds
):
LabelAppearance
.
setbounds
(
self
,
bounds
)
self
.
resetbounds
()
#
def
resetbounds
(
self
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
self
.
width
=
right
-
left
self
.
height
=
bottom
-
top
excess
=
len
(
self
.
ydata
)
-
self
.
width
if
excess
>
0
:
del
self
.
ydata
[:
excess
]
elif
excess
<
0
:
while
len
(
self
.
ydata
)
<
self
.
width
:
self
.
ydata
.
insert
(
0
,
0
)
#
def
append
(
self
,
y
):
self
.
ydata
.
append
(
y
)
excess
=
len
(
self
.
ydata
)
-
self
.
width
if
excess
>
0
:
del
self
.
ydata
[:
excess
]
if
not
self
.
limbo
:
self
.
win
.
scroll
(
self
.
bounds
,
(
-
excess
,
0
))
if
not
self
.
limbo
:
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
i
=
len
(
self
.
ydata
)
area
=
(
left
+
i
-
1
,
top
),
(
left
+
i
,
bottom
)
self
.
draw
(
self
.
win
.
begindrawing
(),
area
)
#
def
draw
(
self
,
(
d
,
area
)):
self
.
limbo
=
0
area
=
rect
.
intersect
(
area
,
self
.
bounds
)
if
area
=
rect
.
empty
:
return
d
.
cliprect
(
area
)
d
.
erase
(
self
.
bounds
)
(
a_left
,
a_top
),
(
a_right
,
a_bottom
)
=
area
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
height
=
bottom
-
top
i1
=
a_left
-
left
i2
=
a_right
-
left
for
i
in
range
(
max
(
0
,
i1
),
min
(
len
(
self
.
ydata
),
i2
)):
split
=
bottom
-
self
.
ydata
[
i
]
*
height
/
self
.
scale
d
.
paint
((
left
+
i
,
split
),
(
left
+
i
+
1
,
bottom
))
if
not
self
.
enabled
:
self
.
flipenable
(
d
)
if
self
.
hilited
:
self
.
fliphilite
(
d
)
d
.
noclip
()
Lib/lib-stdwin/VUMeter.py
0 → 100644
Dosyayı görüntüle @
36ddc9e3
# Module VUMeter
import
audio
from
StripChart
import
StripChart
K
=
1024
Rates
=
[
0
,
32
*
K
,
16
*
K
,
8
*
K
]
class
VUMeter
()
=
StripChart
():
#
# Override define() and timer() methods
#
def
define
(
self
,
(
win
,
bounds
)):
self
=
StripChart
.
define
(
self
,
(
win
,
bounds
,
128
))
self
.
sampling
=
0
self
.
rate
=
3
self
.
enable
(
0
)
return
self
#
def
timer
(
self
):
if
self
.
sampling
:
chunk
=
audio
.
wait_recording
()
self
.
sampling
=
0
nums
=
audio
.
chr2num
(
chunk
)
ampl
=
max
(
abs
(
min
(
nums
)),
abs
(
max
(
nums
)))
self
.
append
(
ampl
)
if
self
.
enabled
and
not
self
.
sampling
:
audio
.
setrate
(
self
.
rate
)
size
=
Rates
[
self
.
rate
]
/
10
size
=
size
/
48
*
48
audio
.
start_recording
(
size
)
self
.
sampling
=
1
if
self
.
sampling
:
self
.
win
.
settimer
(
1
)
#
# New methods: start() and stop()
#
def
stop
(
self
):
if
self
.
sampling
:
chunk
=
audio
.
stop_recording
()
self
.
sampling
=
0
self
.
enable
(
0
)
#
def
start
(
self
):
self
.
enable
(
1
)
self
.
timer
()
Lib/stdwin/StripChart.py
0 → 100755
Dosyayı görüntüle @
36ddc9e3
# Module 'StripChart'
import
rect
from
Buttons
import
*
from
Resize
import
*
class
StripChart
()
=
LabelAppearance
(),
NoReactivity
(),
NoResize
():
#
def
define
(
self
,
(
win
,
bounds
,
scale
)):
self
.
init_appearance
(
win
,
bounds
)
self
.
init_reactivity
()
self
.
init_resize
()
self
.
ydata
=
[]
self
.
scale
=
scale
self
.
resetbounds
()
return
self
#
def
setbounds
(
self
,
bounds
):
LabelAppearance
.
setbounds
(
self
,
bounds
)
self
.
resetbounds
()
#
def
resetbounds
(
self
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
self
.
width
=
right
-
left
self
.
height
=
bottom
-
top
excess
=
len
(
self
.
ydata
)
-
self
.
width
if
excess
>
0
:
del
self
.
ydata
[:
excess
]
elif
excess
<
0
:
while
len
(
self
.
ydata
)
<
self
.
width
:
self
.
ydata
.
insert
(
0
,
0
)
#
def
append
(
self
,
y
):
self
.
ydata
.
append
(
y
)
excess
=
len
(
self
.
ydata
)
-
self
.
width
if
excess
>
0
:
del
self
.
ydata
[:
excess
]
if
not
self
.
limbo
:
self
.
win
.
scroll
(
self
.
bounds
,
(
-
excess
,
0
))
if
not
self
.
limbo
:
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
i
=
len
(
self
.
ydata
)
area
=
(
left
+
i
-
1
,
top
),
(
left
+
i
,
bottom
)
self
.
draw
(
self
.
win
.
begindrawing
(),
area
)
#
def
draw
(
self
,
(
d
,
area
)):
self
.
limbo
=
0
area
=
rect
.
intersect
(
area
,
self
.
bounds
)
if
area
=
rect
.
empty
:
return
d
.
cliprect
(
area
)
d
.
erase
(
self
.
bounds
)
(
a_left
,
a_top
),
(
a_right
,
a_bottom
)
=
area
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
height
=
bottom
-
top
i1
=
a_left
-
left
i2
=
a_right
-
left
for
i
in
range
(
max
(
0
,
i1
),
min
(
len
(
self
.
ydata
),
i2
)):
split
=
bottom
-
self
.
ydata
[
i
]
*
height
/
self
.
scale
d
.
paint
((
left
+
i
,
split
),
(
left
+
i
+
1
,
bottom
))
if
not
self
.
enabled
:
self
.
flipenable
(
d
)
if
self
.
hilited
:
self
.
fliphilite
(
d
)
d
.
noclip
()
Lib/stdwin/VUMeter.py
0 → 100755
Dosyayı görüntüle @
36ddc9e3
# Module VUMeter
import
audio
from
StripChart
import
StripChart
K
=
1024
Rates
=
[
0
,
32
*
K
,
16
*
K
,
8
*
K
]
class
VUMeter
()
=
StripChart
():
#
# Override define() and timer() methods
#
def
define
(
self
,
(
win
,
bounds
)):
self
=
StripChart
.
define
(
self
,
(
win
,
bounds
,
128
))
self
.
sampling
=
0
self
.
rate
=
3
self
.
enable
(
0
)
return
self
#
def
timer
(
self
):
if
self
.
sampling
:
chunk
=
audio
.
wait_recording
()
self
.
sampling
=
0
nums
=
audio
.
chr2num
(
chunk
)
ampl
=
max
(
abs
(
min
(
nums
)),
abs
(
max
(
nums
)))
self
.
append
(
ampl
)
if
self
.
enabled
and
not
self
.
sampling
:
audio
.
setrate
(
self
.
rate
)
size
=
Rates
[
self
.
rate
]
/
10
size
=
size
/
48
*
48
audio
.
start_recording
(
size
)
self
.
sampling
=
1
if
self
.
sampling
:
self
.
win
.
settimer
(
1
)
#
# New methods: start() and stop()
#
def
stop
(
self
):
if
self
.
sampling
:
chunk
=
audio
.
stop_recording
()
self
.
sampling
=
0
self
.
enable
(
0
)
#
def
start
(
self
):
self
.
enable
(
1
)
self
.
timer
()
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