Class MusicBrainz::DiscID::TrackInfo
In: lib/mb-discid.rb
Parent: Object

This class holds information about a single track.

Currently this includes the following fields:

number
The number of the track on the disc.
sectors
Length of the track in sectors.
start_sector
Start position of the track on the disc in sectors.
end_sector
End position of the track on the disc in sectors.
seconds
Length of the track in seconds.
start_time
Start position of the track on the disc in seconds.
end_time
End position of the track on the disc in seconds.

You can access all fields either with directly or with the square bracket notation:

 track = TrackInfo.new(1, 150, 16007)
 puts track.sectors   # 16007
 puts track[:sectors] # 16007
See:DiscID#track_details

Methods

[]   end_sector   end_time   new   seconds   start_time   to_hash  

Attributes

isrc  [R]  ISRC number of the trac
number  [R]  The number of the track on the disc.
sectors  [R]  Length of the track in sectors.
start_sector  [R]  Start position of the track on the disc in sectors.

Public Class methods

Public Instance methods

Allows access to all fields similar to accessing values in a hash.

Example:

 track = TrackInfo.new(1, 150, 16007)
 puts track.sectors   # 16007
 puts track[:sectors] # 16007

End position of the track on the disc in sectors.

End position of the track on the disc in seconds.

Length of the track in seconds.

Start position of the track on the disc in seconds.

Converts the TrackInfo into a Hash.

[Validate]