Class MyTracks
In: db/mytracks.rb
Parent: Hash

Collection of all tracks in database (one per app)

Methods
new    randomTrack   
Public Class methods
new(discs)

Set up from disc database.

discs
from MyDiscs.discs
# File db/mytracks.rb, line 50
  def initialize(discs)
    super()
    discs.each_value { 
      |disc|
      key = disc.key
      disc.dtracks.each {
	|track|
	self[ [key, track.trk] ] = track
      }
    }
  end
Public Instance methods
randomTrack()

Pick a pseudo-random track.

# File db/mytracks.rb, line 63
  def randomTrack()
#    n = 0
    lim = self.size
    keys = self.keys
#    now = Time.now.to_i
#    begin
#      n += 1
#      t = self[keys[rand(lim).to_i]]
#    end until (now - t.song.lastplayed) > MinPlayWait || n >= lim / 4
#    return t
    return self[keys[rand(lim).to_i]]
  end