live_set 0.2.0 → 0.2.2

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: 383208bd53c5b54e254945faa8d79ae100b78a1dd34fa3820abdaec8dc1b2854
4
- data.tar.gz: b6d6ae70303f7ff3a2c43039a27ca2424c8296dcf6cf36d3ff9a572d4d285b97
3
+ metadata.gz: dc8a391b89faff33b3611d93ff5223d28d14c9a87359bc98a9005b93908db8d9
4
+ data.tar.gz: a2aab3005d94ad93eaf5f94bd61af6770b1656ce1addc8d54a83bab20e3faeb3
5
5
  SHA512:
6
- metadata.gz: 1e2078593ba88bb503c9a2a712bc85362f05b31ceec83a3276785a3b01961d8c85b6c6cc3bf7822670e1e4bb4372dfb214225ab1cbe927f9e6ffab541539560a
7
- data.tar.gz: 408994bfca9f20dec4df040cee40268da9339549963ee10da80725f2dc4f619ec01db53d1df4e0c02389aeee6224f8c7ecf1bb21044ce24878a56fb5177a2039
6
+ metadata.gz: 54672b577455e31011165d8c78e1402ac74754f67d53ae07ca9fff123af8263c06650960fa8ce372511f8c26f6d206a9ab829253d4951a9eb7bfa08cd9c5cb6f
7
+ data.tar.gz: 24c3db212c86904c2935c6ea4bad27c80e6ed2e2ca535f4e32cd83b9828f96bdadf3bc1a62bb0f6ae9dc2b7c40a85821aa3db5b79bfe18f3dacd4d3ec4f8bbc5
data/CHANGELOG.md CHANGED
@@ -1,9 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.2.2
4
+
5
+ * Displays `Ready for transfer to Push 3 Standalone` in green if Live set is ready,
6
+ or displays the reasons for not being ready in red.
7
+
8
+ ## 0.2.1
9
+
10
+ * Corrected missing help method for the `live_set` command.
11
+ * Prompts user if they want the extra directory renamed to `Ableton Project Info-`.
12
+
13
+
3
14
  ## 0.2.0
4
15
 
5
16
  * Checks `Ableton Project Info` validity all up the directory tree.
6
- * Prompts user if they want the extra directory renamed to `Ableton Project Info-`.
7
17
  * Reports the clips in the set, and their sizes.
8
18
  * Generates a warning if the total size of the clips might cause freezing to fail.
9
19
 
@@ -1,5 +1,7 @@
1
1
  require 'date'
2
2
  require 'fileutils'
3
+ require 'highline'
4
+ require 'shellwords'
3
5
  require_relative '../common/run'
4
6
 
5
7
  class AlsDelta
@@ -26,6 +28,7 @@ class AlsDelta
26
28
 
27
29
  def backup_set
28
30
  @backup_name = backup_name
31
+ puts "Backing up Live set to '#{@backup_name}'"
29
32
  FileUtils.cp @set_name, @backup_name
30
33
  end
31
34
 
@@ -33,16 +36,25 @@ class AlsDelta
33
36
  return if @options[:keep] || !@backup_name
34
37
  return unless File.exist? @backup_name
35
38
 
36
- puts "Deleting #{@backup_name}"
39
+ puts "Deleting '#{@backup_name}'"
37
40
  File.delete @backup_name
38
41
  end
39
42
 
40
43
  def show
41
- output = run_capture_stdout "zdiff '#{@backup_name}' '#{@set_name}'"
42
- if output.empty?
43
- puts 'There were no changes to the saved live set.'
44
- else
45
- puts output.join("\n")
44
+ backup_set
45
+ loop do
46
+ puts 'Press any key to display the changes to the Live set XML file, or press Esc to exit.'
47
+ character = $stdin.getch
48
+ exit if character.ord == 27
49
+ output = run_capture_stdout "GZIP=--no-name zdiff #{@set_name.shellescape} #{@backup_name.shellescape}"
50
+ if output.empty?
51
+ puts 'There were no changes to the saved live set.'
52
+ else
53
+ puts output.join("\n")
54
+ backup_set
55
+ end
56
+ rescue StandardError => e
57
+ puts e
46
58
  end
47
59
  end
48
60
  end
@@ -1,7 +1,7 @@
1
1
  require 'colorator'
2
2
  require 'optparse'
3
3
 
4
- VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze
4
+ VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze unless defined? VERBOSITY
5
5
 
6
6
  def common(command)
7
7
  @options = parse_options command
@@ -16,6 +16,23 @@ 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.relative_path}' has not been collected".red unless clip.relative_path.start_with?('Samples/Imported/')
31
+ end
32
+ end
33
+ response.join "\n"
34
+ end
35
+
19
36
  def summary
