Merge lp:~zequence/ubuntu/trusty/ardour3/fix-for-1450992 into lp:ubuntu/trusty/ardour3

Proposed by Kaj Ailomaa
Status: Needs review
Proposed branch: lp:~zequence/ubuntu/trusty/ardour3/fix-for-1450992
Merge into: lp:ubuntu/trusty/ardour3
Diff against target: 7848 lines (+3913/-931) (has conflicts)
125 files modified
.pc/applied-patches (+2/-0)
.pc/log-stdout.patch/wscript (+822/-0)
.pc/midi-data-loss.patch/libs/ardour/smf_source.cc (+764/-0)
.pc/wscript.patch/wscript (+4/-4)
debian/changelog (+75/-12)
debian/control (+6/-0)
debian/control.in (+1/-1)
debian/patches/log-stdout.patch (+25/-0)
debian/patches/midi-data-loss.patch (+62/-0)
debian/patches/series (+2/-0)
debian/rules (+2/-1)
gtk2_ardour/add_video_dialog.cc (+4/-1)
gtk2_ardour/ardev_common.sh.in (+1/-0)
gtk2_ardour/ardour.menus.in (+1/-0)
gtk2_ardour/ardour_ui.cc (+6/-3)
gtk2_ardour/ardour_ui.h (+1/-0)
gtk2_ardour/ardour_ui_dialogs.cc (+15/-0)
gtk2_ardour/ardour_ui_ed.cc (+1/-0)
gtk2_ardour/audio_region_view.cc (+2/-2)
gtk2_ardour/audio_region_view.h (+1/-1)
gtk2_ardour/automation_region_view.cc (+9/-3)
gtk2_ardour/automation_region_view.h (+1/-1)
gtk2_ardour/automation_time_axis.cc (+2/-2)
gtk2_ardour/automation_time_axis.h (+1/-1)
gtk2_ardour/editor.bindings (+1/-0)
gtk2_ardour/editor.h (+1/-1)
gtk2_ardour/editor_actions.cc (+30/-30)
gtk2_ardour/editor_audio_import.cc (+30/-18)
gtk2_ardour/editor_drag.cc (+17/-3)
gtk2_ardour/editor_mouse.cc (+8/-4)
gtk2_ardour/editor_ops.cc (+11/-6)
gtk2_ardour/editor_regions.cc (+1/-1)
gtk2_ardour/editor_rulers.cc (+15/-15)
gtk2_ardour/ergonomic-us.bindings.in (+1/-0)
gtk2_ardour/gain_meter.cc (+8/-2)
gtk2_ardour/level_meter.cc (+1/-0)
gtk2_ardour/midi_time_axis.cc (+42/-3)
gtk2_ardour/mixer_strip.cc (+60/-28)
gtk2_ardour/mixer_ui.cc (+39/-0)
gtk2_ardour/mixer_ui.h (+6/-0)
gtk2_ardour/mnemonic-us.bindings.in (+2/-1)
gtk2_ardour/opts.cc (+1/-1)
gtk2_ardour/panner_ui.cc (+81/-1)
gtk2_ardour/panner_ui.h (+1/-0)
gtk2_ardour/plugin_ui.cc (+2/-0)
gtk2_ardour/processor_box.cc (+70/-0)
gtk2_ardour/route_ui.cc (+2/-2)
gtk2_ardour/sfdb_ui.cc (+94/-3)
gtk2_ardour/stereo_panner.cc (+36/-16)
gtk2_ardour/transcode_ffmpeg.cc (+34/-15)
gtk2_ardour/transcode_ffmpeg.h (+1/-0)
gtk2_ardour/transcode_video_dialog.cc (+22/-10)
gtk2_ardour/transcode_video_dialog.h (+3/-3)
gtk2_ardour/video_server_dialog.cc (+7/-2)
gtk2_ardour/video_timeline.cc (+36/-5)
libs/ardour/amp.cc (+4/-19)
libs/ardour/ardour/audio_buffer.h (+5/-4)
libs/ardour/ardour/audio_diskstream.h (+0/-1)
libs/ardour/ardour/audiofilesource.h (+6/-4)
libs/ardour/ardour/buffer.h (+2/-10)
libs/ardour/ardour/diskstream.h (+2/-0)
libs/ardour/ardour/file_source.h (+9/-2)
libs/ardour/ardour/midi_buffer.h (+3/-0)
libs/ardour/ardour/midi_diskstream.h (+1/-1)
libs/ardour/ardour/midi_region.h (+1/-0)
libs/ardour/ardour/midi_source.h (+15/-3)
libs/ardour/ardour/public_diskstream.h (+1/-1)
libs/ardour/ardour/session.h (+8/-11)
libs/ardour/ardour/smf_source.h (+7/-4)
libs/ardour/ardour/sndfilesource.h (+10/-1)
libs/ardour/ardour/source.h (+2/-1)
libs/ardour/ardour/source_factory.h (+3/-0)
libs/ardour/ardour/track.h (+1/-1)
libs/ardour/ardour/vestige/aeffectx.h (+21/-0)
libs/ardour/audio_buffer.cc (+4/-7)
libs/ardour/audio_diskstream.cc (+26/-20)
libs/ardour/audiofilesource.cc (+17/-0)
libs/ardour/automation_control.cc (+14/-6)
libs/ardour/automation_watch.cc (+1/-1)
libs/ardour/coreaudiosource.cc (+14/-1)
libs/ardour/delivery.cc (+4/-0)
libs/ardour/diskstream.cc (+0/-1)
libs/ardour/enums.cc (+1/-0)
libs/ardour/export_channel.cc (+1/-1)
libs/ardour/file_source.cc (+71/-55)
libs/ardour/filter.cc (+2/-3)
libs/ardour/import.cc (+26/-76)
libs/ardour/internal_send.cc (+1/-1)
libs/ardour/lv2_evbuf.c (+1/-1)
libs/ardour/lv2_plugin.cc (+2/-22)
libs/ardour/midi_diskstream.cc (+30/-19)
libs/ardour/midi_region.cc (+21/-3)
libs/ardour/midi_source.cc (+10/-27)
libs/ardour/plugin_insert.cc (+21/-5)
libs/ardour/plugin_manager.cc (+3/-1)
libs/ardour/route.cc (+46/-2)
libs/ardour/session.cc (+199/-245)
libs/ardour/session_state.cc (+80/-60)
libs/ardour/smf_source.cc (+154/-16)
libs/ardour/sndfilesource.cc (+67/-12)
libs/ardour/source_factory.cc (+37/-0)
libs/ardour/tempo.cc (+10/-5)
libs/ardour/track.cc (+3/-3)
libs/evoral/evoral/ControlList.hpp (+1/-1)
libs/evoral/evoral/SMF.hpp (+1/-0)
libs/evoral/src/Control.cpp (+9/-2)
libs/evoral/src/ControlList.cpp (+20/-14)
libs/evoral/src/SMF.cpp (+22/-0)
libs/evoral/test/SequenceTest.cpp (+1/-1)
libs/midi++2/midnam_patch.cc (+3/-4)
libs/panners/vbap/vbap.cc (+1/-1)
libs/panners/vbap/vbap_speakers.cc (+81/-20)
libs/pbd/clear_dir.cc (+37/-0)
libs/pbd/file_utils.cc (+67/-18)
libs/pbd/pbd/clear_dir.h (+1/-0)
libs/surfaces/generic_midi/midicontrollable.cc (+19/-2)
libs/surfaces/mackie/mackie_control_protocol.cc (+16/-2)
libs/surfaces/mackie/mackie_control_protocol.h (+2/-0)
libs/surfaces/mackie/strip.cc (+10/-1)
libs/surfaces/mackie/strip.h (+1/-0)
libs/surfaces/mackie/surface.cc (+32/-3)
patchfiles/Korg_Volca_Bass.midnam (+37/-0)
patchfiles/Korg_Volca_Beats.midnam (+58/-0)
patchfiles/Korg_Volca_Keys.midnam (+41/-0)
wscript (+13/-4)
Text conflict in debian/changelog
Text conflict in debian/control
Text conflict in gtk2_ardour/mixer_strip.cc
Text conflict in gtk2_ardour/panner_ui.cc
Text conflict in gtk2_ardour/processor_box.cc
Text conflict in gtk2_ardour/sfdb_ui.cc
Text conflict in gtk2_ardour/stereo_panner.cc
Text conflict in libs/ardour/ardour/audio_buffer.h
Text conflict in libs/ardour/ardour/vestige/aeffectx.h
Text conflict in libs/ardour/audio_buffer.cc
Text conflict in libs/ardour/delivery.cc
Text conflict in libs/ardour/plugin_insert.cc
Text conflict in libs/ardour/route.cc
Text conflict in libs/ardour/smf_source.cc
Text conflict in libs/ardour/source_factory.cc
Text conflict in libs/panners/vbap/vbap_speakers.cc
To merge this branch: bzr merge lp:~zequence/ubuntu/trusty/ardour3/fix-for-1450992
Reviewer Review Type Date Requested Status
Micah Gersten (community) Disapprove
Review via email: mp+258099@code.launchpad.net

Description of the change

Fix for bug 1450992.

This is the last release of ardour3.

To post a comment you must log in.
Revision history for this message
Micah Gersten (micahg) wrote :

Rejecting in favor of a full backport SRU

review: Disapprove

Unmerged revisions

15. By Adrian Knoth

