live_set 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9caef58c0bed30ead696f9d64848c74038aa520d83a2c47796cb0081c0ad6b14
4
- data.tar.gz: 85906715baa37c0ed5a2fd4f0a101e37d5c5728a4385f0754d120514b18d7b89
3
+ metadata.gz: 32e6a9b1a71d9857578af4ffc6cc644eaf476cf719af3be8c8983f2c51dd1f3a
4
+ data.tar.gz: b4c43b90e98dfb6917d998bf274a603275e6c90a1601977597d5d65d7e3aa77c
5
5
  SHA512:
6
- metadata.gz: 88404bf0b8d04663da0d7a334a8affd9d930df965af1b3fed1b3a2b9286881380ecba7882badbf71d0612674a3f77775a436a6e5a505a4bb9b25801522ad5ab6
7
- data.tar.gz: d633040d514b77e4984e936c4676fd5f124ee30da405b6c612f916edbd33625cbacb0a1d35812aaae393f03436cab2054144e54a75db1214ba64196c92511cf4
6
+ metadata.gz: b400c0bedce4e5d903abe7b32d50abf4087ba1ab7cbf077a5bd559c9fda2a9a9ebf322710cbe211223413e8d79b83cd0fdf583526f5d514094d88d97a94cb7b6
7
+ data.tar.gz: '0891c4261574ef1d988070eba9f8bdd8cd29fc6eb5a3733a41a8afa714e2f46dd0da61a8a06d58cde5d81a8ea96ea76dfea83ccc2c1b9fb923ebfa974a5dfd86'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.3
4
+
5
+ * Improved warning messages.
6
+
7
+
8
+ ## 0.2.2
9
+
10
+ * Displays `Ready for transfer to Push 3 Standalone` in green if Live set is ready,
11
+ or displays the reasons for not being ready in red.
3
12
 
4
13
  ## 0.2.1
5
14
 
@@ -16,9 +16,28 @@ class AllTracks
16
16
  end
17
17
  end
18
18
 
19
+ def ready_for_p3s
20
+ @track_instances.all?(&:clips_collected?) && all_frozen
21
+ end
22
+
23
+ def p3s_tx_msg
24
+ return 'Ready for transfer to Push 3 Standalone'.green if ready_for_p3s
25
+
26
+ response = []
27
+ response << ' - Some tracks are not frozen.'.red unless all_frozen
28
+ @track_instances.each do |track|
29
+ track.audio_clips.each do |clip|
30
+ response << " - Clip '#{clip.absolute_path}' has not been collected.".red unless clip.relative_path.start_with?('Samples/Imported/')
31
+ end
32
+ end
33
+ response.reverse!
34
+ response << 'Warning: This set should not be transferred to Push 3 Standalone.'.red
35
+ response.reverse!
36
+ response.join "\n"
37
+ end
38
+
19
39
  def summary
20
40
  all_frozen_msg = all_frozen ? ' (All are frozen)'.yellow : ''
21
- push_warning = all_frozen ? '' : "\nWarning: some tracks are not frozen, so this set should not be transferred to Push 3 Standalone.".red
22
41
  total_size = @track_instances.sum(&:track_size)
23
42
  size_warning = if total_size >= 2_000_000_000
24
43
  "\nWarning: This set is too large to be frozen and too large too large to transfer to Push 3 Standalone.".red
@@ -27,7 +46,8 @@ class AllTracks
27
46
  end
28
47
  total_set_size = "Total set size: #{human_file_size total_size}".yellow
29
48
  <<~END_MSG
30
- #{total_set_size}#{size_warning}#{push_warning}
49
+ #{p3s_tx_msg}
50
+ #{total_set_size}#{size_warning}
31
51
  #{@track_instances.count} tracks#{all_frozen_msg}:
32
52
  END_MSG
33
53
  end
@@ -1,7 +1,8 @@
1
1
  require 'date'
2
2
 
3
3
  class LiveAudioClip
4
- attr_reader :file_size
4
+ attr_reader :absolute_path, :file_ref, :file_size, :file_type, :id, :last_modified, :live_pack_name, :need_refreeze, :relative_path,
5
+ :relative_path_type
5
6
 
