MusicMaster 0.0.1.20101110 → 1.0.0.20120307

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.
Files changed (49) hide show
  1. data/AUTHORS +4 -1
  2. data/ChangeLog +28 -0
  3. data/LICENSE +1 -1
  4. data/README +2 -5
  5. data/ReleaseInfo +8 -8
  6. data/bin/Calibrate.rb +55 -0
  7. data/bin/Clean.rb +55 -0
  8. data/bin/DBConvert.rb +3 -1
  9. data/bin/Deliver.rb +73 -42
  10. data/bin/Mix.rb +39 -78
  11. data/bin/Process.rb +55 -0
  12. data/bin/Record.rb +63 -116
  13. data/bin/{Album.rb → old/Album.rb} +18 -18
  14. data/bin/{AnalyzeAlbum.rb → old/AnalyzeAlbum.rb} +11 -11
  15. data/bin/{DeliverAlbum.rb → old/DeliverAlbum.rb} +12 -12
  16. data/bin/{Fct2Wave.rb → old/Fct2Wave.rb} +11 -11
  17. data/{album.conf.rb.example → bin/old/album.conf.rb.example} +0 -0
  18. data/lib/MusicMaster/FilesNamer.rb +253 -0
  19. data/lib/MusicMaster/Formats/MP3.rb +50 -0
  20. data/lib/MusicMaster/Formats/Test.rb +44 -0
  21. data/lib/MusicMaster/Formats/Wave.rb +80 -0
  22. data/lib/MusicMaster/Hash.rb +20 -0
  23. data/lib/MusicMaster/Launcher.rb +241 -0
  24. data/lib/MusicMaster/Processes/ApplyVolumeFct.rb +4 -8
  25. data/lib/MusicMaster/Processes/Compressor.rb +50 -47
  26. data/lib/MusicMaster/Processes/Custom.rb +3 -3
  27. data/lib/MusicMaster/Processes/{AddSilence.rb → Cut.rb} +8 -4
  28. data/lib/MusicMaster/Processes/CutFirstSignal.rb +6 -3
  29. data/lib/MusicMaster/Processes/DCShifter.rb +30 -0
  30. data/lib/MusicMaster/Processes/GVerb.rb +3 -2
  31. data/lib/MusicMaster/Processes/Normalize.rb +7 -6
  32. data/lib/MusicMaster/Processes/SilenceInserter.rb +31 -0
  33. data/lib/MusicMaster/Processes/Test.rb +39 -0
  34. data/lib/MusicMaster/Processes/VolCorrection.rb +3 -3
  35. data/lib/MusicMaster/RakeProcesses.rb +1014 -0
  36. data/lib/MusicMaster/Symbol.rb +12 -0
  37. data/lib/MusicMaster/Task.rb +29 -0
  38. data/lib/MusicMaster/Utils.rb +467 -0
  39. data/lib/MusicMaster/old/Common.rb +101 -0
  40. data/musicmaster.conf.rb.example +42 -59
  41. data/record.conf.rb.example +374 -30
  42. metadata +91 -41
  43. data/TODO +0 -3
  44. data/bin/Master.rb +0 -60
  45. data/bin/PrepareMix.rb +0 -422
  46. data/lib/MusicMaster/Common.rb +0 -197
  47. data/lib/MusicMaster/ConfLoader.rb +0 -56
  48. data/lib/MusicMaster/musicmaster.conf.rb +0 -96
  49. data/master.conf.rb.example +0 -13
data/bin/Record.rb CHANGED
@@ -1,141 +1,88 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
- require 'fileutils'
8
- require 'optparse'
9
- require 'rUtilAnts/Logging'
10
- RUtilAnts::Logging::initializeLogging('', '')
11
- require 'MusicMaster/Common'
12
- require 'MusicMaster/ConfLoader'
7
+ require 'MusicMaster/Launcher'
13
8
 
14
9
  module MusicMaster
15
10
 
16
- class Record
11
+ class Record < Launcher
17
12
 
18
- # Constructor
19
- def initialize
20
- # List of perform partitions
21
- # list< list< Integer > >
22
- @LstPerforms = []
23
- # List of patch tracks
24
- # list< Integer >
25
- @LstPatches = []
26
- @WaveFiles = false
27
- MusicMaster::parsePlugins
13
+ protected
14
+
15
+ # Give additional command line options banner
16
+ #
17
+ # Return::
18
+ # * _String_: Options banner
19
+ def getOptionsBanner
20
+ return '[--recordedfilesprepared] [--env <RecordingEnv>]*'
21
+ end
22
+
23
+ # Complete options with the specific ones of this binary
24
+ #
25
+ # Parameters::
26
+ # * *ioOptionParser* (_OptionParser_): The options parser to complete
27
+ def completeOptionParser(ioOptionParser)
28
+ @RecordedFilesPrepared = false
29
+ ioOptionParser.on( '--recordedfilesprepared',
30
+ 'Recorded files are already prepared: no need to wait for user input while recording.') do
31
+ @RecordedFilesPrepared = true
32
+ end
33
+ @LstEnvToRecord = []
34
+ ioOptionParser.on( '--env <RecordingEnv>', String,
35
+ 'Specify the recording environment to record. Can be used several times. If none specified, all environments will be recorded.') do |iArg|
36
+ @LstEnvToRecord << iArg.to_sym
37
+ end
28
38
  end
29
39
 
30
- # Execute the recordings
40
+ # Check configuration.
31
41
  #
32
- # Parameters:
33
- # * *iArgs* (<em>list<String></em>): The list of arguments
34
- # Return:
35
- # * _Integer_: The error code
36
- def execute(iArgs)
37
- rErrorCode = 0
42
+ # Parameters::
43
+ # * *iConf* (<em>map<Symbol,Object></em>): The configuration
44
+ # Return::
45
+ # * _Exception_: Error, or nil in case of success
46
+ def checkConf(iConf)
47
+ rError = nil
38
48
 
39
- lError = nil
40
- # Read the arguments
41
- if (iArgs.size != 1)
42
- lError = RuntimeError.new('Usage: Record <ConfFile>')
43
- else
44
- # Read configuration
45
- lError, lConf = MusicMaster::readRecordConf(iArgs[0])
46
- if (lError == nil)
47
- if (lConf[:Performs] != nil)
48
- if (!lConf[:Performs].empty?)
49
- # Record performances
50
- lConf[:Performs].each do |iLstPerform|
51
- puts "===== Record Perform partition #{iLstPerform.join(', ')} ====="
52
- record("Perform.#{iLstPerform.join(' ')}.wav")
53
- end
54
- puts '===== Record Perform silence ====='
55
- record('Perform.Silence.wav')
56
- end
49
+ # Check that all tracks are assigned somewhere, just once
50
+ if ((iConf[:Recordings] != nil) and
51
+ (iConf[:Recordings][:Tracks] != nil))
52
+ lLstTracks = []
53
+ iConf[:Recordings][:Tracks].keys.each do |iLstTracks|
54
+ lLstTracks.concat(iLstTracks)
55
+ end
56
+ lAssignedTracks = {}
57
+ lLstTracks.each do |iIdxTrack|
58
+ if (lAssignedTracks.has_key?(iIdxTrack))
59
+ rError = RuntimeError.new("Track #{iIdxTrack} is recorded twice.")
60
+ break
61
+ else
62
+ lAssignedTracks[iIdxTrack] = nil
57
63
  end
