Class: LiveAudioClip
- Inherits:
-
Object
- Object
- LiveAudioClip
- Defined in:
- lib/live_set/live_set_audio_clip.rb
Instance Attribute Summary collapse
-
#absolute_path ⇒ Object
readonly
Returns the value of attribute absolute_path.
-
#file_ref ⇒ Object
readonly
Returns the value of attribute file_ref.
-
#file_size ⇒ Object
readonly
Returns the value of attribute file_size.
-
#file_type ⇒ Object
readonly
Returns the value of attribute file_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_modified ⇒ Object
readonly
Returns the value of attribute last_modified.
-
#live_pack_name ⇒ Object
readonly
Returns the value of attribute live_pack_name.
-
#need_refreeze ⇒ Object
readonly
Returns the value of attribute need_refreeze.
-
#relative_path ⇒ Object
readonly
Returns the value of attribute relative_path.
-
#relative_path_type ⇒ Object
readonly
Returns the value of attribute relative_path_type.
Instance Method Summary collapse
- #collected? ⇒ Boolean
-
#initialize(id, need_refreeze, clip_slot) ⇒ LiveAudioClip
constructor
A new instance of LiveAudioClip.
- #show_clip ⇒ Object
Constructor Details
#initialize(id, need_refreeze, clip_slot) ⇒ LiveAudioClip
Returns a new instance of LiveAudioClip.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/live_set/live_set_audio_clip.rb', line 8 def initialize(id, need_refreeze, clip_slot) @id = id @need_refreeze = need_refreeze @audio_clip = clip_slot.Value.AudioClip @file_ref = @audio_clip.SampleRef.FileRef @last_modified = Time.at(@audio_clip.SampleRef.LastModDate['Value'].to_i).utc.to_datetime @absolute_path = @file_ref.Path['Value'] @file_size = @file_ref.OriginalFileSize['Value'].to_i @file_type = @file_ref.Type['Value'] # What do these values mean? @live_pack_name = @file_ref.LivePackName['Value'] @relative_path = @file_ref.RelativePath['Value'] @relative_path_type = @file_ref.RelativePathType['Value'] # What do these values mean? end |
Instance Attribute Details
#absolute_path ⇒ Object (readonly)
Returns the value of attribute absolute_path.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def absolute_path @absolute_path end |
#file_ref ⇒ Object (readonly)
Returns the value of attribute file_ref.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def file_ref @file_ref end |
#file_size ⇒ Object (readonly)
Returns the value of attribute file_size.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def file_size @file_size end |
#file_type ⇒ Object (readonly)
Returns the value of attribute file_type.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def file_type @file_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def id @id end |
#last_modified ⇒ Object (readonly)
Returns the value of attribute last_modified.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def last_modified @last_modified end |
#live_pack_name ⇒ Object (readonly)
Returns the value of attribute live_pack_name.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def live_pack_name @live_pack_name end |
#need_refreeze ⇒ Object (readonly)
Returns the value of attribute need_refreeze.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def need_refreeze @need_refreeze end |
#relative_path ⇒ Object (readonly)
Returns the value of attribute relative_path.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def relative_path @relative_path end |
#relative_path_type ⇒ Object (readonly)
Returns the value of attribute relative_path_type.
4 5 6 |
# File 'lib/live_set/live_set_audio_clip.rb', line 4 def relative_path_type @relative_path_type end |
Instance Method Details
#collected? ⇒ Boolean
24 25 26 |
# File 'lib/live_set/live_set_audio_clip.rb', line 24 def collected? @relative_path.start_with? 'Samples/Imported/' end |
#show_clip ⇒ Object
28 29 30 |
# File 'lib/live_set/live_set_audio_clip.rb', line 28 def show_clip [" #{@relative_path}", human_file_size(@file_size).rjust(8, ' '), @last_modified.strftime('%Y-%m-%d %H:%M:%S')] end |