Class: Multimedia_citation_record

Inherits:
GEDCOMBase show all
Defined in:
lib/gedcom/multimedia_citation_record.rb

Overview

Internal representation of a reference to the GEDCOM level 0 OBJE record type GEDCOM has both inline OBJE records and references to level 0 OBJE records. both are stored stored in a Multimedia_record class and both get referenced through this class.

=MULTIMEDIA_LINK:= n OBJE @<XREF:OBJE>@ 1:1 | n OBJE +1 FILE <MULTIMEDIA_FILE_REFN> +2 FORM <MULTIMEDIA_FORMAT> +3 MEDI <SOURCE_MEDIA_TYPE> +1 TITL <DESCRIPTIVE_TITLE>

This structure provides two options in handling the GEDCOM multimedia interface. The first alternative (embedded) includes all of the data, including the multimedia object, within the transmission file. The embedded method includes pointers to GEDCOM records that contain encoded image or sound objects. Each record represents a multimedia object or object fragment. An object fragment is created by breaking the multimedia files into several multimedia object records of 32K or less. These fragments are tied together by chaining from one multimedia object fragment to the next in sequence. This procedure will help manage the size of a multimedia GEDCOM record so that existing systems which are not expecting large multimedia records may discard the records without crashing due to the size of the record. Systems which handle embedded multimedia can reconstitute the multimedia fragments by decoding the object fragments and concatenating them to the assigned multimedia file.

This second method allows the GEDCOM context to be connected to an external multimedia file. GEDCOM defines this in the MULTIMEDIA_LINK definition, but I have put it into the Multimedia_record. as the attributes are the same, except BLOB becomes FILE. A Multimedia_citation_record is also created to make all references to Multimedia records consistent.

This process is only managed by GEDCOM in the sense that the appropriate file name is included in the GEDCOM file in context, but the maintenance and transfer of the multimedia files are external to GEDCOM. The parser can just treat this as a comment and doesn't check for the file being present.

The attributes are all arrays for the level +1 tags/records. * Those ending in ref are GEDCOM XREF index keys * Those ending in record are array of classes of that type. * The remainder are arrays of attributes that could be present in this record.

Instance Attribute Summary collapse

Attributes inherited from GEDCOMBase

#restriction

Instance Method Summary collapse

Methods inherited from GEDCOMBase

#changed, #changed?, #created?, #find, #initialize, #locked?, no_tabs, #private?, #save, tabs, #to_db, #to_s, #to_s_ordered, #to_s_r, #token_to_s, #xref_check

Constructor Details

This class inherits a constructor from GEDCOMBase

Instance Attribute Details

#multimedia_recordObject

Returns the value of attribute multimedia_record.



41
42
43
# File 'lib/gedcom/multimedia_citation_record.rb', line 41

def multimedia_record
  @multimedia_record
end

#multimedia_refObject

Returns the value of attribute multimedia_ref.



41
42
43
# File 'lib/gedcom/multimedia_citation_record.rb', line 41

def multimedia_ref
  @multimedia_ref
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



42
43
44
# File 'lib/gedcom/multimedia_citation_record.rb', line 42

def note_citation_record
  @note_citation_record
end

Instance Method Details

#to_gedcom(level = 0) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/gedcom/multimedia_citation_record.rb', line 46

def to_gedcom(level=0)
  if @multimedia_ref != nil
    @this_level = [ [:xref, "OBJE", :multimedia_ref] ]
    @sub_level =  [#level +1
                    [:walk, nil,    :note_citation_record ],
                  ]
  else
    @this_level = [ [:walk, nil, :multimedia_record] ]
    @sub_level =  [#level +1
                  ]
  end
  super(level)
end