58
- if (lConf[:Patches] != nil)
59
- lConf[:Patches].each do |iIdxTrack, iTrackConf|
60
- # If the track has already a volume correction to be applied, ignore this step
61
- if (iTrackConf[:VolCorrection] == nil)
62
- puts "===== Record Perform volume preview for track #{iIdxTrack} ====="
63
- record("Patch.#{iIdxTrack}.VolReference.wav")
64
- puts "===== Measure the volume cuts from file Patch.#{iIdxTrack}.VolReference.wav and set them in the record conf file ====="
65
- puts 'Enter when done.'
66
- $stdin.gets
67
- end
68
- end
69
- # Now we don't need anymore the volume setting for Perform.
70
- lConf[:Patches].each do |iIdxTrack, iTrackConf|
71
- lTryAgain = true
72
- while (lTryAgain)
73
- puts "===== Record the Patch track #{iIdxTrack} ====="
74
- record("Patch.#{iIdxTrack}.wav")
75
- puts 'Is the file correct ? (No peak limit reached ?) \'y\'=yes.'
76
- lTryAgain = ($stdin.gets.chomp != 'y')
77
- end
78
- if (iTrackConf[:Effects] != nil)
79
- MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.wav", $MusicMasterConf[:Record][:TempDir])
80
- end
81
- puts "===== Record Patch silence for track #{iIdxTrack} ====="
82
- record("Patch.#{iIdxTrack}.Silence.wav")
83
- if (iTrackConf[:Effects] != nil)
84
- MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.Silence.wav", $MusicMasterConf[:Record][:TempDir])
85
- end
86
- if (iTrackConf[:VolCorrection] == nil)
87
- puts "===== Record Patch volume preview for track #{iIdxTrack} ====="
88
- record("Patch.#{iIdxTrack}.VolOriginal.wav")
89
- if (iTrackConf[:Effects] != nil)
90
- MusicMaster::applyProcesses(iTrackConf[:Effects], "Patch.#{iIdxTrack}.VolOriginal.wav", $MusicMasterConf[:Record][:TempDir])
91
- end
92
- end
64
+ end
65
+ if (rError == nil)
66
+ lAssignedTracks.size.times do |iIdxTrack|
67
+ if (!lAssignedTracks.has_key?(iIdxTrack+1))
68
+ log_warn "Track #{iIdxTrack+1} is never recorded."
93
69
  end
94
70
  end
95
- if (lConf[:WaveFiles])
96
- puts '===== Generate Wave in Wave.*.wav files ====='
97
- puts 'Press Enter to continue once done.'
98
- $stdin.gets
99
- end
100
- logInfo 'Finished recording ok. Ready to use PrepareMix.rb and Mix.rb.'
101
71
  end
102
72
  end
103
- if (lError != nil)
104
- puts "!!! Error: #{lError}"
105
- rErrorCode = 1
106
- end
107
73
 
108
- return rErrorCode
74
+ return rError
109
75
  end
110
76
 
111
- # Record into a given file
77
+ # Initialize Rake processes and return the task to be built
112
78
  #
113
- # Parameters:
114
- # * *iFileName* (_String_): File name to record into
115
- def record(iFileName)
116
- lTryAgain = true
117
- if (File.exists?(iFileName))
118
- puts "File \"#{iFileName}\" already exists. Overwrite ? ['y' = yes]"
119
- lTryAgain = ($stdin.gets.chomp == 'y')
120
- end
121
- while (lTryAgain)
122
- puts "Record file \"#{iFileName}\""
123
- puts 'Press Enter to continue once done. Type \'s\' to skip it.'
124
- lSkip = ($stdin.gets.chomp == 's')
125
- if (lSkip)
126
- lTryAgain = false
127
- else
128
- # Get the last file that has been recorded
129
- lFileName = $MusicMasterConf[:Record][:RecordedFileGetter].call
130
- if (!File.exists?(lFileName))
131
- logErr "File #{lFileName} does not exist. Could not get recorded file."
132
- else
133
- logInfo "Getting recorded file: #{lFileName} => #{iFileName}"
134
- FileUtils::mv(lFileName, iFileName)
135
- lTryAgain = false
136
- end
137
- end
138
- end
79
+ # Return::
80
+ # * _Symbol_: Rake target to execute
81
+ def getRakeTarget
82
+ initialize_RakeProcesses(:RecordedFilesPrepared => @RecordedFilesPrepared, :LstEnvToRecord => @LstEnvToRecord)
83
+ generateRakeFor_GenerateSourceFiles
84
+
85
+ return :GenerateSourceFiles
139
86
  end
140
87
 
141
88
  end
@@ -1,30 +1,30 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
7
  require 'fileutils'
8
8
  require 'MusicMaster/Common'
9
9
  require 'rUtilAnts/Logging'
10
- RUtilAnts::Logging::initializeLogging('', '')
10
+ RUtilAnts::Logging::install_logger_on_object
11
11
  require 'MusicMaster/ConfLoader'
12
12
 
13
13
  module MusicMaster
14
14
 
15
15
  # Execute the album
16
16
  #
17
- # Parameters:
17
+ # Parameters::
18
18
  # * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
19
19
  def self.execute(iConf)
20
20
  lTracksDir = iConf[:TracksDir]
21
21
  if (!File.exists?(lTracksDir))
22
- logErr "Missing directory #{lTracksDir}"
22
+ log_err "Missing directory #{lTracksDir}"
23
23
  raise RuntimeError.new("Missing directory #{lTracksDir}")
24
24
  else
25
25
  iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
26
- logInfo "===== Mastering Track #{iIdxTrack}: #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} ====="
27
- lAlbumFile = "#{$MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
26
+ log_info "===== Mastering Track #{iIdxTrack}: #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} ====="
27
+ lAlbumFile = "#{@MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
28
28
  lCancel = false
29
29
  if (File.exists?(lAlbumFile))
30
30
  puts "File #{lAlbumFile} already exists. Overwrite it by mastering a new one ? [y='yes']"
@@ -32,26 +32,26 @@ module MusicMaster
32
32
  end
33
33
  if (!lCancel)
34
34
  # Find the last Master file for this Track
35
- lMasterFiles = Dir.glob("#{lTracksDir}/#{iTrackInfo[:TrackID]}*/#{iTrackInfo[:Version]}/#{iConf[:TracksFilesSubDir]}#{$MusicMasterConf[:Master][:Dir]}/*.wav")
35
+ lMasterFiles = Dir.glob("#{lTracksDir}/#{iTrackInfo[:TrackID]}*/#{iTrackInfo[:Version]}/#{iConf[:TracksFilesSubDir]}#{@MusicMasterConf[:Master][:Dir]}/*.wav")
36
36
  if (lMasterFiles.empty?)
37
- logErr "No Master files found for Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]}"
37
+ log_err "No Master files found for Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]}"
38
38
  else
39
39
  # Find the last one
40
40
  lFinalMasterFileName = lMasterFiles.sort[-1]
41
- logInfo "Found final Master file from Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} in #{lFinalMasterFileName}"
41
+ log_info "Found final Master file from Track #{iTrackInfo[:TrackID]} version #{iTrackInfo[:Version]} in #{lFinalMasterFileName}"
42
42
  # Copy it
43
- logInfo "Copying Master file to #{lAlbumFile} ..."
43
+ log_info "Copying Master file to #{lAlbumFile} ..."
44
44
  FileUtils::cp(lFinalMasterFileName, lAlbumFile)
45
45
  if (iTrackInfo[:AdditionalMastering] != nil)
46
- lMasterTempDir = "#{$MusicMasterConf[:Album][:TempDir]}/#{iTrackInfo[:TrackID]}.#{iTrackInfo[:Version]}"
46
+ lMasterTempDir = "#{@MusicMasterConf[:Album][:TempDir]}/#{iTrackInfo[:TrackID]}.#{iTrackInfo[:Version]}"
47
47
  FileUtils::mkdir_p(lMasterTempDir)
48
48
  MusicMaster::applyProcesses(iTrackInfo[:AdditionalMastering], lAlbumFile, lMasterTempDir)
49
49
  end
50
50
  # Done.
51
- logInfo "Setting file #{iIdxTrack} for Track #{iTrackInfo[:TrackID]} from #{lAlbumFile}"
51
+ log_info "Setting file #{iIdxTrack} for Track #{iTrackInfo[:TrackID]} from #{lAlbumFile}"
52
52
  end
53
53
  end
54
- logInfo ''
54
+ log_info ''
55
55
  end
56
56
  end
57
57
  end
@@ -61,21 +61,21 @@ end
61
61
  rErrorCode = 0
62
62
  lConfFile = ARGV[0]
63
63
  if (lConfFile == nil)
64
- logErr 'Usage: Album <ConfFile>'
64
+ log_err 'Usage: Album <ConfFile>'
65
65
  rErrorCode = 1