6
7
  # @param audio_clip is an inner <ClipSlot/> element from an Ableton Live .als file as parsed by Nokogiri
7
8
  def initialize(id, need_refreeze, clip_slot)
@@ -20,6 +21,10 @@ class LiveAudioClip
20
21
  @relative_path_type = @file_ref.RelativePathType['Value'] # What do these values mean?
21
22
  end
22
23
 
24
+ def collected?
25
+ @relative_path.start_with? 'Samples/Imported/'
26
+ end
27
+
23
28
  def show_clip
24
29
  [" #{@relative_path}", human_file_size(@file_size).rjust(8, ' '), @last_modified.strftime('%Y-%m-%d %H:%M:%S')]
25
30
  end
@@ -1,5 +1,5 @@
1
1
  class LiveAudioTrack
2
- attr_reader :frozen, :track_size
2
+ attr_reader :audio_clips, :clip_slots, :frozen, :id, :track_size
3
3
 
4
4
  # @param audio_track is an <AudioTrack/> element from an Ableton Live .als file as parsed by Nokogiri
5
5
  def initialize(audio_track)
@@ -13,16 +13,22 @@ class LiveAudioTrack
13
13
  clip_slot_id = clip_slot['Id']
14
14
  need_refreeze = clip_slot.NeedRefreeze['Value'].to_bool
15
15
  inner_clip_slot = clip_slot.ClipSlot
16
- LiveAudioClip.new clip_slot_id, need_refreeze, inner_clip_slot if inner_clip_slot.respond_to?(:Value) && !inner_clip_slot.Value.children.empty?
16
+ LiveAudioClip.new clip_slot_id, need_refreeze, inner_clip_slot if
17
+ inner_clip_slot.respond_to?(:Value) && !inner_clip_slot.Value.children.empty?
17
18
  end
18
19
  @audio_clips.compact!
19
20
  @track_size = @audio_clips.sum(&:file_size) || 0
20
21
  end
21
22
 
23
+ def clips_collected?
24
+ @audio_clips.all?(&:collected?)
25
+ end
26
+
22
27
  def show_track(all_frozen)
23
28
  name = @audio_track.Name.EffectiveName['Value']
24
- frozen = !all_frozen && @audio_track.frozen? ? ' **frozen**' : ''
25
- "Track '#{name}'#{frozen} (#{@audio_clips.length} clips, totaling #{human_file_size @track_size})\n" + show_clips
29
+ frozen = @audio_track.frozen? ? ' frozen'.green : ' **not frozen**'.red unless all_frozen || @audio_clips.empty?
30
+ size = ", totaling #{human_file_size @track_size}" unless @audio_clips.empty?
31
+ "Track '#{name}'#{frozen} (#{@audio_clips.length} clips#{size})\n" + show_clips
26
32
  end
27
33
 
28
34
  def show_clips
@@ -6,9 +6,9 @@ VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze
6
6
  def help_live_set(msg = nil)
7
7
  printf "Error: #{msg}\n\n".yellow unless msg.nil?
8
8
  msg = <<~END_HELP
9
- Live_sete displays information about an Ableton Live set or converts a Live 12 set to Live 11 format.
9
+ Live_set displays information about an Ableton Live set or converts a Live 12 set to Live 11 format.
10
10
  If the special folder called 'Ableton Project Info' is not present in the same folder as the .als file, a warning is generated.
11
- Similarly, if 'Ableton Project Info' is present in any parent folder, a warning is issued.
11
+ Similarly, if 'Ableton Project Info' is present in any parent folder, a warning is issued and the user is asked if the directory should be renamed.
12
12
 
13
13
  Syntax: live_set OPTIONS PATH_TO_ALS_FILE
14
14
 
@@ -1,3 +1,3 @@
1
1
  module LiveSetVersion
2
- VERSION = '0.2.1'.freeze unless defined? VERSION
2
+ VERSION = '0.2.3'.freeze unless defined? VERSION
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn