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
73b715e2
Kaydet (Commit)
73b715e2
authored
Haz 03, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Initial revision
üst
b1ccc6af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
262 additions
and
0 deletions
+262
-0
CD.doc
Demo/sgi/cd/CD.doc
+46
-0
cdplayer.py
Lib/irix5/cdplayer.py
+83
-0
cdplayer.py
Lib/plat-irix5/cdplayer.py
+83
-0
SUNAUDIODEV.py
Lib/plat-sunos4/SUNAUDIODEV.py
+25
-0
SUNAUDIODEV.py
Lib/sunos4/SUNAUDIODEV.py
+25
-0
No files found.
Demo/sgi/cd/CD.doc
0 → 100755
Dosyayı görüntüle @
73b715e2
Introduction.
A number of programs have been written which access the Silicon
Graphics CD-ROM player. These programs all use the interface defined
in readcd.py (see readcd.doc for documentation).
Specifying music stretches.
The programs that are capable of reading music CD's all use the same
syntax to describe which part of the CD is to be read. The syntax
closely corresponds to the available methods in readcd.py.
The music to be read is divided into stretches of music. Each stretch
must be specified as a separate argument on the command line. A
stretch can be a whole CD track, specified as a single number; or it
can be a start time and a end time. The start and end times must be
specified as a tuple, thus: ``(starttime, endtime)''. Don't forget to
quote the parenthesis to the shell. Both starttime and endtime can be
``None'', a simple number which refers to a CD track, or a tuple
consisting of either 3 or 4 elements. A starttime of ``None'' refers
to the start of the CD, an endtime of ``None'' refers to the end of
the CD. A tuple of 3 elements is an absolute time on the CD. The
three elements are (minutes, seconds, frames). A tuple of 4 elements
is a track-relative time. The four elements are (track, minutes,
seconds, frames).
When one stretch ends at the end of a track and the following stretch
starts at the next track, there is the option of either playing or not
playing the pause between the two tracks. When either the end time of
the first stretch or the start time of the second stretch is specified
using absolute or track-relative times, the pause will not be played.
When both times are specified as simple track numbers, the pause will
be played.
If no stretches are specified, the whole CD will be played.
The programs.
Currently, the following programs exist.
playcd [ stretch specification ]
Play (part of) a CD through the system loadspeaker or
headphone set.
cdaiff [ file [ stretch specification ] ]
Copy (part of) a CD to a file. The file will be written in
AIFF format. If no file is specified, cdaiff will write to
the file ``@'' in the current directory.
Lib/irix5/cdplayer.py
0 → 100755
Dosyayı görüntüle @
73b715e2
# This file implements a class which forms an interface to the .cdplayerrc
# file that is maintained by SGI's cdplayer program.
#
# Usage is as follows:
#
# import readcd
# r = readcd.Readcd().init()
# c = Cdplayer().init(r.gettrackinfo())
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# string.
# It is also possible to set the above mentioned variables to new values.
# You can then use c.write() to write out the changed values to the
# .cdplayerrc file.
cdplayerrc
=
'.cdplayerrc'
class
Cdplayer
():
def
init
(
self
,
tracklist
):
import
string
self
.
artist
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
len
(
tracklist
)
self
.
id
=
'd'
+
string
.
zfill
(
len
(
tracklist
),
2
)
for
track
in
tracklist
:
start
,
length
=
track
self
.
id
=
self
.
id
+
string
.
zfill
(
length
[
0
],
2
)
+
\
string
.
zfill
(
length
[
1
],
2
)
try
:
import
posix
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
except
IOError
:
return
self
import
regex
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
s
=
self
.
id
+
'.'
l
=
len
(
s
)
while
1
:
line
=
f
.
readline
()
if
line
==
''
:
break
if
line
[:
l
]
==
s
:
line
=
line
[
l
:]
if
reg
.
match
(
line
)
==
-
1
:
print
'syntax error in ~/'
+
cdplayerrc
continue
name
=
line
[
reg
.
regs
[
1
][
0
]:
reg
.
regs
[
1
][
1
]]
value
=
line
[
reg
.
regs
[
2
][
0
]:
reg
.
regs
[
2
][
1
]]
if
name
==
'title'
:
self
.
title
=
value
elif
name
==
'artist'
:
self
.
artist
=
value
elif
name
[:
5
]
==
'track'
:
trackno
=
string
.
atoi
(
name
[
6
:])
self
.
track
[
trackno
]
=
value
f
.
close
()
return
self
def
write
(
self
):
import
posix
filename
=
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
try
:
old
=
open
(
filename
,
'r'
)
except
IOError
:
old
=
open
(
'/dev/null'
,
'r'
)
new
=
open
(
filename
+
'.new'
,
'w'
)
s
=
self
.
id
+
'.'
l
=
len
(
s
)
while
1
:
line
=
old
.
readline
()
if
line
==
''
:
break
if
line
[:
l
]
<>
s
:
new
.
write
(
line
)
new
.
write
(
self
.
id
+
'.title:
\t
'
+
self
.
title
+
'
\n
'
)
new
.
write
(
self
.
id
+
'.artist:
\t
'
+
self
.
artist
+
'
\n
'
)
for
i
in
range
(
1
,
len
(
self
.
track
)):
new
.
write
(
self
.
id
+
'.track.'
+
`i`
+
':
\t
'
+
\
self
.
track
[
i
]
+
'
\n
'
)
old
.
close
()
new
.
close
()
posix
.
rename
(
filename
+
'.new'
,
filename
)
Lib/plat-irix5/cdplayer.py
0 → 100755
Dosyayı görüntüle @
73b715e2
# This file implements a class which forms an interface to the .cdplayerrc
# file that is maintained by SGI's cdplayer program.
#
# Usage is as follows:
#
# import readcd
# r = readcd.Readcd().init()
# c = Cdplayer().init(r.gettrackinfo())
#
# Now you can use c.artist, c.title and c.track[trackno] (where trackno
# starts at 1). When the CD is not recognized, all values will be the empty
# string.
# It is also possible to set the above mentioned variables to new values.
# You can then use c.write() to write out the changed values to the
# .cdplayerrc file.
cdplayerrc
=
'.cdplayerrc'
class
Cdplayer
():
def
init
(
self
,
tracklist
):
import
string
self
.
artist
=
''
self
.
title
=
''
self
.
track
=
[
None
]
+
[
''
]
*
len
(
tracklist
)
self
.
id
=
'd'
+
string
.
zfill
(
len
(
tracklist
),
2
)
for
track
in
tracklist
:
start
,
length
=
track
self
.
id
=
self
.
id
+
string
.
zfill
(
length
[
0
],
2
)
+
\
string
.
zfill
(
length
[
1
],
2
)
try
:
import
posix
f
=
open
(
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
,
'r'
)
except
IOError
:
return
self
import
regex
reg
=
regex
.
compile
(
'^
\\
([^:]*
\\
):
\t\\
(.*
\\
)'
)
s
=
self
.
id
+
'.'
l
=
len
(
s
)
while
1
:
line
=
f
.
readline
()
if
line
==
''
:
break
if
line
[:
l
]
==
s
:
line
=
line
[
l
:]
if
reg
.
match
(
line
)
==
-
1
:
print
'syntax error in ~/'
+
cdplayerrc
continue
name
=
line
[
reg
.
regs
[
1
][
0
]:
reg
.
regs
[
1
][
1
]]
value
=
line
[
reg
.
regs
[
2
][
0
]:
reg
.
regs
[
2
][
1
]]
if
name
==
'title'
:
self
.
title
=
value
elif
name
==
'artist'
:
self
.
artist
=
value
elif
name
[:
5
]
==
'track'
:
trackno
=
string
.
atoi
(
name
[
6
:])
self
.
track
[
trackno
]
=
value
f
.
close
()
return
self
def
write
(
self
):
import
posix
filename
=
posix
.
environ
[
'HOME'
]
+
'/'
+
cdplayerrc
try
:
old
=
open
(
filename
,
'r'
)
except
IOError
:
old
=
open
(
'/dev/null'
,
'r'
)
new
=
open
(
filename
+
'.new'
,
'w'
)
s
=
self
.
id
+
'.'
l
=
len
(
s
)
while
1
:
line
=
old
.
readline
()
if
line
==
''
:
break
if
line
[:
l
]
<>
s
:
new
.
write
(
line
)
new
.
write
(
self
.
id
+
'.title:
\t
'
+
self
.
title
+
'
\n
'
)
new
.
write
(
self
.
id
+
'.artist:
\t
'
+
self
.
artist
+
'
\n
'
)
for
i
in
range
(
1
,
len
(
self
.
track
)):
new
.
write
(
self
.
id
+
'.track.'
+
`i`
+
':
\t
'
+
\
self
.
track
[
i
]
+
'
\n
'
)
old
.
close
()
new
.
close
()
posix
.
rename
(
filename
+
'.new'
,
filename
)
Lib/plat-sunos4/SUNAUDIODEV.py
0 → 100755
Dosyayı görüntüle @
73b715e2
# Symbolic constants for use with sunaudiodev module
# The names are the same as in audioio.h with the leading AUDIO_
# removed.
# Encoding types, for fields i_encoding and o_encoding
ENCODING_ULAW
=
1
ENCODING_ALAW
=
2
# Gain ranges for i_gain, o_gain and monitor_gain
MIN_GAIN
=
0
MAX_GAIN
=
255
# Port names for i_port and o_port
PORT_A
=
1
PORT_B
=
2
PORT_C
=
3
PORT_D
=
4
SPEAKER
=
PORT_A
HEADPHONE
=
PORT_B
MICROPHONE
=
PORT_A
Lib/sunos4/SUNAUDIODEV.py
0 → 100755
Dosyayı görüntüle @
73b715e2
# Symbolic constants for use with sunaudiodev module
# The names are the same as in audioio.h with the leading AUDIO_
# removed.
# Encoding types, for fields i_encoding and o_encoding
ENCODING_ULAW
=
1
ENCODING_ALAW
=
2
# Gain ranges for i_gain, o_gain and monitor_gain
MIN_GAIN
=
0
MAX_GAIN
=
255
# Port names for i_port and o_port
PORT_A
=
1
PORT_B
=
2
PORT_C
=
3
PORT_D
=
4
SPEAKER
=
PORT_A
HEADPHONE
=
PORT_B
MICROPHONE
=
PORT_A
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