66
66
  elsif (!File.exists?(lConfFile))
67
- logErr "File #{lConfFile} does not exist."
67
+ log_err "File #{lConfFile} does not exist."
68
68
  rErrorCode = 2
69
69
  else
70
70
  MusicMaster::parsePlugins
71
- FileUtils::mkdir_p($MusicMasterConf[:Album][:Dir])
72
- FileUtils::mkdir_p($MusicMasterConf[:Album][:TempDir])
71
+ FileUtils::mkdir_p(@MusicMasterConf[:Album][:Dir])
72
+ FileUtils::mkdir_p(@MusicMasterConf[:Album][:TempDir])
73
73
  lConf = nil
74
74
  File.open(lConfFile, 'r') do |iFile|
75
75
  lConf = eval(iFile.read)
76
76
  end
77
77
  MusicMaster::execute(lConf)
78
- logInfo "===== Album finished in #{$MusicMasterConf[:Album][:Dir]}"
78
+ log_info "===== Album finished in #{@MusicMasterConf[:Album][:Dir]}"
79
79
  end
80
80
 
81
81
  exit rErrorCode
@@ -1,32 +1,32 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
7
  require 'fileutils'
8
8
  require 'MusicMaster/Common'
9
9
  require 'rUtilAnts/Logging'
10
- RUtilAnts::Logging::initializeLogging('', '')
10
+ RUtilAnts::Logging::install_logger_on_object
11
11
  require 'MusicMaster/ConfLoader'
12
12
 
13
13
  module MusicMaster
14
14
 
15
15
  # Execute the album
16
16
  #
17
- # Parameters:
17
+ # Parameters::
18
18
  # * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
19
19
  def self.execute(iConf)
20
20
  lTracksDir = iConf[:TracksDir]
21
21
  if (!File.exists?(lTracksDir))
22
- logErr "Missing directory #{lTracksDir}"
22
+ log_err "Missing directory #{lTracksDir}"
23
23
  raise RuntimeError.new("Missing directory #{lTracksDir}")
24
24
  else
25
25
  # Analyze results, per Track
26
26
  lAnalyzeResults = []
27
27
  iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
28
- lTrackFileName = "#{$MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
29
- MusicMaster::wsk(lTrackFileName, 'Dummy.wav', 'Analyze')
28
+ lTrackFileName = "#{@MusicMasterConf[:Album][:Dir]}/#{iIdxTrack}_#{iTrackInfo[:TrackID]}.wav"
29
+ wsk(lTrackFileName, 'Dummy.wav', 'Analyze')
30
30
  File.unlink('Dummy.wav')
31
31
  File.open('analyze.result', 'rb') do |iFile|
32
32
  lAnalyzeResults << Marshal.load(iFile.read)
@@ -34,13 +34,13 @@ module MusicMaster
34
34
  File.unlink('analyze.result')
35
35
  end
36
36
  # Display analyze results
37
- logInfo ''
38
- logInfo '===== Analyze results:'
37
+ log_info ''
38
+ log_info '===== Analyze results:'
39
39
  iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
40
40
  lStrDBRMSValues = lAnalyzeResults[iIdxTrack][:DBRMSValues].map do |iValue|
41
41
  next sprintf('%.2f', iValue)
42
42
  end
43
- logInfo "[#{iIdxTrack} - #{iTrackInfo[:TrackID]}]: RMS=(#{lStrDBRMSValues.join('db, ')}db) Max=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DBAbsMaxValue])}db Length=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DataLength])}s"
43
+ log_info "[#{iIdxTrack} - #{iTrackInfo[:TrackID]}]: RMS=(#{lStrDBRMSValues.join('db, ')}db) Max=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DBAbsMaxValue])}db Length=#{sprintf('%.2f', lAnalyzeResults[iIdxTrack][:DataLength])}s"
44
44
  end
45
45
  end
46
46
  end
@@ -50,10 +50,10 @@ end
50
50
  rErrorCode = 0
51
51
  lConfFile = ARGV[0]
52
52
  if (lConfFile == nil)
53
- logErr 'Usage: AnalyzeAlbum <ConfFile>'
53
+ log_err 'Usage: AnalyzeAlbum <ConfFile>'
54
54
  rErrorCode = 1
55
55
  elsif (!File.exists?(lConfFile))
56
- logErr "File #{lConfFile} does not exist."
56
+ log_err "File #{lConfFile} does not exist."
57
57
  rErrorCode = 2
58
58
  else
59
59
  lConf = nil
@@ -1,35 +1,35 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
7
  require 'MusicMaster/Common'
8
8
  require 'rUtilAnts/Logging'
9
- RUtilAnts::Logging::initializeLogging('', '')
9
+ RUtilAnts::Logging::install_logger_on_object
10
10
  require 'MusicMaster/ConfLoader'
11
11
 
12
12
  module MusicMaster
13
13
 
14
14
  # Execute the delivery of the album
15
15
  #
16
- # Parameters:
16
+ # Parameters::
17
17
  # * *iConf* (<em>map<Symbol,Object></em>): Configuration of the album
18
18
  def self.execute(iConf)
19
19
  lDeliveries = iConf[:Deliveries]
20
20
  if (lDeliveries == nil)
21
- logWarn 'Configuration does not specify any delivery. Nothing to deliver.'
21
+ log_warn 'Configuration does not specify any delivery. Nothing to deliver.'
22
22
  else
23
23
  lTracksDir = iConf[:TracksDir]
24
24
  if (!File.exists?(lTracksDir))
25
- logErr "Missing directory #{lTracksDir}"
25
+ log_err "Missing directory #{lTracksDir}"
26
26
  raise RuntimeError.new("Missing directory #{lTracksDir}")
27
27
  else
28
28
  iConf[:Tracks].each_with_index do |iTrackInfo, iIdxTrack|
29
29
  lBaseFileName = "#{iIdxTrack}_#{iTrackInfo[:TrackID]}"
30
- lSourceFile = "#{$MusicMasterConf[:Album][:Dir]}/#{lBaseFileName}.wav"
30
+ lSourceFile = "#{@MusicMasterConf[:Album][:Dir]}/#{lBaseFileName}.wav"
31
31
  if (!File.exists?(lSourceFile))
32
- logErr "Missing file #{lSourceFile}"
32
+ log_err "Missing file #{lSourceFile}"
33
33
  else
34
34
  lDeliveries.each do |iDeliveryName, iDeliveryConf|
35
35
  lExt = 'wav'
@@ -37,7 +37,7 @@ module MusicMaster
37
37
  (iDeliveryConf[:FileFormat] == :MP3))
38
38
  lExt = 'mp3'
39
39
  end
40
- MusicMaster::src(lSourceFile, "#{$MusicMasterConf[:AlbumDeliver][:Dir]}/#{iDeliveryName}/#{lBaseFileName}.#{lExt}", iDeliveryConf)
40
+ MusicMaster::src(lSourceFile, "#{@MusicMasterConf[:AlbumDeliver][:Dir]}/#{iDeliveryName}/#{lBaseFileName}.#{lExt}", iDeliveryConf)
41
41
  end
42
42
  end
43
43
  end
@@ -50,19 +50,19 @@ end
50
50
  rErrorCode = 0
51
51
  lConfFile = ARGV[0]
52
52
  if (lConfFile == nil)
53
- logErr 'Usage: DeliverAlbum <ConfFile>'
53
+ log_err 'Usage: DeliverAlbum <ConfFile>'
54
54
  rErrorCode = 1
55
55
  elsif (!File.exists?(lConfFile))
56
- logErr "File #{lConfFile} does not exist."
56
+ log_err "File #{lConfFile} does not exist."
57
57
  rErrorCode = 2
58
58
  else
59
- FileUtils::mkdir_p($MusicMasterConf[:AlbumDeliver][:Dir])
59
+ FileUtils::mkdir_p(@MusicMasterConf[:AlbumDeliver][:Dir])
60
60
  lConf = nil
61
61
  File.open(lConfFile, 'r') do |iFile|
62
62
  lConf = eval(iFile.read)
