Class: C64GeosPhotoAlbum

Inherits:
C64GeosFile show all
Defined in:
lib/native_file_types/c64/C64GeosPhotoAlbum.rb

Instance Attribute Summary

Attributes inherited from NativeFileType

#aux_code, #contents, #file_system_image, #file_type, #filename, #meta_data

Instance Method Summary collapse

Methods inherited from C64GeosFile

#contents, #header_filename, #icon_background, #icon_bitmap, #icon_foreground, #icon_format, #icon_height, #icon_tag, #icon_width, #info_block, #load_address, #meta_data, #parent_application, #record_nos, #to_hex_dump, #to_icon

Methods inherited from CbmFile

file_system_file_types

Methods inherited from NativeFileType

#<=>, #==, all_native_file_types, best_fit, code_for_tests, compatability_score, #data_without_header, file_type_matches?, #full_filename, #header_length, #initialize, is_valid_file_if, load_address, #load_address, matching_score, native_file_types_possible_on_file_system, non_matching_score, #to_hex_dump, #to_info_dump

Methods included from SubclassTracking

extended

Constructor Details

This class inherits a constructor from NativeFileType

Instance Method Details

#filesObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/native_file_types/c64/C64GeosPhotoAlbum.rb', line 24

def files
	if @files.nil? then
		@files=[]
		titles=
				
		record_nos.each do |r|
			next if r==0 
			next if version.to_i>1 && r==record_nos.last #version 2 albums have titles
			
			title_offset=1+(17*(r-1))
			title=""
			if (version.to_i>1) then
				17.times do |i|
					b=@contents[record_nos.last][title_offset+i]
					break if b==0 || b.nil?
					title<<b.chr
				end
			end
			title=("scrap %02x" % r) if title.length<1
			@files<<C64PhotoScrap.new(self,"#{filename}/#{title}",@contents[r])
		end
	end
	@files
end

#type_descriptionObject



16
17
18
# File 'lib/native_file_types/c64/C64GeosPhotoAlbum.rb', line 16

def type_description
	"GEOS Photo Album (#{version})"
end

#versionObject



20
21
22
23
# File 'lib/native_file_types/c64/C64GeosPhotoAlbum.rb', line 20

def version
	(@contents[0][0x5A,3])

end