20
37
  all_frozen_msg = all_frozen ? ' (All are frozen)'.yellow : ''
21
38
  push_warning = all_frozen ? '' : "\nWarning: some tracks are not frozen, so this set should not be transferred to Push 3 Standalone.".red
@@ -27,6 +44,7 @@ class AllTracks
27
44
  end
28
45
  total_set_size = "Total set size: #{human_file_size total_size}".yellow
29
46
  <<~END_MSG
47
+ #{p3s_tx_msg}
30
48
  #{total_set_size}#{size_warning}#{push_warning}
31
49
  #{@track_instances.count} tracks#{all_frozen_msg}:
32
50
  END_MSG
@@ -20,6 +20,10 @@ class LiveAudioClip
20
20
  @relative_path_type = @file_ref.RelativePathType['Value'] # What do these values mean?
21
21
  end
22
22
 
23
+ def collected?
24
+ @relative_path.start_with? 'Samples/Imported/'
25
+ end
26
+
23
27
  def show_clip
24
28
  [" #{@relative_path}", human_file_size(@file_size).rjust(8, ' '), @last_modified.strftime('%Y-%m-%d %H:%M:%S')]
25
29
  end
@@ -19,6 +19,10 @@ class LiveAudioTrack
19
19
  @track_size = @audio_clips.sum(&:file_size) || 0
20
20
  end
21
21
 
22
+ def clips_collected?
23
+ @audio_clips.all?(&:collected?)
24
+ end
25
+
22
26
  def show_track(all_frozen)
23
27
  name = @audio_track.Name.EffectiveName['Value']
24
28
  frozen = !all_frozen && @audio_track.frozen? ? ' **frozen**' : ''
@@ -1,3 +1,6 @@
1
+ require 'colorator'
2
+ require 'highline'
3
+
1
4
  class LiveSet
2
5
  private
3
6
 
@@ -9,12 +12,18 @@ class LiveSet
9
12
 
10
13
  cur_dir = Pathname.new(set_directory).parent
11
14
  while cur_dir
12
- if File.exist? File.join(cur_dir, 'Ableton Project Info')
13
- puts "Warning: 'Ableton Project Info' exists in parent directory '#{cur_dir.to_path}'".red
14
- end
15
+ project_info_path = File.join(cur_dir, 'Ableton Project Info')
16
+ add_dash_suffix(project_info_path) if File.exist? project_info_path
15
17
  break if cur_dir.to_path == '/'
16
18
 
17
19
  cur_dir = cur_dir.parent
18
20
  end
19
21
  end
22
+
23
+ def add_dash_suffix(cur_dir, path)
24
+ puts "Warning: 'Ableton Project Info' exists in parent directory '#{cur_dir.to_path}'".red
25
+ return unless HighLine.agree("\nDo you want the directory to be disabled by suffixing a dash to its name? ", character = true)
26
+
27
+ File.rename path, "#{path}-"
28
+ end
20
29
  end
@@ -1,14 +1,14 @@
1
1
  require 'colorator'
2
2
  require 'optparse'
3
3
 
4
- VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze
4
+ VERBOSITY = %w[trace debug verbose info warning error fatal panic quiet].freeze unless defined? VERBOSITY
5
5
 
6
- def live_set(msg = nil)
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.0'.freeze unless defined? VERSION
2
+ VERSION = '0.2.2'.freeze unless defined? VERSION
3
3
  end
data/lib/live_set.rb CHANGED
@@ -22,7 +22,6 @@ def als_delta
22
22
 
23
23
  als_delta = AlsDelta.new set_name, **@options
24
24
  catch :ctrl_c do
25
- als_delta.backup_set
26
25
  als_delta.show
27
26
  als_delta.cleanup
28
27
  rescue Exception # rubocop:disable Lint/RescueException
data/live_set.gemspec CHANGED
@@ -33,5 +33,6 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_dependency 'bytesize'
35
35
  spec.add_dependency 'colorator'
36
+ spec.add_dependency 'highline'
36
37
  spec.add_dependency 'nokogiri'
37
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: live_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Slinn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bytesize
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: highline
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: nokogiri
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -71,7 +85,7 @@ files:
71
85
  - als_notes.md
72
86
  - exe/als_delta
73
87
  - exe/live_set
74
- - lib/als_delta/ als_delta_class.rb
88
+ - lib/als_delta/als_delta_class.rb
75
89
  - lib/als_delta/als_delta_options.rb
76
90
  - lib/common/common.rb
77
91
  - lib/common/run.rb