63
63
  end
64
64
  MusicMaster::execute(lConf)
65
- logInfo "===== Album delivered in #{$MusicMasterConf[:AlbumDeliver][:Dir]}"
65
+ log_info "===== Album delivered in #{@MusicMasterConf[:AlbumDeliver][:Dir]}"
66
66
  end
67
67
 
68
68
  exit rErrorCode
@@ -1,32 +1,32 @@
1
1
  #!env ruby
2
2
  #--
3
- # Copyright (c) 2009-2010 Muriel Salvan (murielsalvan@users.sourceforge.net)
3
+ # Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
4
4
  # Licensed under the terms specified in LICENSE file. No warranty is provided.
5
5
  #++
6
6
 
7
7
  require 'fileutils'
8
8
  require 'MusicMaster/Common'
9
9
  require 'rUtilAnts/Logging'
10
- RUtilAnts::Logging::initializeLogging('', '')
10
+ RUtilAnts::Logging::install_logger_on_object
11
11
  require 'MusicMaster/ConfLoader'
12
12
 
13
13
  module MusicMaster
14
14
 
15
15
  # Execute the mastering
16
16
  #
17
- # Parameters:
17
+ # Parameters::
18
18
  # * *iConf* (<em>map<Symbol,Object></em>): Configuration of the master
19
19
  # * *iWaveFile* (_String_): Wave file to master
20
- # Return:
20
+ # Return::
21
21
  # * _String_: Name of the Wave file containing the result
22
22
  def self.execute(iConf, iWaveFile)
23
- rWaveFileToProcess = "#{$MusicMasterConf[:Master][:Dir]}/#{File.basename(iWaveFile)}"
23
+ rWaveFileToProcess = "#{@MusicMasterConf[:Master][:Dir]}/#{File.basename(iWaveFile)}"
24
24
 
25
- logInfo 'Copying Master file ...'
25
+ log_info 'Copying Master file ...'
26
26
  FileUtils::cp(iWaveFile, rWaveFileToProcess)
27
27
  # Execute each step of the mastering to the wave file
28
28
  if (iConf[:Mastering] != nil)
29
- self.applyProcesses(iConf[:Mastering], rWaveFileToProcess, $MusicMasterConf[:Master][:Dir])
29
+ self.applyProcesses(iConf[:Mastering], rWaveFileToProcess, @MusicMasterConf[:Master][:Dir])
30
30
  end
31
31
 
32
32
  return rWaveFileToProcess
@@ -39,20 +39,20 @@ lFctFile, lInputWaveFile, lOutputWaveFile, lUnitDB = ARGV[0..4]
39
39
  if ((lFctFile == nil) or
40
40
  (lInputWaveFile == nil) or
41
41
  (lOutputWaveFile == nil))
42
- logErr 'Usage: Master <FctFile> <InputWaveFile> <OutputWaveFile> [--unitdb]'
42
+ log_err 'Usage: Master <FctFile> <InputWaveFile> <OutputWaveFile> [--unitdb]'
43
43
  rErrorCode = 1
44
44
  elsif (!File.exists?(lFctFile))
45
- logErr "File #{lFctFile} does not exist."
45
+ log_err "File #{lFctFile} does not exist."
46
46
  rErrorCode = 2
47
47
  elsif (!File.exists?(lInputWaveFile))
48
- logErr "File #{lInputWaveFile} does not exist."
48
+ log_err "File #{lInputWaveFile} does not exist."
49
49
  rErrorCode = 3
50
50
  else
51
51
  lStrUnitDB = '0'
52
52
  if (lUnitDB == '--unitdb')
53
53
  lStrUnitDB = '1'
54
54
  end
55
- MusicMaster::wsk(lInputWaveFile, lOutputWaveFile, 'DrawFct', "--function \"#{lFctFile}\" --unitdb #{lStrUnitDB}")
55
+ wsk(lInputWaveFile, lOutputWaveFile, 'DrawFct', "--function \"#{lFctFile}\" --unitdb #{lStrUnitDB}")
56
56
  end
57
57
 
58
58
  exit rErrorCode