このcdromモジュールでパソコンのCD/DVDドライブの制御を行えます。音楽CDの再生も行えます。このモジュールを使用する際は事前に初期化をしなければいけません。pygame.cdrom.CD命令で作成した各CDオブジェクトでは一つのCDドライブの操作を行え、CDオブジェクトの命令を使用する際も個々に初期化を行わなければいけません。
The cdrom module manages the CD and DVD drives on a computer. It can also control the playback of audio cd's. This module needs to be initialized before it can do anything. Each CD object you create represents a cdrom drive and must also be initialized individually before it can do most things.
cdromモジュールを初期化します。この命令ではパソコンに接続された全てのCDドライブを調べます。cdromモジュールの他の命令を実行する前には初期化を行っていなければなりません。 この命令はpygame.init命令を実行したときに自動的に実行されます。
この命令を複数回実行しても特に問題ありません。
Initialize the cdrom module. This will scan the system for all CD devices. The module must be initialized before any other functions will work. This automatically happens when you call pygame.init - initialize all imported pygame modules.
It is safe to call this function more than once.
cdromモジュールの初期化を解除します。この命令を実行すると作成済みのCDオブジェクトも使用できなくなります。
この命令を複数回実行しても特に問題ありません。
Uninitialize the cdrom module. After you call this any existing CD objects will no longer work.
It is safe to call this function more than once.
cdromモジュールが初期化済みかどうか調べます。個々のCDドライブの初期化は別途個別に行われているので、CD.init命令で行った初期化状態までは調べられません。
Test if the cdrom module is initialized or not. This is different than the CD.init - initialize a cdrom drive for use since each drive must also be initialized individually.
パソコンに接続されているCDドライブの数を戻り値として返します。pygame.cdrom.CD命令でCDオブジェクトを作成する際にはCDドライブを識別するための定数を設定するのですが、その定数は個々で取得される数より小さい値でなければなりません。パソコンにCDドライブが付いていない場合は0が戻り値として返されます。
Return the number of cd drives on the system. When you create CD objects you need to pass an integer id that must be lower than this count. The count will be 0 if there are no drives on the system.
パソコンに接続されているCDドライブ一つにつき一つのCDオブジェクトを作成できます。pygame.cdrom.get_count命令を使用すればパソコンにいくつのCDドライブが接続されているかが分かります。id引数にはCDドライブの識別番号を設定します。識別番号は、パソコンに接続されているCDドライブの数に合わせた0から始まる整数となります。
CDオブジェクトが初期化されていない状態ではCD.get_id命令とCD.get_name命令しか実行できません。
一つのCDドライブに対して複数のCDオブジェクトを作成しても特に問題はなく、各オブジェクトを通じて正常にCDドライブの操作を行えます。
You can create a CD object for each cdrom on the system. Use pygame.cdrom.get_count - number of cd drives on the system to determine how many drives actually exist. The id argument is an integer of the drive, starting at zero.
The CD object is not initialized, you can only call CD.get_id - the index of the cdrom drive and CD.get_name - the system name of the cdrom drive on an uninitialized drive.
It is safe to create multiple CD objects for the same drive, they will all cooperate normally.
cdromドライブを使用するために初期化を行います。他のpygameモジュールが初期化済みであっても、CD操作命令を実行するにはドライブの初期化が行われていなければなりません。
ドライブを初期化する間、プログラムが少し停止する場合があります。プログラムを1~2秒たりとも停止させたくない場合はCD.init命令を使うのは避けてください。
Initialize the cdrom drive for use. The drive must be initialized for most CD methods to work. Even if the rest of pygame has been initialized.
There may be a brief pause while the drive is initialized. Avoid CD.init - initialize a cdrom drive for use if the program should not stop for a second or two.
ドライブを使用するために初期化を行います。しばらくCDドライブの操作を行わないのであれば、この命令を実行してください。
Uninitialize a drive for use. Call this when your program will not be accessing the drive for awhile.
CDROMドライブが初期化されているか調べます。個々のCDドライブの初期化は別途個別に行われているので、pygame.cdrom.init命令で行った初期化状態までは調べられません。
Test if this CDROM device is initialized. This is different than the pygame.cdrom.init - initialize the cdrom module since each drive must also be initialized individually.
CDドライブにセットされている音楽CDを再生します。再生するトラックナンバーを指定する引数以外にも、再生の開始時間や終了時間も引数に設定することができます。開始・終了時間は秒単位で設定し、音楽の再生される範囲を制限することができます。
start引数を設定してend引数を設定しなかった場合、音楽はトラックの最後まで再生されます。 start引数を設定してend引数に'None'を設定した場合、音楽はディスクの最後まで再生されます。
再生するトラックを調べる方法についてはCD.get_numtracks命令やCD.get_track_audio命令を参照してください。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Playback audio from an audio cdrom in the drive. Besides the track number argument, you can also pass a starting and ending time for playback. The start and end time are in seconds, and can limit the section of an audio track played.
If you pass a start time but no end, the audio will play to the end of the track. If you pass a start time and 'None' for the end time, the audio will play to the end of the entire disc.
See the CD.get_numtracks - the number of tracks on the cdrom and CD.get_track_audio - true if the cdrom track has audio data to find tracks to playback.
Note, track 0 is the first track on the CD. Track numbers start at zero.
cdromの音楽再生を終了します。現在の再生位置情報は失われます。CDドライブで音楽の再生が行われていない場合は、この命令を実行しても何も起こりません。
Stops playback of audio from the cdrom. This will also lose the current playback position. This method does nothing if the drive isn't already playing audio.
CDの音楽再生を一時停止します。CD.resume命令を使用することで停止位置から再生を再開できます。 CDの音楽再生が行われていない場合は、この命令を実行しても何も起こりません。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Temporarily stop audio playback on the CD. The playback can be resumed at the same point with the CD.resume - unpause audio playback method. If the CD is not playing this method does nothing.
Note, track 0 is the first track on the CD. Track numbers start at zero.
CDの一時停止を解除します。CDが一時停止されていなかったり、既に再生が開始されている場合は、この命令を実行しても何も起こりません。
Unpause a paused CD. If the CD is not paused or already playing, this method does nothing.
この命令でCDトレイを開くことができます。CDが再生中だったり一時停止状態だった場合、その再生は終了されます。
This will open the cdrom drive and eject the cdrom. If the drive is playing or paused it will be stopped.
CDインスタンスの作成に使われる識別番号を戻り値として返します。CDインスタンスが初期化されていなくてもこの命令は実行することができます。
Returns the integer id that was used to create the CD instance. This method can work on an uninitialized CD.
ドライブの名前を文字列型の戻り値として返します。これはドライブを分かりやすく表すのに使用されるシステム名です。大抵はcdromドライブのドライブ文字か、機器名が取得されます。CDインスタンスが初期化されていなくてもこの命令は実行することができます。
Return the string name of the drive. This is the system name used to represent the drive. It is often the drive letter or device name. This method can work on an uninitialized CD.
CDドライブが再生中の場合はTrueが戻り値として返ります。
Returns True if the drive busy playing back audio.
CDドライブが一時停止状態の場合はTrueが戻り値として返ります。
Returns True if the drive is currently paused.
現在再生しているトラックナンバーとトラック再生時間の二つを戻り値として返します。この命令は音楽が再生中か一時停止状態の時に実行できます。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Returns both the current track and time of that track. This method works when the drive is either playing or paused.
Note, track 0 is the first track on the CD. Track numbers start at zero.
音楽CDがドライブにセットされている場合はFalseが戻り値として返されます。ドライブに何もセットされていない場合はTrueが戻り値として返されます。
Return False if there is a cdrom currently in the drive. If the drive is empty this will return True.
ドライブにセットされた音楽CDのトラック数を戻り値として返します。CDがセットされていなかったり、CDに音楽トラックがない場合は0を戻り値として返します。
Return the number of tracks on the cdrom in the drive. This will return zero of the drive is empty or has no tracks.
cdromに音楽データトラックがあるかどうかを確認します。またCD.num_tracks()命令やCD.get_all命令を使用することでより詳細なCDのトラック情報を確認することもできます。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Determine if a track on a cdrom contains audio data. You can also call CD.num_tracks() and CD.get_all - get all track information to determine more information about the cdrom.
Note, track 0 is the first track on the CD. Track numbers start at zero.
cdromに記録された全てのトラック情報をリスト型の戻り値として取得します。各トラック情報には4つの値がタプル形式で入っています。audio値は、トラックに音楽データが記録されている場合にTrueとなります。start値・end値・length値は、秒単位の浮動小数点で表されます。start値とend値の時間位置については、cd全体を通した再生時間内での絶対位置となります。
Return a list with information for every track on the cdrom. The information consists of a tuple with four values. The audio value is True if the track contains audio data. The start, end, and length values are floating point numbers in seconds. Start and end represent absolute times on the entire disc.
指定したトラックの再生開始時間を、cd全体を通した再生時間内での絶対位置で取得します。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Return the absolute time in seconds where at start of the cdrom track.
Note, track 0 is the first track on the CD. Track numbers start at zero.
指定したトラックの再生時間を、秒単位の浮動小数点で取得します。
トラック0がCDの一番初めのトラックになるので注意してください。トラックナンバーは0から始まります。
Return a floating point value in seconds of the length of the cdrom track.
Note, track 0 is the first track on the CD. Track numbers start at zero.