Fix MIDI data loss when editing (Closes: #772118)

14. By Adrian Knoth

Reupload with waf fixes from 3.5.380~dfsg-2 and -3

13. By Felipe Sateler

Prevent build failures in slower architectures by
forcing waf logging to stdout instead of stderr.

12. By Felipe Sateler

* Team upload.
* Pass correct -j flag to waf. Closes: #748584

11. By Adrian Knoth

Imported Upstream version 3.5.380~dfsg

10. By Adrian Knoth

* Imported Upstream version 3.5.357~dfsg
* Critical bugfix release. All users are recommended to upgrade.
* Details: https://community.ardour.org/node/8015

9. By Adrian Knoth

[ Jaromír Mikeš ]
* Use higher resolution picture for desktop icon (Closes: #729890).

[ Adrian Knoth ]
* Change Name entry in desktop file (Closes: #729890)
* Remove python runtime dependencies
* Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2013-11-06 13:22:44 +0000
+++ .pc/applied-patches 2015-05-02 14:23:30 +0000
@@ -1,2 +1,4 @@
1waf.patch1waf.patch
2wscript.patch2wscript.patch
3log-stdout.patch
4midi-data-loss.patch
35
=== added directory '.pc/log-stdout.patch'
=== added file '.pc/log-stdout.patch/wscript'
--- .pc/log-stdout.patch/wscript 1970-01-01 00:00:00 +0000
+++ .pc/log-stdout.patch/wscript 2015-05-02 14:23:30 +0000
@@ -0,0 +1,822 @@
1#!/usr/bin/env python
2from waflib.extras import autowaf as autowaf
3from waflib import Options
4import os
5import re
6import string
7import subprocess
8import sys
9
10def fetch_git_revision ():
11 cmd = "git describe HEAD"
12 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
13 rev = output[0].decode ('utf-8')
14 return rev
15
16def fetch_tarball_revision ():
17 if not os.path.exists ('libs/ardour/revision.cc'):
18 print 'This tarball was not created correctly - it is missing libs/ardour/revision.cc'
19 sys.exit (1)
20 with open('libs/ardour/revision.cc') as f:
21 content = f.readlines()
22 remove_punctuation_map = dict((ord(char), None) for char in '";')
23 return content[1].decode('utf-8').strip().split(' ')[7].translate (remove_punctuation_map)
24
25rev = fetch_tarball_revision ()
26
27#
28# rev is now of the form MAJOR.MINOR-rev-commit
29#
30
31parts = rev.split ('.')
32MAJOR = parts[0]
33MINOR = parts[1]
34MICRO = parts[2]
35
36V = MAJOR + '.' + MINOR + '.' + MICRO
37#
38# it is important that VERSION *not* be unicode string
39# because if it is, it breaks waf somehow.
40#
41VERSION = V.encode ('ascii', 'ignore')
42APPNAME = 'Ardour' + MAJOR
43
44# Mandatory variables
45top = '.'
46out = 'build'
47
48children = [
49 'libs/pbd',
50 'libs/midi++2',
51 'libs/evoral',
52 'libs/vamp-sdk',
53 'libs/qm-dsp',
54 'libs/vamp-plugins',
55 'libs/taglib',
56 'libs/libltc',
57 'libs/rubberband',
58 'libs/surfaces',
59 'libs/panners',
60 'libs/backends',
61 'libs/timecode',
62 'libs/ardour',
63 'libs/gtkmm2ext',
64 'libs/clearlooks-newer',
65 'libs/audiographer',
66 'libs/plugins/reasonablesynth.lv2',
67 'gtk2_ardour',
68 'export',
69 'midi_maps',
70 'mcp',
71 'patchfiles'
72]
73
74i18n_children = [
75 'gtk2_ardour',
76 'libs/ardour',
77 'libs/gtkmm2ext',
78]
79
80if sys.platform == 'linux2':
81 children += [ 'tools/sanity_check' ]
82 lxvst_default = True
83elif sys.platform == 'darwin':
84 children += [ 'libs/appleutility' ]
85 lxvst_default = False
86else:
87 lxvst_default = False
88
89# Version stuff
90
91def fetch_gcc_version (CC):
92 cmd = "LANG= %s --version" % CC
93 output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
94 o = output[0].decode('utf-8')
95 version = o.split(' ')[2].split('.')
96 return version
97
98def create_stored_revision():
99 rev = ""
100 if os.path.exists('.git'):
101 rev = fetch_git_revision();
102 print("Git version: " + rev + "\n")
103 elif os.path.exists('libs/ardour/revision.cc'):
104 print("Using packaged revision")
105 return
106 else:
107 print("Missing libs/ardour/revision.cc. Blame the packager.")
108 sys.exit(-1)
109
110 try:
111 #
112 # if you change the format of this, be sure to fix fetch_tarball_revision() above
113 # so that it still works.
114 #
115 text = '#include "ardour/revision.h"\n'
116 text += 'namespace ARDOUR { const char* revision = \"%s\"; }\n' % rev
117 print('Writing revision info to libs/ardour/revision.cc using ' + rev)
118 o = open('libs/ardour/revision.cc', 'w')
119 o.write(text)
120 o.close()
121 except IOError:
122 print('Could not open libs/ardour/revision.cc for writing\n')
123 sys.exit(-1)
124
125def set_compiler_flags (conf,opt):
126 #
127 # Compiler flags and other system-dependent stuff
128 #
129
130 build_host_supports_sse = False
131
132 # Flags necessary for building
133 compiler_flags = [] # generic
134 c_flags = [] # C-specific
135 cxx_flags = [] # C++-specific
136 linker_flags = []
137
138 # Optimization flags (overridable)
139 optimization_flags = []
140
141 # Debugging flags
142 debug_flags = []
143
144 u = os.uname ()
145 cpu = u[4]
146 platform = u[0].lower()
147 version = u[2]
148
149 # waf adds -O0 -g itself. thanks waf!
150 is_clang = conf.env['CXX'][0].endswith('clang++')
151
152 if conf.options.cxx11:
153 conf.check_cxx(cxxflags=["-std=c++11"])
154 cxx_flags.append('-std=c++11')
155 if platform == "darwin":
156 cxx_flags.append('-stdlib=libc++')
157 link_flags.append('-lc++')
158 # Prevents visibility issues in standard headers
159 conf.define("_DARWIN_C_SOURCE", 1)
160
161 if conf.options.asan:
162 conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"])
163 cxx_flags.append('-fsanitize=address')
164 cxx_flags.append('-fno-omit-frame-pointer')
165 linker_flags.append('-fsanitize=address')
166
167 if is_clang and platform == "darwin":
168 # Silence warnings about the non-existing osx clang compiler flags
169 # -compatibility_version and -current_version. These are Waf
170 # generated and not needed with clang
171 cxx_flags.append("-Qunused-arguments")
172
173 if opt.gprofile:
174 debug_flags = [ '-pg' ]
175
176 # Autodetect
177 if opt.dist_target == 'auto':
178 if platform == 'darwin':
179 # The [.] matches to the dot after the major version, "." would match any character
180 if re.search ("^[0-7][.]", version) != None:
181 conf.env['build_target'] = 'panther'
182 elif re.search ("^8[.]", version) != None:
183 conf.env['build_target'] = 'tiger'
184 elif re.search ("^9[.]", version) != None:
185 conf.env['build_target'] = 'leopard'
186 elif re.search ("^10[.]", version) != None:
187 conf.env['build_target'] = 'snowleopard'
188 elif re.search ("^11[.]", version) != None:
189 conf.env['build_target'] = 'lion'
190 else:
191 conf.env['build_target'] = 'mountainlion'
192 else:
193 match = re.search(
194 "(?P<cpu>i[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)",
195 cpu)
196 if (match):
197 conf.env['build_target'] = match.group("cpu")
198 if re.search("i[0-5]86", conf.env['build_target']):
199 conf.env['build_target'] = "i386"
200 else:
201 conf.env['build_target'] = 'none'
202 else:
203 conf.env['build_target'] = opt.dist_target
204
205 if conf.env['build_target'] == 'snowleopard':
206 #
207 # stupid OS X 10.6 has a bug in math.h that prevents llrint and friends
208 # from being visible.
209 #
210 compiler_flags.append ('-U__STRICT_ANSI__')
211
212 if cpu == 'powerpc' and conf.env['build_target'] != 'none':
213 #
214 # Apple/PowerPC optimization options
215 #
216 # -mcpu=7450 does not reliably work with gcc 3.*
217 #
218 if opt.dist_target == 'panther' or opt.dist_target == 'tiger':
219 if platform == 'darwin':
220 # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"])
221 # to support g3s but still have some optimization for above
222 compiler_flags.extend ([ "-mcpu=G3", "-mtune=7450"])
223 else:
224 compiler_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
225 else:
226 compiler_flags.extend([ "-mcpu=750", "-mmultiple" ])
227 compiler_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
228 optimization_flags.extend (["-Os"])
229
230 elif ((re.search ("i[0-9]86", cpu) != None) or (re.search ("x86_64", cpu) != None)) and conf.env['build_target'] != 'none':
231
232
233 #
234 # ARCH_X86 means anything in the x86 family from i386 to x86_64
235 # the compile-time presence of the macro _LP64 is used to
236 # distingush 32 and 64 bit assembler
237 #
238
239 if (re.search ("(i[0-9]86|x86_64)", cpu) != None):
240 compiler_flags.append ("-DARCH_X86")
241
242 if platform == 'linux' :
243
244 #
245 # determine processor flags via /proc/cpuinfo
246 #
247
248 if conf.env['build_target'] != 'i386':
249
250 flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
251 x86_flags = flag_line.split (": ")[1:][0].split ()
252
253 if "mmx" in x86_flags:
254 compiler_flags.append ("-mmmx")
255 if "sse" in x86_flags:
256 build_host_supports_sse = True
257 if "3dnow" in x86_flags:
258 compiler_flags.append ("-m3dnow")
259
260 if cpu == "i586":
261 compiler_flags.append ("-march=i586")
262 elif cpu == "i686":
263 compiler_flags.append ("-march=i686")
264
265 if not is_clang and ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse:
266 compiler_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"])
267
268 # end of processor-specific section
269
270 # optimization section
271 if conf.env['FPU_OPTIMIZATION']:
272 if sys.platform == 'darwin':
273 compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS");
274 linker_flags.append("-framework Accelerate")
275 elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64':
276 compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
277 if not build_host_supports_sse:
278 print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)")
279
280 # end optimization section
281
282 #
283 # no VST on x86_64
284 #
285
286 if conf.env['build_target'] == 'x86_64' and opt.windows_vst:
287 print("\n\n==================================================")
288 print("You cannot use VST plugins with a 64 bit host. Please run waf with --windows-vst=0")
289 print("\nIt is theoretically possible to build a 32 bit host on a 64 bit system.")
290 print("However, this is tricky and not recommended for beginners.")
291 sys.exit (-1)
292
293 if opt.lxvst:
294 if conf.env['build_target'] == 'x86_64':
295 compiler_flags.append("-DLXVST_64BIT")
296 else:
297 compiler_flags.append("-DLXVST_32BIT")
298
299 #
300 # a single way to test if we're on OS X
301 #
302
303 if conf.env['build_target'] in ['panther', 'tiger', 'leopard', 'snowleopard' ]:
304 conf.define ('IS_OSX', 1)
305 # force tiger or later, to avoid issues on PPC which defaults
306 # back to 10.1 if we don't tell it otherwise.
307
308 compiler_flags.extend(
309 ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1040",
310 '-mmacosx-version-min=10.4'))
311
312 elif conf.env['build_target'] in [ 'lion', 'mountainlion' ]:
313 compiler_flags.extend(
314 ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1070",
315 '-mmacosx-version-min=10.7'))
316 else:
317 conf.define ('IS_OSX', 0)
318
319 #
320 # save off CPU element in an env
321 #
322 conf.define ('CONFIG_ARCH', cpu)
323
324 #
325 # ARCH="..." overrides all
326 #
327
328 if opt.arch != None:
329 optimization_flags = opt.arch.split()
330
331 #
332 # prepend boiler plate optimization flags that work on all architectures
333 #
334
335 optimization_flags[:0] = ["-pipe"]
336
337 # don't prepend optimization flags if "-O<something>" is present
338 prepend_opt_flags = True
339 for flag in optimization_flags:
340 if flag.startswith("-O"):
341 prepend_opt_flags = False
342 break
343
344 if prepend_opt_flags:
345 optimization_flags[:0] = [
346 "-O3",
347 "-fomit-frame-pointer",
348 "-ffast-math",
349 "-fstrength-reduce"
350 ]
351
352 if opt.stl_debug:
353 cxx_flags.append("-D_GLIBCXX_DEBUG")
354
355 if conf.env['DEBUG_RT_ALLOC']:
356 compiler_flags.append('-DDEBUG_RT_ALLOC')
357 linker_flags.append('-ldl')
358
359 if conf.env['DEBUG_DENORMAL_EXCEPTION']:
360 compiler_flags.append('-DDEBUG_DENORMAL_EXCEPTION')
361
362 if opt.universal:
363 if opt.generic:
364 print ('Specifying Universal and Generic builds at the same time is not supported')
365 sys.exit (1)
366 else:
367 if not Options.options.nocarbon:
368 compiler_flags.extend(("-arch", "i386", "-arch", "ppc"))
369 linker_flags.extend(("-arch", "i386", "-arch", "ppc"))
370 else:
371 compiler_flags.extend(
372 ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc"))
373 linker_flags.extend(
374 ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc"))
375 else:
376 if opt.generic:
377 compiler_flags.extend(('-arch', 'i386'))
378 linker_flags.extend(('-arch', 'i386'))
379
380 #
381 # warnings flags
382 #
383
384 compiler_flags.extend(
385 ('-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align'))
386
387 c_flags.extend(('-Wstrict-prototypes', '-Wmissing-prototypes'))
388 cxx_flags.append('-Woverloaded-virtual')
389
390 #
391 # more boilerplate
392 #
393
394 # need ISOC9X for llabs()
395 compiler_flags.extend(
396 ('-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE',
397 '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64'))
398 cxx_flags.extend(('-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS'))
399
400 if opt.nls:
401 compiler_flags.append('-DENABLE_NLS')
402
403 if opt.debug:
404 conf.env.append_value('CFLAGS', debug_flags)
405 conf.env.append_value('CXXFLAGS', debug_flags)
406 else:
407 conf.env.append_value('CFLAGS', optimization_flags)
408 conf.env.append_value('CXXFLAGS', optimization_flags)
409
410 if opt.backtrace:
411 if platform != 'darwin' and not is_clang:
412 linker_flags += [ '-rdynamic' ]
413
414 conf.env.append_value('CFLAGS', compiler_flags)
415 conf.env.append_value('CFLAGS', c_flags)
416 conf.env.append_value('CXXFLAGS', compiler_flags)
417 conf.env.append_value('CXXFLAGS', cxx_flags)
418 conf.env.append_value('LINKFLAGS', linker_flags)
419
420#----------------------------------------------------------------
421
422# Waf stages
423
424def options(opt):
425 opt.load('compiler_c')
426 opt.load('compiler_cxx')
427 autowaf.set_options(opt, debug_by_default=True)
428 opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name',
429 help='The user-visible name of the program being built')
430 opt.add_option('--arch', type='string', action='store', dest='arch',
431 help='Architecture-specific compiler flags')
432 opt.add_option('--backtrace', action='store_true', default=True, dest='backtrace',
433 help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour')
434 opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon',
435 help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)')
436 opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug',
437 help='Compile with Boost shared pointer debugging')
438 opt.add_option('--depstack-root', type='string', default='~', dest='depstack_root',
439 help='Directory/folder where dependency stack trees (gtk, a3) can be found (defaults to ~)')
440 opt.add_option('--dist-target', type='string', default='auto', dest='dist_target',
441 help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,powerpc,tiger,leopard]')
442 opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
443 help='Build runtime checked assembler code (default)')
444 opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization')
445 opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
446 help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
447 opt.add_option('--freebie', action='store_true', default=False, dest='freebie',
448 help='Build a version suitable for distribution as a zero-cost binary')
449 opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile',
450 help='Compile for use with gprofile')
451 opt.add_option('--internal-shared-libs', action='store_true', default=True, dest='internal_shared_libs',
452 help='Build internal libs as shared libraries')
453 opt.add_option('--internal-static-libs', action='store_false', dest='internal_shared_libs',
454 help='Build internal libs as static libraries')
455 opt.add_option('--use-external-libs', action='store_true', default=False, dest='use_external_libs',
456 help='Use external/system versions of some bundled libraries')
457 opt.add_option('--lv2', action='store_true', default=True, dest='lv2',
458 help='Compile with support for LV2 (if Lilv+Suil is available)')
459 opt.add_option('--no-lv2', action='store_false', dest='lv2',
460 help='Do not compile with support for LV2')
461 opt.add_option('--lxvst', action='store_true', default=lxvst_default, dest='lxvst',
462 help='Compile with support for linuxVST plugins')
463 opt.add_option('--nls', action='store_true', default=True, dest='nls',
464 help='Enable i18n (native language support) (default)')
465 opt.add_option('--no-nls', action='store_false', dest='nls')
466 opt.add_option('--phone-home', action='store_true', default=True, dest='phone_home',
467 help='Contact ardour.org at startup for new announcements')
468 opt.add_option('--no-phone-home', action='store_false', dest='phone_home',
469 help='Do not contact ardour.org at startup for new announcements')
470 opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug',
471 help='Build with debugging for the STL')
472 opt.add_option('--rt-alloc-debug', action='store_true', default=False, dest='rt_alloc_debug',
473 help='Build with debugging for memory allocation in the real-time thread')
474 opt.add_option('--pt-timing', action='store_true', default=False, dest='pt_timing',
475 help='Build with logging of timing in the process thread(s)')
476 opt.add_option('--denormal-exception', action='store_true', default=False, dest='denormal_exception',
477 help='Raise a floating point exception if a denormal is detected')
478 opt.add_option('--test', action='store_true', default=False, dest='build_tests',
479 help="Build unit tests")
480 opt.add_option('--run-tests', action='store_true', default=False, dest='run_tests',
481 help="Run tests after build")
482 opt.add_option('--single-tests', action='store_true', default=False, dest='single_tests',
483 help="Build a single executable for each unit test")
484 #opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport',
485 # help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
486 opt.add_option('--universal', action='store_true', default=False, dest='universal',
487 help='Compile as universal binary (OS X ONLY, requires that external libraries are universal)')
488 opt.add_option('--generic', action='store_true', default=False, dest='generic',
489 help='Compile with -arch i386 (OS X ONLY)')
490 opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
491 help='Add revision information to executable name inside the build directory')
492 opt.add_option('--windows-vst', action='store_true', default=False, dest='windows_vst',
493 help='Compile with support for Windows VST')
494 opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super',
495 help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' +
496 'Multiple modifiers must be separated by \'><\'')
497 opt.add_option('--boost-include', type='string', action='store', dest='boost_include', default='',
498 help='directory where Boost header files can be found')
499 opt.add_option('--also-include', type='string', action='store', dest='also_include', default='',
500 help='additional include directory where header files can be found (split multiples with commas)')
501 opt.add_option('--also-libdir', type='string', action='store', dest='also_libdir', default='',
502 help='additional include directory where shared libraries can be found (split multiples with commas)')
503 opt.add_option('--wine-include', type='string', action='store', dest='wine_include', default='/usr/include/wine/windows',
504 help='directory where Wine\'s Windows header files can be found')
505 opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm',
506 help='Do not ask questions that require confirmation during the build')
507 opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11',
508 help='Turn on c++11 compiler flags (-std=c++11)')
509 opt.add_option('--address-sanitizer', action='store_true', default=False, dest='asan',
510 help='Turn on AddressSanitizer (requires GCC >= 4.8 or clang >= 3.1)')
511 for i in children:
512 opt.recurse(i)
513
514def sub_config_and_use(conf, name, has_objects = True):
515 conf.recurse(name)
516 autowaf.set_local_lib(conf, name, has_objects)
517
518def configure(conf):
519 conf.load('compiler_c')
520 conf.load('compiler_cxx')
521 conf.env['VERSION'] = VERSION
522 conf.env['MAJOR'] = MAJOR
523 conf.env['MINOR'] = MINOR
524 conf.line_just = 52
525 autowaf.set_recursive()
526 autowaf.configure(conf)
527 autowaf.display_header('Ardour Configuration')
528
529 gcc_versions = fetch_gcc_version(str(conf.env['CC']))
530 if not Options.options.debug and gcc_versions[0] == '4' and gcc_versions[1] > '4':
531 print('Version 4.5 of gcc is not ready for use when compiling Ardour with optimization.')
532 print('Please use a different version or re-configure with --debug')
533 exit (1)
534
535 # systems with glibc have libintl builtin. systems without require explicit
536 # linkage against libintl.
537 #
538
539 pkg_config_path = os.getenv('PKG_CONFIG_PATH')
540 user_gtk_root = os.path.expanduser (Options.options.depstack_root + '/gtk/inst')
541
542 if pkg_config_path is not None and pkg_config_path.find (user_gtk_root) >= 0:
543 # told to search user_gtk_root
544 prefinclude = ''.join ([ '-I', user_gtk_root + '/include'])
545 preflib = ''.join ([ '-L', user_gtk_root + '/lib'])
546 conf.env.append_value('CFLAGS', [ prefinclude ])
547 conf.env.append_value('CXXFLAGS', [prefinclude ])
548 conf.env.append_value('LINKFLAGS', [ preflib ])
549 autowaf.display_msg(conf, 'Will build against private GTK dependency stack in ' + user_gtk_root, 'yes')
550 else:
551 autowaf.display_msg(conf, 'Will build against private GTK dependency stack', 'no')
552
553 if sys.platform == 'darwin':
554 conf.define ('NEED_INTL', 1)
555 autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes')
556 else:
557 # libintl is part of the system, so use it
558 autowaf.display_msg(conf, 'Will rely on libintl built into libc', 'yes')
559
560 user_ardour_root = os.path.expanduser (Options.options.depstack_root + '/a3/inst')
561 if pkg_config_path is not None and pkg_config_path.find (user_ardour_root) >= 0:
562 # told to search user_ardour_root
563 prefinclude = ''.join ([ '-I', user_ardour_root + '/include'])
564 preflib = ''.join ([ '-L', user_ardour_root + '/lib'])
565 conf.env.append_value('CFLAGS', [ prefinclude ])
566 conf.env.append_value('CXXFLAGS', [prefinclude ])
567 conf.env.append_value('LINKFLAGS', [ preflib ])
568 autowaf.display_msg(conf, 'Will build against private Ardour dependency stack in ' + user_ardour_root, 'yes')
569 else:
570 autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no')
571
572 if Options.options.freebie:
573 conf.env.append_value ('CFLAGS', '-DNO_PLUGIN_STATE')
574 conf.env.append_value ('CXXFLAGS', '-DNO_PLUGIN_STATE')
575 conf.define ('NO_PLUGIN_STATE', 1)
576
577 if sys.platform == 'darwin':
578
579 # this is required, potentially, for anything we link and then relocate into a bundle
580 conf.env.append_value('LINKFLAGS', [ '-Xlinker', '-headerpad_max_install_names' ])
581
582 conf.define ('HAVE_COREAUDIO', 1)
583 conf.define ('AUDIOUNIT_SUPPORT', 1)
584
585 conf.define ('GTKOSX', 1)
586 conf.define ('TOP_MENUBAR',1)
587 conf.define ('GTKOSX',1)
588
589 # It would be nice to be able to use this to force back-compatibility with 10.4
590 # but even by the time of 11, the 10.4 SDK is no longer available in any normal
591 # way.
592 #
593 #conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
594 #conf.env.append_value('CFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk")
595 #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
596 #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk")
597
598 conf.env.append_value('CXXFLAGS_OSX', "-msse")
599 conf.env.append_value('CFLAGS_OSX', "-msse")
600 conf.env.append_value('CXXFLAGS_OSX', "-msse2")
601 conf.env.append_value('CFLAGS_OSX', "-msse2")
602 #
603 # TODO: The previous sse flags NEED to be based
604 # off processor type. Need to add in a check
605 # for that.
606 #
607 conf.env.append_value('CXXFLAGS_OSX', '-F/System/Library/Frameworks')
608 conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks')
609
610 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'AppKit'])
611 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudio'])
612 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudioKit'])
613 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreFoundation'])
614 conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreServices'])
615
616 conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'dynamic_lookup' ])
617 conf.env.append_value('LINKFLAGS_OSX', ['-flat_namespace'])
618
619 conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DAUDIOUNIT_SUPPORT")
620 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'AudioToolbox', '-framework', 'AudioUnit'])
621 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Cocoa'])
622
623 if re.search ("^[1-9][0-9]\.", os.uname()[2]) == None and not Options.options.nocarbon:
624 conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DWITH_CARBON")
625 conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Carbon'])
626 else:
627 print ('No Carbon support available for this build\n')
628
629
630 if Options.options.internal_shared_libs:
631 conf.define('INTERNAL_SHARED_LIBS', 1)
632
633 if Options.options.use_external_libs:
634 conf.define('USE_EXTERNAL_LIBS', 1)
635
636 if Options.options.boost_include != '':
637 conf.env.append_value('CXXFLAGS', '-I' + Options.options.boost_include)
638
639 if Options.options.also_include != '':
640 conf.env.append_value('CXXFLAGS', '-I' + Options.options.also_include)
641 conf.env.append_value('CFLAGS', '-I' + Options.options.also_include)
642
643 if Options.options.also_libdir != '':
644 conf.env.append_value('LDFLAGS', '-L' + Options.options.also_libdir)
645
646 if Options.options.boost_sp_debug:
647 conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS')
648
649 conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n",
650 execute = "1",
651 mandatory = True,
652 msg = 'Checking for boost library >= 1.39',
653 okmsg = 'ok',
654 errmsg = 'too old\nPlease install boost version 1.39 or higher.')
655
656 autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
657 autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2')
658 autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0')
659 autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
660 autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2')
661 autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0')
662 autowaf.check_pkg(conf, 'liblo', uselib_store='LO', atleast_version='0.26')
663
664 conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL')
665
666 # Tell everyone that this is a waf build
667
668 conf.env.append_value('CFLAGS', '-DWAF_BUILD')
669 conf.env.append_value('CXXFLAGS', '-DWAF_BUILD')
670
671 # Set up waf environment and C defines
672 opts = Options.options
673 if opts.phone_home:
674 conf.define('PHONE_HOME', 1)
675 conf.env['PHONE_HOME'] = True
676 if opts.fpu_optimization:
677 conf.env['FPU_OPTIMIZATION'] = True
678 if opts.nls:
679 conf.define('ENABLE_NLS', 1)
680 conf.env['ENABLE_NLS'] = True
681 if opts.build_tests:
682 conf.env['BUILD_TESTS'] = True
683 conf.env['RUN_TESTS'] = opts.run_tests
684 if opts.single_tests:
685 conf.env['SINGLE_TESTS'] = opts.single_tests
686 #if opts.tranzport:
687 # conf.env['TRANZPORT'] = 1
688 if opts.windows_vst:
689 conf.define('WINDOWS_VST_SUPPORT', 1)
690 conf.env['WINDOWS_VST_SUPPORT'] = True
691 conf.env.append_value('CFLAGS', '-I' + Options.options.wine_include)
692 conf.env.append_value('CXXFLAGS', '-I' + Options.options.wine_include)
693 autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True)
694 if opts.lxvst:
695 conf.define('LXVST_SUPPORT', 1)
696 conf.env['LXVST_SUPPORT'] = True
697 conf.define('WINDOWS_KEY', opts.windows_key)
698 conf.env['PROGRAM_NAME'] = opts.program_name
699 if opts.rt_alloc_debug:
700 conf.define('DEBUG_RT_ALLOC', 1)
701 conf.env['DEBUG_RT_ALLOC'] = True
702 if opts.pt_timing:
703 conf.define('PT_TIMING', 1)
704 conf.env['PT_TIMING'] = True
705 if opts.denormal_exception:
706 conf.define('DEBUG_DENORMAL_EXCEPTION', 1)
707 conf.env['DEBUG_DENORMAL_EXCEPTION'] = True
708 if opts.build_tests:
709 autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=True)
710
711 set_compiler_flags (conf, Options.options)
712
713 for i in children:
714 sub_config_and_use(conf, i)
715
716 # Fix utterly braindead FLAC include path to not smash assert.h
717 conf.env['INCLUDES_FLAC'] = []
718
719 config_text = open('libs/ardour/config_text.cc', "w")
720 config_text.write('''#include "ardour/ardour.h"
721namespace ARDOUR {
722const char* const ardour_config_info = "\\n\\
723''')
724
725 def write_config_text(title, val):
726 autowaf.display_msg(conf, title, val)
727 config_text.write(title + ': ')
728 config_text.write(str(val))
729 config_text.write("\\n\\\n")
730
731 write_config_text('Build documentation', conf.env['DOCS'])
732 write_config_text('Debuggable build', conf.env['DEBUG'])
733 write_config_text('Export all symbols (backtrace)', opts.backtrace)
734 write_config_text('Install prefix', conf.env['PREFIX'])
735 write_config_text('Strict compiler flags', conf.env['STRICT'])
736 write_config_text('Internal Shared Libraries', conf.is_defined('INTERNAL_SHARED_LIBS'))
737 write_config_text('Use External Libraries', conf.is_defined('USE_EXTERNAL_LIBS'))
738
739 write_config_text('Architecture flags', opts.arch)
740 write_config_text('Aubio', conf.is_defined('HAVE_AUBIO'))
741 write_config_text('AudioUnits', conf.is_defined('AUDIOUNIT_SUPPORT'))
742 write_config_text('No plugin state', conf.is_defined('NO_PLUGIN_STATE'))
743 write_config_text('Build target', conf.env['build_target'])
744 write_config_text('CoreAudio', conf.is_defined('HAVE_COREAUDIO'))
745 write_config_text('Debug RT allocations', conf.is_defined('DEBUG_RT_ALLOC'))
746 write_config_text('Process thread timing', conf.is_defined('PT_TIMING'))
747 write_config_text('Denormal exceptions', conf.is_defined('DEBUG_DENORMAL_EXCEPTION'))
748 write_config_text('FLAC', conf.is_defined('HAVE_FLAC'))
749 write_config_text('FPU optimization', opts.fpu_optimization)
750 write_config_text('Freedesktop files', opts.freedesktop)
751 write_config_text('LV2 UI embedding', conf.is_defined('HAVE_SUIL'))
752 write_config_text('LV2 support', conf.is_defined('LV2_SUPPORT'))
753 write_config_text('LXVST support', conf.is_defined('LXVST_SUPPORT'))
754 write_config_text('OGG', conf.is_defined('HAVE_OGG'))
755 write_config_text('Phone home', conf.is_defined('PHONE_HOME'))
756 write_config_text('Program name', opts.program_name)
757 write_config_text('Rubberband', conf.is_defined('HAVE_RUBBERBAND'))
758 write_config_text('Samplerate', conf.is_defined('HAVE_SAMPLERATE'))
759# write_config_text('Soundtouch', conf.is_defined('HAVE_SOUNDTOUCH'))
760 write_config_text('Translation', opts.nls)
761# write_config_text('Tranzport', opts.tranzport)
762 write_config_text('Unit tests', conf.env['BUILD_TESTS'])
763 write_config_text('Universal binary', opts.universal)
764 write_config_text('Generic x86 CPU', opts.generic)
765 write_config_text('Windows VST support', opts.windows_vst)
766 write_config_text('Wiimote support', conf.is_defined('BUILD_WIIMOTE'))
767 write_config_text('Windows key', opts.windows_key)
768
769 write_config_text('C compiler flags', conf.env['CFLAGS'])
770 write_config_text('C++ compiler flags', conf.env['CXXFLAGS'])
771 write_config_text('Linker flags', conf.env['LINKFLAGS'])
772
773 config_text.write ('";\n}\n')
774 config_text.close ()
775 print('')
776
777def build(bld):
778 create_stored_revision()
779
780 # add directories that contain only headers, to workaround an issue with waf
781
782 bld.path.find_dir ('libs/evoral/evoral')
783 if not bld.is_defined('USE_EXTERNAL_LIBS'):
784 bld.path.find_dir ('libs/vamp-sdk/vamp-sdk')
785 bld.path.find_dir ('libs/surfaces/control_protocol/control_protocol')
786 bld.path.find_dir ('libs/timecode/timecode')
787 if not bld.is_defined('USE_EXTERNAL_LIBS'):
788 bld.path.find_dir ('libs/libltc/ltc')
789 bld.path.find_dir ('libs/rubberband/rubberband')
790 bld.path.find_dir ('libs/gtkmm2ext/gtkmm2ext')
791 bld.path.find_dir ('libs/ardour/ardour')
792 if not bld.is_defined('USE_EXTERNAL_LIBS'):
793 bld.path.find_dir ('libs/taglib/taglib')
794 bld.path.find_dir ('libs/pbd/pbd')
795
796 autowaf.set_recursive()
797
798 for i in children:
799 bld.recurse(i)
800
801 bld.install_files (os.path.join(bld.env['SYSCONFDIR'], 'ardour3', ), 'ardour_system.rc')
802
803 if bld.env['RUN_TESTS']:
804 bld.add_post_fun(test)
805
806def i18n(bld):
807 bld.recurse (i18n_children)
808
809def i18n_pot(bld):
810 bld.recurse (i18n_children)
811
812def i18n_po(bld):
813 bld.recurse (i18n_children)
814
815def i18n_mo(bld):
816 bld.recurse (i18n_children)
817
818def tarball(bld):
819 create_stored_revision()
820
821def test(bld):
822 subprocess.call("gtk2_ardour/artest")
0823
=== added directory '.pc/midi-data-loss.patch'
=== added directory '.pc/midi-data-loss.patch/libs'
=== added directory '.pc/midi-data-loss.patch/libs/ardour'
=== added file '.pc/midi-data-loss.patch/libs/ardour/smf_source.cc'
--- .pc/midi-data-loss.patch/libs/ardour/smf_source.cc 1970-01-01 00:00:00 +0000
+++ .pc/midi-data-loss.patch/libs/ardour/smf_source.cc 2015-05-02 14:23:30 +0000
@@ -0,0 +1,764 @@
1/*
2 Copyright (C) 2006 Paul Davis
3 Author: David Robillard
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19*/
20
21#include <vector>
22
23#include <sys/time.h>
24#include <sys/stat.h>
25#include <unistd.h>
26#include <errno.h>
27#include <regex.h>
28
29#include "pbd/pathscanner.h"
30#include "pbd/stl_delete.h"
31#include "pbd/strsplit.h"
32
33#include <glibmm/miscutils.h>
34#include <glibmm/fileutils.h>
35
36#include "evoral/Control.hpp"
37#include "evoral/evoral/SMF.hpp"
38
39#include "ardour/event_type_map.h"
40#include "ardour/midi_model.h"
41#include "ardour/midi_ring_buffer.h"
42#include "ardour/midi_state_tracker.h"
43#include "ardour/session.h"
44#include "ardour/smf_source.h"
45#include "ardour/debug.h"
46
47#include "i18n.h"
48
49using namespace ARDOUR;
50using namespace Glib;
51using namespace PBD;
52using namespace Evoral;
53
54/** Constructor used for new internal-to-session files. File cannot exist. */
55SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags)
56 : Source(s, DataType::MIDI, path, flags)
57 , MidiSource(s, path, flags)
58 , FileSource(s, DataType::MIDI, path, string(), flags)
59 , Evoral::SMF()
60 , _last_ev_time_beats(0.0)
61 , _last_ev_time_frames(0)
62 , _smf_last_read_end (0)
63 , _smf_last_read_time (0)
64{
65 /* note that origin remains empty */
66
67 if (init (_path, false)) {
68 throw failed_constructor ();
69 }
70
71 assert (!Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
72 existence_check ();
73
74 _flags = Source::Flag (_flags | Empty);
75
76 /* file is not opened until write */
77
78 if (flags & Writable) {
79 return;
80 }
81
82 if (open (_path)) {
83 throw failed_constructor ();
84 }
85
86 _open = true;
87}
88
89/** Constructor used for external-to-session files. File must exist. */
90SMFSource::SMFSource (Session& s, const string& path)
91 : Source(s, DataType::MIDI, path, Source::Flag (0))
92 , MidiSource(s, path, Source::Flag (0))
93 , FileSource(s, DataType::MIDI, path, string(), Source::Flag (0))
94 , Evoral::SMF()
95 , _last_ev_time_beats(0.0)
96 , _last_ev_time_frames(0)
97 , _smf_last_read_end (0)
98 , _smf_last_read_time (0)
99{
100 /* note that origin remains empty */
101
102 if (init (_path, true)) {
103 throw failed_constructor ();
104 }
105
106 assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
107 existence_check ();
108
109 if (_flags & Writable) {
110 /* file is not opened until write */
111 return;
112 }
113
114 if (open (_path)) {
115 throw failed_constructor ();
116 }
117
118 _open = true;
119}
120
121/** Constructor used for existing internal-to-session files. */
122SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist)
123 : Source(s, node)
124 , MidiSource(s, node)
125 , FileSource(s, node, must_exist)
126 , _last_ev_time_beats(0.0)
127 , _last_ev_time_frames(0)
128 , _smf_last_read_end (0)
129 , _smf_last_read_time (0)
130{
131 if (set_state(node, Stateful::loading_state_version)) {
132 throw failed_constructor ();
133 }
134
135 /* we expect the file to exist, but if no MIDI data was ever added
136 it will have been removed at last session close. so, we don't
137 require it to exist if it was marked Empty.
138 */
139
140 try {
141
142 if (init (_path, true)) {
143 throw failed_constructor ();
144 }
145
146 } catch (MissingSource& err) {
147
148 if (_flags & Source::Empty) {
149 /* we don't care that the file was not found, because
150 it was empty. But FileSource::init() will have
151 failed to set our _path correctly, so we have to do
152 this ourselves. Use the first entry in the search
153 path for MIDI files, which is assumed to be the
154 correct "main" location.
155 */
156 std::vector<Glib::ustring> sdirs;
157 split (s.source_search_path (DataType::MIDI), sdirs, ':');
158 if (sdirs.empty()) {
159 fatal << _("Empty MIDI source search path!") << endmsg;
160 /*NOTREACHED*/
161 }
162 _path = Glib::build_filename (sdirs.front(), _path);
163 /* This might be important, too */
164 _file_is_new = true;
165 } else {
166 /* pass it on */
167 throw;
168 }
169 }
170
171 if (!(_flags & Source::Empty)) {
172 assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
173 existence_check ();
174 } else {
175 assert (_flags & Source::Writable);
176 /* file will be opened on write */
177 return;
178 }
179
180 if (open(_path)) {
181 throw failed_constructor ();
182 }
183
184 _open = true;
185}
186
187SMFSource::~SMFSource ()
188{
189 if (removable()) {
190 unlink (_path.c_str());
191 }
192}
193
194int
195SMFSource::open_for_write ()
196{
197 if (create (_path)) {
198 return -1;
199 }
200 _open = true;
201 return 0;
202}
203
204/** All stamps in audio frames */
205framecnt_t
206SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination,
207 framepos_t const source_start,
208 framepos_t start,
209 framecnt_t duration,
210 MidiStateTracker* tracker) const
211{
212 int ret = 0;
213 uint64_t time = 0; // in SMF ticks, 1 tick per _ppqn
214
215 if (writable() && !_open) {
216 /* nothing to read since nothing has ben written */
217 return duration;
218 }
219
220 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: start %1 duration %2\n", start, duration));
221
222 // Output parameters for read_event (which will allocate scratch in buffer as needed)
223 uint32_t ev_delta_t = 0;
224 uint32_t ev_type = 0;
225 uint32_t ev_size = 0;
226 uint8_t* ev_buffer = 0;
227
228 size_t scratch_size = 0; // keep track of scratch to minimize reallocs
229
230 BeatsFramesConverter converter(_session.tempo_map(), source_start);
231
232 const uint64_t start_ticks = (uint64_t)(converter.from(start) * ppqn());
233 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: start in ticks %1\n", start_ticks));
234
235 if (_smf_last_read_end == 0 || start != _smf_last_read_end) {
236 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: seek to %1\n", start));
237 Evoral::SMF::seek_to_start();
238 while (time < start_ticks) {
239 gint ignored;
240
241 ret = read_event(&ev_delta_t, &ev_size, &ev_buffer, &ignored);
242 if (ret == -1) { // EOF
243 _smf_last_read_end = start + duration;
244 return duration;
245 }
246 time += ev_delta_t; // accumulate delta time
247 }
248 } else {
249 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: set time to %1\n", _smf_last_read_time));
250 time = _smf_last_read_time;
251 }
252
253 _smf_last_read_end = start + duration;
254
255 while (true) {
256 gint ignored; /* XXX don't ignore note id's ??*/
257
258 ret = read_event(&ev_delta_t, &ev_size, &ev_buffer, &ignored);
259 if (ret == -1) { // EOF
260 break;
261 }
262
263 time += ev_delta_t; // accumulate delta time
264 _smf_last_read_time = time;
265
266 if (ret == 0) { // meta-event (skipped, just accumulate time)
267 continue;
268 }
269
270 ev_type = EventTypeMap::instance().midi_event_type(ev_buffer[0]);
271
272 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked delta %1, time %2, buf[0] %3, type %4\n",
273 ev_delta_t, time, ev_buffer[0], ev_type));
274
275 assert(time >= start_ticks);
276
277 /* Note that we add on the source start time (in session frames) here so that ev_frame_time
278 is in session frames.
279 */
280 const framepos_t ev_frame_time = converter.to(time / (double)ppqn()) + source_start;
281
282 if (ev_frame_time < start + duration) {
283 destination.write (ev_frame_time, ev_type, ev_size, ev_buffer);
284
285 if (tracker) {
286 if (ev_buffer[0] & MIDI_CMD_NOTE_ON) {
287 tracker->add (ev_buffer[1], ev_buffer[0] & 0xf);
288 } else if (ev_buffer[0] & MIDI_CMD_NOTE_OFF) {
289 tracker->remove (ev_buffer[1], ev_buffer[0] & 0xf);
290 }
291 }
292 } else {
293 break;
294 }
295
296 if (ev_size > scratch_size) {
297 scratch_size = ev_size;
298 }
299 ev_size = scratch_size; // ensure read_event only allocates if necessary
300 }
301
302 return duration;
303}
304
305framecnt_t
306SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source,
307 framepos_t position,
308 framecnt_t cnt)
309{
310 if (!_writing) {
311 mark_streaming_write_started ();
312 }
313
314 framepos_t time;
315 Evoral::EventType type;
316 uint32_t size;
317
318 size_t buf_capacity = 4;
319 uint8_t* buf = (uint8_t*)malloc(buf_capacity);
320
321 if (_model && !_model->writing()) {
322 _model->start_write();
323 }
324
325 Evoral::MIDIEvent<framepos_t> ev;
326 while (true) {
327 /* Get the event time, in frames since session start but ignoring looping. */
328 bool ret;
329 if (!(ret = source.peek ((uint8_t*)&time, sizeof (time)))) {
330 /* Ring is empty, no more events. */
331 break;
332 }
333
334 if ((cnt != max_framecnt) &&
335 (time > position + _capture_length + cnt)) {
336 /* The diskstream doesn't want us to write everything, and this
337 event is past the end of this block, so we're done for now. */
338 break;
339 }
340
341 /* Read the time, type, and size of the event. */
342 if (!(ret = source.read_prefix (&time, &type, &size))) {
343 error << _("Unable to read event prefix, corrupt MIDI ring") << endmsg;
344 break;
345 }
346
347 /* Enlarge body buffer if necessary now that we know the size. */
348 if (size > buf_capacity) {
349 buf_capacity = size;
350 buf = (uint8_t*)realloc(buf, size);
351 }
352
353 /* Read the event body into buffer. */
354 ret = source.read_contents(size, buf);
355 if (!ret) {
356 error << _("Event has time and size but no body, corrupt MIDI ring") << endmsg;
357 break;
358 }
359
360 /* Convert event time from absolute to source relative. */
361 if (time < position) {
362 error << _("Event time is before MIDI source position") << endmsg;
363 break;
364 }
365 time -= position;
366
367 ev.set(buf, size, time);
368 ev.set_event_type(EventTypeMap::instance().midi_event_type(ev.buffer()[0]));
369 ev.set_id(Evoral::next_event_id());
370
371 if (!(ev.is_channel_event() || ev.is_smf_meta_event() || ev.is_sysex())) {
372 continue;
373 }
374
375 append_event_unlocked_frames(ev, position);
376 }
377
378 Evoral::SMF::flush ();
379 free (buf);
380
381 return cnt;
382}
383
384/** Append an event with a timestamp in beats (double) */
385void
386SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev)
387{
388 if (!_writing || ev.size() == 0) {
389 return;
390 }
391
392 /*printf("SMFSource: %s - append_event_unlocked_beats ID = %d time = %lf, size = %u, data = ",
393 name().c_str(), ev.id(), ev.time(), ev.size());
394 for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/
395
396 if (ev.time() < _last_ev_time_beats) {
397 warning << string_compose(_("Skipping event with unordered time %1"), ev.time())
398 << endmsg;
399 return;
400 }
401
402 Evoral::event_id_t event_id;
403
404 if (ev.id() < 0) {
405 event_id = Evoral::next_event_id();
406 } else {
407 event_id = ev.id();
408 }
409
410 if (_model) {
411 _model->append (ev, event_id);
412 }
413
414 _length_beats = max(_length_beats, ev.time());
415
416 const double delta_time_beats = ev.time() - _last_ev_time_beats;
417 const uint32_t delta_time_ticks = (uint32_t)lrint(delta_time_beats * (double)ppqn());
418
419 Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id);
420 _last_ev_time_beats = ev.time();
421 _flags = Source::Flag (_flags & ~Empty);
422}
423
424/** Append an event with a timestamp in frames (framepos_t) */
425void
426SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t position)
427{
428 if (!_writing || ev.size() == 0) {
429 return;
430 }
431
432 // printf("SMFSource: %s - append_event_unlocked_frames ID = %d time = %u, size = %u, data = ",
433 // name().c_str(), ev.id(), ev.time(), ev.size());
434 // for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");
435
436 if (ev.time() < _last_ev_time_frames) {
437 warning << string_compose(_("Skipping event with unordered time %1"), ev.time())
438 << endmsg;
439 return;
440 }
441
442 BeatsFramesConverter converter(_session.tempo_map(), position);
443 const double ev_time_beats = converter.from(ev.time());
444 Evoral::event_id_t event_id;
445
446 if (ev.id() < 0) {
447 event_id = Evoral::next_event_id();
448 } else {
449 event_id = ev.id();
450 }
451
452 if (_model) {
453 const Evoral::Event<double> beat_ev (ev.event_type(),
454 ev_time_beats,
455 ev.size(),
456 const_cast<uint8_t*>(ev.buffer()));
457 _model->append (beat_ev, event_id);
458 }
459
460 _length_beats = max(_length_beats, ev_time_beats);
461
462 const Evoral::MusicalTime last_time_beats = converter.from (_last_ev_time_frames);
463 const Evoral::MusicalTime delta_time_beats = ev_time_beats - last_time_beats;
464 const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn()));
465
466 Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id);
467 _last_ev_time_frames = ev.time();
468 _flags = Source::Flag (_flags & ~Empty);
469}
470
471XMLNode&
472SMFSource::get_state ()
473{
474 XMLNode& node = MidiSource::get_state();
475 node.add_property (X_("origin"), _origin);
476 return node;
477}
478
479int
480SMFSource::set_state (const XMLNode& node, int version)
481{
482 if (Source::set_state (node, version)) {
483 return -1;
484 }
485
486 if (MidiSource::set_state (node, version)) {
487 return -1;
488 }
489
490 if (FileSource::set_state (node, version)) {
491 return -1;
492 }
493
494 return 0;
495}
496
497void
498SMFSource::mark_streaming_midi_write_started (NoteMode mode)
499{
500 /* CALLER MUST HOLD LOCK */
501
502 if (!_open && open_for_write()) {
503 error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg;
504 /* XXX should probably throw or return something */
505 return;
506 }
507
508 MidiSource::mark_streaming_midi_write_started (mode);
509 Evoral::SMF::begin_write ();
510 _last_ev_time_beats = 0.0;
511 _last_ev_time_frames = 0;
512}
513
514void
515SMFSource::mark_streaming_write_completed ()
516{
517 mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::DeleteStuckNotes);
518}
519
520void
521SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption stuck_notes_option, Evoral::MusicalTime when)
522{
523 Glib::Threads::Mutex::Lock lm (_lock);
524 MidiSource::mark_midi_streaming_write_completed (stuck_notes_option, when);
525
526 if (!writable()) {
527 warning << string_compose ("attempt to write to unwritable SMF file %1", _path) << endmsg;
528 return;
529 }
530
531 if (_model) {
532 _model->set_edited(false);
533 }
534
535 Evoral::SMF::end_write ();
536
537 /* data in the file now, not removable */
538
539 mark_nonremovable ();
540}
541
542bool
543SMFSource::valid_midi_file (const string& file)
544{
545 if (safe_midi_file_extension (file) ) {
546 return (SMF::test (file) );
547 }
548 return false;
549}
550
551bool
552SMFSource::safe_midi_file_extension (const string& file)
553{
554 static regex_t compiled_pattern;
555 static bool compile = true;
556 const int nmatches = 2;
557 regmatch_t matches[nmatches];
558
559 if (Glib::file_test (file, Glib::FILE_TEST_EXISTS)) {
560 if (!Glib::file_test (file, Glib::FILE_TEST_IS_REGULAR)) {
561 /* exists but is not a regular file */
562 return false;
563 }
564 }
565
566 if (compile && regcomp (&compiled_pattern, "\\.[mM][iI][dD][iI]?$", REG_EXTENDED)) {
567 return false;
568 } else {
569 compile = false;
570 }
571
572 if (regexec (&compiled_pattern, file.c_str(), nmatches, matches, 0)) {
573 return false;
574 }
575
576 return true;
577}
578
579static bool compare_eventlist (
580 const std::pair< Evoral::Event<double>*, gint >& a,
581 const std::pair< Evoral::Event<double>*, gint >& b) {
582 return ( a.first->time() < b.first->time() );
583}
584
585void
586SMFSource::load_model (bool lock, bool force_reload)
587{
588 if (_writing) {
589 return;
590 }
591
592 boost::shared_ptr<Glib::Threads::Mutex::Lock> lm;
593 if (lock)
594 lm = boost::shared_ptr<Glib::Threads::Mutex::Lock>(new Glib::Threads::Mutex::Lock(_lock));
595
596 if (_model && !force_reload) {
597 return;
598 }
599
600 if (!_model) {
601 _model = boost::shared_ptr<MidiModel> (new MidiModel (shared_from_this ()));
602 } else {
603 _model->clear();
604 }
605
606 if (writable() && !_open) {
607 return;
608 }
609
610 _model->start_write();
611 Evoral::SMF::seek_to_start();
612
613 uint64_t time = 0; /* in SMF ticks */
614 Evoral::Event<double> ev;
615
616 uint32_t scratch_size = 0; // keep track of scratch and minimize reallocs
617
618 uint32_t delta_t = 0;
619 uint32_t size = 0;
620 uint8_t* buf = NULL;
621 int ret;
622 gint event_id;
623 bool have_event_id;
624
625 // TODO simplify event allocation
626 std::list< std::pair< Evoral::Event<double>*, gint > > eventlist;
627
628 for (unsigned i = 1; i <= num_tracks(); ++i) {
629 if (seek_to_track(i)) continue;
630
631 time = 0;
632 have_event_id = false;
633
634 while ((ret = read_event (&delta_t, &size, &buf, &event_id)) >= 0) {
635
636 time += delta_t;
637
638 if (ret == 0) {
639 /* meta-event : did we get an event ID ? */
640 if (event_id >= 0) {
641 have_event_id = true;
642 }
643 continue;
644 }
645
646 if (ret > 0) {
647 /* not a meta-event */
648
649 if (!have_event_id) {
650 event_id = Evoral::next_event_id();
651 }
652 uint32_t event_type = EventTypeMap::instance().midi_event_type(buf[0]);
653 double event_time = time / (double) ppqn();
654#ifndef NDEBUG
655 std::string ss;
656
657 for (uint32_t xx = 0; xx < size; ++xx) {
658 char b[8];
659 snprintf (b, sizeof (b), "0x%x ", buf[xx]);
660 ss += b;
661 }
662
663 DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF %6 load model delta %1, time %2, size %3 buf %4, type %5\n",
664 delta_t, time, size, ss , event_type, name()));
665#endif
666
667 eventlist.push_back(make_pair (
668 new Evoral::Event<double> (
669 event_type, event_time,
670 size, buf, true)
671 , event_id));
672
673 // Set size to max capacity to minimize allocs in read_event
674 scratch_size = std::max(size, scratch_size);
675 size = scratch_size;
676
677 _length_beats = max(_length_beats, event_time);
678 }
679
680 /* event ID's must immediately precede the event they are for */
681 have_event_id = false;
682 }
683 }
684
685 eventlist.sort(compare_eventlist);
686
687 std::list< std::pair< Evoral::Event<double>*, gint > >::iterator it;
688 for (it=eventlist.begin(); it!=eventlist.end(); ++it) {
689 _model->append (*it->first, it->second);
690 delete it->first;
691 }
692
693 _model->end_write (Evoral::Sequence<Evoral::MusicalTime>::ResolveStuckNotes, _length_beats);
694 _model->set_edited (false);
695
696 _model_iter = _model->begin();
697
698 free(buf);
699}
700
701void
702SMFSource::destroy_model ()
703{
704 //cerr << _name << " destroying model " << _model.get() << endl;
705 _model.reset();
706}
707
708void
709SMFSource::flush_midi ()
710{
711 if (!writable() || _length_beats == 0.0) {
712 return;
713 }
714
715 ensure_disk_file ();
716
717 Evoral::SMF::end_write ();
718 /* data in the file means its no longer removable */
719 mark_nonremovable ();
720}
721
722void
723SMFSource::set_path (const string& p)
724{
725 FileSource::set_path (p);
726 SMF::set_path (_path);
727}
728
729/** Ensure that this source has some file on disk, even if it's just a SMF header */
730void
731SMFSource::ensure_disk_file ()
732{
733 if (!writable()) {
734 return;
735 }
736
737 if (_model) {
738 /* We have a model, so write it to disk; see MidiSource::session_saved
739 for an explanation of what we are doing here.
740 */
741 boost::shared_ptr<MidiModel> mm = _model;
742 _model.reset ();
743 mm->sync_to_source ();
744 _model = mm;
745 } else {
746 /* No model; if it's not already open, it's an empty source, so create
747 and open it for writing.
748 */
749 if (!_open) {
750 open_for_write ();
751 }
752 }
753}
754
755void
756SMFSource::prevent_deletion ()
757{
758 /* Unlike the audio case, the MIDI file remains mutable (because we can
759 edit MIDI data)
760 */
761
762 _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
763}
764
0765
=== modified file '.pc/wscript.patch/wscript'
--- .pc/wscript.patch/wscript 2014-01-24 16:31:54 +0000
+++ .pc/wscript.patch/wscript 2015-05-02 14:23:30 +0000
@@ -177,10 +177,6 @@
177 if opt.gprofile:177 if opt.gprofile:
178 debug_flags = [ '-pg' ]178 debug_flags = [ '-pg' ]
179179
180 if opt.backtrace:
181 if platform != 'darwin' and not is_clang:
182 debug_flags = [ '-rdynamic' ]
183
184 # Autodetect180 # Autodetect
185 if opt.dist_target == 'auto':181 if opt.dist_target == 'auto':
186 if platform == 'darwin':182 if platform == 'darwin':
@@ -415,6 +411,10 @@
415 conf.env.append_value('CFLAGS', optimization_flags)411 conf.env.append_value('CFLAGS', optimization_flags)
416 conf.env.append_value('CXXFLAGS', optimization_flags)412 conf.env.append_value('CXXFLAGS', optimization_flags)
417413
414 if opt.backtrace:
415 if platform != 'darwin' and not is_clang:
416 linker_flags += [ '-rdynamic' ]
417
418 conf.env.append_value('CFLAGS', compiler_flags)418 conf.env.append_value('CFLAGS', compiler_flags)
419 conf.env.append_value('CFLAGS', c_flags)419 conf.env.append_value('CFLAGS', c_flags)
420 conf.env.append_value('CXXFLAGS', compiler_flags)420 conf.env.append_value('CXXFLAGS', compiler_flags)
421421
=== modified file 'debian/changelog'
--- debian/changelog 2014-01-24 16:31:54 +0000
+++ debian/changelog 2015-05-02 14:23:30 +0000
@@ -1,15 +1,78 @@
1ardour3 (3.5.308~dfsg-1) unstable; urgency=low1<<<<<<< TREE
22ardour3 (3.5.308~dfsg-1) unstable; urgency=low
3 [ Jaromír Mikeš ]3
4 * Use higher resolution picture for desktop icon (Closes: #729890).4 [ Jaromír Mikeš ]
55 * Use higher resolution picture for desktop icon (Closes: #729890).
6 [ Adrian Knoth ]6
7 * Change Name entry in desktop file (Closes: #729890)7 [ Adrian Knoth ]
8 * Remove python runtime dependencies8 * Change Name entry in desktop file (Closes: #729890)
9 * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969)9 * Remove python runtime dependencies
1010 * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969)
11 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +010011
1212 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +0100
13
14=======
15ardour3 (3.5.403~dfsg-3) unstable; urgency=medium
16
17 * Fix MIDI data loss when editing (Closes: #772118)
18
19 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Thu, 04 Dec 2014 19:34:45 +0100
20
21ardour3 (3.5.403~dfsg-2) unstable; urgency=high
22
23 * Reupload with waf fixes from 3.5.380~dfsg-2 and -3
24
25 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 03 Oct 2014 14:01:07 +0200
26
27ardour3 (3.5.403~dfsg-1) unstable; urgency=high
28
29 * Imported Upstream version 3.5.403~dfsg
30 * Critical bugfix release. All users are recommended to upgrade.
31 * Details: https://community.ardour.org/node/8457
32
33 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 03 Oct 2014 13:02:45 +0200
34
35ardour3 (3.5.380~dfsg-3) unstable; urgency=medium
36
37 * Prevent build failures in slower architectures by
38 forcing waf logging to stdout instead of stderr.
39
40 -- Felipe Sateler <fsateler@debian.org> Fri, 11 Jul 2014 12:46:37 -0400
41
42ardour3 (3.5.380~dfsg-2) unstable; urgency=medium
43
44 * Team upload.
45 * Pass correct -j flag to waf. Closes: #748584
46
47 -- Felipe Sateler <fsateler@debian.org> Mon, 16 Jun 2014 11:03:20 -0400
48
49ardour3 (3.5.380~dfsg-1) unstable; urgency=low
50
51 * Imported Upstream version 3.5.380~dfsg
52
53 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Thu, 15 May 2014 14:33:48 +0200
54
55ardour3 (3.5.357~dfsg-1) unstable; urgency=high
56
57 * Imported Upstream version 3.5.357~dfsg
58 * Critical bugfix release. All users are recommended to upgrade.
59 * Details: https://community.ardour.org/node/8015
60
61 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Tue, 25 Feb 2014 14:13:18 +0100
62
63ardour3 (3.5.308~dfsg-1) unstable; urgency=low
64
65 [ Jaromír Mikeš ]
66 * Use higher resolution picture for desktop icon (Closes: #729890).
67
68 [ Adrian Knoth ]
69 * Change Name entry in desktop file (Closes: #729890)
70 * Remove python runtime dependencies
71 * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969)
72
73 -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +0100
74
75>>>>>>> MERGE-SOURCE
13ardour3 (3.5.143~dfsg-1) unstable; urgency=low76ardour3 (3.5.143~dfsg-1) unstable; urgency=low
1477
15 * Imported Upstream version 3.5.143~dfsg78 * Imported Upstream version 3.5.143~dfsg
1679
=== modified file 'debian/control'
--- debian/control 2014-01-24 16:31:54 +0000
+++ debian/control 2015-05-02 14:23:30 +0000
@@ -47,9 +47,15 @@
47 vamp-plugin-sdk (>=2.1),47 vamp-plugin-sdk (>=2.1),
48 python-setuptools,48 python-setuptools,
49 python-isodate,49 python-isodate,
50<<<<<<< TREE
50 libpcre3-dev,51 libpcre3-dev,
51 python-rdflib52 python-rdflib
52Standards-Version: 3.9.453Standards-Version: 3.9.4
54=======
55 libpcre3-dev,
56 python-rdflib
57Standards-Version: 3.9.6
58>>>>>>> MERGE-SOURCE
53Homepage: http://www.ardour.org/59Homepage: http://www.ardour.org/
54Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git60Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git
55Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git61Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git
5662
=== modified file 'debian/control.in'
--- debian/control.in 2014-01-24 16:31:54 +0000
+++ debian/control.in 2015-05-02 14:23:30 +0000
@@ -7,7 +7,7 @@
7 Jaromír Mikeš <mira.mikes@seznam.cz>7 Jaromír Mikeš <mira.mikes@seznam.cz>
8Build-Depends:8Build-Depends:
9 @cdbs@9 @cdbs@
10Standards-Version: 3.9.410Standards-Version: 3.9.6
11Homepage: http://www.ardour.org/11Homepage: http://www.ardour.org/
12Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git12Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git
13Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git13Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git
1414
=== added file 'debian/patches/log-stdout.patch'
--- debian/patches/log-stdout.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/log-stdout.patch 2015-05-02 14:23:30 +0000
@@ -0,0 +1,25 @@
1Description: Log waf messages to stdout, not stderr
2 The buildds kill the build if they don't see messages in stdout for a
3 long time. Unfortunately, waf defaults to printing such messages to
4 stderr, so ardour takes too long on slower archs. Work around that
5 by printing to stdout.
6Author: Felipe Sateler <fsateler@debian.org>
7Forwarded: no
8--- ardour3-3.5.380~dfsg.orig/wscript
9+++ ardour3-3.5.380~dfsg/wscript
10@@ -777,6 +777,15 @@ const char* const ardour_config_info = "
11 def build(bld):
12 create_stored_revision()
13
14+ # Log command executions to stdout, not err
15+ def our_log(msg):
16+ if not msg:
17+ return
18+ sys.stdout.write(str(msg))
19+ sys.stdout.flush()
20+
21+ bld.to_log = our_log
22+
23 # add directories that contain only headers, to workaround an issue with waf
24
25 bld.path.find_dir ('libs/evoral/evoral')
026
=== added file 'debian/patches/midi-data-loss.patch'
--- debian/patches/midi-data-loss.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/midi-data-loss.patch 2015-05-02 14:23:30 +0000
@@ -0,0 +1,62 @@
1From: David Robillard <d@drobilla.net>
2Description: Fix MIDI data loss when editing
3Forwarded: not-needed
4Last-Update: 2014-12-04
5Bug-Vendor: http://tracker.ardour.org/view.php?id=5669
6Applied-Upstream: 3.5.404; https://github.com/Ardour/ardour/commit/94954f852ead97bcda7afa548d543222733228ef
7--- ardour3.orig/libs/ardour/smf_source.cc
8+++ ardour3/libs/ardour/smf_source.cc
9@@ -393,10 +393,22 @@ SMFSource::append_event_unlocked_beats (
10 name().c_str(), ev.id(), ev.time(), ev.size());
11 for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/
12
13- if (ev.time() < _last_ev_time_beats) {
14- warning << string_compose(_("Skipping event with unordered time %1"), ev.time())
15- << endmsg;
16- return;
17+ double time = ev.time();
18+ if (time < _last_ev_time_beats) {
19+ const double difference = _last_ev_time_beats - time;
20+ if (difference / (double)ppqn() < 1.0) {
21+ /* Close enough. This problem occurs because Sequence is not
22+ actually ordered due to fuzzy time comparison. I'm pretty sure
23+ this is inherently a bad idea which causes problems all over the
24+ place, but tolerate it here for now anyway. */
25+ time = _last_ev_time_beats;
26+ } else {
27+ /* Out of order by more than a tick. */
28+ warning << string_compose(_("Skipping event with unordered beat time %1 < %2 (off by %3 beats, %4 ticks)"),
29+ ev.time(), _last_ev_time_beats, difference, difference / (double)ppqn())
30+ << endmsg;
31+ return;
32+ }
33 }
34
35 Evoral::event_id_t event_id;
36@@ -411,13 +423,13 @@ SMFSource::append_event_unlocked_beats (
37 _model->append (ev, event_id);
38 }
39
40- _length_beats = max(_length_beats, ev.time());
41+ _length_beats = max(_length_beats, time);
42
43- const double delta_time_beats = ev.time() - _last_ev_time_beats;
44+ const double delta_time_beats = time - _last_ev_time_beats;
45 const uint32_t delta_time_ticks = (uint32_t)lrint(delta_time_beats * (double)ppqn());
46
47 Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id);
48- _last_ev_time_beats = ev.time();
49+ _last_ev_time_beats = time;
50 _flags = Source::Flag (_flags & ~Empty);
51 }
52
53@@ -434,7 +446,8 @@ SMFSource::append_event_unlocked_frames
54 // for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");
55
56 if (ev.time() < _last_ev_time_frames) {
57- warning << string_compose(_("Skipping event with unordered time %1"), ev.time())
58+ warning << string_compose(_("Skipping event with unordered frame time %1 < %2"),
59+ ev.time(), _last_ev_time_frames)
60 << endmsg;
61 return;
62 }
063
=== modified file 'debian/patches/series'
--- debian/patches/series 2013-11-06 13:22:44 +0000
+++ debian/patches/series 2015-05-02 14:23:30 +0000
@@ -1,2 +1,4 @@
1waf.patch1waf.patch
2wscript.patch2wscript.patch
3log-stdout.patch
4midi-data-loss.patch
35
=== modified file 'debian/rules'
--- debian/rules 2014-01-24 16:31:54 +0000
+++ debian/rules 2015-05-02 14:23:30 +0000
@@ -37,7 +37,8 @@
37 --optimize \37 --optimize \
3838
3939
40DEB_MAKE_EXTRA_ARGS = -v --destdir=$(CURDIR)/debian/tmp40DEB_MAKE_PARALLEL = -j$(if $(DEB_PARALLEL_JOBS),$(DEB_PARALLEL_JOBS),1)
41DEB_MAKE_EXTRA_ARGS = -v --destdir=$(CURDIR)/debian/tmp $(DEB_MAKE_PARALLEL)
41DEB_MAKE_BUILD_TARGET = build i18n_mo42DEB_MAKE_BUILD_TARGET = build i18n_mo
42DEB_MAKE_ENVVARS = CFLAGS="$(or $(CFLAGS_$(cdbs_curpkg)),$(CFLAGS))" CXXFLAGS="$(or $(CXXFLAGS_$(cdbs_curpkg)),$(CXXFLAGS))" CPPFLAGS="$(or $(CPPFLAGS_$(cdbs_curpkg)),$(CPPFLAGS))" LDFLAGS="$(or $(LDFLAGS_$(cdbs_curpkg)),$(LDFLAGS))"43DEB_MAKE_ENVVARS = CFLAGS="$(or $(CFLAGS_$(cdbs_curpkg)),$(CFLAGS))" CXXFLAGS="$(or $(CXXFLAGS_$(cdbs_curpkg)),$(CXXFLAGS))" CPPFLAGS="$(or $(CPPFLAGS_$(cdbs_curpkg)),$(CPPFLAGS))" LDFLAGS="$(or $(LDFLAGS_$(cdbs_curpkg)),$(LDFLAGS))"
43DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(CURDIR)/waf-light $(DEB_MAKE_EXTRA_ARGS)44DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(CURDIR)/waf-light $(DEB_MAKE_EXTRA_ARGS)
4445
=== modified file 'gtk2_ardour/add_video_dialog.cc'
--- gtk2_ardour/add_video_dialog.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/add_video_dialog.cc 2015-05-02 14:23:30 +0000
@@ -258,7 +258,8 @@
258 ".ogg" , ".OGG" ,258 ".ogg" , ".OGG" ,
259 ".ogv" , ".OGV" ,259 ".ogv" , ".OGV" ,
260 ".mpg" , ".MPG" ,260 ".mpg" , ".MPG" ,
261 ".mov" , ".MOV" ,261 ".mpeg" , ".MPEG" ,
262 ".mts" , ".MTS" ,
262 ".mp4" , ".MP4" ,263 ".mp4" , ".MP4" ,
263 ".mkv" , ".MKV" ,264 ".mkv" , ".MKV" ,
264 ".vob" , ".VOB" ,265 ".vob" , ".VOB" ,
@@ -272,6 +273,8 @@
272 ".dv" , ".DV" ,273 ".dv" , ".DV" ,
273 ".dirac" , ".DIRAC" ,274 ".dirac" , ".DIRAC" ,
274 ".webm" , ".WEBM" ,275 ".webm" , ".WEBM" ,
276 ".wmv" , ".wmv" ,
277 ".ts" , ".ts" ,
275 };278 };
276279
277 for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {280 for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {
278281
=== modified file 'gtk2_ardour/ardev_common.sh.in'
--- gtk2_ardour/ardev_common.sh.in 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/ardev_common.sh.in 2015-05-02 14:23:30 +0000
@@ -18,6 +18,7 @@
18export ARDOUR_MCP_PATH=$TOP/mcp:.18export ARDOUR_MCP_PATH=$TOP/mcp:.
19export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:.19export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:.
20export ARDOUR_BACKEND_PATH=$libs/backends/jack20export ARDOUR_BACKEND_PATH=$libs/backends/jack
21export ARDOUR_TEST_PATH=$libs/ardour/test/data
2122
22#23#
23# even though we set the above variables, ardour requires that these 24# even though we set the above variables, ardour requires that these
2425
=== modified file 'gtk2_ardour/ardour.menus.in'
--- gtk2_ardour/ardour.menus.in 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/ardour.menus.in 2015-05-02 14:23:30 +0000
@@ -341,6 +341,7 @@
341341
342 <menu name='View' action = 'View'>342 <menu name='View' action = 'View'>
343 <menuitem action='ToggleMaximalEditor'/>343 <menuitem action='ToggleMaximalEditor'/>
344 <menuitem action='ToggleMaximalMixer'/>
344 <menuitem action='KeepTearoffs'/>345 <menuitem action='KeepTearoffs'/>
345346
346 <separator/>347 <separator/>
347348
=== modified file 'gtk2_ardour/ardour_ui.cc'
--- gtk2_ardour/ardour_ui.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/ardour_ui.cc 2015-05-02 14:23:30 +0000
@@ -496,10 +496,13 @@
496496
497 vector<string>::iterator n;497 vector<string>::iterator n;
498 vector<string>::iterator k;498 vector<string>::iterator k;
499 for (n = names.begin(), k = keys.begin(); n != names.end(); ++n, ++k) {499 vector<string>::iterator p;
500 cout << "Action: " << (*n) << " bound to " << (*k) << endl;500 for (n = names.begin(), k = keys.begin(), p = paths.begin(); n != names.end(); ++n, ++k, ++p) {
501 cout << "Action: '" << (*n) << "' bound to '" << (*k) << "' Path: '" << (*p) << "'" << endl;
501 }502 }
502503
504 halt_connection.disconnect ();
505 AudioEngine::instance()->stop ();
503 exit (0);506 exit (0);
504 }507 }
505508
@@ -3264,7 +3267,7 @@
3264 } else {3267 } else {
3265 for (TrackSelection::iterator s = editor->get_selection().tracks.begin(); s != editor->get_selection().tracks.end(); ++s) {3268 for (TrackSelection::iterator s = editor->get_selection().tracks.begin(); s != editor->get_selection().tracks.end(); ++s) {
3266 RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s);3269 RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s);
3267 if (tav->route()->order_key() > order_hint) {3270 if (tav && tav->route() && tav->route()->order_key() > order_hint) {
3268 order_hint = tav->route()->order_key();3271 order_hint = tav->route()->order_key();
3269 }3272 }
3270 }3273 }
32713274
=== modified file 'gtk2_ardour/ardour_ui.h'
--- gtk2_ardour/ardour_ui.h 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/ardour_ui.h 2015-05-02 14:23:30 +0000
@@ -171,6 +171,7 @@
171171
172 void new_midi_tracer_window ();172 void new_midi_tracer_window ();
173 void toggle_editing_space();173 void toggle_editing_space();
174 void toggle_mixer_space();
174 void toggle_keep_tearoffs();175 void toggle_keep_tearoffs();
175176
176 Gtk::Tooltips& tooltips() { return _tooltips; }177 Gtk::Tooltips& tooltips() { return _tooltips; }
177178
=== modified file 'gtk2_ardour/ardour_ui_dialogs.cc'
--- gtk2_ardour/ardour_ui_dialogs.cc 2013-12-23 22:07:52 +0000
+++ gtk2_ardour/ardour_ui_dialogs.cc 2015-05-02 14:23:30 +0000
@@ -565,3 +565,18 @@
565 }565 }
566 return true;566 return true;
567}567}
568
569void
570ARDOUR_UI::toggle_mixer_space()
571{
572 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
573
574 if (act) {
575 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
576 if (tact->get_active()) {
577 mixer->maximise_mixer_space ();
578 } else {
579 mixer->restore_mixer_space ();
580 }
581 }
582}
568583
=== modified file 'gtk2_ardour/ardour_ui_ed.cc'
--- gtk2_ardour/ardour_ui_ed.cc 2013-10-17 11:16:21 +0000
+++ gtk2_ardour/ardour_ui_ed.cc 2015-05-02 14:23:30 +0000
@@ -191,6 +191,7 @@
191 /* windows visibility actions */191 /* windows visibility actions */
192192
193 ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space));193 ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space));
194 ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalMixer"), _("Maximise Mixer Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_space));
194 act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Show Toolbars"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));195 act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Show Toolbars"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));
195 ActionManager::session_sensitive_actions.push_back (act);196 ActionManager::session_sensitive_actions.push_back (act);
196197
197198
=== modified file 'gtk2_ardour/audio_region_view.cc'
--- gtk2_ardour/audio_region_view.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/audio_region_view.cc 2015-05-02 14:23:30 +0000
@@ -963,7 +963,7 @@
963}963}
964964
965void965void
966AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)966AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, bool with_guard_points)
967{967{
968 if (!gain_line) {968 if (!gain_line) {
969 return;969 return;
@@ -1008,7 +1008,7 @@
1008 trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), &region_before, &region_after));1008 trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), &region_before, &region_after));
1009 }1009 }
10101010
1011 audio_region()->envelope()->add (fx, y);1011 audio_region()->envelope()->add (fx, y, with_guard_points);
10121012
1013 XMLNode &after = audio_region()->envelope()->get_state();1013 XMLNode &after = audio_region()->envelope()->get_state();
1014 trackview.session()->add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));1014 trackview.session()->add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
10151015
=== modified file 'gtk2_ardour/audio_region_view.h'
--- gtk2_ardour/audio_region_view.h 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/audio_region_view.h 2015-05-02 14:23:30 +0000
@@ -81,7 +81,7 @@
8181
82 void update_envelope_visibility ();82 void update_envelope_visibility ();
8383
84 void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);84 void add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event, bool with_guard_points);
85 void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);85 void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event);
8686
87 boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; }87 boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; }
8888
=== modified file 'gtk2_ardour/automation_region_view.cc'
--- gtk2_ardour/automation_region_view.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/automation_region_view.cc 2015-05-02 14:23:30 +0000
@@ -27,6 +27,8 @@
27#include "ardour/midi_region.h"27#include "ardour/midi_region.h"
28#include "ardour/session.h"28#include "ardour/session.h"
2929
30#include "gtkmm2ext/keyboard.h"
31
30#include "automation_region_view.h"32#include "automation_region_view.h"
31#include "editing.h"33#include "editing.h"
32#include "editor.h"34#include "editor.h"
@@ -120,7 +122,11 @@
120 y = std::max (y, 0.0);122 y = std::max (y, 0.0);
121 y = std::min (y, _height - NAME_HIGHLIGHT_SIZE);123 y = std::min (y, _height - NAME_HIGHLIGHT_SIZE);
122124
123 add_automation_event (ev, trackview.editor().pixel_to_frame (x) - _region->position() + _region->start(), y);125 /* guard points only if primary modifier is used */
126
127 bool with_guard_points = Gtkmm2ext::Keyboard::modifier_state_equals (ev->button.state, Gtkmm2ext::Keyboard::PrimaryModifier);
128
129 add_automation_event (ev, trackview.editor().pixel_to_frame (x) - _region->position() + _region->start(), y, with_guard_points);
124 }130 }
125131
126 return false;132 return false;
@@ -130,7 +136,7 @@
130 * @param y y position, relative to our TimeAxisView.136 * @param y y position, relative to our TimeAxisView.
131 */137 */
132void138void
133AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y)139AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y, bool with_guard_points)
134{140{
135 if (!_line) {141 if (!_line) {
136 boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);142 boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);
@@ -160,7 +166,7 @@
160 view->session()->begin_reversible_command (_("add automation event"));166 view->session()->begin_reversible_command (_("add automation event"));
161 XMLNode& before = _line->the_list()->get_state();167 XMLNode& before = _line->the_list()->get_state();
162168
163 _line->the_list()->add (when_d, y);169 _line->the_list()->add (when_d, y, with_guard_points);
164170
165 XMLNode& after = _line->the_list()->get_state();171 XMLNode& after = _line->the_list()->get_state();
166172
167173
=== modified file 'gtk2_ardour/automation_region_view.h'
--- gtk2_ardour/automation_region_view.h 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/automation_region_view.h 2015-05-02 14:23:30 +0000
@@ -66,7 +66,7 @@
66 bool set_position(framepos_t pos, void* src, double* ignored);66 bool set_position(framepos_t pos, void* src, double* ignored);
67 void region_resized (const PBD::PropertyChange&);67 void region_resized (const PBD::PropertyChange&);
68 bool canvas_event(GdkEvent* ev);68 bool canvas_event(GdkEvent* ev);
69 void add_automation_event (GdkEvent* event, framepos_t when, double y);69 void add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points);
70 void entered (bool);70 void entered (bool);
71 void exited();71 void exited();
7272
7373
=== modified file 'gtk2_ardour/automation_time_axis.cc'
--- gtk2_ardour/automation_time_axis.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/automation_time_axis.cc 2015-05-02 14:23:30 +0000
@@ -550,7 +550,7 @@
550}550}
551551
552void552void
553AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y)553AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points)
554{554{
555 if (!_line) {555 if (!_line) {
556 return;556 return;
@@ -583,7 +583,7 @@
583 _session->begin_reversible_command (_("add automation event"));583 _session->begin_reversible_command (_("add automation event"));
584 XMLNode& before = list->get_state();584 XMLNode& before = list->get_state();
585585
586 list->add (when, y);586 list->add (when, y, with_guard_points);
587587
588 XMLNode& after = list->get_state();588 XMLNode& after = list->get_state();
589 _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after));589 _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after));
590590
=== modified file 'gtk2_ardour/automation_time_axis.h'
--- gtk2_ardour/automation_time_axis.h 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/automation_time_axis.h 2015-05-02 14:23:30 +0000
@@ -72,7 +72,7 @@
72 void set_samples_per_unit (double);72 void set_samples_per_unit (double);
73 std::string name() const { return _name; }73 std::string name() const { return _name; }
7474
75 void add_automation_event (GdkEvent *, framepos_t, double);75 void add_automation_event (GdkEvent *, framepos_t, double, bool with_guard_points);
7676
77 void clear_lines ();77 void clear_lines ();
7878
7979
=== modified file 'gtk2_ardour/editor.bindings'
--- gtk2_ardour/editor.bindings 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/editor.bindings 2015-05-02 14:23:30 +0000
@@ -167,6 +167,7 @@
167 <Binding action="Editor/pitch-shift-region" key="F5"/>167 <Binding action="Editor/pitch-shift-region" key="F5"/>
168 <Binding action="Editor/select-range-between-cursors" key="F6"/>168 <Binding action="Editor/select-range-between-cursors" key="F6"/>
169 <Binding action="Common/ToggleMaximalEditor" key="F11"/>169 <Binding action="Common/ToggleMaximalEditor" key="F11"/>
170 <Binding action="Common/ToggleMaximalMixer" key="F12"/>
170 <Binding action="Editor/save-visual-state-1" key="Primary-F1"/>171 <Binding action="Editor/save-visual-state-1" key="Primary-F1"/>
171 <Binding action="Editor/save-visual-state-2" key="Primary-F2"/>172 <Binding action="Editor/save-visual-state-2" key="Primary-F2"/>
172 <Binding action="Editor/save-visual-state-3" key="Primary-F3"/>173 <Binding action="Editor/save-visual-state-3" key="Primary-F3"/>
173174
=== modified file 'gtk2_ardour/editor.h'
--- gtk2_ardour/editor.h 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/editor.h 2015-05-02 14:23:30 +0000
@@ -1262,7 +1262,7 @@
1262 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);1262 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
12631263
1264 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode,1264 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode,
1265 boost::shared_ptr<ARDOUR::Track>& existing_track);1265 boost::shared_ptr<ARDOUR::Track>& existing_track, const std::string& new_track_name);
12661266
1267 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;1267 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1268 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;1268 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
12691269
=== modified file 'gtk2_ardour/editor_actions.cc'
--- gtk2_ardour/editor_actions.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/editor_actions.cc 2015-05-02 14:23:30 +0000
@@ -1143,94 +1143,94 @@
1143{1143{
1144 switch (_snap_type) {1144 switch (_snap_type) {
1145 case Editing::SnapToCDFrame:1145 case Editing::SnapToCDFrame:
1146 set_snap_to (Editing::SnapToTimecodeFrame);1146 set_snap_to (Editing::SnapToRegionBoundary);
1147 break;1147 break;
1148 case Editing::SnapToTimecodeFrame:1148 case Editing::SnapToTimecodeFrame:
1149 set_snap_to (Editing::SnapToTimecodeSeconds);1149 set_snap_to (Editing::SnapToCDFrame);
1150 break;1150 break;
1151 case Editing::SnapToTimecodeSeconds:1151 case Editing::SnapToTimecodeSeconds:
1152 set_snap_to (Editing::SnapToTimecodeMinutes);1152 set_snap_to (Editing::SnapToTimecodeFrame);
1153 break;1153 break;
1154 case Editing::SnapToTimecodeMinutes:1154 case Editing::SnapToTimecodeMinutes:
1155 set_snap_to (Editing::SnapToSeconds);1155 set_snap_to (Editing::SnapToTimecodeSeconds);
1156 break;1156 break;
1157 case Editing::SnapToSeconds:1157 case Editing::SnapToSeconds:
1158 set_snap_to (Editing::SnapToMinutes);1158 set_snap_to (Editing::SnapToTimecodeMinutes);
1159 break;1159 break;
1160 case Editing::SnapToMinutes:1160 case Editing::SnapToMinutes:
1161 set_snap_to (Editing::SnapToBeatDiv128);1161 set_snap_to (Editing::SnapToSeconds);
1162 break;1162 break;
1163 case Editing::SnapToBeatDiv128:1163 case Editing::SnapToBeatDiv128:
1164 set_snap_to (Editing::SnapToBeatDiv64);1164 set_snap_to (Editing::SnapToMinutes);
1165 break;1165 break;
1166 case Editing::SnapToBeatDiv64:1166 case Editing::SnapToBeatDiv64:
1167 set_snap_to (Editing::SnapToBeatDiv32);1167 set_snap_to (Editing::SnapToBeatDiv128);
1168 break;1168 break;
1169 case Editing::SnapToBeatDiv32:1169 case Editing::SnapToBeatDiv32:
1170 set_snap_to (Editing::SnapToBeatDiv28);1170 set_snap_to (Editing::SnapToBeatDiv64);
1171 break;1171 break;
1172 case Editing::SnapToBeatDiv28:1172 case Editing::SnapToBeatDiv28:
1173 set_snap_to (Editing::SnapToBeatDiv24);1173 set_snap_to (Editing::SnapToBeatDiv32);
1174 break;1174 break;
1175 case Editing::SnapToBeatDiv24:1175 case Editing::SnapToBeatDiv24:
1176 set_snap_to (Editing::SnapToBeatDiv20);1176 set_snap_to (Editing::SnapToBeatDiv28);
1177 break;1177 break;
1178 case Editing::SnapToBeatDiv20:1178 case Editing::SnapToBeatDiv20:
1179 set_snap_to (Editing::SnapToBeatDiv16);1179 set_snap_to (Editing::SnapToBeatDiv24);
1180 break;1180 break;
1181 case Editing::SnapToBeatDiv16:1181 case Editing::SnapToBeatDiv16:
1182 set_snap_to (Editing::SnapToBeatDiv14);1182 set_snap_to (Editing::SnapToBeatDiv20);
1183 break;1183 break;
1184 case Editing::SnapToBeatDiv14:1184 case Editing::SnapToBeatDiv14:
1185 set_snap_to (Editing::SnapToBeatDiv12);1185 set_snap_to (Editing::SnapToBeatDiv16);
1186 break;1186 break;
1187 case Editing::SnapToBeatDiv12:1187 case Editing::SnapToBeatDiv12:
1188 set_snap_to (Editing::SnapToBeatDiv10);1188 set_snap_to (Editing::SnapToBeatDiv14);
1189 break;1189 break;
1190 case Editing::SnapToBeatDiv10:1190 case Editing::SnapToBeatDiv10:
1191 set_snap_to (Editing::SnapToBeatDiv8);1191 set_snap_to (Editing::SnapToBeatDiv12);
1192 break;1192 break;
1193 case Editing::SnapToBeatDiv8:1193 case Editing::SnapToBeatDiv8:
1194 set_snap_to (Editing::SnapToBeatDiv7);1194 set_snap_to (Editing::SnapToBeatDiv10);
1195 break;1195 break;
1196 case Editing::SnapToBeatDiv7:1196 case Editing::SnapToBeatDiv7:
1197 set_snap_to (Editing::SnapToBeatDiv6);1197 set_snap_to (Editing::SnapToBeatDiv8);
1198 break;1198 break;
1199 case Editing::SnapToBeatDiv6:1199 case Editing::SnapToBeatDiv6:
1200 set_snap_to (Editing::SnapToBeatDiv5);1200 set_snap_to (Editing::SnapToBeatDiv7);
1201 break;1201 break;
1202 case Editing::SnapToBeatDiv5:1202 case Editing::SnapToBeatDiv5:
1203 set_snap_to (Editing::SnapToBeatDiv4);1203 set_snap_to (Editing::SnapToBeatDiv6);
1204 break;1204 break;
1205 case Editing::SnapToBeatDiv4:1205 case Editing::SnapToBeatDiv4:
1206 set_snap_to (Editing::SnapToBeatDiv3);1206 set_snap_to (Editing::SnapToBeatDiv5);
1207 break;1207 break;
1208 case Editing::SnapToBeatDiv3:1208 case Editing::SnapToBeatDiv3:
1209 set_snap_to (Editing::SnapToBeatDiv2);1209 set_snap_to (Editing::SnapToBeatDiv4);
1210 break;1210 break;
1211 case Editing::SnapToBeatDiv2:1211 case Editing::SnapToBeatDiv2:
1212 set_snap_to (Editing::SnapToBeat);1212 set_snap_to (Editing::SnapToBeatDiv3);
1213 break;1213 break;
1214 case Editing::SnapToBeat:1214 case Editing::SnapToBeat:
1215 set_snap_to (Editing::SnapToBar);1215 set_snap_to (Editing::SnapToBeatDiv2);
1216 break;1216 break;
1217 case Editing::SnapToBar:1217 case Editing::SnapToBar:
1218 set_snap_to (Editing::SnapToMark);1218 set_snap_to (Editing::SnapToBeat);
1219 break;1219 break;
1220 case Editing::SnapToMark:1220 case Editing::SnapToMark:
1221 set_snap_to (Editing::SnapToRegionStart);1221 set_snap_to (Editing::SnapToBar);
1222 break;1222 break;
1223 case Editing::SnapToRegionStart:1223 case Editing::SnapToRegionStart:
1224 set_snap_to (Editing::SnapToRegionEnd);1224 set_snap_to (Editing::SnapToMark);
1225 break;1225 break;
1226 case Editing::SnapToRegionEnd:1226 case Editing::SnapToRegionEnd:
1227 set_snap_to (Editing::SnapToRegionSync);1227 set_snap_to (Editing::SnapToRegionStart);
1228 break;1228 break;
1229 case Editing::SnapToRegionSync:1229 case Editing::SnapToRegionSync:
1230 set_snap_to (Editing::SnapToRegionBoundary);1230 set_snap_to (Editing::SnapToRegionEnd);
1231 break;1231 break;
1232 case Editing::SnapToRegionBoundary:1232 case Editing::SnapToRegionBoundary:
1233 set_snap_to (Editing::SnapToCDFrame);1233 set_snap_to (Editing::SnapToRegionSync);
1234 break;1234 break;
1235 }1235 }
1236}1236}
12371237
=== modified file 'gtk2_ardour/editor_audio_import.cc'
--- gtk2_ardour/editor_audio_import.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/editor_audio_import.cc 2015-05-02 14:23:30 +0000
@@ -611,7 +611,7 @@
611611
612 boost::shared_ptr<Source> s;612 boost::shared_ptr<Source> s;
613613
614 if ((s = _session->source_by_path_and_channel (path, n)) == 0) {614 if ((s = _session->audio_source_by_path_and_channel (path, n)) == 0) {
615615
616 source = boost::dynamic_pointer_cast<AudioFileSource> (616 source = boost::dynamic_pointer_cast<AudioFileSource> (
617 SourceFactory::createExternal (DataType::AUDIO, *_session,617 SourceFactory::createExternal (DataType::AUDIO, *_session,
@@ -657,7 +657,8 @@
657 uint32_t input_chan = 0;657 uint32_t input_chan = 0;
658 uint32_t output_chan = 0;658 uint32_t output_chan = 0;
659 bool use_timestamp;659 bool use_timestamp;
660 660 vector<string> track_names;
661
661 use_timestamp = (pos == -1);662 use_timestamp = (pos == -1);
662663
663 // kludge (for MIDI we're abusing "channel" for "track" here)664 // kludge (for MIDI we're abusing "channel" for "track" here)
@@ -694,6 +695,11 @@
694695
695 regions.push_back (r);696 regions.push_back (r);
696697
698 /* if we're creating a new track, name it after the cleaned-up
699 * and "merged" region name.
700 */
701
702 track_names.push_back (region_name);
697703
698 } else if (target_regions == -1 || target_regions > 1) {704 } else if (target_regions == -1 || target_regions > 1) {
699705
@@ -724,29 +730,26 @@
724 region_name = (*x)->name();730 region_name = (*x)->name();
725 }731 }
726 732
727 switch (sources.size()) {733 if (sources.size() == 2) {
728 /* zero and one channel handled
729 by previous if() condition
730 */
731 case 2:
732 if (n == 0) {734 if (n == 0) {
733 region_name += "-L";735 region_name += "-L";
734 } else {736 } else {
735 region_name += "-R";737 region_name += "-R";
736 }738 }
737 break;739 } else if (sources.size() > 2) {
738 default:740 region_name += string_compose ("-%1", n+1);
739 region_name += (char) '-';
740 region_name += (char) ('1' + n);
741 break;
742 }741 }
743 742
743 track_names.push_back (region_name);
744
744 } else {745 } else {
745 if (fs) {746 if (fs) {
746 region_name = region_name_from_path (fs->path(), false, false, sources.size(), n);747 region_name = region_name_from_path (fs->path(), false, false, sources.size(), n);
747 } else{748 } else {
748 region_name = (*x)->name();749 region_name = (*x)->name();
749 }750 }
751
752 track_names.push_back (PBD::basename_nosuffix (paths[n]));
750 }753 }
751754
752 PropertyList plist;755 PropertyList plist;
@@ -798,6 +801,12 @@
798 framepos_t rlen = 0;801 framepos_t rlen = 0;
799802
800 begin_reversible_command (Operations::insert_file);803 begin_reversible_command (Operations::insert_file);
804
805 /* we only use tracks names when importing to new tracks, but we
806 * require that one is defined for every region, just to keep
807 * the API simpler.
808 */
809 assert (regions.size() == track_names.size());
801 810
802 for (vector<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) {811 for (vector<boost::shared_ptr<Region> >::iterator r = regions.begin(); r != regions.end(); ++r, ++n) {
803 boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r);812 boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r);
@@ -830,9 +839,8 @@
830 pos = get_preferred_edit_position ();839 pos = get_preferred_edit_position ();
831 }840 }
832 }841 }
833842
834843 finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track, track_names[n]);
835 finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track);
836844
837 rlen = (*r)->length();845 rlen = (*r)->length();
838846
@@ -859,7 +867,7 @@
859867
860int868int
861Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos,869Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos,
862 ImportMode mode, boost::shared_ptr<Track>& existing_track)870 ImportMode mode, boost::shared_ptr<Track>& existing_track, const string& new_track_name)
863{871{
864 boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);872 boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region);
865 boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);873 boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region);
@@ -916,7 +924,11 @@
916 existing_track = mt.front();924 existing_track = mt.front();
917 }925 }
918926
919 existing_track->set_name (region->name());927 if (!new_track_name.empty()) {
928 existing_track->set_name (new_track_name);
929 } else {
930 existing_track->set_name (region->name());
931 }
920 }932 }
921933
922 boost::shared_ptr<Playlist> playlist = existing_track->playlist();934 boost::shared_ptr<Playlist> playlist = existing_track->playlist();
923935
=== modified file 'gtk2_ardour/editor_drag.cc'
--- gtk2_ardour/editor_drag.cc 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/editor_drag.cc 2015-05-02 14:23:30 +0000
@@ -3275,10 +3275,24 @@
3275}3275}
32763276
3277void3277void
3278LineDrag::finished (GdkEvent* event, bool)3278LineDrag::finished (GdkEvent* event, bool movement_occured)
3279{3279{
3280 motion (event, false);3280 if (movement_occured) {
3281 _line->end_drag (false, 0);3281 motion (event, false);
3282 _line->end_drag (false, 0);
3283 } else {
3284 /* add a new control point on the line */
3285
3286 AutomationTimeAxisView* atv;
3287
3288 _line->end_drag (false, 0);
3289
3290 if ((atv = dynamic_cast<AutomationTimeAxisView*>(_editor->clicked_axisview)) != 0) {
3291 framepos_t where = _editor->event_frame (event, 0, 0);
3292 atv->add_automation_event (event, where, event->button.y, false);
3293 }
3294 }
3295
3282 _editor->session()->commit_reversible_command ();3296 _editor->session()->commit_reversible_command ();
3283}3297}
32843298
32853299
=== modified file 'gtk2_ardour/editor_mouse.cc'
--- gtk2_ardour/editor_mouse.cc 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/editor_mouse.cc 2015-05-02 14:23:30 +0000
@@ -1682,7 +1682,8 @@
1682 case AutomationTrackItem:1682 case AutomationTrackItem:
1683 atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview);1683 atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview);
1684 if (atv) {1684 if (atv) {
1685 atv->add_automation_event (event, where, event->button.y);1685 bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
1686 atv->add_automation_event (event, where, event->button.y, with_guard_points);
1686 }1687 }
1687 return true;1688 return true;
1688 break;1689 break;
@@ -1701,17 +1702,20 @@
1701 */1702 */
1702 AudioRegionView* arv = dynamic_cast<AudioRegionView*> (clicked_regionview);1703 AudioRegionView* arv = dynamic_cast<AudioRegionView*> (clicked_regionview);
1703 if (!were_dragging && arv) {1704 if (!were_dragging && arv) {
1704 arv->add_gain_point_event (item, event);1705 bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
1706 arv->add_gain_point_event (item, event, with_guard_points);
1705 }1707 }
1706 return true;1708 return true;
1707 break;1709 break;
1708 }1710 }
17091711
1710 case AutomationTrackItem:1712 case AutomationTrackItem: {
1713 bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
1711 dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)->1714 dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)->
1712 add_automation_event (event, where, event->button.y);1715 add_automation_event (event, where, event->button.y, with_guard_points);
1713 return true;1716 return true;
1714 break;1717 break;
1718 }
1715 default:1719 default:
1716 break;1720 break;
1717 }1721 }
17181722
=== modified file 'gtk2_ardour/editor_ops.cc'
--- gtk2_ardour/editor_ops.cc 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/editor_ops.cc 2015-05-02 14:23:30 +0000
@@ -4772,12 +4772,17 @@
4772 MidiRegionView* const mrv = dynamic_cast<MidiRegionView*>(*r);4772 MidiRegionView* const mrv = dynamic_cast<MidiRegionView*>(*r);
47734773
4774 if (mrv) {4774 if (mrv) {
4775 boost::shared_ptr<Playlist> playlist = mrv->region()->playlist();4775 try {
4776 boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone ();4776 boost::shared_ptr<Playlist> playlist = mrv->region()->playlist();
47774777 boost::shared_ptr<MidiSource> new_source = _session->create_midi_source_by_stealing_name (mrv->midi_view()->track());
4778 playlist->clear_changes ();4778 boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone (new_source);
4779 playlist->replace_region (mrv->region(), newregion, mrv->region()->position());4779
4780 _session->add_command(new StatefulDiffCommand (playlist));4780 playlist->clear_changes ();
4781 playlist->replace_region (mrv->region(), newregion, mrv->region()->position());
4782 _session->add_command(new StatefulDiffCommand (playlist));
4783 } catch (...) {
4784 error << string_compose (_("Could not unlink %1"), mrv->region()->name()) << endmsg;
4785 }
4781 }4786 }
47824787
4783 r = tmp;4788 r = tmp;
47844789
=== modified file 'gtk2_ardour/editor_regions.cc'
--- gtk2_ardour/editor_regions.cc 2013-12-23 22:07:52 +0000
+++ gtk2_ardour/editor_regions.cc 2015-05-02 14:23:30 +0000
@@ -114,7 +114,7 @@
114 { 3, _("Length"), _("Length of the region") },114 { 3, _("Length"), _("Length of the region") },
115 { 4, _("Sync"), _("Position of region sync point, relative to start of the region") },115 { 4, _("Sync"), _("Position of region sync point, relative to start of the region") },
116 { 5, _("Fade In"), _("Length of region fade-in (units: secondary clock), () if disabled") },116 { 5, _("Fade In"), _("Length of region fade-in (units: secondary clock), () if disabled") },
117 { 6, _("Fade Out"), _("Length of region fade-out (units: secondary clock), () if dsisabled") },117 { 6, _("Fade Out"), _("Length of region fade-out (units: secondary clock), () if disabled") },
118 { 7, _("L"), _("Region position locked?") },118 { 7, _("L"), _("Region position locked?") },
119 { 8, _("G"), _("Region position glued to Bars|Beats time?") },119 { 8, _("G"), _("Region position glued to Bars|Beats time?") },
120 { 9, _("M"), _("Region muted?") },120 { 9, _("M"), _("Region muted?") },
121121
=== modified file 'gtk2_ardour/editor_rulers.cc'
--- gtk2_ardour/editor_rulers.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/editor_rulers.cc 2015-05-02 14:23:30 +0000
@@ -1862,13 +1862,13 @@
1862 long millisecs;1862 long millisecs;
18631863
1864 left = sample;1864 left = sample;
1865 hrs = left / (sample_rate * 60 * 60);1865 hrs = left / (sample_rate * 60 * 60 * 1000);
1866 left -= hrs * sample_rate * 60 * 60;1866 left -= hrs * sample_rate * 60 * 60 * 1000;
1867 mins = left / (sample_rate * 60);1867 mins = left / (sample_rate * 60 * 1000);
1868 left -= mins * sample_rate * 60;1868 left -= mins * sample_rate * 60 * 1000;
1869 secs = left / sample_rate;1869 secs = left / (sample_rate * 1000);
1870 left -= secs * sample_rate;1870 left -= secs * sample_rate * 1000;
1871 millisecs = left * 1000 / sample_rate;1871 millisecs = left / sample_rate;
18721872
1873 *millisecs_p = millisecs;1873 *millisecs_p = millisecs;
1874 *secs_p = secs;1874 *secs_p = secs;
@@ -1888,7 +1888,7 @@
1888 return;1888 return;
1889 }1889 }
18901890
1891 fr = _session->frame_rate();1891 fr = _session->frame_rate() * 1000;
18921892
1893 /* to prevent 'flashing' */1893 /* to prevent 'flashing' */
1894 if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) {1894 if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) {
@@ -1897,7 +1897,7 @@
1897 lower = 0;1897 lower = 0;
1898 }1898 }
1899 upper += spacer;1899 upper += spacer;
1900 framecnt_t const range = upper - lower;1900 framecnt_t const range = (upper - lower) * 1000;
19011901
1902 if (range < (fr / 50)) {1902 if (range < (fr / 50)) {
1903 minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */1903 minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */
@@ -1997,7 +1997,7 @@
1997 }1997 }
19981998
1999 *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * minsec_nmarks);1999 *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * minsec_nmarks);
2000 pos = ((((framepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;2000 pos = (((1000 * (framepos_t) floor(lower)) + (minsec_mark_interval/2))/minsec_mark_interval) * minsec_mark_interval;
2001 switch (minsec_ruler_scale) {2001 switch (minsec_ruler_scale) {
2002 case minsec_show_seconds:2002 case minsec_show_seconds:
2003 for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {2003 for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
@@ -2014,7 +2014,7 @@
2014 (*marks)[n].style = GtkCustomRulerMarkMicro;2014 (*marks)[n].style = GtkCustomRulerMarkMicro;
2015 }2015 }
2016 (*marks)[n].label = g_strdup (buf);2016 (*marks)[n].label = g_strdup (buf);
2017 (*marks)[n].position = pos;2017 (*marks)[n].position = pos/1000.0;
2018 }2018 }
2019 break;2019 break;
2020 case minsec_show_minutes:2020 case minsec_show_minutes:
@@ -2032,7 +2032,7 @@
2032 (*marks)[n].style = GtkCustomRulerMarkMicro;2032 (*marks)[n].style = GtkCustomRulerMarkMicro;
2033 }2033 }
2034 (*marks)[n].label = g_strdup (buf);2034 (*marks)[n].label = g_strdup (buf);
2035 (*marks)[n].position = pos;2035 (*marks)[n].position = pos/1000.0;
2036 }2036 }
2037 break;2037 break;
2038 case minsec_show_hours:2038 case minsec_show_hours:
@@ -2046,14 +2046,14 @@
2046 (*marks)[n].style = GtkCustomRulerMarkMicro;2046 (*marks)[n].style = GtkCustomRulerMarkMicro;
2047 }2047 }
2048 (*marks)[n].label = g_strdup (buf);2048 (*marks)[n].label = g_strdup (buf);
2049 (*marks)[n].position = pos;2049 (*marks)[n].position = pos/1000.0;
2050 }2050 }
2051 break;2051 break;
2052 case minsec_show_frames:2052 case minsec_show_frames:
2053 for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {2053 for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) {
2054 sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);2054 sample_to_clock_parts (pos, _session->frame_rate(), &hrs, &mins, &secs, &millisecs);
2055 if (millisecs % minsec_mark_modulo == 0) {2055 if (millisecs % minsec_mark_modulo == 0) {
2056 if (secs == 0) {2056 if (millisecs == 0) {
2057 (*marks)[n].style = GtkCustomRulerMarkMajor;2057 (*marks)[n].style = GtkCustomRulerMarkMajor;
2058 } else {2058 } else {
2059 (*marks)[n].style = GtkCustomRulerMarkMinor;2059 (*marks)[n].style = GtkCustomRulerMarkMinor;
@@ -2064,7 +2064,7 @@
2064 (*marks)[n].style = GtkCustomRulerMarkMicro;2064 (*marks)[n].style = GtkCustomRulerMarkMicro;
2065 }2065 }
2066 (*marks)[n].label = g_strdup (buf);2066 (*marks)[n].label = g_strdup (buf);
2067 (*marks)[n].position = pos;2067 (*marks)[n].position = pos/1000.0;
2068 }2068 }
2069 break;2069 break;
2070 }2070 }
20712071
=== modified file 'gtk2_ardour/ergonomic-us.bindings.in'
--- gtk2_ardour/ergonomic-us.bindings.in 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/ergonomic-us.bindings.in 2015-05-02 14:23:30 +0000
@@ -163,6 +163,7 @@
163; (gtk_accel_path "<Actions>/Snap/snap-to-eighths" "")163; (gtk_accel_path "<Actions>/Snap/snap-to-eighths" "")
164(gtk_accel_path "<Actions>/Editor/select-all-after-playhead" "<@TERTIARY@><@PRIMARY@>p")164(gtk_accel_path "<Actions>/Editor/select-all-after-playhead" "<@TERTIARY@><@PRIMARY@>p")
165(gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11")165(gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11")
166(gtk_accel_path "<Actions>/Common/ToggleMaximalMixer" "F12")
166; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileLength" "")167; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileLength" "")
167; (gtk_accel_path "<Actions>/Editor/Timecode" "")168; (gtk_accel_path "<Actions>/Editor/Timecode" "")
168; (gtk_accel_path "<Actions>/Transport/PlaySelection" "")169; (gtk_accel_path "<Actions>/Transport/PlaySelection" "")
169170
=== modified file 'gtk2_ardour/gain_meter.cc'
--- gtk2_ardour/gain_meter.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/gain_meter.cc 2015-05-02 14:23:30 +0000
@@ -274,18 +274,24 @@
274GainMeterBase::setup_meters (int len)274GainMeterBase::setup_meters (int len)
275{275{
276 int meter_width = 5;276 int meter_width = 5;
277 uint32_t meter_channels = 0;
278 if (_meter) {
279 meter_channels = _meter->input_streams().n_total();
280 } else if (_route) {
281 meter_channels = _route->shared_peak_meter()->input_streams().n_total();
282 }
277283
278 switch (_width) {284 switch (_width) {
279 case Wide:285 case Wide:
280 //meter_ticks1_area.show();286 //meter_ticks1_area.show();
281 //meter_ticks2_area.show();287 //meter_ticks2_area.show();
282 meter_metric_area.show();288 meter_metric_area.show();
283 if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) {289 if (meter_channels == 1) {
284 meter_width = 10;290 meter_width = 10;
285 }291 }
286 break;292 break;
287 case Narrow:293 case Narrow:
288 if (_route && _route->shared_peak_meter()->input_streams().n_total() > 1) {294 if (meter_channels > 1) {
289 meter_width = 4;295 meter_width = 4;
290 }296 }
291 //meter_ticks1_area.hide();297 //meter_ticks1_area.hide();
292298
=== modified file 'gtk2_ardour/level_meter.cc'
--- gtk2_ardour/level_meter.cc 2013-12-23 22:07:52 +0000
+++ gtk2_ardour/level_meter.cc 2015-05-02 14:23:30 +0000
@@ -78,6 +78,7 @@
78 _meter_type_connection.disconnect();78 _meter_type_connection.disconnect();
7979
80 _meter = meter;80 _meter = meter;
81 color_changed = true;
8182
82 if (_meter) {83 if (_meter) {
83 _meter->ConfigurationChanged.connect (_configuration_connection, parent_invalidator, boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), gui_context());84 _meter->ConfigurationChanged.connect (_configuration_connection, parent_invalidator, boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), gui_context());
8485
=== modified file 'gtk2_ardour/midi_time_axis.cc'
--- gtk2_ardour/midi_time_axis.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/midi_time_axis.cc 2015-05-02 14:23:30 +0000
@@ -757,7 +757,7 @@
757 Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl);757 Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl);
758 ctl_items.push_back (758 ctl_items.push_back (
759 CheckMenuElem (759 CheckMenuElem (
760 string_compose ("<b>%1</b>: %2 [%3]", ctl, name, int (chn)),760 string_compose ("<b>%1</b>: %2 [%3]", ctl, name, int (chn + 1)),
761 sigc::bind (761 sigc::bind (
762 sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),762 sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track),
763 fully_qualified_param)));763 fully_qualified_param)));
@@ -1199,16 +1199,56 @@
1199void1199void
1200MidiTimeAxisView::show_all_automation (bool apply_to_selection)1200MidiTimeAxisView::show_all_automation (bool apply_to_selection)
1201{1201{
1202 using namespace MIDI::Name;
1203
1202 if (apply_to_selection) {1204 if (apply_to_selection) {
1203 _editor.get_selection().tracks.foreach_midi_time_axis (1205 _editor.get_selection().tracks.foreach_midi_time_axis (
1204 boost::bind (&MidiTimeAxisView::show_all_automation, _1, false));1206 boost::bind (&MidiTimeAxisView::show_all_automation, _1, false));
1205 } else {1207 } else {
1206 if (midi_track()) {1208 if (midi_track()) {
1209 // Show existing automation
1207 const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();1210 const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
12081211
1209 for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {1212 for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
1210 create_automation_child(*i, true);1213 create_automation_child(*i, true);
1211 }1214 }
1215
1216 // Show automation for all controllers named in midnam file
1217 boost::shared_ptr<MasterDeviceNames> device_names = get_device_names();
1218 if (gui_property (X_("midnam-model-name")) != "Generic" &&
1219 device_names && !device_names->controls().empty()) {
1220 const std::string device_mode = _midnam_custom_device_mode_selector.get_active_text();
1221 const uint16_t selected_channels = midi_track()->get_playback_channel_mask();
1222 for (uint32_t chn = 0; chn < 16; ++chn) {
1223 if ((selected_channels & (0x0001 << chn)) == 0) {
1224 // Channel not in use
1225 continue;
1226 }
1227
1228 boost::shared_ptr<ChannelNameSet> chan_names = device_names->channel_name_set_by_channel(
1229 device_mode, chn);
1230 if (!chan_names) {
1231 continue;
1232 }
1233
1234 boost::shared_ptr<ControlNameList> control_names = device_names->control_name_list(
1235 chan_names->control_list_name());
1236 if (!control_names) {
1237 continue;
1238 }
1239
1240 for (ControlNameList::Controls::const_iterator c = control_names->controls().begin();
1241 c != control_names->controls().end();
1242 ++c) {
1243 const uint16_t ctl = c->second->number();
1244 if (ctl != MIDI_CTL_MSB_BANK && ctl != MIDI_CTL_LSB_BANK) {
1245 /* Skip bank select controllers since they're handled specially */
1246 const Evoral::Parameter param(MidiCCAutomation, chn, ctl);
1247 create_automation_child(param, true);
1248 }
1249 }
1250 }
1251 }
1212 }1252 }
12131253
1214 RouteTimeAxisView::show_all_automation ();1254 RouteTimeAxisView::show_all_automation ();
@@ -1524,8 +1564,7 @@
15241564
1525 real_editor->snap_to (pos, 0);1565 real_editor->snap_to (pos, 0);
15261566
1527 boost::shared_ptr<Source> src = _session->create_midi_source_for_session (1567 boost::shared_ptr<Source> src = _session->create_midi_source_by_stealing_name (view()->trackview().track());
1528 view()->trackview().track().get(), view()->trackview().track()->name());
1529 PropertyList plist;1568 PropertyList plist;
15301569
1531 plist.add (ARDOUR::Properties::start, 0);1570 plist.add (ARDOUR::Properties::start, 0);
15321571
=== modified file 'gtk2_ardour/mixer_strip.cc'
--- gtk2_ardour/mixer_strip.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/mixer_strip.cc 2015-05-02 14:23:30 +0000
@@ -37,6 +37,7 @@
37#include "ardour/audio_track.h"37#include "ardour/audio_track.h"
38#include "ardour/audioengine.h"38#include "ardour/audioengine.h"
39#include "ardour/internal_send.h"39#include "ardour/internal_send.h"
40#include "ardour/meter.h"
40#include "ardour/midi_track.h"41#include "ardour/midi_track.h"
41#include "ardour/pannable.h"42#include "ardour/pannable.h"
42#include "ardour/panner.h"43#include "ardour/panner.h"
@@ -1023,32 +1024,62 @@
1023 p->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());1024 p->automation_state_changed.connect (panstate_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_state_changed, &panners), gui_context());
1024 p->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());1025 p->automation_style_changed.connect (panstyle_connection, invalidator (*this), boost::bind (&PannerUI::pan_automation_style_changed, &panners), gui_context());
10251026
1026 /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself1027<<<<<<< TREE
1027 * However, that only works a panner was previously set.1028 /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself
1028 *1029 * However, that only works a panner was previously set.
1029 * PannerUI must remain subscribed to _panshell->Changed() in case1030 *
1030 * we switch the panner eg. AUX-Send and back1031 * PannerUI must remain subscribed to _panshell->Changed() in case
1031 * _route->panner_shell()->Changed() vs _panshell->Changed1032 * we switch the panner eg. AUX-Send and back
1032 */1033 * _route->panner_shell()->Changed() vs _panshell->Changed
1033 if (panners._panner == 0) {1034 */
1034 panners.panshell_changed ();1035 if (panners._panner == 0) {
1035 }1036 panners.panshell_changed ();
1036}1037 }
10371038}
1038void1039
1039MixerStrip::update_panner_choices ()1040void
1040{1041MixerStrip::update_panner_choices ()
1041 ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices)1042{
1042 if (!_route->panner_shell()) { return; }1043 ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices)
10431044 if (!_route->panner_shell()) { return; }
1044 uint32_t in = _route->output()->n_ports().n_audio();1045
1045 uint32_t out = in;1046 uint32_t in = _route->output()->n_ports().n_audio();
1046 if (_route->panner()) {1047 uint32_t out = in;
1047 in = _route->panner()->in().n_audio();1048 if (_route->panner()) {
1048 }1049 in = _route->panner()->in().n_audio();
10491050 }
1050 panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));1051
1051}1052 panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
1053}
1054=======
1055 /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself
1056 * However, that only works a panner was previously set.
1057 *
1058 * PannerUI must remain subscribed to _panshell->Changed() in case
1059 * we switch the panner eg. AUX-Send and back
1060 * _route->panner_shell()->Changed() vs _panshell->Changed
1061 */
1062 if (panners._panner == 0) {
1063 panners.panshell_changed ();
1064 }
1065 update_panner_choices();
1066}
1067
1068void
1069MixerStrip::update_panner_choices ()
1070{
1071 ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices)
1072 if (!_route->panner_shell()) { return; }
1073
1074 uint32_t in = _route->output()->n_ports().n_audio();
1075 uint32_t out = in;
1076 if (_route->panner()) {
1077 in = _route->panner()->in().n_audio();
1078 }
1079
1080 panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out));
1081}
1082>>>>>>> MERGE-SOURCE
10521083
1053/*1084/*
1054 * Output port labelling1085 * Output port labelling
@@ -1869,6 +1900,7 @@
18691900
1870 set_current_delivery (send);1901 set_current_delivery (send);
18711902
1903 send->meter()->set_type(_route->shared_peak_meter()->get_type());
1872 send->set_metering (true);1904 send->set_metering (true);
1873 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());1905 _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
18741906
@@ -2159,8 +2191,8 @@
21592191
2160 _suspend_menu_callbacks = true;2192 _suspend_menu_callbacks = true;
2161 add_level_meter_item_point (items, group, _("Input"), MeterInput);2193 add_level_meter_item_point (items, group, _("Input"), MeterInput);
2162 add_level_meter_item_point (items, group, _("Pre-fader"), MeterPreFader);2194 add_level_meter_item_point (items, group, _("Pre Fader"), MeterPreFader);
2163 add_level_meter_item_point (items, group, _("Post-fader"), MeterPostFader);2195 add_level_meter_item_point (items, group, _("Post Fader"), MeterPostFader);
2164 add_level_meter_item_point (items, group, _("Output"), MeterOutput);2196 add_level_meter_item_point (items, group, _("Output"), MeterOutput);
2165 add_level_meter_item_point (items, group, _("Custom"), MeterCustom);2197 add_level_meter_item_point (items, group, _("Custom"), MeterCustom);
21662198
21672199
=== modified file 'gtk2_ardour/mixer_ui.cc'
--- gtk2_ardour/mixer_ui.cc 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/mixer_ui.cc 2015-05-02 14:23:30 +0000
@@ -240,6 +240,7 @@
240 group_display.show();240 group_display.show();
241241
242 _in_group_rebuild_or_clear = false;242 _in_group_rebuild_or_clear = false;
243 _maximised = false;
243244
244 MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());245 MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
245246
@@ -1559,6 +1560,19 @@
1559 }1560 }
1560 }1561 }
15611562
1563 if ((prop = node.property ("maximised"))) {
1564 bool yn = string_is_affirmative (prop->value());
1565 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMaximalMixer"));
1566 assert (act);
1567 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
1568 bool fs = tact && tact->get_active();
1569 if (yn ^ fs) {
1570 ActionManager::do_action ("Common",
1571 "ToggleMaximalMixer");
1572 }
1573 }
1574
1575
1562 return 0;1576 return 0;
1563}1577}
15641578
@@ -1601,6 +1615,8 @@
16011615
1602 node->add_property ("show-mixer", _visible ? "yes" : "no");1616 node->add_property ("show-mixer", _visible ? "yes" : "no");
16031617
1618 node->add_property ("maximised", _maximised ? "yes" : "no");
1619
1604 return *node;1620 return *node;
1605}1621}
16061622
@@ -1942,3 +1958,26 @@
1942 _session->set_exclusive_input_active (rl, onoff, flip_others);1958 _session->set_exclusive_input_active (rl, onoff, flip_others);
1943}1959}
19441960
1961void
1962Mixer_UI::maximise_mixer_space ()
1963{
1964 if (_maximised) {
1965 return;
1966 }
1967
1968 fullscreen ();
1969
1970 _maximised = true;
1971}
1972
1973void
1974Mixer_UI::restore_mixer_space ()
1975{
1976 if (!_maximised) {
1977 return;
1978 }
1979
1980 unfullscreen();
1981
1982 _maximised = false;
1983}
19451984
=== modified file 'gtk2_ardour/mixer_ui.h'
--- gtk2_ardour/mixer_ui.h 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/mixer_ui.h 2015-05-02 14:23:30 +0000
@@ -80,6 +80,9 @@
80 void show_strip (MixerStrip *);80 void show_strip (MixerStrip *);
81 void hide_strip (MixerStrip *);81 void hide_strip (MixerStrip *);
8282
83 void maximise_mixer_space();
84 void restore_mixer_space();
85
83 void ensure_float (Gtk::Window&);86 void ensure_float (Gtk::Window&);
8487
85 MonitorSection* monitor_section() const { return _monitor_section; }88 MonitorSection* monitor_section() const { return _monitor_section; }
@@ -279,6 +282,9 @@
279 bool _following_editor_selection;282 bool _following_editor_selection;
280283
281 void monitor_section_going_away ();284 void monitor_section_going_away ();
285
286 /// true if we are in fullscreen mode
287 bool _maximised;
282};288};
283289
284#endif /* __ardour_mixer_ui_h__ */290#endif /* __ardour_mixer_ui_h__ */
285291
=== modified file 'gtk2_ardour/mnemonic-us.bindings.in'
--- gtk2_ardour/mnemonic-us.bindings.in 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/mnemonic-us.bindings.in 2015-05-02 14:23:30 +0000
@@ -189,6 +189,7 @@
189@trans|Editor/toggle-follow-playhead|<@PRIMARY@>f|toggle playhead tracking189@trans|Editor/toggle-follow-playhead|<@PRIMARY@>f|toggle playhead tracking
190@trans|Transport/ToggleFollowEdits|<@TERTIARY@>f|toggle playhead follows edits190@trans|Transport/ToggleFollowEdits|<@TERTIARY@>f|toggle playhead follows edits
191@wvis|Common/ToggleMaximalEditor|<@PRIMARY@><@SECONDARY@>f|maximise editor space191@wvis|Common/ToggleMaximalEditor|<@PRIMARY@><@SECONDARY@>f|maximise editor space
192@wvis|Common/ToggleMaximalMixer|F12|maximise mixer space
192@wvis|Region/show-rhythm-ferret|<@WINDOW@>f|show rhythm ferret window 193@wvis|Region/show-rhythm-ferret|<@WINDOW@>f|show rhythm ferret window
193@mmode|MouseMode/set-mouse-mode-gain|g|region gain mode194@mmode|MouseMode/set-mouse-mode-gain|g|region gain mode
194@epp|Region/play-selected-regions|h|play selected region(s)195@epp|Region/play-selected-regions|h|play selected region(s)
@@ -338,7 +339,7 @@
338@trans|Transport/ToggleAutoPlay|5|toggle auto play339@trans|Transport/ToggleAutoPlay|5|toggle auto play
339@trans|Transport/ToggleAutoReturn|6|toggle auto return340@trans|Transport/ToggleAutoReturn|6|toggle auto return
340@trans|Transport/ToggleClick|7|toggle click (metronome)341@trans|Transport/ToggleClick|7|toggle click (metronome)
341@ranges|Editor/set-tempo-from-region|9|set tempo (1 bar) from region(s)342@ranges|Region/set-tempo-from-region|9|set tempo (1 bar) from region(s)
342@ranges|Editor/set-tempo-from-edit-range|0|set tempo (1 bar) from edit range343@ranges|Editor/set-tempo-from-edit-range|0|set tempo (1 bar) from edit range
343344
344; mouse stuff345; mouse stuff
345346
=== modified file 'gtk2_ardour/opts.cc'
--- gtk2_ardour/opts.cc 2013-10-17 11:16:21 +0000
+++ gtk2_ardour/opts.cc 2015-05-02 14:23:30 +0000
@@ -102,7 +102,7 @@
102 { "help", 0, 0, 'h' },102 { "help", 0, 0, 'h' },
103 { "no-announcements", 0, 0, 'a' },103 { "no-announcements", 0, 0, 'a' },
104 { "bindings", 0, 0, 'b' },104 { "bindings", 0, 0, 'b' },
105 { "disable-plugins", 1, 0, 'd' },105 { "disable-plugins", 0, 0, 'd' },
106 { "debug", 1, 0, 'D' },106 { "debug", 1, 0, 'D' },
107 { "no-splash", 0, 0, 'n' },107 { "no-splash", 0, 0, 'n' },
108 { "menus", 1, 0, 'm' },108 { "menus", 1, 0, 'm' },
109109
=== modified file 'gtk2_ardour/panner_ui.cc'
--- gtk2_ardour/panner_ui.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/panner_ui.cc 2015-05-02 14:23:30 +0000
@@ -49,6 +49,7 @@
49PannerUI::PannerUI (Session* s)49PannerUI::PannerUI (Session* s)
50 : _current_nouts (-1)50 : _current_nouts (-1)
51 , _current_nins (-1)51 , _current_nins (-1)
52 , _current_uri ("")
52 , pan_automation_style_button ("")53 , pan_automation_style_button ("")
53 , pan_automation_state_button ("")54 , pan_automation_state_button ("")
54 , _panner_list()55 , _panner_list()
@@ -214,12 +215,17 @@
214 int const nouts = _panner ? _panner->out().n_audio() : -1;215 int const nouts = _panner ? _panner->out().n_audio() : -1;
215 int const nins = _panner ? _panner->in().n_audio() : -1;216 int const nins = _panner ? _panner->in().n_audio() : -1;
216217
217 if (nouts == _current_nouts && nins == _current_nins) {218 if (nouts == _current_nouts
219 && nins == _current_nins
220 && _current_uri == _panshell->panner_gui_uri()
221 )
222 {
218 return;223 return;
219 }224 }
220225
221 _current_nins = nins;226 _current_nins = nins;
222 _current_nouts = nouts;227 _current_nouts = nouts;
228 _current_uri = _panshell->panner_gui_uri();
223229
224 container_clear (pan_vbox);230 container_clear (pan_vbox);
225231
@@ -236,6 +242,7 @@
236 return;242 return;
237 }243 }
238244
245<<<<<<< TREE
239 if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_2in2out#ui")246 if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_2in2out#ui")
240 {247 {
241 delete big_window;248 delete big_window;
@@ -286,6 +293,58 @@
286 }293 }
287 else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_vbap#ui")294 else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_vbap#ui")
288 {295 {
296=======
297 if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui")
298 {
299 delete big_window;
300 big_window = 0;
301
302 boost::shared_ptr<Pannable> pannable = _panner->pannable();
303
304 _stereo_panner = new StereoPanner (_panshell);
305 _stereo_panner->set_size_request (-1, pan_bar_height);
306 pan_vbox.pack_start (*_stereo_panner, false, false);
307
308 boost::shared_ptr<AutomationControl> ac;
309
310 ac = pannable->pan_azimuth_control;
311 _stereo_panner->StartPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
312 boost::weak_ptr<AutomationControl> (ac)));
313 _stereo_panner->StopPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
314 boost::weak_ptr<AutomationControl>(ac)));
315
316 ac = pannable->pan_width_control;
317 _stereo_panner->StartWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
318 boost::weak_ptr<AutomationControl> (ac)));
319 _stereo_panner->StopWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
320 boost::weak_ptr<AutomationControl>(ac)));
321 _stereo_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event));
322 }
323 else if (_current_uri == "http://ardour.org/plugin/panner_1in2out#ui"
324 || _current_uri == "http://ardour.org/plugin/panner_balance#ui")
325 {
326 delete big_window;
327 big_window = 0;
328 boost::shared_ptr<Pannable> pannable = _panner->pannable();
329 boost::shared_ptr<AutomationControl> ac = pannable->pan_azimuth_control;
330
331 _mono_panner = new MonoPanner (_panshell);
332
333 _mono_panner->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch),
334 boost::weak_ptr<AutomationControl> (ac)));
335 _mono_panner->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch),
336 boost::weak_ptr<AutomationControl>(ac)));
337
338 _mono_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event));
339
340 _mono_panner->set_size_request (-1, pan_bar_height);
341
342 update_pan_sensitive ();
343 pan_vbox.pack_start (*_mono_panner, false, false);
344 }
345 else if (_current_uri == "http://ardour.org/plugin/panner_vbap#ui")
346 {
347>>>>>>> MERGE-SOURCE
289 if (!twod_panner) {348 if (!twod_panner) {
290 twod_panner = new Panner2d (_panshell, 61);349 twod_panner = new Panner2d (_panshell, 61);
291 twod_panner->set_name ("MixerPanZone");350 twod_panner->set_name ("MixerPanZone");
@@ -383,6 +442,7 @@
383 bypass_menu_item->set_active (_panshell->bypassed());442 bypass_menu_item->set_active (_panshell->bypassed());
384 bypass_menu_item->signal_toggled().connect (sigc::mem_fun(*this, &PannerUI::pan_bypass_toggle));443 bypass_menu_item->signal_toggled().connect (sigc::mem_fun(*this, &PannerUI::pan_bypass_toggle));
385444
445<<<<<<< TREE
386 if (!_panshell->bypassed()) {446 if (!_panshell->bypassed()) {
387 items.push_back (MenuElem (_("Reset"), sigc::mem_fun (*this, &PannerUI::pan_reset)));447 items.push_back (MenuElem (_("Reset"), sigc::mem_fun (*this, &PannerUI::pan_reset)));
388 items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit)));448 items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit)));
@@ -404,6 +464,26 @@
404 }464 }
405 _suspend_menu_callbacks = false;465 _suspend_menu_callbacks = false;
406 }466 }
467=======
468 if (!_panshell->bypassed()) {
469 items.push_back (MenuElem (_("Reset"), sigc::mem_fun (*this, &PannerUI::pan_reset)));
470 items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit)));
471 }
472
473 if (_panner_list.size() > 1 && !_panshell->bypassed()) {
474 RadioMenuItem::Group group;
475 items.push_back (SeparatorElem());
476
477 _suspend_menu_callbacks = true;
478 for (std::map<std::string,std::string>::const_iterator p = _panner_list.begin(); p != _panner_list.end(); ++p) {
479 items.push_back (RadioMenuElem (group, p->second,
480 sigc::bind(sigc::mem_fun (*this, &PannerUI::pan_set_custom_type), p->first)));
481 RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&items.back ());
482 i->set_active (_panshell->current_panner_uri() == p->first);
483 }
484 _suspend_menu_callbacks = false;
485 }
486>>>>>>> MERGE-SOURCE
407}487}
408488
409void489void
410490
=== modified file 'gtk2_ardour/panner_ui.h'
--- gtk2_ardour/panner_ui.h 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/panner_ui.h 2015-05-02 14:23:30 +0000
@@ -96,6 +96,7 @@
96 bool in_pan_update;96 bool in_pan_update;
97 int _current_nouts;97 int _current_nouts;
98 int _current_nins;98 int _current_nins;
99 std::string _current_uri;
99100
100 static const int pan_bar_height;101 static const int pan_bar_height;
101102
102103
=== modified file 'gtk2_ardour/plugin_ui.cc'
--- gtk2_ardour/plugin_ui.cc 2013-10-17 11:16:21 +0000
+++ gtk2_ardour/plugin_ui.cc 2015-05-02 14:23:30 +0000
@@ -161,7 +161,9 @@
161161
162PluginUIWindow::~PluginUIWindow ()162PluginUIWindow::~PluginUIWindow ()
163{163{
164#ifndef NDEBUG
164 cerr << "PluginWindow deleted for " << this << endl;165 cerr << "PluginWindow deleted for " << this << endl;
166#endif
165 delete _pluginui;167 delete _pluginui;
166}168}
167169
168170
=== modified file 'gtk2_ardour/processor_box.cc'
--- gtk2_ardour/processor_box.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/processor_box.cc 2015-05-02 14:23:30 +0000
@@ -820,6 +820,7 @@
820 Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL);820 Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL);
821 cairo_set_source_rgb (cr, fg.get_red_p (), fg.get_green_p (), fg.get_blue_p ());821 cairo_set_source_rgb (cr, fg.get_red_p (), fg.get_green_p (), fg.get_blue_p ());
822822
823<<<<<<< TREE
823 const uint32_t sources = _sources.n_total();824 const uint32_t sources = _sources.n_total();
824 const uint32_t sinks = _sinks.n_total();825 const uint32_t sinks = _sinks.n_total();
825826
@@ -878,6 +879,75 @@
878 cairo_stroke (cr);879 cairo_stroke (cr);
879 }880 }
880 cairo_destroy(cr);881 cairo_destroy(cr);
882=======
883 const uint32_t sources = _sources.n_total();
884 const uint32_t sinks = _sinks.n_total();
885
886 /* MIDI */
887 const uint32_t midi_sources = _sources.n_midi();
888 const uint32_t midi_sinks = _sinks.n_midi();
889
890 cairo_set_source_rgb (cr,
891 UINT_RGBA_R_FLT(midi_port_color),
892 UINT_RGBA_G_FLT(midi_port_color),
893 UINT_RGBA_B_FLT(midi_port_color));
894 if (midi_sources > 0 && midi_sinks > 0 && sinks > 1 && sources > 1) {
895 for (uint32_t i = 0 ; i < midi_sources; ++i) {
896 const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f;
897 const float si_x0 = rintf(width * (.2f + .6f * i / (sources - 1.f))) + .5f;
898 cairo_move_to (cr, si_x, height);
899 cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
900 cairo_stroke (cr);
901 }
902 } else if (midi_sources == 1 && midi_sinks == 1 && sinks == 1 && sources == 1) {
903 const float si_x = rintf(width * .5f) + .5f;
904 cairo_move_to (cr, si_x, height);
905 cairo_line_to (cr, si_x, 0);
906 cairo_stroke (cr);
907 } else if (midi_sources == 1 && midi_sinks == 1) {
908 /* unusual cases -- removed synth, midi-track w/audio plugins */
909 const float si_x = rintf(width * (sinks > 1 ? .2f : .5f)) + .5f;
910 const float si_x0 = rintf(width * (sources > 1 ? .2f : .5f)) + .5f;
911 cairo_move_to (cr, si_x, height);
912 cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
913 cairo_stroke (cr);
914 }
915
916 /* AUDIO */
917 const uint32_t audio_sources = _sources.n_audio();
918 const uint32_t audio_sinks = _sinks.n_audio();
919 cairo_set_source_rgb (cr,
920 UINT_RGBA_R_FLT(audio_port_color),
921 UINT_RGBA_G_FLT(audio_port_color),
922 UINT_RGBA_B_FLT(audio_port_color));
923
924 if (_splitting) {
925 assert(audio_sources < 2);
926 assert(audio_sinks > 1);
927 /* assume there is only ever one MIDI port */
928 const float si_x0 = rintf(width * (midi_sources > 0 ? .8f : .5f)) + .5f;
929 for (uint32_t i = midi_sinks; i < sinks; ++i) {
930 const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f;
931 cairo_move_to (cr, si_x, height);
932 cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
933 cairo_stroke (cr);
934 }
935 } else if (audio_sources > 1) {
936 for (uint32_t i = 0 ; i < audio_sources; ++i) {
937 const float si_x = rintf(width * (.2f + .6f * (i + midi_sinks) / (sinks - 1.f))) + .5f;
938 const float si_x0 = rintf(width * (.2f + .6f * (i + midi_sources) / (sources - 1.f))) + .5f;
939 cairo_move_to (cr, si_x, height);
940 cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
941 cairo_stroke (cr);
942 }
943 } else if (audio_sources == 1 && audio_sinks == 1) {
944 const float si_x = rintf(width * .5f) + .5f;
945 cairo_move_to (cr, si_x, height);
946 cairo_line_to (cr, si_x, 0);
947 cairo_stroke (cr);
948 }
949 cairo_destroy(cr);
950>>>>>>> MERGE-SOURCE
881 return true;951 return true;
882}952}
883953
884954
=== modified file 'gtk2_ardour/route_ui.cc'
--- gtk2_ardour/route_ui.cc 2013-11-06 13:22:44 +0000
+++ gtk2_ardour/route_ui.cc 2015-05-02 14:23:30 +0000
@@ -1237,13 +1237,13 @@
12371237
1238 MenuList& items = mute_menu->items();1238 MenuList& items = mute_menu->items();
12391239
1240 pre_fader_mute_check = manage (new CheckMenuItem(_("Pre Fader")));1240 pre_fader_mute_check = manage (new CheckMenuItem(_("Pre Fader Sends")));
1241 init_mute_menu(MuteMaster::PreFader, pre_fader_mute_check);1241 init_mute_menu(MuteMaster::PreFader, pre_fader_mute_check);
1242 pre_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PreFader, pre_fader_mute_check));1242 pre_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PreFader, pre_fader_mute_check));
1243 items.push_back (CheckMenuElem(*pre_fader_mute_check));1243 items.push_back (CheckMenuElem(*pre_fader_mute_check));
1244 pre_fader_mute_check->show_all();1244 pre_fader_mute_check->show_all();
12451245
1246 post_fader_mute_check = manage (new CheckMenuItem(_("Post Fader")));1246 post_fader_mute_check = manage (new CheckMenuItem(_("Post Fader Sends")));
1247 init_mute_menu(MuteMaster::PostFader, post_fader_mute_check);1247 init_mute_menu(MuteMaster::PostFader, post_fader_mute_check);
1248 post_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PostFader, post_fader_mute_check));1248 post_fader_mute_check->signal_toggled().connect(sigc::bind (sigc::mem_fun (*this, &RouteUI::toggle_mute_menu), MuteMaster::PostFader, post_fader_mute_check));
1249 items.push_back (CheckMenuElem(*post_fader_mute_check));1249 items.push_back (CheckMenuElem(*post_fader_mute_check));
12501250
=== modified file 'gtk2_ardour/sfdb_ui.cc'
--- gtk2_ardour/sfdb_ui.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/sfdb_ui.cc 2015-05-02 14:23:30 +0000
@@ -116,7 +116,7 @@
116 return _("as new tracks");116 return _("as new tracks");
117}117}
118118
119SoundFileBox::SoundFileBox (bool persistent)119SoundFileBox::SoundFileBox (bool /*persistent*/)
120 : table (6, 2),120 : table (6, 2),
121 length_clock ("sfboxLengthClock", true, "", false, false, true, false),121 length_clock ("sfboxLengthClock", true, "", false, false, true, false),
122 timecode_clock ("sfboxTimecodeClock", true, "", false, false, false, false),122 timecode_clock ("sfboxTimecodeClock", true, "", false, false, false, false),
@@ -279,6 +279,7 @@
279279
280 string error_msg;280 string error_msg;
281281
282<<<<<<< TREE
282 if (SMFSource::safe_midi_file_extension (path)) {283 if (SMFSource::safe_midi_file_extension (path)) {
283284
284 boost::shared_ptr<SMFSource> ms =285 boost::shared_ptr<SMFSource> ms =
@@ -311,6 +312,40 @@
311 return true;312 return true;
312 }313 }
313314
315=======
316 if (SMFSource::valid_midi_file (path)) {
317
318 boost::shared_ptr<SMFSource> ms =
319 boost::dynamic_pointer_cast<SMFSource> (
320 SourceFactory::createExternal (DataType::MIDI, *_session,
321 path, 0, Source::Flag (0), false));
322
323 preview_label.set_markup (_("<b>Midi File Information</b>"));
324
325 format_text.set_text ("MIDI");
326 samplerate_value.set_text ("-");
327 tags_entry.get_buffer()->set_text ("");
328 timecode_clock.set (0);
329 tags_entry.set_sensitive (false);
330
331 if (ms) {
332 channels_value.set_text (to_string(ms->num_tracks(), std::dec));
333 length_clock.set (ms->length(ms->timeline_position()));
334 } else {
335 channels_value.set_text ("");
336 length_clock.set (0);
337 }
338
339 if (_session && ms) {
340 play_btn.set_sensitive (true);
341 } else {
342 play_btn.set_sensitive (false);
343 }
344
345 return true;
346 }
347
348>>>>>>> MERGE-SOURCE
314 if(!AudioFileSource::get_soundfile_info (filename, sf_info, error_msg)) {349 if(!AudioFileSource::get_soundfile_info (filename, sf_info, error_msg)) {
315350
316 preview_label.set_markup (_("<b>Sound File Information</b>"));351 preview_label.set_markup (_("<b>Sound File Information</b>"));
@@ -403,6 +438,7 @@
403 }438 }
404439
405 boost::shared_ptr<Region> r;440 boost::shared_ptr<Region> r;
441<<<<<<< TREE
406442
407 if (SMFSource::safe_midi_file_extension (path)) {443 if (SMFSource::safe_midi_file_extension (path)) {
408444
@@ -456,6 +492,61 @@
456 AudioSource::set_build_peakfiles (old_sbp);492 AudioSource::set_build_peakfiles (old_sbp);
457493
458 if (srclist.empty()) {494 if (srclist.empty()) {
495=======
496
497 if (SMFSource::valid_midi_file (path)) {
498
499 boost::shared_ptr<SMFSource> ms =
500 boost::dynamic_pointer_cast<SMFSource> (
501 SourceFactory::createExternal (DataType::MIDI, *_session,
502 path, 0, Source::Flag (0), false));
503
504 string rname = region_name_from_path (ms->path(), false);
505
506 PropertyList plist;
507
508 plist.add (ARDOUR::Properties::start, 0);
509 plist.add (ARDOUR::Properties::length, ms->length(ms->timeline_position()));
510 plist.add (ARDOUR::Properties::name, rname);
511 plist.add (ARDOUR::Properties::layer, 0);
512
513 r = boost::dynamic_pointer_cast<MidiRegion> (RegionFactory::create (boost::dynamic_pointer_cast<Source>(ms), plist, false));
514 assert(r);
515
516 } else {
517
518 SourceList srclist;
519 boost::shared_ptr<AudioFileSource> afs;
520 bool old_sbp = AudioSource::get_build_peakfiles ();
521
522 /* don't even think of building peakfiles for these files */
523
524 AudioSource::set_build_peakfiles (false);
525
526 for (int n = 0; n < sf_info.channels; ++n) {
527 try {
528 afs = boost::dynamic_pointer_cast<AudioFileSource> (
529 SourceFactory::createExternal (DataType::AUDIO, *_session,
530 path, n,
531 Source::Flag (0), false));
532 if (afs->sample_rate() != _session->nominal_frame_rate()) {
533 boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, _src_quality));
534 srclist.push_back(sfs);
535 } else {
536 srclist.push_back(afs);
537 }
538
539 } catch (failed_constructor& err) {
540 error << _("Could not access soundfile: ") << path << endmsg;
541 AudioSource::set_build_peakfiles (old_sbp);
542 return;
543 }
544 }
545
546 AudioSource::set_build_peakfiles (old_sbp);
547
548 if (srclist.empty()) {
549>>>>>>> MERGE-SOURCE
459 return;550 return;
460 }551 }
461552
@@ -1307,7 +1398,7 @@
13071398
1308 /* See if we are thinking about importing any MIDI files */1399 /* See if we are thinking about importing any MIDI files */
1309 vector<string>::iterator i = paths.begin ();1400 vector<string>::iterator i = paths.begin ();
1310 while (i != paths.end() && SMFSource::safe_midi_file_extension (*i) == false) {1401 while (i != paths.end() && SMFSource::valid_midi_file (*i) == false) {
1311 ++i;1402 ++i;
1312 }1403 }
1313 bool const have_a_midi_file = (i != paths.end ());1404 bool const have_a_midi_file = (i != paths.end ());
@@ -1535,7 +1626,7 @@
1535 src_needed = true;1626 src_needed = true;
1536 }1627 }
15371628
1538 } else if (SMFSource::safe_midi_file_extension (*i)) {1629 } else if (SMFSource::valid_midi_file (*i)) {
15391630
1540 Evoral::SMF reader;1631 Evoral::SMF reader;
1541 reader.open(*i);1632 reader.open(*i);
15421633
=== modified file 'gtk2_ardour/stereo_panner.cc'
--- gtk2_ardour/stereo_panner.cc 2014-01-24 16:31:54 +0000
+++ gtk2_ardour/stereo_panner.cc 2015-05-02 14:23:30 +0000
@@ -83,22 +83,42 @@
83 set_colors ();83 set_colors ();
84 have_colors = true;84 have_colors = true;
85 }85 }
86 if (!have_font) {86<<<<<<< TREE
87 Pango::FontDescription font;87 if (!have_font) {
88 Pango::AttrFontDesc* font_attr;88 Pango::FontDescription font;
89 font = Pango::FontDescription ("ArdourMono");89 Pango::AttrFontDesc* font_attr;
90 font.set_weight (Pango::WEIGHT_BOLD);90 font = Pango::FontDescription ("ArdourMono");
91 font.set_size(9 * PANGO_SCALE);91 font.set_weight (Pango::WEIGHT_BOLD);
92 font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));92 font.set_size(9 * PANGO_SCALE);
93 panner_font_attributes.change(*font_attr);93 font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
94 delete font_attr;94 panner_font_attributes.change(*font_attr);
95 have_font = true;95 delete font_attr;
96 }96 have_font = true;
9797 }
98 position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());98
99 width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());99 position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());
100100 width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());
101 _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context());101
102 _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context());
103=======
104 if (!have_font) {
105 Pango::FontDescription font;
106 Pango::AttrFontDesc* font_attr;
107 font = Pango::FontDescription ("ArdourMono");
108 font.set_weight (Pango::WEIGHT_BOLD);
109 font.set_size(9 * PANGO_SCALE);
110 font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
111 panner_font_attributes.change(*font_attr);
112 delete font_attr;
113 have_font = true;
114 }
115
116 position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());
117 width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context());
118
119 _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context());
120 _panner_shell->PannableChanged.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::pannable_handler, this), gui_context());
121>>>>>>> MERGE-SOURCE
102122
103 ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));123 ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler));
104124
105125
=== modified file 'gtk2_ardour/transcode_ffmpeg.cc'
--- gtk2_ardour/transcode_ffmpeg.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/transcode_ffmpeg.cc 2015-05-02 14:23:30 +0000
@@ -46,6 +46,7 @@
46 m_avoffset = m_lead_in = m_lead_out = 0;46 m_avoffset = m_lead_in = m_lead_out = 0;
47 m_width = m_height = 0;47 m_width = m_height = 0;
48 m_aspect = m_fps = 0;48 m_aspect = m_fps = 0;
49 m_sar = "";
49#if 1 /* tentative debug mode */50#if 1 /* tentative debug mode */
50 debug_enable = false;51 debug_enable = false;
51#endif52#endif
@@ -70,17 +71,19 @@
70 if (ffmpeg_exe.empty() || ffprobe_exe.empty()) {71 if (ffmpeg_exe.empty() || ffprobe_exe.empty()) {
71 warning << string_compose(72 warning << string_compose(
72 _(73 _(
73 "No ffprobe or ffmpeg executables could be found on this system.\n"74 "No ffprobe or ffmpeg executables could be found on this system.\n"
74 "Video import and export is not possible until you install those tools.\n"75 "Video import and export is not possible until you install those tools.\n"
75 "%1 requires ffmpeg and ffprobe from ffmpeg.org - version 1.1 or newer.\n"76 "%1 requires ffmpeg and ffprobe from ffmpeg.org - version 1.1 or newer.\n"
76 "\n"77 "\n"
77 "The tools are included with the %1 releases from ardour.org "78 "The tools are included with the %1 releases from ardour.org "
78 "and also available with the video-server at http://x42.github.com/harvid/\n"79 "and also available with the video-server at http://x42.github.com/harvid/\n"
79 "\n"80 "\n"
80 "Important: the files need to be installed in $PATH and named ffmpeg_harvid and ffprobe_harvid.\n"81 "Important: the files need to be installed in $PATH and named ffmpeg_harvid and ffprobe_harvid.\n"
81 "If you already have a suitable ffmpeg installation on your system, we recommend creating "82 "If you already have a suitable ffmpeg installation on your system, we recommend creating "
82 "symbolic links from ffmpeg to ffmpeg_harvid and from ffprobe to ffprobe_harvid.\n"83 "symbolic links from ffmpeg to ffmpeg_harvid and from ffprobe to ffprobe_harvid.\n"
83 ), PROGRAM_NAME) << endmsg;84 "\n"
85 "see also http://manual.ardour.org/video-timeline/setup/"
86 ), PROGRAM_NAME) << endmsg;
84 return;87 return;
85 }88 }
86 ffexecok = true;89 ffexecok = true;
@@ -138,6 +141,7 @@
138 m_width = m_height = 0;141 m_width = m_height = 0;
139 m_fps = m_aspect = 0;142 m_fps = m_aspect = 0;
140 m_duration = 0;143 m_duration = 0;
144 m_sar.clear();
141 m_codec.clear();145 m_codec.clear();
142 m_audio.clear();146 m_audio.clear();
143147
@@ -199,6 +203,13 @@
199 m_duration = atof(value) * m_fps * timebase;203 m_duration = atof(value) * m_fps * timebase;
200 } else if (key == X_("duration") && m_fps != 0 && m_duration == 0) {204 } else if (key == X_("duration") && m_fps != 0 && m_duration == 0) {
201 m_duration = atof(value) * m_fps;205 m_duration = atof(value) * m_fps;
206 } else if (key == X_("sample_aspect_ratio")) {
207 std::string::size_type pos;
208 pos = value.find_first_of(':');
209 if (pos != std::string::npos && atof(value.substr(pos+1)) != 0) {
210 m_sar = value;
211 m_sar.replace(pos, 1, "/");
212 }
202 } else if (key == X_("display_aspect_ratio")) {213 } else if (key == X_("display_aspect_ratio")) {
203 std::string::size_type pos;214 std::string::size_type pos;
204 pos = value.find_first_of(':');215 pos = value.find_first_of(':');
@@ -340,20 +351,28 @@
340 if (m_lead_in != 0 && m_lead_out != 0) {351 if (m_lead_in != 0 && m_lead_out != 0) {
341 std::ostringstream osstream;352 std::ostringstream osstream;
342 argp[a++] = strdup("-vf");353 argp[a++] = strdup("-vf");
343 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_in << X_(" [pre]; ");354 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_in;
344 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_out << X_(" [post]; ");355 if (!m_sar.empty()) osstream << X_(":sar=") << m_sar;
356 osstream << X_(" [pre]; ");
357 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_out;
358 if (!m_sar.empty()) osstream << X_(":sar=") << m_sar;
359 osstream << X_(" [post]; ");
345 osstream << X_("[pre] [in] [post] concat=n=3");360 osstream << X_("[pre] [in] [post] concat=n=3");
346 argp[a++] = strdup(osstream.str().c_str());361 argp[a++] = strdup(osstream.str().c_str());
347 } else if (m_lead_in != 0) {362 } else if (m_lead_in != 0) {
348 std::ostringstream osstream;363 std::ostringstream osstream;
349 argp[a++] = strdup("-vf");364 argp[a++] = strdup("-vf");
350 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_in << X_(" [pre]; ");365 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_in;
366 if (!m_sar.empty()) osstream << X_(":sar=") << m_sar;
367 osstream << X_(" [pre]; ");
351 osstream << X_("[pre] [in] concat=n=2");368 osstream << X_("[pre] [in] concat=n=2");
352 argp[a++] = strdup(osstream.str().c_str());369 argp[a++] = strdup(osstream.str().c_str());
353 } else if (m_lead_out != 0) {370 } else if (m_lead_out != 0) {
354 std::ostringstream osstream;371 std::ostringstream osstream;
355 argp[a++] = strdup("-vf");372 argp[a++] = strdup("-vf");
356 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_out << X_(" [post]; ");373 osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_out;
374 if (!m_sar.empty()) osstream << X_(":sar=") << m_sar;
375 osstream << X_(" [post]; ");
357 osstream << X_("[in] [post] concat=n=2");376 osstream << X_("[in] [post] concat=n=2");
358 argp[a++] = strdup(osstream.str().c_str());377 argp[a++] = strdup(osstream.str().c_str());
359 }378 }
360379
=== modified file 'gtk2_ardour/transcode_ffmpeg.h'
--- gtk2_ardour/transcode_ffmpeg.h 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/transcode_ffmpeg.h 2015-05-02 14:23:30 +0000
@@ -134,6 +134,7 @@
134134
135 double m_fps;135 double m_fps;
136 double m_aspect;136 double m_aspect;
137 std::string m_sar;
137 ARDOUR::framecnt_t m_duration;138 ARDOUR::framecnt_t m_duration;
138 int m_width;139 int m_width;
139 int m_height;140 int m_height;
140141
=== modified file 'gtk2_ardour/transcode_video_dialog.cc'
--- gtk2_ardour/transcode_video_dialog.cc 2013-10-17 11:16:21 +0000
+++ gtk2_ardour/transcode_video_dialog.cc 2015-05-02 14:23:30 +0000
@@ -177,16 +177,18 @@
177 options_box->pack_start (*l, false, true, 4);177 options_box->pack_start (*l, false, true, 4);
178178
179 video_combo.set_name ("PaddedButton");179 video_combo.set_name ("PaddedButton");
180 video_combo.append_text(_("Do Not Import Video"));180 video_combo.append_text(_("Reference From Current Location (Previously Transcoded Files Only)"));
181 video_combo.append_text(_("Reference From Current Location"));
182 if (ffok) {181 if (ffok) {
183 video_combo.append_text(_("Import/Transcode Video to Session"));182 video_combo.append_text(_("Import/Transcode Video to Session"));
184 video_combo.set_active(2);
185 } else {
186 video_combo.set_active(1);183 video_combo.set_active(1);
184 } else {
185 video_combo.set_active(0);
187 video_combo.set_sensitive(false);186 video_combo.set_sensitive(false);
188 audio_combo.set_sensitive(false);187 audio_combo.set_sensitive(false);
189 }188 }
189 if (as.size() > 0) {
190 video_combo.append_text(_("Do Not Import Video (Audio Import Only)"));
191 }
190192
191 options_box->pack_start (video_combo, false, false, 4);193 options_box->pack_start (video_combo, false, false, 4);
192194
@@ -225,8 +227,11 @@
225 t->attach (*l, 0, 1, 2, 3);227 t->attach (*l, 0, 1, 2, 3);
226 audio_combo.set_name ("PaddedButton");228 audio_combo.set_name ("PaddedButton");
227 t->attach (audio_combo, 1, 4, 2, 3);229 t->attach (audio_combo, 1, 4, 2, 3);
228 audio_combo.append_text("No audio");230 if (as.size() == 0) {
229 if (as.size() > 0) {231 audio_combo.append_text(_("No Audio Track Present"));
232 audio_combo.set_sensitive(false);
233 } else {
234 audio_combo.append_text(_("Do Not Extract Audio"));
230 for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {235 for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) {
231 audio_combo.append_text((*it).name);236 audio_combo.append_text((*it).name);
232 }237 }
@@ -364,7 +369,7 @@
364void369void
365TranscodeVideoDialog::launch_transcode ()370TranscodeVideoDialog::launch_transcode ()
366{371{
367 if (video_combo.get_active_row_number() != 2) {372 if (video_combo.get_active_row_number() != 1) {
368 launch_audioonly();373 launch_audioonly();
369 return;374 return;
370 }375 }
@@ -413,8 +418,8 @@
413void418void
414TranscodeVideoDialog::video_combo_changed ()419TranscodeVideoDialog::video_combo_changed ()
415{420{
416 int i = video_combo.get_active_row_number();421 const int i = video_combo.get_active_row_number();
417 if (i != 2) {422 if (i != 1) {
418 scale_combo.set_sensitive(false);423 scale_combo.set_sensitive(false);
419 aspect_checkbox.set_sensitive(false);424 aspect_checkbox.set_sensitive(false);
420 height_spinner.set_sensitive(false);425 height_spinner.set_sensitive(false);
@@ -427,12 +432,19 @@
427 bitrate_checkbox.set_sensitive(true);432 bitrate_checkbox.set_sensitive(true);
428 bitrate_spinner.set_sensitive(true);433 bitrate_spinner.set_sensitive(true);
429 }434 }
435 if (i == 2 && audio_combo.get_active_row_number() == 0) {
436 audio_combo.set_active(1);
437 }
430}438}
431439
432void440void
433TranscodeVideoDialog::audio_combo_changed ()441TranscodeVideoDialog::audio_combo_changed ()
434{442{
435 ;443 if (video_combo.get_active_row_number() == 2
444 && audio_combo.get_active_row_number() == 0)
445 {
446 audio_combo.set_active(1);
447 }
436}448}
437449
438void450void
439451
=== modified file 'gtk2_ardour/transcode_video_dialog.h'
--- gtk2_ardour/transcode_video_dialog.h 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/transcode_video_dialog.h 2015-05-02 14:23:30 +0000
@@ -31,9 +31,9 @@
31#include "transcode_ffmpeg.h"31#include "transcode_ffmpeg.h"
3232
33enum VtlTranscodeOption {33enum VtlTranscodeOption {
34 VTL_IMPORT_NO_VIDEO = 0,34 VTL_IMPORT_REFERENCE = 0,
35 VTL_IMPORT_REFERENCE = 1,35 VTL_IMPORT_TRANSCODED = 1,
36 VTL_IMPORT_TRANSCODED = 236 VTL_IMPORT_NO_VIDEO = 2
37};37};
3838
39/** @class TranscodeVideoDialog39/** @class TranscodeVideoDialog
4040
=== modified file 'gtk2_ardour/video_server_dialog.cc'
--- gtk2_ardour/video_server_dialog.cc 2013-10-17 11:16:21 +0000
+++ gtk2_ardour/video_server_dialog.cc 2015-05-02 14:23:30 +0000
@@ -89,8 +89,13 @@
89 else {89 else {
90 PBD::warning <<90 PBD::warning <<
91 string_compose(91 string_compose(
92 _("The external video server 'harvid' can not be found. The tool is included with the %1 releases from ardour.org, "92 _("The external video server 'harvid' can not be found.\n"
93 "alternatively you can download it from http://x42.github.com/harvid/ or acquire it from your distribution."), PROGRAM_NAME)93 "The tool is included with the %1 releases from ardour.org, "
94 "alternatively you can download it from http://x42.github.com/harvid/ "
95 "or acquire it from your distribution.\n"
96 "\n"
97 "see also http://manual.ardour.org/video-timeline/setup/"
98 ), PROGRAM_NAME)
94 << endmsg;99 << endmsg;
95 }100 }
96101
97102
=== modified file 'gtk2_ardour/video_timeline.cc'
--- gtk2_ardour/video_timeline.cc 2013-09-21 19:05:02 +0000
+++ gtk2_ardour/video_timeline.cc 2015-05-02 14:23:30 +0000
@@ -39,6 +39,10 @@
39#include <pthread.h>39#include <pthread.h>
40#include <curl/curl.h>40#include <curl/curl.h>
4141
42#ifdef PLATFORM_WINDOWS
43#include <windows.h>
44#endif
45
42#include "i18n.h"46#include "i18n.h"
4347
44using namespace std;48using namespace std;
@@ -718,25 +722,52 @@
718VideoTimeLine::find_xjadeo () {722VideoTimeLine::find_xjadeo () {
719 std::string xjadeo_file_path;723 std::string xjadeo_file_path;
720 if (getenv("XJREMOTE")) {724 if (getenv("XJREMOTE")) {
721 _xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?!725 _xjadeo_bin = getenv("XJREMOTE");
722 } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {726 }
723 _xjadeo_bin = xjadeo_file_path;727 else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) {
728 _xjadeo_bin = xjadeo_file_path;
729 }
730 else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjadeo"), xjadeo_file_path)) {
731 _xjadeo_bin = xjadeo_file_path;
732 }
733#ifdef __APPLE__
734 else if (Glib::file_test(X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
735 _xjadeo_bin = X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote");
724 }736 }
725 else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {737 else if (Glib::file_test(X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) {
726 _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote");738 _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote");
727 }739 }
728 /* TODO: win32: allow to configure PATH to xjremote */740#endif
741#ifdef PLATFORM_WINDOWS
742 else {
743 HKEY key;
744 DWORD size = PATH_MAX;
745 char path[PATH_MAX+1];
746 xjadeo_file_path = X_("");
747 if ( (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\RSS\\xjadeo", 0, KEY_READ, &key))
748 && (ERROR_SUCCESS == RegQueryValueExA (key, "Install_Dir", 0, NULL, (LPBYTE)path, &size))
749 )
750 {
751 xjadeo_file_path = g_build_filename(path, X_("xjadeo.exe"));
752 }
753 }
754 if (Glib::file_test(xjadeo_file_path, Glib::FILE_TEST_EXISTS)) {
755 _xjadeo_bin = xjadeo_file_path;
756 }
729 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.exe"), Glib::FILE_TEST_EXISTS)) {757 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.exe"), Glib::FILE_TEST_EXISTS)) {
730 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe");758 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe");
731 }759 }
732 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.bat"), Glib::FILE_TEST_EXISTS)) {760 else if (Glib::file_test(X_("C:\\Program Files\\xjadeo\\xjremote.bat"), Glib::FILE_TEST_EXISTS)) {
733 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat");761 _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat");
734 }762 }
763#endif
735 else {764 else {
736 _xjadeo_bin = X_("");765 _xjadeo_bin = X_("");
737 warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "766 warning << _("Video-monitor 'xjadeo' was not found. Please install http://xjadeo.sf.net/ "
738 "(a custom path to xjadeo can be specified by setting the XJREMOTE environment variable. "767 "(a custom path to xjadeo can be specified by setting the XJREMOTE environment variable. "
739 "It should point to an application compatible with xjadeo's remote-control interface 'xjremote').")768 "It should point to an application compatible with xjadeo's remote-control interface 'xjremote').\n"
769 "\n"
770 "see also http://manual.ardour.org/video-timeline/setup/")
740 << endmsg;771 << endmsg;
741 }772 }
742}773}
743774
=== modified file 'libs/ardour/amp.cc'
--- libs/ardour/amp.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/amp.cc 2015-05-02 14:23:30 +0000
@@ -372,19 +372,9 @@
372}372}
373373
374void374void
375Amp::set_gain (gain_t val, void *src)375Amp::set_gain (gain_t val, void *)
376{376{
377 val = min (val, max_gain_coefficient);377 _gain_control->set_value (val);
378
379 if (src != _gain_control.get()) {
380 _gain_control->set_value (val);
381 // bit twisty, this will come back and call us again
382 // (this keeps control in sync with reality)
383 return;
384 }
385
386 _gain_control->set_double (val);
387 _session.set_dirty();
388}378}
389379
390XMLNode&380XMLNode&
@@ -414,13 +404,8 @@
414void404void
415Amp::GainControl::set_value (double val)405Amp::GainControl::set_value (double val)
416{406{
417 if (val > max_gain_coefficient) {407 AutomationControl::set_value (min (val, (double) max_gain_coefficient));
418 val = max_gain_coefficient;408 _amp->session().set_dirty ();
419 }
420
421 _amp->set_gain (val, this);
422
423 AutomationControl::set_value(val);
424}409}
425410
426double411double
427412
=== modified file 'libs/ardour/ardour/audio_buffer.h'
--- libs/ardour/ardour/audio_buffer.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/audio_buffer.h 2015-05-02 14:23:30 +0000
@@ -62,7 +62,7 @@
62 assert(&src != this);62 assert(&src != this);
63 assert(_capacity > 0);63 assert(_capacity > 0);
64 assert(src.type() == DataType::AUDIO);64 assert(src.type() == DataType::AUDIO);
65 assert(len <= _capacity);65 assert(dst_offset + len <= _capacity);
66 assert( src_offset <= ((framecnt_t) src.capacity()-len));66 assert( src_offset <= ((framecnt_t) src.capacity()-len));
67 memcpy(_data + dst_offset, ((const AudioBuffer&)src).data() + src_offset, sizeof(Sample) * len);67 memcpy(_data + dst_offset, ((const AudioBuffer&)src).data() + src_offset, sizeof(Sample) * len);
68 if (dst_offset == 0 && src_offset == 0 && len == _capacity) {68 if (dst_offset == 0 && src_offset == 0 && len == _capacity) {
@@ -173,7 +173,6 @@
173 void set_data (Sample* data, size_t size) {173 void set_data (Sample* data, size_t size) {
174 assert(!_owns_data); // prevent leaks174 assert(!_owns_data); // prevent leaks
175 _capacity = size;175 _capacity = size;
176 _size = size;
177 _data = data;176 _data = data;
178 _silent = false;177 _silent = false;
179 _written = false;178 _written = false;
@@ -185,8 +184,6 @@
185 */184 */
186 void resize (size_t nframes);185 void resize (size_t nframes);
187186
188 bool empty() const { return _size == 0; }
189
190 const Sample* data (framecnt_t offset = 0) const {187 const Sample* data (framecnt_t offset = 0) const {
191 assert(offset <= _capacity);188 assert(offset <= _capacity);
192 return _data + offset;189 return _data + offset;
@@ -198,7 +195,11 @@
198 return _data + offset;195 return _data + offset;
199 }196 }
200197
198<<<<<<< TREE
201 bool check_silence (pframes_t, bool, pframes_t&) const;199 bool check_silence (pframes_t, bool, pframes_t&) const;
200=======
201 bool check_silence (pframes_t, pframes_t&) const;
202>>>>>>> MERGE-SOURCE
202203
203 void prepare () { _written = false; _silent = false; }204 void prepare () { _written = false; _silent = false; }
204 bool written() const { return _written; }205 bool written() const { return _written; }
205206
=== modified file 'libs/ardour/ardour/audio_diskstream.h'
--- libs/ardour/ardour/audio_diskstream.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/audio_diskstream.h 2015-05-02 14:23:30 +0000
@@ -139,7 +139,6 @@
139 void set_block_size (pframes_t);139 void set_block_size (pframes_t);
140 int internal_playback_seek (framecnt_t distance);140 int internal_playback_seek (framecnt_t distance);
141 int can_internal_playback_seek (framecnt_t distance);141 int can_internal_playback_seek (framecnt_t distance);
142 std::list<boost::shared_ptr<Source> > steal_write_sources();
143 void reset_write_sources (bool, bool force = false);142 void reset_write_sources (bool, bool force = false);
144 void non_realtime_input_change ();143 void non_realtime_input_change ();
145 void non_realtime_locate (framepos_t location);144 void non_realtime_locate (framepos_t location);
146145
=== modified file 'libs/ardour/ardour/audiofilesource.h'
--- libs/ardour/ardour/audiofilesource.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/audiofilesource.h 2015-05-02 14:23:30 +0000
@@ -39,10 +39,6 @@
39public:39public:
40 virtual ~AudioFileSource ();40 virtual ~AudioFileSource ();
4141
42 bool set_name (const std::string& newname) {
43 return (set_source_name(newname, destructive()) == 0);
44 }
45
46 std::string peak_path (std::string audio_path);42 std::string peak_path (std::string audio_path);
47 std::string find_broken_peakfile (std::string missing_peak_path,43 std::string find_broken_peakfile (std::string missing_peak_path,
48 std::string audio_path);44 std::string audio_path);
@@ -97,6 +93,12 @@
97 /** Constructor to be called for existing in-session files */93 /** Constructor to be called for existing in-session files */
98 AudioFileSource (Session&, const XMLNode&, bool must_exist = true);94 AudioFileSource (Session&, const XMLNode&, bool must_exist = true);
9995
96 /** Constructor to be called for crash recovery. Final argument is not
97 * used but exists to differentiate from the external-to-session
98 * constructor above.
99 */
100 AudioFileSource (Session&, const std::string& path, Source::Flag flags, bool);
101
100 int init (const std::string& idstr, bool must_exist);102 int init (const std::string& idstr, bool must_exist);
101103
102 virtual void set_header_timeline_position () = 0;104 virtual void set_header_timeline_position () = 0;
103105
=== modified file 'libs/ardour/ardour/buffer.h'
--- libs/ardour/ardour/buffer.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/buffer.h 2015-05-02 14:23:30 +0000
@@ -46,16 +46,9 @@
46 /** Factory function */46 /** Factory function */
47 static Buffer* create(DataType type, size_t capacity);47 static Buffer* create(DataType type, size_t capacity);
4848
49 /** Maximum capacity of buffer.49 /** Maximum capacity of buffer. */
50 * Note in some cases the entire buffer may not contain valid data, use size. */
51 size_t capacity() const { return _capacity; }50 size_t capacity() const { return _capacity; }
5251
53 /** Amount of valid data in buffer. Use this over capacity almost always. */
54 size_t size() const { return _size; }
55
56 /** Return true if the buffer contains no data, false otherwise */
57 virtual bool empty() const { return _size == 0; }
58
59 /** Type of this buffer.52 /** Type of this buffer.
60 * Based on this you can static cast a Buffer* to the desired type. */53 * Based on this you can static cast a Buffer* to the desired type. */
61 DataType type() const { return _type; }54 DataType type() const { return _type; }
@@ -80,12 +73,11 @@
8073
81 protected:74 protected:
82 Buffer(DataType type)75 Buffer(DataType type)
83 : _type(type), _capacity(0), _size(0), _silent (true)76 : _type(type), _capacity(0), _silent (true)
84 {}77 {}
8578
86 DataType _type;79 DataType _type;
87 pframes_t _capacity;80 pframes_t _capacity;
88 pframes_t _size;
89 bool _silent;81 bool _silent;
90};82};
9183
9284
=== modified file 'libs/ardour/ardour/diskstream.h'
--- libs/ardour/ardour/diskstream.h 2013-10-17 11:16:21 +0000
+++ libs/ardour/ardour/diskstream.h 2015-05-02 14:23:30 +0000
@@ -70,6 +70,8 @@
7070
71 virtual bool set_name (const std::string& str);71 virtual bool set_name (const std::string& str);
7272
73 virtual std::string steal_write_source_name () { return std::string(); }
74
73 boost::shared_ptr<ARDOUR::IO> io() const { return _io; }75 boost::shared_ptr<ARDOUR::IO> io() const { return _io; }
74 void set_track (ARDOUR::Track *);76 void set_track (ARDOUR::Track *);
7577
7678
=== modified file 'libs/ardour/ardour/file_source.h'
--- libs/ardour/ardour/file_source.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/file_source.h 2015-05-02 14:23:30 +0000
@@ -44,7 +44,7 @@
44/** A source associated with a file on disk somewhere */44/** A source associated with a file on disk somewhere */
45class FileSource : virtual public Source {45class FileSource : virtual public Source {
46public:46public:
47 virtual ~FileSource () {}47 virtual ~FileSource ();
4848
49 virtual const std::string& path() const { return _path; }49 virtual const std::string& path() const { return _path; }
5050
@@ -74,6 +74,7 @@
7474
75 void inc_use_count ();75 void inc_use_count ();
76 bool removable () const;76 bool removable () const;
77 bool is_stub () const;
7778
78 const std::string& origin() const { return _origin; }79 const std::string& origin() const { return _origin; }
7980
@@ -81,6 +82,13 @@
81 82
82 static PBD::Signal3<int,std::string,std::string,std::vector<std::string> > AmbiguousFileName;83 static PBD::Signal3<int,std::string,std::string,std::vector<std::string> > AmbiguousFileName;
8384
85 void existence_check ();
86 virtual void prevent_deletion ();
87
88 /** Rename the file on disk referenced by this source to \param newname
89 */
90 int rename (const std::string& name);
91
84protected:92protected:
85 FileSource (Session& session, DataType type,93 FileSource (Session& session, DataType type,
86 const std::string& path,94 const std::string& path,
@@ -102,7 +110,6 @@
102 std::string _origin;110 std::string _origin;
103 bool _open;111 bool _open;
104112
105 void prevent_deletion ();
106};113};
107114
108} // namespace ARDOUR115} // namespace ARDOUR
109116
=== modified file 'libs/ardour/ardour/midi_buffer.h'
--- libs/ardour/ardour/midi_buffer.h 2013-10-17 11:16:21 +0000
+++ libs/ardour/ardour/midi_buffer.h 2015-05-02 14:23:30 +0000
@@ -48,6 +48,8 @@
48 uint8_t* reserve(TimeType time, size_t size);48 uint8_t* reserve(TimeType time, size_t size);
4949
50 void resize(size_t);50 void resize(size_t);
51 size_t size() const { return _size; }
52 bool empty() const { return _size == 0; }
5153
52 bool merge_in_place(const MidiBuffer &other);54 bool merge_in_place(const MidiBuffer &other);
5355
@@ -159,6 +161,7 @@
159 friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >;161 friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >;
160162
161 uint8_t* _data; ///< timestamp, event, timestamp, event, ...163 uint8_t* _data; ///< timestamp, event, timestamp, event, ...
164 pframes_t _size;
162};165};
163166
164167
165168
=== modified file 'libs/ardour/ardour/midi_diskstream.h'
--- libs/ardour/ardour/midi_diskstream.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/midi_diskstream.h 2015-05-02 14:23:30 +0000
@@ -111,7 +111,7 @@
111 void set_block_size (pframes_t);111 void set_block_size (pframes_t);
112 int internal_playback_seek (framecnt_t distance);112 int internal_playback_seek (framecnt_t distance);
113 int can_internal_playback_seek (framecnt_t distance);113 int can_internal_playback_seek (framecnt_t distance);
114 std::list<boost::shared_ptr<Source> > steal_write_sources();114 std::string steal_write_source_name();
115 void reset_write_sources (bool, bool force = false);115 void reset_write_sources (bool, bool force = false);
116 void non_realtime_input_change ();116 void non_realtime_input_change ();
117 void non_realtime_locate (framepos_t location);117 void non_realtime_locate (framepos_t location);
118118
=== modified file 'libs/ardour/ardour/midi_region.h'
--- libs/ardour/ardour/midi_region.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/midi_region.h 2015-05-02 14:23:30 +0000
@@ -63,6 +63,7 @@
63 ~MidiRegion();63 ~MidiRegion();
6464
65 boost::shared_ptr<MidiRegion> clone (std::string path = std::string()) const;65 boost::shared_ptr<MidiRegion> clone (std::string path = std::string()) const;
66 boost::shared_ptr<MidiRegion> clone (boost::shared_ptr<MidiSource>) const;
6667
67 boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const;68 boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const;
6869
6970
=== modified file 'libs/ardour/ardour/midi_source.h'
--- libs/ardour/ardour/midi_source.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/midi_source.h 2015-05-02 14:23:30 +0000
@@ -48,9 +48,21 @@
48 MidiSource (Session& session, const XMLNode&);48 MidiSource (Session& session, const XMLNode&);
49 virtual ~MidiSource ();49 virtual ~MidiSource ();
5050
51 boost::shared_ptr<MidiSource> clone (const std::string& path,51 /** Write the data in the given time range to another MidiSource
52 Evoral::MusicalTime begin = Evoral::MinMusicalTime,52 * \param newsrc MidiSource to which data will be written. Should be a
53 Evoral::MusicalTime end = Evoral::MaxMusicalTime);53 * new, empty source. If it already has contents, the results are
54 * undefined. Source must be writable.
55 *
56 * \param begin time of earliest event that can be written.
57 * \param end time of latest event that can be written.
58 *
59 * Returns zero on success, non-zero if the write failed for any
60 * reason.
61 *
62 */
63 int write_to (boost::shared_ptr<MidiSource> newsrc,
64 Evoral::MusicalTime begin = Evoral::MinMusicalTime,
65 Evoral::MusicalTime end = Evoral::MaxMusicalTime);
5466
55 /** Read the data in a given time range from the MIDI source.67 /** Read the data in a given time range from the MIDI source.
56 * All time stamps in parameters are in audio frames (even if the source has tempo time).68 * All time stamps in parameters are in audio frames (even if the source has tempo time).
5769
=== modified file 'libs/ardour/ardour/public_diskstream.h'
--- libs/ardour/ardour/public_diskstream.h 2013-10-17 11:16:21 +0000
+++ libs/ardour/ardour/public_diskstream.h 2015-05-02 14:23:30 +0000
@@ -38,7 +38,7 @@
38 virtual bool destructive () const = 0;38 virtual bool destructive () const = 0;
39 virtual std::list<boost::shared_ptr<Source> > & last_capture_sources () = 0;39 virtual std::list<boost::shared_ptr<Source> > & last_capture_sources () = 0;
40 virtual void set_capture_offset () = 0;40 virtual void set_capture_offset () = 0;
41 virtual std::list<boost::shared_ptr<Source> > steal_write_sources () = 0;41 virtual std::string steal_write_source_name () = 0;
42 virtual void reset_write_sources (bool, bool force = false) = 0;42 virtual void reset_write_sources (bool, bool force = false) = 0;
43 virtual float playback_buffer_load () const = 0;43 virtual float playback_buffer_load () const = 0;
44 virtual float capture_buffer_load () const = 0;44 virtual float capture_buffer_load () const = 0;
4545
=== modified file 'libs/ardour/ardour/session.h'
--- libs/ardour/ardour/session.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/session.h 2015-05-02 14:23:30 +0000
@@ -194,13 +194,11 @@
194194
195 std::string peak_path (std::string) const;195 std::string peak_path (std::string) const;
196196
197 std::string change_source_path_by_name (std::string oldpath, std::string oldname, std::string newname, bool destructive);
198
199 std::string peak_path_from_audio_path (std::string) const;197 std::string peak_path_from_audio_path (std::string) const;
200 std::string new_audio_source_name (const std::string&, uint32_t nchans, uint32_t chan, bool destructive);198 std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool destructive, bool take_required);
201 std::string new_midi_source_name (const std::string&);199 std::string new_midi_source_path (const std::string&);
202 std::string new_source_path_from_name (DataType type, const std::string&);
203 RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name);200 RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name);
201 std::vector<std::string> get_paths_for_new_sources (bool allow_replacing, const std::string& import_file_path, uint32_t channels);
204202
205 void process (pframes_t nframes);203 void process (pframes_t nframes);
206204
@@ -528,8 +526,6 @@
528526
529 boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>) const;527 boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>) const;
530528
531 std::string path_from_region_name (DataType type, std::string name, std::string identifier);
532
533 boost::shared_ptr<Region> XMLRegionFactory (const XMLNode&, bool full);529 boost::shared_ptr<Region> XMLRegionFactory (const XMLNode&, bool full);
534 boost::shared_ptr<AudioRegion> XMLAudioRegionFactory (const XMLNode&, bool full);530 boost::shared_ptr<AudioRegion> XMLAudioRegionFactory (const XMLNode&, bool full);
535 boost::shared_ptr<MidiRegion> XMLMidiRegionFactory (const XMLNode&, bool full);531 boost::shared_ptr<MidiRegion> XMLMidiRegionFactory (const XMLNode&, bool full);
@@ -582,11 +578,12 @@
582 boost::shared_ptr<AudioFileSource> create_audio_source_for_session (578 boost::shared_ptr<AudioFileSource> create_audio_source_for_session (
583 size_t, std::string const &, uint32_t, bool destructive);579 size_t, std::string const &, uint32_t, bool destructive);
584580
585 boost::shared_ptr<MidiSource> create_midi_source_for_session (581 boost::shared_ptr<MidiSource> create_midi_source_for_session (std::string const &);
586 Track*, std::string const &);582 boost::shared_ptr<MidiSource> create_midi_source_by_stealing_name (boost::shared_ptr<Track>);
587583
588 boost::shared_ptr<Source> source_by_id (const PBD::ID&);584 boost::shared_ptr<Source> source_by_id (const PBD::ID&);
589 boost::shared_ptr<Source> source_by_path_and_channel (const std::string&, uint16_t);585 boost::shared_ptr<AudioFileSource> audio_source_by_path_and_channel (const std::string&, uint16_t) const;
586 boost::shared_ptr<MidiSource> midi_source_by_path (const std::string&) const;
590 uint32_t count_sources_by_origin (const std::string&);587 uint32_t count_sources_by_origin (const std::string&);
591588
592 void add_playlist (boost::shared_ptr<Playlist>, bool unused = false);589 void add_playlist (boost::shared_ptr<Playlist>, bool unused = false);
@@ -1434,7 +1431,7 @@
14341431
1435 bool no_questions_about_missing_files;1432 bool no_questions_about_missing_files;
14361433
1437 std::string get_best_session_directory_for_new_source ();1434 std::string get_best_session_directory_for_new_audio ();
14381435
1439 mutable gint _playback_load;1436 mutable gint _playback_load;
1440 mutable gint _capture_load;1437 mutable gint _capture_load;
14411438
=== modified file 'libs/ardour/ardour/smf_source.h'
--- libs/ardour/ardour/smf_source.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/smf_source.h 2015-05-02 14:23:30 +0000
@@ -36,9 +36,11 @@
36/** Standard Midi File (Type 0) Source */36/** Standard Midi File (Type 0) Source */
37class SMFSource : public MidiSource, public FileSource, public Evoral::SMF {37class SMFSource : public MidiSource, public FileSource, public Evoral::SMF {
38public:38public:
39 /** Constructor for new internal-to-session files */
40 SMFSource (Session& session, const std::string& path, Source::Flag flags);
41
39 /** Constructor for existing external-to-session files */42 /** Constructor for existing external-to-session files */
40 SMFSource (Session& session, const std::string& path,43 SMFSource (Session& session, const std::string& path);
41 Source::Flag flags = Source::Flag(0));
4244
43 /** Constructor for existing in-session files */45 /** Constructor for existing in-session files */
44 SMFSource (Session& session, const XMLNode&, bool must_exist = false);46 SMFSource (Session& session, const XMLNode&, bool must_exist = false);
@@ -49,8 +51,6 @@
49 return safe_midi_file_extension(path);51 return safe_midi_file_extension(path);
50 }52 }
5153
52 bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); }
53
54 void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev);54 void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev);
55 void append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t source_start);55 void append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t source_start);
5656
@@ -68,6 +68,9 @@
68 void ensure_disk_file ();68 void ensure_disk_file ();
6969
70 static bool safe_midi_file_extension (const std::string& path);70 static bool safe_midi_file_extension (const std::string& path);
71 static bool valid_midi_file (const std::string& path);
72
73 void prevent_deletion ();
7174
72 protected:75 protected:
73 void set_path (const std::string& newpath);76 void set_path (const std::string& newpath);
7477
=== modified file 'libs/ardour/ardour/sndfilesource.h'
--- libs/ardour/ardour/sndfilesource.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/sndfilesource.h 2015-05-02 14:23:30 +0000
@@ -38,7 +38,16 @@
38 SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate,38 SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate,
39 Flag flags = SndFileSource::default_writable_flags);39 Flag flags = SndFileSource::default_writable_flags);
4040
41 /** Constructor to be called for existing in-session files */41 /* Constructor to be called for recovering files being used for
42 * capture. They are in-session, they already exist, they should not
43 * be writable. They are an odd hybrid (from a constructor point of
44 * view) of the previous two constructors.
45 */
46 SndFileSource (Session&, const std::string& path, int chn);
47
48 /** Constructor to be called for existing in-session files during
49 * session loading
50 */
42 SndFileSource (Session&, const XMLNode&);51 SndFileSource (Session&, const XMLNode&);
4352
44 ~SndFileSource ();53 ~SndFileSource ();
4554
=== modified file 'libs/ardour/ardour/source.h'
--- libs/ardour/ardour/source.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/source.h 2015-05-02 14:23:30 +0000
@@ -47,7 +47,8 @@
47 RemovableIfEmpty = 0x10,47 RemovableIfEmpty = 0x10,
48 RemoveAtDestroy = 0x20,48 RemoveAtDestroy = 0x20,
49 NoPeakFile = 0x40,49 NoPeakFile = 0x40,
50 Destructive = 0x8050 Destructive = 0x80,
51 Empty = 0x100, /* used for MIDI only */
51 };52 };
5253
53 Source (Session&, DataType type, const std::string& name, Flag flags=Flag(0));54 Source (Session&, DataType type, const std::string& name, Flag flags=Flag(0));
5455
=== modified file 'libs/ardour/ardour/source_factory.h'
--- libs/ardour/ardour/source_factory.h 2013-09-21 19:05:02 +0000
+++ libs/ardour/ardour/source_factory.h 2015-05-02 14:23:30 +0000
@@ -57,6 +57,9 @@
57 bool destructive, framecnt_t rate, bool announce = true, bool async = false);57 bool destructive, framecnt_t rate, bool announce = true, bool async = false);
5858
5959
60 static boost::shared_ptr<Source> createForRecovery
61 (DataType type, Session&, const std::string& path, int chn);
62
60 static boost::shared_ptr<Source> createFromPlaylist63 static boost::shared_ptr<Source> createFromPlaylist
61 (DataType type, Session& s, boost::shared_ptr<Playlist> p, const PBD::ID& orig, const std::string& name,64 (DataType type, Session& s, boost::shared_ptr<Playlist> p, const PBD::ID& orig, const std::string& name,
62 uint32_t chn, frameoffset_t start, framecnt_t len, bool copy, bool defer_peaks);65 uint32_t chn, frameoffset_t start, framecnt_t len, bool copy, bool defer_peaks);
6366
=== modified file 'libs/ardour/ardour/track.h'
--- libs/ardour/ardour/track.h 2013-10-17 11:16:21 +0000
+++ libs/ardour/ardour/track.h 2015-05-02 14:23:30 +0000
@@ -120,7 +120,7 @@
120 bool destructive () const;120 bool destructive () const;
121 std::list<boost::shared_ptr<Source> > & last_capture_sources ();121 std::list<boost::shared_ptr<Source> > & last_capture_sources ();
122 void set_capture_offset ();122 void set_capture_offset ();
123 std::list<boost::shared_ptr<Source> > steal_write_sources();123 std::string steal_write_source_name ();
124 void reset_write_sources (bool, bool force = false);124 void reset_write_sources (bool, bool force = false);
125 float playback_buffer_load () const;125 float playback_buffer_load () const;
126 float capture_buffer_load () const;126 float capture_buffer_load () const;
127127
=== modified file 'libs/ardour/ardour/vestige/aeffectx.h'
--- libs/ardour/ardour/vestige/aeffectx.h 2014-01-24 16:31:54 +0000
+++ libs/ardour/ardour/vestige/aeffectx.h 2015-05-02 14:23:30 +0000
@@ -251,6 +251,7 @@
251251
252typedef struct _VstTimeInfo252typedef struct _VstTimeInfo
253{253{
254<<<<<<< TREE
254 /* info from online documentation of VST provided by Steinberg */255 /* info from online documentation of VST provided by Steinberg */
255256
256 double samplePos;257 double samplePos;
@@ -271,6 +272,26 @@
271} VstTimeInfo;272} VstTimeInfo;
272273
273typedef struct _VstTimeInfo VstTimeInfo;274typedef struct _VstTimeInfo VstTimeInfo;
275=======
276 /* info from online documentation of VST provided by Steinberg */
277
278 double samplePos;
279 double sampleRate;
280 double nanoSeconds;
281 double ppqPos;
282 double tempo;
283 double barStartPos;
284 double cycleStartPos;
285 double cycleEndPos;
286 int32_t timeSigNumerator;
287 int32_t timeSigDenominator;
288 int32_t smpteOffset;
289 int32_t smpteFrameRate;
290 int32_t samplesToNextClock;
291 int32_t flags;
292
293} VstTimeInfo;
294>>>>>>> MERGE-SOURCE
274295
275typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);296typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float);
276297
277298
=== modified file 'libs/ardour/audio_buffer.cc'
--- libs/ardour/audio_buffer.cc 2014-01-24 16:31:54 +0000
+++ libs/ardour/audio_buffer.cc 2015-05-02 14:23:30 +0000
@@ -57,12 +57,6 @@
5757
58 if (_data && size < _capacity) {58 if (_data && size < _capacity) {
59 /* buffer is already large enough */59 /* buffer is already large enough */
60
61 if (size < _size) {
62 /* truncate */
63 _size = size;
64 }
65
66 return;60 return;
67 }61 }
6862
@@ -71,14 +65,17 @@
71 cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size);65 cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size);
7266
73 _capacity = size;67 _capacity = size;
74 _size = 0;
75 _silent = false;68 _silent = false;
76}69}
7770
78bool71bool
79AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) const72AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) const
80{73{
74<<<<<<< TREE
81 for (n = 0; (wholebuffer || n < _size) && n < nframes; ++n) {75 for (n = 0; (wholebuffer || n < _size) && n < nframes; ++n) {
76=======
77 for (n = 0; n < nframes; ++n) {
78>>>>>>> MERGE-SOURCE
82 if (_data[n] != Sample (0)) {79 if (_data[n] != Sample (0)) {
83 return false;80 return false;
84 }81 }
8582
=== modified file 'libs/ardour/audio_diskstream.cc'
--- libs/ardour/audio_diskstream.cc 2013-10-17 11:16:21 +0000
+++ libs/ardour/audio_diskstream.cc 2015-05-02 14:23:30 +0000
@@ -1928,14 +1928,6 @@
1928 return 0;1928 return 0;
1929}1929}
19301930
1931list<boost::shared_ptr<Source> >
1932AudioDiskstream::steal_write_sources()
1933{
1934 /* not possible to steal audio write sources */
1935 list<boost::shared_ptr<Source> > ret;
1936 return ret;
1937}
1938
1939void1931void
1940AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)1932AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
1941{1933{
@@ -2189,11 +2181,16 @@
2189 continue;2181 continue;
2190 }2182 }
21912183
2184 /* XXX as of June 2014, we always record to mono
2185 files. Since this Source is being created as part of
2186 crash recovery, we know that we need the first
2187 channel (the final argument to the SourceFactory
2188 call below). If we ever support non-mono files for
2189 capture, this will need rethinking.
2190 */
2191
2192 try {2192 try {
2193 fs = boost::dynamic_pointer_cast<AudioFileSource> (2193 fs = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createForRecovery (DataType::AUDIO, _session, prop->value(), 0));
2194 SourceFactory::createWritable (
2195 DataType::AUDIO, _session,
2196 prop->value(), false, _session.frame_rate()));
2197 }2194 }
21982195
2199 catch (failed_constructor& err) {2196 catch (failed_constructor& err) {
@@ -2224,21 +2221,31 @@
2224 return -1;2221 return -1;
2225 }2222 }
22262223
2227 boost::shared_ptr<AudioRegion> region;
2228
2229 try {2224 try {
22302225
2226 boost::shared_ptr<AudioRegion> wf_region;
2227 boost::shared_ptr<AudioRegion> region;
2228
2229 /* First create the whole file region */
2230
2231 PropertyList plist;2231 PropertyList plist;
22322232
2233 plist.add (Properties::start, 0);2233 plist.add (Properties::start, 0);
2234 plist.add (Properties::length, first_fs->length (first_fs->timeline_position()));2234 plist.add (Properties::length, first_fs->length (first_fs->timeline_position()));
2235 plist.add (Properties::name, region_name_from_path (first_fs->name(), true));2235 plist.add (Properties::name, region_name_from_path (first_fs->name(), true));
22362236
2237 wf_region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist));
2238
2239 wf_region->set_automatic (true);
2240 wf_region->set_whole_file (true);
2241 wf_region->special_set_position (position);
2242
2243 /* Now create a region that isn't the whole file for adding to
2244 * the playlist */
2245
2237 region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist));2246 region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist));
22382247
2239 region->set_automatic (true);2248 _playlist->add_region (region, position);
2240 region->set_whole_file (true);
2241 region->special_set_position (0);
2242 }2249 }
22432250
2244 catch (failed_constructor& err) {2251 catch (failed_constructor& err) {
@@ -2249,7 +2256,6 @@
2249 return -1;2256 return -1;
2250 }2257 }
22512258
2252 _playlist->add_region (region, position);
22532259
2254 return 0;2260 return 0;
2255}2261}
22562262
=== modified file 'libs/ardour/audiofilesource.cc'
--- libs/ardour/audiofilesource.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/audiofilesource.cc 2015-05-02 14:23:30 +0000
@@ -36,6 +36,7 @@
36#include "pbd/stl_delete.h"36#include "pbd/stl_delete.h"
37#include "pbd/strsplit.h"37#include "pbd/strsplit.h"
38#include "pbd/shortpath.h"38#include "pbd/shortpath.h"
39#include "pbd/stacktrace.h"
39#include "pbd/enumwriter.h"40#include "pbd/enumwriter.h"
4041
41#include <sndfile.h>42#include <sndfile.h>
@@ -114,6 +115,22 @@
114 }115 }
115}116}
116117
118/** Constructor used for existing internal-to-session files during crash
119 * recovery. File must exist
120 */
121AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags, bool /* ignored-exists-for-prototype differentiation */)
122 : Source (s, DataType::AUDIO, path, flags)
123 , AudioSource (s, path)
124 , FileSource (s, DataType::AUDIO, path, string(), flags)
125{
126 /* note that origin remains empty */
127
128 if (init (_path, true)) {
129 throw failed_constructor ();
130 }
131}
132
133
117/** Constructor used for existing internal-to-session files via XML. File must exist. */134/** Constructor used for existing internal-to-session files via XML. File must exist. */
118AudioFileSource::AudioFileSource (Session& s, const XMLNode& node, bool must_exist)135AudioFileSource::AudioFileSource (Session& s, const XMLNode& node, bool must_exist)
119 : Source (s, node)136 : Source (s, node)
120137
=== modified file 'libs/ardour/automation_control.cc'
--- libs/ardour/automation_control.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/automation_control.cc 2015-05-02 14:23:30 +0000
@@ -117,15 +117,23 @@
117void117void
118AutomationControl::start_touch(double when)118AutomationControl::start_touch(double when)
119{119{
120 set_touching (true);120 if (!touching()) {
121 alist()->start_touch(when);121 if (alist()->automation_state() == Touch) {
122 AutomationWatch::instance().add_automation_watch (shared_from_this());122 alist()->start_touch (when);
123 AutomationWatch::instance().add_automation_watch (shared_from_this());
124 }
125 set_touching (true);
126 }
123}127}
124128
125void129void
126AutomationControl::stop_touch(bool mark, double when)130AutomationControl::stop_touch(bool mark, double when)
127{131{
128 set_touching (false);132 if (touching()) {
129 alist()->stop_touch (mark, when);133 set_touching (false);
130 AutomationWatch::instance().remove_automation_watch (shared_from_this());134 if (alist()->automation_state() == Touch) {
135 alist()->stop_touch (mark, when);
136 AutomationWatch::instance().remove_automation_watch (shared_from_this());
137 }
138 }
131}139}
132140
=== modified file 'libs/ardour/automation_watch.cc'
--- libs/ardour/automation_watch.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/automation_watch.cc 2015-05-02 14:23:30 +0000
@@ -122,7 +122,7 @@
122122
123 for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {123 for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {
124 if ((*aw)->alist()->automation_write()) {124 if ((*aw)->alist()->automation_write()) {
125 (*aw)->list()->add (time, (*aw)->user_double());125 (*aw)->list()->add (time, (*aw)->user_double(), true);
126 }126 }
127 }127 }
128 }128 }
129129
=== modified file 'libs/ardour/coreaudiosource.cc'
--- libs/ardour/coreaudiosource.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/coreaudiosource.cc 2015-05-02 14:23:30 +0000
@@ -28,6 +28,8 @@
28#include <appleutility/CAAudioFile.h>28#include <appleutility/CAAudioFile.h>
29#include <appleutility/CAStreamBasicDescription.h>29#include <appleutility/CAStreamBasicDescription.h>
3030
31#include <glibmm/fileutils.h>
32
31#include "i18n.h"33#include "i18n.h"
3234
33#include <AudioToolbox/AudioFormat.h>35#include <AudioToolbox/AudioFormat.h>
@@ -36,21 +38,32 @@
36using namespace ARDOUR;38using namespace ARDOUR;
37using namespace PBD;39using namespace PBD;
3840
41/** Create a new CoreAudioSource using session state, which implies that the
42 * file must already exist.
43 */
39CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node)44CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node)
40 : Source (s, node)45 : Source (s, node)
41 , AudioFileSource (s, node)46 , AudioFileSource (s, node)
42{47{
43 init_cafile ();48 init_cafile ();
49
50 assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
51 existence_check ();
44}52}
4553
54/** Create a new CoreAudioSource from an existing file. Sources created with this
55 * method are never writable or removable.
56 */
46CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags)57CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags)
47 /* files created this way are never writable or removable */
48 : Source (s, DataType::AUDIO, path, Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))),58 : Source (s, DataType::AUDIO, path, Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))),
49 AudioFileSource (s, path,59 AudioFileSource (s, path,
50 Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))60 Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))
51{61{
52 _channel = chn;62 _channel = chn;
53 init_cafile ();63 init_cafile ();
64
65 assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
66 existence_check ();
54}67}
5568
56void69void
5770
=== modified file 'libs/ardour/delivery.cc'
--- libs/ardour/delivery.cc 2014-01-24 16:31:54 +0000
+++ libs/ardour/delivery.cc 2015-05-02 14:23:30 +0000
@@ -397,7 +397,11 @@
397 if (panners_legal) {397 if (panners_legal) {
398 if (!_no_panner_reset) {398 if (!_no_panner_reset) {
399399
400<<<<<<< TREE
400 if (_panshell && _role != Insert) {401 if (_panshell && _role != Insert) {
402=======
403 if (_panshell && _role != Insert && _role != Listen) {
404>>>>>>> MERGE-SOURCE
401 _panshell->configure_io (ChanCount (DataType::AUDIO, pans_required()), ChanCount (DataType::AUDIO, pan_outs()));405 _panshell->configure_io (ChanCount (DataType::AUDIO, pans_required()), ChanCount (DataType::AUDIO, pan_outs()));
402 }406 }
403 }407 }
404408
=== modified file 'libs/ardour/diskstream.cc'
--- libs/ardour/diskstream.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/diskstream.cc 2015-05-02 14:23:30 +0000
@@ -739,4 +739,3 @@
739{739{
740 g_atomic_int_set (&_record_enabled, 0);740 g_atomic_int_set (&_record_enabled, 0);
741}741}
742
743742
=== modified file 'libs/ardour/enums.cc'
--- libs/ardour/enums.cc 2013-12-23 22:07:52 +0000
+++ libs/ardour/enums.cc 2015-05-02 14:23:30 +0000
@@ -447,6 +447,7 @@
447 REGISTER_CLASS_ENUM (Source, RemoveAtDestroy);447 REGISTER_CLASS_ENUM (Source, RemoveAtDestroy);
448 REGISTER_CLASS_ENUM (Source, NoPeakFile);448 REGISTER_CLASS_ENUM (Source, NoPeakFile);
449 REGISTER_CLASS_ENUM (Source, Destructive);449 REGISTER_CLASS_ENUM (Source, Destructive);
450 REGISTER_CLASS_ENUM (Source, Empty);
450 REGISTER_BITS (_Source_Flag);451 REGISTER_BITS (_Source_Flag);
451452
452 REGISTER_ENUM (FadeLinear);453 REGISTER_ENUM (FadeLinear);
453454
=== modified file 'libs/ardour/export_channel.cc'
--- libs/ardour/export_channel.cc 2013-12-23 22:07:52 +0000
+++ libs/ardour/export_channel.cc 2015-05-02 14:23:30 +0000
@@ -239,7 +239,7 @@
239{239{
240 assert(processor);240 assert(processor);
241 AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel);241 AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel);
242 assert (frames <= (framecnt_t) buffer.size());242 assert (frames <= (framecnt_t) buffer.capacity());
243 data = buffer.data();243 data = buffer.data();
244}244}
245245
246246
=== modified file 'libs/ardour/file_source.cc'
--- libs/ardour/file_source.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/file_source.cc 2015-05-02 14:23:30 +0000
@@ -56,14 +56,12 @@
56FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag)56FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag)
57 : Source(session, type, path, flag)57 : Source(session, type, path, flag)
58 , _path (path)58 , _path (path)
59 , _file_is_new (!origin.empty()) // origin empty => new file VS. origin !empty => new file59 , _file_is_new (!origin.empty()) // if origin is left unspecified (empty string) then file must exist
60 , _channel (0)60 , _channel (0)
61 , _origin (origin)61 , _origin (origin)
62 , _open (false)62 , _open (false)
63{63{
64 set_within_session_from_path (path);64 set_within_session_from_path (path);
65
66 prevent_deletion ();
67}65}
6866
69FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist*/)67FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist*/)
@@ -77,23 +75,28 @@
7775
78 _path = _name;76 _path = _name;
79 _within_session = true;77 _within_session = true;
8078}
81 prevent_deletion ();79
80FileSource::~FileSource()
81{
82}
83
84void
85FileSource::existence_check ()
86{
87 if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) {
88 prevent_deletion ();
89 }
82}90}
8391
84void92void
85FileSource::prevent_deletion ()93FileSource::prevent_deletion ()
86{94{
87 /* if this file already exists, it cannot be removed, ever95 if (!(_flags & Destructive)) {
88 */96 mark_immutable ();
8997 } else {
90 if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) {98 _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
91 if (!(_flags & Destructive)) {99 }
92 mark_immutable ();
93 } else {
94 _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
95 }
96 }
97}100}
98101
99bool102bool
@@ -101,7 +104,7 @@
101{104{
102 bool r = ((_flags & Removable)105 bool r = ((_flags & Removable)
103 && ((_flags & RemoveAtDestroy) ||106 && ((_flags & RemoveAtDestroy) ||
104 ((_flags & RemovableIfEmpty) && empty() == 0)));107 ((_flags & RemovableIfEmpty) && empty())));
105108
106 return r;109 return r;
107}110}
@@ -211,7 +214,7 @@
211214
212 if (move_dependents_to_trash() != 0) {215 if (move_dependents_to_trash() != 0) {
213 /* try to back out */216 /* try to back out */
214 rename (newpath.c_str(), _path.c_str());217 ::rename (newpath.c_str(), _path.c_str());
215 return -1;218 return -1;
216 }219 }
217220
@@ -253,8 +256,6 @@
253256
254 split (search_path, dirs, ':');257 split (search_path, dirs, ':');
255258
256 hits.clear ();
257
258 for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) {259 for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) {
259260
260 fullpath = Glib::build_filename (*i, path);261 fullpath = Glib::build_filename (*i, path);
@@ -309,9 +310,9 @@
309 /* no match: error */310 /* no match: error */
310311
311 if (must_exist) {312 if (must_exist) {
312 error << string_compose(313 /* do not generate an error here, leave that to
313 _("Filesource: cannot find required file (%1): while searching %2"),314 whoever deals with the false return value.
314 path, search_path) << endmsg;315 */
315 goto out;316 goto out;
316 } else {317 } else {
317 isnew = true;318 isnew = true;
@@ -322,16 +323,17 @@
322 323
323 keeppath = de_duped_hits[0];324 keeppath = de_duped_hits[0];
324 }325 }
325 326
326 } else {327 } else {
327 keeppath = path;328 keeppath = path;
328 }329 }
329330
330 /* Current find() is unable to parse relative path names to yet non-existant331 /* Current find() is unable to parse relative path names to yet non-existant
331 sources. QuickFix(tm)332 sources. QuickFix(tm)
332 */333 */
333 if (keeppath == "") {334
334 if (must_exist) {335 if (keeppath.empty()) {
336 if (must_exist) {
335 error << "FileSource::find(), keeppath = \"\", but the file must exist" << endl;337 error << "FileSource::find(), keeppath = \"\", but the file must exist" << endl;
336 } else {338 } else {
337 keeppath = path;339 keeppath = path;
@@ -518,35 +520,6 @@
518 return ret;520 return ret;
519}521}
520522
521int
522FileSource::set_source_name (const string& newname, bool destructive)
523{
524 Glib::Threads::Mutex::Lock lm (_lock);
525 string oldpath = _path;
526 string newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive);
527
528 if (newpath.empty()) {
529 error << string_compose (_("programming error: %1"), "cannot generate a changed file path") << endmsg;
530 return -1;
531 }
532
533 // Test whether newpath exists, if yes notify the user but continue.
534 if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) {
535 error << string_compose (_("Programming error! %1 tried to rename a file over another file! It's safe to continue working, but please report this to the developers."), PROGRAM_NAME) << endmsg;
536 return -1;
537 }
538
539 if (::rename (oldpath.c_str(), newpath.c_str()) != 0) {
540 error << string_compose (_("cannot rename file %1 to %2 (%3)"), oldpath, newpath, strerror(errno)) << endmsg;
541 return -1;
542 }
543
544 _name = Glib::path_get_basename (newpath);
545 _path = newpath;
546
547 return 0;
548}
549
550void523void
551FileSource::mark_immutable ()524FileSource::mark_immutable ()
552{525{
@@ -589,3 +562,46 @@
589 Source::inc_use_count ();562 Source::inc_use_count ();
590}563}
591564
565bool
566FileSource::is_stub () const
567{
568 if (!empty()) {
569 return false;
570 }
571
572 if (!removable()) {
573 return false;
574 }
575
576 if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) {
577 return false;
578 }
579
580 return true;
581}
582
583int
584FileSource::rename (const string& newpath)
585{
586 Glib::Threads::Mutex::Lock lm (_lock);
587 string oldpath = _path;
588
589 // Test whether newpath exists, if yes notify the user but continue.
590 if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) {
591 error << string_compose (_("Programming error! %1 tried to rename a file over another file! It's safe to continue working, but please report this to the developers."), PROGRAM_NAME) << endmsg;
592 return -1;
593 }
594
595 if (Glib::file_test (oldpath.c_str(), Glib::FILE_TEST_EXISTS)) {
596 /* rename only needed if file exists on disk */
597 if (::rename (oldpath.c_str(), newpath.c_str()) != 0) {
598 error << string_compose (_("cannot rename file %1 to %2 (%3)"), oldpath, newpath, strerror(errno)) << endmsg;
599 return -1;
600 }
601 }
602
603 _name = Glib::path_get_basename (newpath);
604 _path = newpath;
605
606 return 0;
607}
592608
=== modified file 'libs/ardour/filter.cc'
--- libs/ardour/filter.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/filter.cc 2015-05-02 14:23:30 +0000
@@ -59,10 +59,9 @@
59 }59 }
60 }60 }
6161
62 string path = session.path_from_region_name (region->data_type(),62 string path = session.new_audio_source_path (name, region->n_channels(), i, false, false);
63 PBD::basename_nosuffix (names[i]), string (""));
6463
65 if (path.length() == 0) {64 if (path.empty()) {
66 error << string_compose (_("filter: error creating name for new file based on %1"), region->name())65 error << string_compose (_("filter: error creating name for new file based on %1"), region->name())
67 << endmsg;66 << endmsg;
68 return -1;67 return -1;
6968
=== modified file 'libs/ardour/import.cc'
--- libs/ardour/import.cc 2013-09-21 19:05:02 +0000
+++ libs/ardour/import.cc 2015-05-02 14:23:30 +0000
@@ -116,78 +116,31 @@
116 }116 }
117}117}
118118
119static std::string119vector<string>
120get_non_existent_filename (HeaderFormat hf, DataType type, const bool allow_replacing, const std::string& destdir, const std::string& basename, uint channel, uint channels)120Session::get_paths_for_new_sources (bool /*allow_replacing*/, const string& import_file_path, uint32_t channels)
121{
122 char buf[PATH_MAX+1];
123 bool goodfile = false;
124 string base = basename;
125 string ext = native_header_format_extension (hf, type);
126 uint32_t cnt = 1;
127
128 do {
129
130 if (type == DataType::AUDIO && channels == 2) {
131 if (channel == 0) {
132 if (cnt == 1) {
133 snprintf (buf, sizeof(buf), "%s-L%s", base.c_str(), ext.c_str());
134 } else {
135 snprintf (buf, sizeof(buf), "%s-%d-L%s", base.c_str(), cnt, ext.c_str());
136 }
137 } else {
138 if (cnt == 1) {
139 snprintf (buf, sizeof(buf), "%s-R%s", base.c_str(), ext.c_str());
140 } else {
141 snprintf (buf, sizeof(buf), "%s-%d-R%s", base.c_str(), cnt, ext.c_str());
142 }
143 }
144 } else if (channels > 1) {
145 if (cnt == 1) {
146 snprintf (buf, sizeof(buf), "%s-c%d%s", base.c_str(), channel, ext.c_str());
147 } else {
148 snprintf (buf, sizeof(buf), "%s-%d-c%d%s", base.c_str(), cnt, channel, ext.c_str());
149 }
150 } else {
151 if (cnt == 1) {
152 snprintf (buf, sizeof(buf), "%s%s", base.c_str(), ext.c_str());
153 } else {
154 snprintf (buf, sizeof(buf), "%s-%d%s", base.c_str(), cnt, ext.c_str());
155 }
156 }
157
158 string tempname = destdir + "/" + buf;
159
160 if (!allow_replacing && Glib::file_test (tempname, Glib::FILE_TEST_EXISTS)) {
161
162 cnt++;
163
164 } else {
165
166 goodfile = true;
167 }
168
169 } while (!goodfile);
170
171 return buf;
172}
173
174static vector<string>
175get_paths_for_new_sources (HeaderFormat hf, const bool allow_replacing, const string& import_file_path, const string& session_dir, uint channels)
176{121{
177 vector<string> new_paths;122 vector<string> new_paths;
178 const string basename = basename_nosuffix (import_file_path);123 const string basename = basename_nosuffix (import_file_path);
179124
180 SessionDirectory sdir(session_dir);
181
182 for (uint n = 0; n < channels; ++n) {125 for (uint n = 0; n < channels; ++n) {
183126
184 const DataType type = SMFSource::safe_midi_file_extension (import_file_path) ? DataType::MIDI : DataType::AUDIO;127 const DataType type = SMFSource::safe_midi_file_extension (import_file_path) ? DataType::MIDI : DataType::AUDIO;
185128 string filepath;
186 std::string filepath = (type == DataType::MIDI)129
187 ? sdir.midi_path() : sdir.sound_path();130 switch (type) {
188131 case DataType::MIDI:
189 filepath = Glib::build_filename (filepath,132 filepath = new_midi_source_path (basename);
190 get_non_existent_filename (hf, type, allow_replacing, filepath, basename, n, channels));133 break;
134 case DataType::AUDIO:
135 filepath = new_audio_source_path (basename, channels, n, false, false);
136 break;
137 }
138
139 if (filepath.empty()) {
140 error << string_compose (_("Cannot find new filename for imported file %1"), import_file_path) << endmsg;
141 return vector<string>();
142 }
143
191 new_paths.push_back (filepath);144 new_paths.push_back (filepath);
192 }145 }
193146
@@ -201,7 +154,7 @@
201 for (vector<string>::const_iterator i = new_paths.begin();154 for (vector<string>::const_iterator i = new_paths.begin();
202 i != new_paths.end(); ++i)155 i != new_paths.end(); ++i)
203 {156 {
204 boost::shared_ptr<Source> source = session->source_by_path_and_channel(*i, 0);157 boost::shared_ptr<Source> source = session->audio_source_by_path_and_channel(*i, 0);
205158
206 if (source == 0) {159 if (source == 0) {
207 error << string_compose(_("Could not find a source for %1 even though we are updating this file!"), (*i)) << endl;160 error << string_compose(_("Could not find a source for %1 even though we are updating this file!"), (*i)) << endl;
@@ -274,12 +227,12 @@
274{227{
275 const framecnt_t nframes = ResampledImportableSource::blocksize;228 const framecnt_t nframes = ResampledImportableSource::blocksize;
276 boost::shared_ptr<AudioFileSource> afs;229 boost::shared_ptr<AudioFileSource> afs;
277 uint channels = source->channels();230 uint32_t channels = source->channels();
278231
279 boost::scoped_array<float> data(new float[nframes * channels]);232 boost::scoped_array<float> data(new float[nframes * channels]);
280 vector<boost::shared_array<Sample> > channel_data;233 vector<boost::shared_array<Sample> > channel_data;
281234
282 for (uint n = 0; n < channels; ++n) {235 for (uint32_t n = 0; n < channels; ++n) {
283 channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes]));236 channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes]));
284 }237 }
285238
@@ -323,14 +276,14 @@
323 progress_multiplier = 0.5;276 progress_multiplier = 0.5;
324 progress_base = 0.5;277 progress_base = 0.5;
325 }278 }
326279
327 uint read_count = 0;280 framecnt_t read_count = 0;
328281
329 while (!status.cancel) {282 while (!status.cancel) {
330283
331 framecnt_t nread, nfread;284 framecnt_t nread, nfread;
332 uint x;285 uint32_t x;
333 uint chn;286 uint32_t chn;
334287
335 if ((nread = source->read (data.get(), nframes)) == 0) {288 if ((nread = source->read (data.get(), nframes)) == 0) {
336 break;289 break;
@@ -513,10 +466,7 @@
513 }466 }
514 }467 }
515468
516 vector<string> new_paths = get_paths_for_new_sources (config.get_native_file_header_format(),469 vector<string> new_paths = get_paths_for_new_sources (status.replace_existing_source, *p, channels);
517 status.replace_existing_source, *p,
518 get_best_session_directory_for_new_source (),
519 channels);
520 Sources newfiles;470 Sources newfiles;
521 framepos_t natural_position = source ? source->natural_position() : 0;471 framepos_t natural_position = source ? source->natural_position() : 0;
522472
523473
=== modified file 'libs/ardour/internal_send.cc'
--- libs/ardour/internal_send.cc 2014-01-24 16:31:54 +0000
+++ libs/ardour/internal_send.cc 2015-05-02 14:23:30 +0000
@@ -129,7 +129,7 @@
129 // we have to copy the input, because we may alter the buffers with the amp129 // we have to copy the input, because we may alter the buffers with the amp
130 // in-place, which a send must never do.130 // in-place, which a send must never do.
131131
132 if (_panshell && !_panshell->bypassed()) {132 if (_panshell && !_panshell->bypassed() && role() != Listen) {
133 _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes);133 _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes);
134 } else {134 } else {
135 if (role() == Listen) {135 if (role() == Listen) {
136136
=== modified file 'libs/ardour/lv2_evbuf.c'
--- libs/ardour/lv2_evbuf.c 2013-09-21 19:05:02 +0000
+++ libs/ardour/lv2_evbuf.c 2015-05-02 14:23:30 +0000
@@ -203,7 +203,7 @@
203 switch (iter.evbuf->type) {203 switch (iter.evbuf->type) {
204 case LV2_EVBUF_EVENT:204 case LV2_EVBUF_EVENT:
205 ebuf = &iter.evbuf->buf.event;205 ebuf = &iter.evbuf->buf.event;
206 ev = (LV2_Event*)ebuf->data + iter.offset;206 ev = (LV2_Event*)((char*)ebuf->data + iter.offset);
207 *frames = ev->frames;207 *frames = ev->frames;
208 *subframes = ev->subframes;208 *subframes = ev->subframes;
209 *type = ev->type;209 *type = ev->type;
210210
=== modified file 'libs/ardour/lv2_plugin.cc'
--- libs/ardour/lv2_plugin.cc 2014-01-24 16:31:54 +0000
+++ libs/ardour/lv2_plugin.cc 2015-05-02 14:23:30 +0000
@@ -31,6 +31,7 @@
3131
32#include <boost/utility.hpp>32#include <boost/utility.hpp>
3333
34#include "pbd/clear_dir.h"
34#include "pbd/pathscanner.h"35#include "pbd/pathscanner.h"
35#include "pbd/compose.h"36#include "pbd/compose.h"
36#include "pbd/error.h"37#include "pbd/error.h"
@@ -880,27 +881,6 @@
880 return g_strndup(abs_path.c_str(), abs_path.length());881 return g_strndup(abs_path.c_str(), abs_path.length());
881}882}
882883
883static void
884remove_directory(const std::string& path)
885{
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: