|
@@ -19,6 +19,7 @@ function Audiogram(id) {
|
19
|
19
|
|
20
|
20
|
// File locations to use
|
21
|
21
|
this.dir = path.join(serverSettings.workingDirectory, this.id);
|
|
22
|
+
|
22
|
23
|
this.audioPath = path.join(this.dir, "audio");
|
23
|
24
|
this.videoPath = path.join(this.dir, "video.mp4");
|
24
|
25
|
this.frameDir = path.join(this.dir, "frames");
|
|
@@ -40,11 +41,11 @@ Audiogram.prototype.getDuration = function(cb) {
|
40
|
41
|
return cb(err);
|
41
|
42
|
}
|
42
|
43
|
|
43
|
|
- if (self.settings.maxDuration && self.settings.maxDuration < duration) {
|
44
|
|
- cb("Exceeds max duration of " + self.settings.maxDuration + "s");
|
|
44
|
+ if (self.settings.theme.maxDuration && self.settings.theme.maxDuration < duration) {
|
|
45
|
+ cb("Exceeds max duration of " + self.settings.theme.maxDuration + "s");
|
45
|
46
|
}
|
46
|
47
|
|
47
|
|
- self.set("numFrames", self.numFrames = Math.floor(duration * self.settings.framesPerSecond));
|
|
48
|
+ self.set("numFrames", self.numFrames = Math.floor(duration * self.settings.theme.framesPerSecond));
|
48
|
49
|
|
49
|
50
|
cb(null);
|
50
|
51
|
|
|
@@ -61,7 +62,7 @@ Audiogram.prototype.getWaveform = function(cb) {
|
61
|
62
|
|
62
|
63
|
getWaveform(this.audioPath, {
|
63
|
64
|
numFrames: this.numFrames,
|
64
|
|
- samplesPerFrame: this.settings.samplesPerFrame
|
|
65
|
+ samplesPerFrame: this.settings.theme.samplesPerFrame
|
65
|
66
|
}, function(err, waveform){
|
66
|
67
|
|
67
|
68
|
return cb(err, self.waveform = waveform);
|
|
@@ -104,7 +105,7 @@ Audiogram.prototype.drawFrames = function(cb) {
|
104
|
105
|
|
105
|
106
|
this.status("renderer");
|
106
|
107
|
|
107
|
|
- initializeCanvas(this.settings, function(err, renderer){
|
|
108
|
+ initializeCanvas(this.settings.theme, function(err, renderer){
|
108
|
109
|
|
109
|
110
|
if (err) {
|
110
|
111
|
return cb(err);
|
|
@@ -113,8 +114,8 @@ Audiogram.prototype.drawFrames = function(cb) {
|
113
|
114
|
self.status("frames");
|
114
|
115
|
|
115
|
116
|
drawFrames(renderer, {
|
116
|
|
- width: self.settings.width,
|
117
|
|
- height: self.settings.height,
|
|
117
|
+ width: self.settings.theme.width,
|
|
118
|
+ height: self.settings.theme.height,
|
118
|
119
|
numFrames: self.numFrames,
|
119
|
120
|
frameDir: self.frameDir,
|
120
|
121
|
caption: self.settings.caption,
|
|
@@ -137,7 +138,7 @@ Audiogram.prototype.combineFrames = function(cb) {
|
137
|
138
|
framePath: path.join(this.frameDir, "%06d.png"),
|
138
|
139
|
audioPath: this.audioPath,
|
139
|
140
|
videoPath: this.videoPath,
|
140
|
|
- framesPerSecond: this.settings.framesPerSecond
|
|
141
|
+ framesPerSecond: this.settings.theme.framesPerSecond
|
141
|
142
|
}, cb);
|
142
|
143
|
|
143
|
144
|
};
|