@@ -73,6 +73,9 @@ def paramHasChanged(thisParam, thisNode, thisGroup, app, userEdited):
73
73
audio_file = thisNode .inputFile .get ()
74
74
# ascii output file
75
75
ascii_file = thisNode .curveFile .get ()
76
+ # external editing app
77
+ ext_edit_app = thisNode .editApp .get ()
78
+ ext_edit_app_param = thisNode .editParam .get ()
76
79
77
80
# convert dimension in comprehensive thing for audio2ascii script
78
81
dim = thisNode .dimEnsion .get ()
@@ -83,6 +86,13 @@ def paramHasChanged(thisParam, thisNode, thisGroup, app, userEdited):
83
86
elif dim == 2 :
84
87
dimension = "xy"
85
88
89
+ # edit with External app
90
+ if audio_file and ext_edit_app and thisParam == thisNode .editAudio :
91
+ os .system (ext_edit_app + " " + ext_edit_app_param + " '" + audio_file + "' &" )
92
+ # doesn't work ?!
93
+ #else:
94
+ #app.warningDialog("Audio File", "You need to set a audio editor to edit an audio file")
95
+
86
96
# Import Curve
87
97
if ascii_file is not None and audio_file is not None and thisParam == thisNode .importCurve :
88
98
ret_exec = audioToAscii (audio_file , ascii_file , dimension , thisNode .framesPerSec .get (), thisNode .duraTion .get (), thisNode .xHeight .get (), thisNode .yHeight .get ())
@@ -155,7 +165,7 @@ def createInstance(app,group):
155
165
156
166
157
167
#Create the user-parameters
158
- lastNode .userNatron = lastNode .createPageParam ("userNatron" , "User " )
168
+ lastNode .userNatron = lastNode .createPageParam ("userNatron" , "Settings " )
159
169
param = lastNode .createFileParam ("inputFile" , "Audio File" )
160
170
param .setSequenceEnabled (False )
161
171
@@ -169,6 +179,62 @@ def createInstance(app,group):
169
179
lastNode .inputFile = param
170
180
del param
171
181
182
+ # Group /
183
+ param = lastNode .createGroupParam ("setEditor" , "Editor setting" )
184
+
185
+ #Add the param to the page
186
+ lastNode .userNatron .addParam (param )
187
+
188
+ #Set param properties
189
+ param .setHelp ("" )
190
+ param .setAddNewLine (True )
191
+ param .setEvaluateOnChange (False )
192
+ lastNode .setEditor = param
193
+ del param
194
+
195
+ param = lastNode .createFileParam ("editApp" , "Audio Editor" )
196
+ param .setSequenceEnabled (False )
197
+
198
+ #Add the param to the group, no need to add it to the page
199
+ lastNode .setEditor .addParam (param )
200
+
201
+ #Set param properties
202
+ param .setHelp ("Set the Audio Editor path" )
203
+ param .setAddNewLine (True )
204
+ param .setAnimationEnabled (False )
205
+ param .setDefaultValue ("audacity" )
206
+ lastNode .editApp = param
207
+ del param
208
+
209
+ param = lastNode .createStringParam ("editParam" , "Audio editor parameters" )
210
+ param .setType (NatronEngine .StringParam .TypeEnum .eStringTypeDefault )
211
+ param .setDefaultValue ("" )
212
+
213
+ #Add the param to the group, no need to add it to the page
214
+ lastNode .setEditor .addParam (param )
215
+
216
+ #Set param properties
217
+ param .setHelp ("Set the Audio Editor command line parameters" )
218
+ param .setVisible (True )
219
+ param .setAddNewLine (False )
220
+ param .setAnimationEnabled (True )
221
+ lastNode .editParam = param
222
+ del param
223
+ # / Group
224
+
225
+ param = lastNode .createButtonParam ("editAudio" , "Edit audio File" )
226
+
227
+ #Add the param to the page
228
+ lastNode .userNatron .addParam (param )
229
+
230
+ #Set param properties
231
+ param .setHelp ("Set an audio editor in the tab 'Editor Setting" )
232
+ param .setAddNewLine (False )
233
+ param .setPersistant (False )
234
+ param .setEvaluateOnChange (False )
235
+ lastNode .editAudio = param
236
+ del param
237
+
172
238
param = lastNode .createFileParam ("curveFile" , "Curve File" )
173
239
param .setSequenceEnabled (False )
174
240
@@ -209,7 +275,7 @@ def createInstance(app,group):
209
275
lastNode .dimEnsion = param
210
276
del param
211
277
212
- param = lastNode .createIntParam ("framesPerSec" , "Frames / sec " )
278
+ param = lastNode .createIntParam ("framesPerSec" , "Frame Rate " )
213
279
param .setDisplayMinimum (0 , 0 )
214
280
param .setDisplayMaximum (100 , 0 )
215
281
param .setDefaultValue (24 , 0 )
0 commit comments