Merge lp:~zequence/ubuntu/trusty/ardour3/fix-for-1450992 into lp:ubuntu/trusty/ardour3
- Trusty (14.04)
- fix-for-1450992
- Merge into trusty
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Micah Gersten (community) | Disapprove | ||
Review via email: mp+258099@code.launchpad.net |
Commit message
Description of the change
Fix for bug 1450992.
This is the last release of ardour3.
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
1 | === modified file '.pc/applied-patches' | |||
2 | --- .pc/applied-patches 2013-11-06 13:22:44 +0000 | |||
3 | +++ .pc/applied-patches 2015-05-02 14:23:30 +0000 | |||
4 | @@ -1,2 +1,4 @@ | |||
5 | 1 | waf.patch | 1 | waf.patch |
6 | 2 | wscript.patch | 2 | wscript.patch |
7 | 3 | log-stdout.patch | ||
8 | 4 | midi-data-loss.patch | ||
9 | 3 | 5 | ||
10 | === added directory '.pc/log-stdout.patch' | |||
11 | === added file '.pc/log-stdout.patch/wscript' | |||
12 | --- .pc/log-stdout.patch/wscript 1970-01-01 00:00:00 +0000 | |||
13 | +++ .pc/log-stdout.patch/wscript 2015-05-02 14:23:30 +0000 | |||
14 | @@ -0,0 +1,822 @@ | |||
15 | 1 | #!/usr/bin/env python | ||
16 | 2 | from waflib.extras import autowaf as autowaf | ||
17 | 3 | from waflib import Options | ||
18 | 4 | import os | ||
19 | 5 | import re | ||
20 | 6 | import string | ||
21 | 7 | import subprocess | ||
22 | 8 | import sys | ||
23 | 9 | |||
24 | 10 | def fetch_git_revision (): | ||
25 | 11 | cmd = "git describe HEAD" | ||
26 | 12 | output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() | ||
27 | 13 | rev = output[0].decode ('utf-8') | ||
28 | 14 | return rev | ||
29 | 15 | |||
30 | 16 | def fetch_tarball_revision (): | ||
31 | 17 | if not os.path.exists ('libs/ardour/revision.cc'): | ||
32 | 18 | print 'This tarball was not created correctly - it is missing libs/ardour/revision.cc' | ||
33 | 19 | sys.exit (1) | ||
34 | 20 | with open('libs/ardour/revision.cc') as f: | ||
35 | 21 | content = f.readlines() | ||
36 | 22 | remove_punctuation_map = dict((ord(char), None) for char in '";') | ||
37 | 23 | return content[1].decode('utf-8').strip().split(' ')[7].translate (remove_punctuation_map) | ||
38 | 24 | |||
39 | 25 | rev = fetch_tarball_revision () | ||
40 | 26 | |||
41 | 27 | # | ||
42 | 28 | # rev is now of the form MAJOR.MINOR-rev-commit | ||
43 | 29 | # | ||
44 | 30 | |||
45 | 31 | parts = rev.split ('.') | ||
46 | 32 | MAJOR = parts[0] | ||
47 | 33 | MINOR = parts[1] | ||
48 | 34 | MICRO = parts[2] | ||
49 | 35 | |||
50 | 36 | V = MAJOR + '.' + MINOR + '.' + MICRO | ||
51 | 37 | # | ||
52 | 38 | # it is important that VERSION *not* be unicode string | ||
53 | 39 | # because if it is, it breaks waf somehow. | ||
54 | 40 | # | ||
55 | 41 | VERSION = V.encode ('ascii', 'ignore') | ||
56 | 42 | APPNAME = 'Ardour' + MAJOR | ||
57 | 43 | |||
58 | 44 | # Mandatory variables | ||
59 | 45 | top = '.' | ||
60 | 46 | out = 'build' | ||
61 | 47 | |||
62 | 48 | children = [ | ||
63 | 49 | 'libs/pbd', | ||
64 | 50 | 'libs/midi++2', | ||
65 | 51 | 'libs/evoral', | ||
66 | 52 | 'libs/vamp-sdk', | ||
67 | 53 | 'libs/qm-dsp', | ||
68 | 54 | 'libs/vamp-plugins', | ||
69 | 55 | 'libs/taglib', | ||
70 | 56 | 'libs/libltc', | ||
71 | 57 | 'libs/rubberband', | ||
72 | 58 | 'libs/surfaces', | ||
73 | 59 | 'libs/panners', | ||
74 | 60 | 'libs/backends', | ||
75 | 61 | 'libs/timecode', | ||
76 | 62 | 'libs/ardour', | ||
77 | 63 | 'libs/gtkmm2ext', | ||
78 | 64 | 'libs/clearlooks-newer', | ||
79 | 65 | 'libs/audiographer', | ||
80 | 66 | 'libs/plugins/reasonablesynth.lv2', | ||
81 | 67 | 'gtk2_ardour', | ||
82 | 68 | 'export', | ||
83 | 69 | 'midi_maps', | ||
84 | 70 | 'mcp', | ||
85 | 71 | 'patchfiles' | ||
86 | 72 | ] | ||
87 | 73 | |||
88 | 74 | i18n_children = [ | ||
89 | 75 | 'gtk2_ardour', | ||
90 | 76 | 'libs/ardour', | ||
91 | 77 | 'libs/gtkmm2ext', | ||
92 | 78 | ] | ||
93 | 79 | |||
94 | 80 | if sys.platform == 'linux2': | ||
95 | 81 | children += [ 'tools/sanity_check' ] | ||
96 | 82 | lxvst_default = True | ||
97 | 83 | elif sys.platform == 'darwin': | ||
98 | 84 | children += [ 'libs/appleutility' ] | ||
99 | 85 | lxvst_default = False | ||
100 | 86 | else: | ||
101 | 87 | lxvst_default = False | ||
102 | 88 | |||
103 | 89 | # Version stuff | ||
104 | 90 | |||
105 | 91 | def fetch_gcc_version (CC): | ||
106 | 92 | cmd = "LANG= %s --version" % CC | ||
107 | 93 | output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines() | ||
108 | 94 | o = output[0].decode('utf-8') | ||
109 | 95 | version = o.split(' ')[2].split('.') | ||
110 | 96 | return version | ||
111 | 97 | |||
112 | 98 | def create_stored_revision(): | ||
113 | 99 | rev = "" | ||
114 | 100 | if os.path.exists('.git'): | ||
115 | 101 | rev = fetch_git_revision(); | ||
116 | 102 | print("Git version: " + rev + "\n") | ||
117 | 103 | elif os.path.exists('libs/ardour/revision.cc'): | ||
118 | 104 | print("Using packaged revision") | ||
119 | 105 | return | ||
120 | 106 | else: | ||
121 | 107 | print("Missing libs/ardour/revision.cc. Blame the packager.") | ||
122 | 108 | sys.exit(-1) | ||
123 | 109 | |||
124 | 110 | try: | ||
125 | 111 | # | ||
126 | 112 | # if you change the format of this, be sure to fix fetch_tarball_revision() above | ||
127 | 113 | # so that it still works. | ||
128 | 114 | # | ||
129 | 115 | text = '#include "ardour/revision.h"\n' | ||
130 | 116 | text += 'namespace ARDOUR { const char* revision = \"%s\"; }\n' % rev | ||
131 | 117 | print('Writing revision info to libs/ardour/revision.cc using ' + rev) | ||
132 | 118 | o = open('libs/ardour/revision.cc', 'w') | ||
133 | 119 | o.write(text) | ||
134 | 120 | o.close() | ||
135 | 121 | except IOError: | ||
136 | 122 | print('Could not open libs/ardour/revision.cc for writing\n') | ||
137 | 123 | sys.exit(-1) | ||
138 | 124 | |||
139 | 125 | def set_compiler_flags (conf,opt): | ||
140 | 126 | # | ||
141 | 127 | # Compiler flags and other system-dependent stuff | ||
142 | 128 | # | ||
143 | 129 | |||
144 | 130 | build_host_supports_sse = False | ||
145 | 131 | |||
146 | 132 | # Flags necessary for building | ||
147 | 133 | compiler_flags = [] # generic | ||
148 | 134 | c_flags = [] # C-specific | ||
149 | 135 | cxx_flags = [] # C++-specific | ||
150 | 136 | linker_flags = [] | ||
151 | 137 | |||
152 | 138 | # Optimization flags (overridable) | ||
153 | 139 | optimization_flags = [] | ||
154 | 140 | |||
155 | 141 | # Debugging flags | ||
156 | 142 | debug_flags = [] | ||
157 | 143 | |||
158 | 144 | u = os.uname () | ||
159 | 145 | cpu = u[4] | ||
160 | 146 | platform = u[0].lower() | ||
161 | 147 | version = u[2] | ||
162 | 148 | |||
163 | 149 | # waf adds -O0 -g itself. thanks waf! | ||
164 | 150 | is_clang = conf.env['CXX'][0].endswith('clang++') | ||
165 | 151 | |||
166 | 152 | if conf.options.cxx11: | ||
167 | 153 | conf.check_cxx(cxxflags=["-std=c++11"]) | ||
168 | 154 | cxx_flags.append('-std=c++11') | ||
169 | 155 | if platform == "darwin": | ||
170 | 156 | cxx_flags.append('-stdlib=libc++') | ||
171 | 157 | link_flags.append('-lc++') | ||
172 | 158 | # Prevents visibility issues in standard headers | ||
173 | 159 | conf.define("_DARWIN_C_SOURCE", 1) | ||
174 | 160 | |||
175 | 161 | if conf.options.asan: | ||
176 | 162 | conf.check_cxx(cxxflags=["-fsanitize=address", "-fno-omit-frame-pointer"], linkflags=["-fsanitize=address"]) | ||
177 | 163 | cxx_flags.append('-fsanitize=address') | ||
178 | 164 | cxx_flags.append('-fno-omit-frame-pointer') | ||
179 | 165 | linker_flags.append('-fsanitize=address') | ||
180 | 166 | |||
181 | 167 | if is_clang and platform == "darwin": | ||
182 | 168 | # Silence warnings about the non-existing osx clang compiler flags | ||
183 | 169 | # -compatibility_version and -current_version. These are Waf | ||
184 | 170 | # generated and not needed with clang | ||
185 | 171 | cxx_flags.append("-Qunused-arguments") | ||
186 | 172 | |||
187 | 173 | if opt.gprofile: | ||
188 | 174 | debug_flags = [ '-pg' ] | ||
189 | 175 | |||
190 | 176 | # Autodetect | ||
191 | 177 | if opt.dist_target == 'auto': | ||
192 | 178 | if platform == 'darwin': | ||
193 | 179 | # The [.] matches to the dot after the major version, "." would match any character | ||
194 | 180 | if re.search ("^[0-7][.]", version) != None: | ||
195 | 181 | conf.env['build_target'] = 'panther' | ||
196 | 182 | elif re.search ("^8[.]", version) != None: | ||
197 | 183 | conf.env['build_target'] = 'tiger' | ||
198 | 184 | elif re.search ("^9[.]", version) != None: | ||
199 | 185 | conf.env['build_target'] = 'leopard' | ||
200 | 186 | elif re.search ("^10[.]", version) != None: | ||
201 | 187 | conf.env['build_target'] = 'snowleopard' | ||
202 | 188 | elif re.search ("^11[.]", version) != None: | ||
203 | 189 | conf.env['build_target'] = 'lion' | ||
204 | 190 | else: | ||
205 | 191 | conf.env['build_target'] = 'mountainlion' | ||
206 | 192 | else: | ||
207 | 193 | match = re.search( | ||
208 | 194 | "(?P<cpu>i[0-6]86|x86_64|powerpc|ppc|ppc64|arm|s390x?)", | ||
209 | 195 | cpu) | ||
210 | 196 | if (match): | ||
211 | 197 | conf.env['build_target'] = match.group("cpu") | ||
212 | 198 | if re.search("i[0-5]86", conf.env['build_target']): | ||
213 | 199 | conf.env['build_target'] = "i386" | ||
214 | 200 | else: | ||
215 | 201 | conf.env['build_target'] = 'none' | ||
216 | 202 | else: | ||
217 | 203 | conf.env['build_target'] = opt.dist_target | ||
218 | 204 | |||
219 | 205 | if conf.env['build_target'] == 'snowleopard': | ||
220 | 206 | # | ||
221 | 207 | # stupid OS X 10.6 has a bug in math.h that prevents llrint and friends | ||
222 | 208 | # from being visible. | ||
223 | 209 | # | ||
224 | 210 | compiler_flags.append ('-U__STRICT_ANSI__') | ||
225 | 211 | |||
226 | 212 | if cpu == 'powerpc' and conf.env['build_target'] != 'none': | ||
227 | 213 | # | ||
228 | 214 | # Apple/PowerPC optimization options | ||
229 | 215 | # | ||
230 | 216 | # -mcpu=7450 does not reliably work with gcc 3.* | ||
231 | 217 | # | ||
232 | 218 | if opt.dist_target == 'panther' or opt.dist_target == 'tiger': | ||
233 | 219 | if platform == 'darwin': | ||
234 | 220 | # optimization_flags.extend ([ "-mcpu=7450", "-faltivec"]) | ||
235 | 221 | # to support g3s but still have some optimization for above | ||
236 | 222 | compiler_flags.extend ([ "-mcpu=G3", "-mtune=7450"]) | ||
237 | 223 | else: | ||
238 | 224 | compiler_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"]) | ||
239 | 225 | else: | ||
240 | 226 | compiler_flags.extend([ "-mcpu=750", "-mmultiple" ]) | ||
241 | 227 | compiler_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"]) | ||
242 | 228 | optimization_flags.extend (["-Os"]) | ||
243 | 229 | |||
244 | 230 | elif ((re.search ("i[0-9]86", cpu) != None) or (re.search ("x86_64", cpu) != None)) and conf.env['build_target'] != 'none': | ||
245 | 231 | |||
246 | 232 | |||
247 | 233 | # | ||
248 | 234 | # ARCH_X86 means anything in the x86 family from i386 to x86_64 | ||
249 | 235 | # the compile-time presence of the macro _LP64 is used to | ||
250 | 236 | # distingush 32 and 64 bit assembler | ||
251 | 237 | # | ||
252 | 238 | |||
253 | 239 | if (re.search ("(i[0-9]86|x86_64)", cpu) != None): | ||
254 | 240 | compiler_flags.append ("-DARCH_X86") | ||
255 | 241 | |||
256 | 242 | if platform == 'linux' : | ||
257 | 243 | |||
258 | 244 | # | ||
259 | 245 | # determine processor flags via /proc/cpuinfo | ||
260 | 246 | # | ||
261 | 247 | |||
262 | 248 | if conf.env['build_target'] != 'i386': | ||
263 | 249 | |||
264 | 250 | flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1] | ||
265 | 251 | x86_flags = flag_line.split (": ")[1:][0].split () | ||
266 | 252 | |||
267 | 253 | if "mmx" in x86_flags: | ||
268 | 254 | compiler_flags.append ("-mmmx") | ||
269 | 255 | if "sse" in x86_flags: | ||
270 | 256 | build_host_supports_sse = True | ||
271 | 257 | if "3dnow" in x86_flags: | ||
272 | 258 | compiler_flags.append ("-m3dnow") | ||
273 | 259 | |||
274 | 260 | if cpu == "i586": | ||
275 | 261 | compiler_flags.append ("-march=i586") | ||
276 | 262 | elif cpu == "i686": | ||
277 | 263 | compiler_flags.append ("-march=i686") | ||
278 | 264 | |||
279 | 265 | if not is_clang and ((conf.env['build_target'] == 'i686') or (conf.env['build_target'] == 'x86_64')) and build_host_supports_sse: | ||
280 | 266 | compiler_flags.extend (["-msse", "-mfpmath=sse", "-DUSE_XMMINTRIN"]) | ||
281 | 267 | |||
282 | 268 | # end of processor-specific section | ||
283 | 269 | |||
284 | 270 | # optimization section | ||
285 | 271 | if conf.env['FPU_OPTIMIZATION']: | ||
286 | 272 | if sys.platform == 'darwin': | ||
287 | 273 | compiler_flags.append("-DBUILD_VECLIB_OPTIMIZATIONS"); | ||
288 | 274 | linker_flags.append("-framework Accelerate") | ||
289 | 275 | elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': | ||
290 | 276 | compiler_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") | ||
291 | 277 | if not build_host_supports_sse: | ||
292 | 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)") | ||
293 | 279 | |||
294 | 280 | # end optimization section | ||
295 | 281 | |||
296 | 282 | # | ||
297 | 283 | # no VST on x86_64 | ||
298 | 284 | # | ||
299 | 285 | |||
300 | 286 | if conf.env['build_target'] == 'x86_64' and opt.windows_vst: | ||
301 | 287 | print("\n\n==================================================") | ||
302 | 288 | print("You cannot use VST plugins with a 64 bit host. Please run waf with --windows-vst=0") | ||
303 | 289 | print("\nIt is theoretically possible to build a 32 bit host on a 64 bit system.") | ||
304 | 290 | print("However, this is tricky and not recommended for beginners.") | ||
305 | 291 | sys.exit (-1) | ||
306 | 292 | |||
307 | 293 | if opt.lxvst: | ||
308 | 294 | if conf.env['build_target'] == 'x86_64': | ||
309 | 295 | compiler_flags.append("-DLXVST_64BIT") | ||
310 | 296 | else: | ||
311 | 297 | compiler_flags.append("-DLXVST_32BIT") | ||
312 | 298 | |||
313 | 299 | # | ||
314 | 300 | # a single way to test if we're on OS X | ||
315 | 301 | # | ||
316 | 302 | |||
317 | 303 | if conf.env['build_target'] in ['panther', 'tiger', 'leopard', 'snowleopard' ]: | ||
318 | 304 | conf.define ('IS_OSX', 1) | ||
319 | 305 | # force tiger or later, to avoid issues on PPC which defaults | ||
320 | 306 | # back to 10.1 if we don't tell it otherwise. | ||
321 | 307 | |||
322 | 308 | compiler_flags.extend( | ||
323 | 309 | ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1040", | ||
324 | 310 | '-mmacosx-version-min=10.4')) | ||
325 | 311 | |||
326 | 312 | elif conf.env['build_target'] in [ 'lion', 'mountainlion' ]: | ||
327 | 313 | compiler_flags.extend( | ||
328 | 314 | ("-DMAC_OS_X_VERSION_MIN_REQUIRED=1070", | ||
329 | 315 | '-mmacosx-version-min=10.7')) | ||
330 | 316 | else: | ||
331 | 317 | conf.define ('IS_OSX', 0) | ||
332 | 318 | |||
333 | 319 | # | ||
334 | 320 | # save off CPU element in an env | ||
335 | 321 | # | ||
336 | 322 | conf.define ('CONFIG_ARCH', cpu) | ||
337 | 323 | |||
338 | 324 | # | ||
339 | 325 | # ARCH="..." overrides all | ||
340 | 326 | # | ||
341 | 327 | |||
342 | 328 | if opt.arch != None: | ||
343 | 329 | optimization_flags = opt.arch.split() | ||
344 | 330 | |||
345 | 331 | # | ||
346 | 332 | # prepend boiler plate optimization flags that work on all architectures | ||
347 | 333 | # | ||
348 | 334 | |||
349 | 335 | optimization_flags[:0] = ["-pipe"] | ||
350 | 336 | |||
351 | 337 | # don't prepend optimization flags if "-O<something>" is present | ||
352 | 338 | prepend_opt_flags = True | ||
353 | 339 | for flag in optimization_flags: | ||
354 | 340 | if flag.startswith("-O"): | ||
355 | 341 | prepend_opt_flags = False | ||
356 | 342 | break | ||
357 | 343 | |||
358 | 344 | if prepend_opt_flags: | ||
359 | 345 | optimization_flags[:0] = [ | ||
360 | 346 | "-O3", | ||
361 | 347 | "-fomit-frame-pointer", | ||
362 | 348 | "-ffast-math", | ||
363 | 349 | "-fstrength-reduce" | ||
364 | 350 | ] | ||
365 | 351 | |||
366 | 352 | if opt.stl_debug: | ||
367 | 353 | cxx_flags.append("-D_GLIBCXX_DEBUG") | ||
368 | 354 | |||
369 | 355 | if conf.env['DEBUG_RT_ALLOC']: | ||
370 | 356 | compiler_flags.append('-DDEBUG_RT_ALLOC') | ||
371 | 357 | linker_flags.append('-ldl') | ||
372 | 358 | |||
373 | 359 | if conf.env['DEBUG_DENORMAL_EXCEPTION']: | ||
374 | 360 | compiler_flags.append('-DDEBUG_DENORMAL_EXCEPTION') | ||
375 | 361 | |||
376 | 362 | if opt.universal: | ||
377 | 363 | if opt.generic: | ||
378 | 364 | print ('Specifying Universal and Generic builds at the same time is not supported') | ||
379 | 365 | sys.exit (1) | ||
380 | 366 | else: | ||
381 | 367 | if not Options.options.nocarbon: | ||
382 | 368 | compiler_flags.extend(("-arch", "i386", "-arch", "ppc")) | ||
383 | 369 | linker_flags.extend(("-arch", "i386", "-arch", "ppc")) | ||
384 | 370 | else: | ||
385 | 371 | compiler_flags.extend( | ||
386 | 372 | ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc")) | ||
387 | 373 | linker_flags.extend( | ||
388 | 374 | ("-arch", "x86_64", "-arch", "i386", "-arch", "ppc")) | ||
389 | 375 | else: | ||
390 | 376 | if opt.generic: | ||
391 | 377 | compiler_flags.extend(('-arch', 'i386')) | ||
392 | 378 | linker_flags.extend(('-arch', 'i386')) | ||
393 | 379 | |||
394 | 380 | # | ||
395 | 381 | # warnings flags | ||
396 | 382 | # | ||
397 | 383 | |||
398 | 384 | compiler_flags.extend( | ||
399 | 385 | ('-Wall', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align')) | ||
400 | 386 | |||
401 | 387 | c_flags.extend(('-Wstrict-prototypes', '-Wmissing-prototypes')) | ||
402 | 388 | cxx_flags.append('-Woverloaded-virtual') | ||
403 | 389 | |||
404 | 390 | # | ||
405 | 391 | # more boilerplate | ||
406 | 392 | # | ||
407 | 393 | |||
408 | 394 | # need ISOC9X for llabs() | ||
409 | 395 | compiler_flags.extend( | ||
410 | 396 | ('-DBOOST_SYSTEM_NO_DEPRECATED', '-D_ISOC9X_SOURCE', | ||
411 | 397 | '-D_LARGEFILE64_SOURCE', '-D_FILE_OFFSET_BITS=64')) | ||
412 | 398 | cxx_flags.extend(('-D__STDC_LIMIT_MACROS', '-D__STDC_FORMAT_MACROS')) | ||
413 | 399 | |||
414 | 400 | if opt.nls: | ||
415 | 401 | compiler_flags.append('-DENABLE_NLS') | ||
416 | 402 | |||
417 | 403 | if opt.debug: | ||
418 | 404 | conf.env.append_value('CFLAGS', debug_flags) | ||
419 | 405 | conf.env.append_value('CXXFLAGS', debug_flags) | ||
420 | 406 | else: | ||
421 | 407 | conf.env.append_value('CFLAGS', optimization_flags) | ||
422 | 408 | conf.env.append_value('CXXFLAGS', optimization_flags) | ||
423 | 409 | |||
424 | 410 | if opt.backtrace: | ||
425 | 411 | if platform != 'darwin' and not is_clang: | ||
426 | 412 | linker_flags += [ '-rdynamic' ] | ||
427 | 413 | |||
428 | 414 | conf.env.append_value('CFLAGS', compiler_flags) | ||
429 | 415 | conf.env.append_value('CFLAGS', c_flags) | ||
430 | 416 | conf.env.append_value('CXXFLAGS', compiler_flags) | ||
431 | 417 | conf.env.append_value('CXXFLAGS', cxx_flags) | ||
432 | 418 | conf.env.append_value('LINKFLAGS', linker_flags) | ||
433 | 419 | |||
434 | 420 | #---------------------------------------------------------------- | ||
435 | 421 | |||
436 | 422 | # Waf stages | ||
437 | 423 | |||
438 | 424 | def options(opt): | ||
439 | 425 | opt.load('compiler_c') | ||
440 | 426 | opt.load('compiler_cxx') | ||
441 | 427 | autowaf.set_options(opt, debug_by_default=True) | ||
442 | 428 | opt.add_option('--program-name', type='string', action='store', default='Ardour', dest='program_name', | ||
443 | 429 | help='The user-visible name of the program being built') | ||
444 | 430 | opt.add_option('--arch', type='string', action='store', dest='arch', | ||
445 | 431 | help='Architecture-specific compiler flags') | ||
446 | 432 | opt.add_option('--backtrace', action='store_true', default=True, dest='backtrace', | ||
447 | 433 | help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour') | ||
448 | 434 | opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon', | ||
449 | 435 | help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)') | ||
450 | 436 | opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug', | ||
451 | 437 | help='Compile with Boost shared pointer debugging') | ||
452 | 438 | opt.add_option('--depstack-root', type='string', default='~', dest='depstack_root', | ||
453 | 439 | help='Directory/folder where dependency stack trees (gtk, a3) can be found (defaults to ~)') | ||
454 | 440 | opt.add_option('--dist-target', type='string', default='auto', dest='dist_target', | ||
455 | 441 | help='Specify the target for cross-compiling [auto,none,x86,i386,i686,x86_64,powerpc,tiger,leopard]') | ||
456 | 442 | opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization', | ||
457 | 443 | help='Build runtime checked assembler code (default)') | ||
458 | 444 | opt.add_option('--no-fpu-optimization', action='store_false', dest='fpu_optimization') | ||
459 | 445 | opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop', | ||
460 | 446 | help='Install MIME type, icons and .desktop file as per freedesktop.org standards') | ||
461 | 447 | opt.add_option('--freebie', action='store_true', default=False, dest='freebie', | ||
462 | 448 | help='Build a version suitable for distribution as a zero-cost binary') | ||
463 | 449 | opt.add_option('--gprofile', action='store_true', default=False, dest='gprofile', | ||
464 | 450 | help='Compile for use with gprofile') | ||
465 | 451 | opt.add_option('--internal-shared-libs', action='store_true', default=True, dest='internal_shared_libs', | ||
466 | 452 | help='Build internal libs as shared libraries') | ||
467 | 453 | opt.add_option('--internal-static-libs', action='store_false', dest='internal_shared_libs', | ||
468 | 454 | help='Build internal libs as static libraries') | ||
469 | 455 | opt.add_option('--use-external-libs', action='store_true', default=False, dest='use_external_libs', | ||
470 | 456 | help='Use external/system versions of some bundled libraries') | ||
471 | 457 | opt.add_option('--lv2', action='store_true', default=True, dest='lv2', | ||
472 | 458 | help='Compile with support for LV2 (if Lilv+Suil is available)') | ||
473 | 459 | opt.add_option('--no-lv2', action='store_false', dest='lv2', | ||
474 | 460 | help='Do not compile with support for LV2') | ||
475 | 461 | opt.add_option('--lxvst', action='store_true', default=lxvst_default, dest='lxvst', | ||
476 | 462 | help='Compile with support for linuxVST plugins') | ||
477 | 463 | opt.add_option('--nls', action='store_true', default=True, dest='nls', | ||
478 | 464 | help='Enable i18n (native language support) (default)') | ||
479 | 465 | opt.add_option('--no-nls', action='store_false', dest='nls') | ||
480 | 466 | opt.add_option('--phone-home', action='store_true', default=True, dest='phone_home', | ||
481 | 467 | help='Contact ardour.org at startup for new announcements') | ||
482 | 468 | opt.add_option('--no-phone-home', action='store_false', dest='phone_home', | ||
483 | 469 | help='Do not contact ardour.org at startup for new announcements') | ||
484 | 470 | opt.add_option('--stl-debug', action='store_true', default=False, dest='stl_debug', | ||
485 | 471 | help='Build with debugging for the STL') | ||
486 | 472 | opt.add_option('--rt-alloc-debug', action='store_true', default=False, dest='rt_alloc_debug', | ||
487 | 473 | help='Build with debugging for memory allocation in the real-time thread') | ||
488 | 474 | opt.add_option('--pt-timing', action='store_true', default=False, dest='pt_timing', | ||
489 | 475 | help='Build with logging of timing in the process thread(s)') | ||
490 | 476 | opt.add_option('--denormal-exception', action='store_true', default=False, dest='denormal_exception', | ||
491 | 477 | help='Raise a floating point exception if a denormal is detected') | ||
492 | 478 | opt.add_option('--test', action='store_true', default=False, dest='build_tests', | ||
493 | 479 | help="Build unit tests") | ||
494 | 480 | opt.add_option('--run-tests', action='store_true', default=False, dest='run_tests', | ||
495 | 481 | help="Run tests after build") | ||
496 | 482 | opt.add_option('--single-tests', action='store_true', default=False, dest='single_tests', | ||
497 | 483 | help="Build a single executable for each unit test") | ||
498 | 484 | #opt.add_option('--tranzport', action='store_true', default=False, dest='tranzport', | ||
499 | 485 | # help='Compile with support for Frontier Designs Tranzport (if libusb is available)') | ||
500 | 486 | opt.add_option('--universal', action='store_true', default=False, dest='universal', | ||
501 | 487 | help='Compile as universal binary (OS X ONLY, requires that external libraries are universal)') | ||
502 | 488 | opt.add_option('--generic', action='store_true', default=False, dest='generic', | ||
503 | 489 | help='Compile with -arch i386 (OS X ONLY)') | ||
504 | 490 | opt.add_option('--versioned', action='store_true', default=False, dest='versioned', | ||
505 | 491 | help='Add revision information to executable name inside the build directory') | ||
506 | 492 | opt.add_option('--windows-vst', action='store_true', default=False, dest='windows_vst', | ||
507 | 493 | help='Compile with support for Windows VST') | ||
508 | 494 | opt.add_option('--windows-key', type='string', action='store', dest='windows_key', default='Mod4><Super', | ||
509 | 495 | help='X Modifier(s) (Mod1,Mod2, etc) for the Windows key (X11 builds only). ' + | ||
510 | 496 | 'Multiple modifiers must be separated by \'><\'') | ||
511 | 497 | opt.add_option('--boost-include', type='string', action='store', dest='boost_include', default='', | ||
512 | 498 | help='directory where Boost header files can be found') | ||
513 | 499 | opt.add_option('--also-include', type='string', action='store', dest='also_include', default='', | ||
514 | 500 | help='additional include directory where header files can be found (split multiples with commas)') | ||
515 | 501 | opt.add_option('--also-libdir', type='string', action='store', dest='also_libdir', default='', | ||
516 | 502 | help='additional include directory where shared libraries can be found (split multiples with commas)') | ||
517 | 503 | opt.add_option('--wine-include', type='string', action='store', dest='wine_include', default='/usr/include/wine/windows', | ||
518 | 504 | help='directory where Wine\'s Windows header files can be found') | ||
519 | 505 | opt.add_option('--noconfirm', action='store_true', default=False, dest='noconfirm', | ||
520 | 506 | help='Do not ask questions that require confirmation during the build') | ||
521 | 507 | opt.add_option('--cxx11', action='store_true', default=False, dest='cxx11', | ||
522 | 508 | help='Turn on c++11 compiler flags (-std=c++11)') | ||
523 | 509 | opt.add_option('--address-sanitizer', action='store_true', default=False, dest='asan', | ||
524 | 510 | help='Turn on AddressSanitizer (requires GCC >= 4.8 or clang >= 3.1)') | ||
525 | 511 | for i in children: | ||
526 | 512 | opt.recurse(i) | ||
527 | 513 | |||
528 | 514 | def sub_config_and_use(conf, name, has_objects = True): | ||
529 | 515 | conf.recurse(name) | ||
530 | 516 | autowaf.set_local_lib(conf, name, has_objects) | ||
531 | 517 | |||
532 | 518 | def configure(conf): | ||
533 | 519 | conf.load('compiler_c') | ||
534 | 520 | conf.load('compiler_cxx') | ||
535 | 521 | conf.env['VERSION'] = VERSION | ||
536 | 522 | conf.env['MAJOR'] = MAJOR | ||
537 | 523 | conf.env['MINOR'] = MINOR | ||
538 | 524 | conf.line_just = 52 | ||
539 | 525 | autowaf.set_recursive() | ||
540 | 526 | autowaf.configure(conf) | ||
541 | 527 | autowaf.display_header('Ardour Configuration') | ||
542 | 528 | |||
543 | 529 | gcc_versions = fetch_gcc_version(str(conf.env['CC'])) | ||
544 | 530 | if not Options.options.debug and gcc_versions[0] == '4' and gcc_versions[1] > '4': | ||
545 | 531 | print('Version 4.5 of gcc is not ready for use when compiling Ardour with optimization.') | ||
546 | 532 | print('Please use a different version or re-configure with --debug') | ||
547 | 533 | exit (1) | ||
548 | 534 | |||
549 | 535 | # systems with glibc have libintl builtin. systems without require explicit | ||
550 | 536 | # linkage against libintl. | ||
551 | 537 | # | ||
552 | 538 | |||
553 | 539 | pkg_config_path = os.getenv('PKG_CONFIG_PATH') | ||
554 | 540 | user_gtk_root = os.path.expanduser (Options.options.depstack_root + '/gtk/inst') | ||
555 | 541 | |||
556 | 542 | if pkg_config_path is not None and pkg_config_path.find (user_gtk_root) >= 0: | ||
557 | 543 | # told to search user_gtk_root | ||
558 | 544 | prefinclude = ''.join ([ '-I', user_gtk_root + '/include']) | ||
559 | 545 | preflib = ''.join ([ '-L', user_gtk_root + '/lib']) | ||
560 | 546 | conf.env.append_value('CFLAGS', [ prefinclude ]) | ||
561 | 547 | conf.env.append_value('CXXFLAGS', [prefinclude ]) | ||
562 | 548 | conf.env.append_value('LINKFLAGS', [ preflib ]) | ||
563 | 549 | autowaf.display_msg(conf, 'Will build against private GTK dependency stack in ' + user_gtk_root, 'yes') | ||
564 | 550 | else: | ||
565 | 551 | autowaf.display_msg(conf, 'Will build against private GTK dependency stack', 'no') | ||
566 | 552 | |||
567 | 553 | if sys.platform == 'darwin': | ||
568 | 554 | conf.define ('NEED_INTL', 1) | ||
569 | 555 | autowaf.display_msg(conf, 'Will use explicit linkage against libintl in ' + user_gtk_root, 'yes') | ||
570 | 556 | else: | ||
571 | 557 | # libintl is part of the system, so use it | ||
572 | 558 | autowaf.display_msg(conf, 'Will rely on libintl built into libc', 'yes') | ||
573 | 559 | |||
574 | 560 | user_ardour_root = os.path.expanduser (Options.options.depstack_root + '/a3/inst') | ||
575 | 561 | if pkg_config_path is not None and pkg_config_path.find (user_ardour_root) >= 0: | ||
576 | 562 | # told to search user_ardour_root | ||
577 | 563 | prefinclude = ''.join ([ '-I', user_ardour_root + '/include']) | ||
578 | 564 | preflib = ''.join ([ '-L', user_ardour_root + '/lib']) | ||
579 | 565 | conf.env.append_value('CFLAGS', [ prefinclude ]) | ||
580 | 566 | conf.env.append_value('CXXFLAGS', [prefinclude ]) | ||
581 | 567 | conf.env.append_value('LINKFLAGS', [ preflib ]) | ||
582 | 568 | autowaf.display_msg(conf, 'Will build against private Ardour dependency stack in ' + user_ardour_root, 'yes') | ||
583 | 569 | else: | ||
584 | 570 | autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no') | ||
585 | 571 | |||
586 | 572 | if Options.options.freebie: | ||
587 | 573 | conf.env.append_value ('CFLAGS', '-DNO_PLUGIN_STATE') | ||
588 | 574 | conf.env.append_value ('CXXFLAGS', '-DNO_PLUGIN_STATE') | ||
589 | 575 | conf.define ('NO_PLUGIN_STATE', 1) | ||
590 | 576 | |||
591 | 577 | if sys.platform == 'darwin': | ||
592 | 578 | |||
593 | 579 | # this is required, potentially, for anything we link and then relocate into a bundle | ||
594 | 580 | conf.env.append_value('LINKFLAGS', [ '-Xlinker', '-headerpad_max_install_names' ]) | ||
595 | 581 | |||
596 | 582 | conf.define ('HAVE_COREAUDIO', 1) | ||
597 | 583 | conf.define ('AUDIOUNIT_SUPPORT', 1) | ||
598 | 584 | |||
599 | 585 | conf.define ('GTKOSX', 1) | ||
600 | 586 | conf.define ('TOP_MENUBAR',1) | ||
601 | 587 | conf.define ('GTKOSX',1) | ||
602 | 588 | |||
603 | 589 | # It would be nice to be able to use this to force back-compatibility with 10.4 | ||
604 | 590 | # but even by the time of 11, the 10.4 SDK is no longer available in any normal | ||
605 | 591 | # way. | ||
606 | 592 | # | ||
607 | 593 | #conf.env.append_value('CXXFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk") | ||
608 | 594 | #conf.env.append_value('CFLAGS_OSX', "-isysroot /Developer/SDKs/MacOSX10.4u.sdk") | ||
609 | 595 | #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk") | ||
610 | 596 | #conf.env.append_value('LINKFLAGS_OSX', "-sysroot /Developer/SDKs/MacOSX10.4u.sdk") | ||
611 | 597 | |||
612 | 598 | conf.env.append_value('CXXFLAGS_OSX', "-msse") | ||
613 | 599 | conf.env.append_value('CFLAGS_OSX', "-msse") | ||
614 | 600 | conf.env.append_value('CXXFLAGS_OSX', "-msse2") | ||
615 | 601 | conf.env.append_value('CFLAGS_OSX', "-msse2") | ||
616 | 602 | # | ||
617 | 603 | # TODO: The previous sse flags NEED to be based | ||
618 | 604 | # off processor type. Need to add in a check | ||
619 | 605 | # for that. | ||
620 | 606 | # | ||
621 | 607 | conf.env.append_value('CXXFLAGS_OSX', '-F/System/Library/Frameworks') | ||
622 | 608 | conf.env.append_value('CXXFLAGS_OSX', '-F/Library/Frameworks') | ||
623 | 609 | |||
624 | 610 | conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'AppKit']) | ||
625 | 611 | conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudio']) | ||
626 | 612 | conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreAudioKit']) | ||
627 | 613 | conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreFoundation']) | ||
628 | 614 | conf.env.append_value('LINKFLAGS_OSX', ['-framework', 'CoreServices']) | ||
629 | 615 | |||
630 | 616 | conf.env.append_value('LINKFLAGS_OSX', ['-undefined', 'dynamic_lookup' ]) | ||
631 | 617 | conf.env.append_value('LINKFLAGS_OSX', ['-flat_namespace']) | ||
632 | 618 | |||
633 | 619 | conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DAUDIOUNIT_SUPPORT") | ||
634 | 620 | conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'AudioToolbox', '-framework', 'AudioUnit']) | ||
635 | 621 | conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Cocoa']) | ||
636 | 622 | |||
637 | 623 | if re.search ("^[1-9][0-9]\.", os.uname()[2]) == None and not Options.options.nocarbon: | ||
638 | 624 | conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DWITH_CARBON") | ||
639 | 625 | conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Carbon']) | ||
640 | 626 | else: | ||
641 | 627 | print ('No Carbon support available for this build\n') | ||
642 | 628 | |||
643 | 629 | |||
644 | 630 | if Options.options.internal_shared_libs: | ||
645 | 631 | conf.define('INTERNAL_SHARED_LIBS', 1) | ||
646 | 632 | |||
647 | 633 | if Options.options.use_external_libs: | ||
648 | 634 | conf.define('USE_EXTERNAL_LIBS', 1) | ||
649 | 635 | |||
650 | 636 | if Options.options.boost_include != '': | ||
651 | 637 | conf.env.append_value('CXXFLAGS', '-I' + Options.options.boost_include) | ||
652 | 638 | |||
653 | 639 | if Options.options.also_include != '': | ||
654 | 640 | conf.env.append_value('CXXFLAGS', '-I' + Options.options.also_include) | ||
655 | 641 | conf.env.append_value('CFLAGS', '-I' + Options.options.also_include) | ||
656 | 642 | |||
657 | 643 | if Options.options.also_libdir != '': | ||
658 | 644 | conf.env.append_value('LDFLAGS', '-L' + Options.options.also_libdir) | ||
659 | 645 | |||
660 | 646 | if Options.options.boost_sp_debug: | ||
661 | 647 | conf.env.append_value('CXXFLAGS', '-DBOOST_SP_ENABLE_DEBUG_HOOKS') | ||
662 | 648 | |||
663 | 649 | conf.check_cxx(fragment = "#include <boost/version.hpp>\nint main(void) { return (BOOST_VERSION >= 103900 ? 0 : 1); }\n", | ||
664 | 650 | execute = "1", | ||
665 | 651 | mandatory = True, | ||
666 | 652 | msg = 'Checking for boost library >= 1.39', | ||
667 | 653 | okmsg = 'ok', | ||
668 | 654 | errmsg = 'too old\nPlease install boost version 1.39 or higher.') | ||
669 | 655 | |||
670 | 656 | autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2') | ||
671 | 657 | autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2') | ||
672 | 658 | autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.32.0') | ||
673 | 659 | autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18') | ||
674 | 660 | autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2') | ||
675 | 661 | autowaf.check_pkg(conf, 'libcurl', uselib_store='CURL', atleast_version='7.0.0') | ||
676 | 662 | autowaf.check_pkg(conf, 'liblo', uselib_store='LO', atleast_version='0.26') | ||
677 | 663 | |||
678 | 664 | conf.check_cc(function_name='dlopen', header_name='dlfcn.h', lib='dl', uselib_store='DL') | ||
679 | 665 | |||
680 | 666 | # Tell everyone that this is a waf build | ||
681 | 667 | |||
682 | 668 | conf.env.append_value('CFLAGS', '-DWAF_BUILD') | ||
683 | 669 | conf.env.append_value('CXXFLAGS', '-DWAF_BUILD') | ||
684 | 670 | |||
685 | 671 | # Set up waf environment and C defines | ||
686 | 672 | opts = Options.options | ||
687 | 673 | if opts.phone_home: | ||
688 | 674 | conf.define('PHONE_HOME', 1) | ||
689 | 675 | conf.env['PHONE_HOME'] = True | ||
690 | 676 | if opts.fpu_optimization: | ||
691 | 677 | conf.env['FPU_OPTIMIZATION'] = True | ||
692 | 678 | if opts.nls: | ||
693 | 679 | conf.define('ENABLE_NLS', 1) | ||
694 | 680 | conf.env['ENABLE_NLS'] = True | ||
695 | 681 | if opts.build_tests: | ||
696 | 682 | conf.env['BUILD_TESTS'] = True | ||
697 | 683 | conf.env['RUN_TESTS'] = opts.run_tests | ||
698 | 684 | if opts.single_tests: | ||
699 | 685 | conf.env['SINGLE_TESTS'] = opts.single_tests | ||
700 | 686 | #if opts.tranzport: | ||
701 | 687 | # conf.env['TRANZPORT'] = 1 | ||
702 | 688 | if opts.windows_vst: | ||
703 | 689 | conf.define('WINDOWS_VST_SUPPORT', 1) | ||
704 | 690 | conf.env['WINDOWS_VST_SUPPORT'] = True | ||
705 | 691 | conf.env.append_value('CFLAGS', '-I' + Options.options.wine_include) | ||
706 | 692 | conf.env.append_value('CXXFLAGS', '-I' + Options.options.wine_include) | ||
707 | 693 | autowaf.check_header(conf, 'cxx', 'windows.h', mandatory = True) | ||
708 | 694 | if opts.lxvst: | ||
709 | 695 | conf.define('LXVST_SUPPORT', 1) | ||
710 | 696 | conf.env['LXVST_SUPPORT'] = True | ||
711 | 697 | conf.define('WINDOWS_KEY', opts.windows_key) | ||
712 | 698 | conf.env['PROGRAM_NAME'] = opts.program_name | ||
713 | 699 | if opts.rt_alloc_debug: | ||
714 | 700 | conf.define('DEBUG_RT_ALLOC', 1) | ||
715 | 701 | conf.env['DEBUG_RT_ALLOC'] = True | ||
716 | 702 | if opts.pt_timing: | ||
717 | 703 | conf.define('PT_TIMING', 1) | ||
718 | 704 | conf.env['PT_TIMING'] = True | ||
719 | 705 | if opts.denormal_exception: | ||
720 | 706 | conf.define('DEBUG_DENORMAL_EXCEPTION', 1) | ||
721 | 707 | conf.env['DEBUG_DENORMAL_EXCEPTION'] = True | ||
722 | 708 | if opts.build_tests: | ||
723 | 709 | autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=True) | ||
724 | 710 | |||
725 | 711 | set_compiler_flags (conf, Options.options) | ||
726 | 712 | |||
727 | 713 | for i in children: | ||
728 | 714 | sub_config_and_use(conf, i) | ||
729 | 715 | |||
730 | 716 | # Fix utterly braindead FLAC include path to not smash assert.h | ||
731 | 717 | conf.env['INCLUDES_FLAC'] = [] | ||
732 | 718 | |||
733 | 719 | config_text = open('libs/ardour/config_text.cc', "w") | ||
734 | 720 | config_text.write('''#include "ardour/ardour.h" | ||
735 | 721 | namespace ARDOUR { | ||
736 | 722 | const char* const ardour_config_info = "\\n\\ | ||
737 | 723 | ''') | ||
738 | 724 | |||
739 | 725 | def write_config_text(title, val): | ||
740 | 726 | autowaf.display_msg(conf, title, val) | ||
741 | 727 | config_text.write(title + ': ') | ||
742 | 728 | config_text.write(str(val)) | ||
743 | 729 | config_text.write("\\n\\\n") | ||
744 | 730 | |||
745 | 731 | write_config_text('Build documentation', conf.env['DOCS']) | ||
746 | 732 | write_config_text('Debuggable build', conf.env['DEBUG']) | ||
747 | 733 | write_config_text('Export all symbols (backtrace)', opts.backtrace) | ||
748 | 734 | write_config_text('Install prefix', conf.env['PREFIX']) | ||
749 | 735 | write_config_text('Strict compiler flags', conf.env['STRICT']) | ||
750 | 736 | write_config_text('Internal Shared Libraries', conf.is_defined('INTERNAL_SHARED_LIBS')) | ||
751 | 737 | write_config_text('Use External Libraries', conf.is_defined('USE_EXTERNAL_LIBS')) | ||
752 | 738 | |||
753 | 739 | write_config_text('Architecture flags', opts.arch) | ||
754 | 740 | write_config_text('Aubio', conf.is_defined('HAVE_AUBIO')) | ||
755 | 741 | write_config_text('AudioUnits', conf.is_defined('AUDIOUNIT_SUPPORT')) | ||
756 | 742 | write_config_text('No plugin state', conf.is_defined('NO_PLUGIN_STATE')) | ||
757 | 743 | write_config_text('Build target', conf.env['build_target']) | ||
758 | 744 | write_config_text('CoreAudio', conf.is_defined('HAVE_COREAUDIO')) | ||
759 | 745 | write_config_text('Debug RT allocations', conf.is_defined('DEBUG_RT_ALLOC')) | ||
760 | 746 | write_config_text('Process thread timing', conf.is_defined('PT_TIMING')) | ||
761 | 747 | write_config_text('Denormal exceptions', conf.is_defined('DEBUG_DENORMAL_EXCEPTION')) | ||
762 | 748 | write_config_text('FLAC', conf.is_defined('HAVE_FLAC')) | ||
763 | 749 | write_config_text('FPU optimization', opts.fpu_optimization) | ||
764 | 750 | write_config_text('Freedesktop files', opts.freedesktop) | ||
765 | 751 | write_config_text('LV2 UI embedding', conf.is_defined('HAVE_SUIL')) | ||
766 | 752 | write_config_text('LV2 support', conf.is_defined('LV2_SUPPORT')) | ||
767 | 753 | write_config_text('LXVST support', conf.is_defined('LXVST_SUPPORT')) | ||
768 | 754 | write_config_text('OGG', conf.is_defined('HAVE_OGG')) | ||
769 | 755 | write_config_text('Phone home', conf.is_defined('PHONE_HOME')) | ||
770 | 756 | write_config_text('Program name', opts.program_name) | ||
771 | 757 | write_config_text('Rubberband', conf.is_defined('HAVE_RUBBERBAND')) | ||
772 | 758 | write_config_text('Samplerate', conf.is_defined('HAVE_SAMPLERATE')) | ||
773 | 759 | # write_config_text('Soundtouch', conf.is_defined('HAVE_SOUNDTOUCH')) | ||
774 | 760 | write_config_text('Translation', opts.nls) | ||
775 | 761 | # write_config_text('Tranzport', opts.tranzport) | ||
776 | 762 | write_config_text('Unit tests', conf.env['BUILD_TESTS']) | ||
777 | 763 | write_config_text('Universal binary', opts.universal) | ||
778 | 764 | write_config_text('Generic x86 CPU', opts.generic) | ||
779 | 765 | write_config_text('Windows VST support', opts.windows_vst) | ||
780 | 766 | write_config_text('Wiimote support', conf.is_defined('BUILD_WIIMOTE')) | ||
781 | 767 | write_config_text('Windows key', opts.windows_key) | ||
782 | 768 | |||
783 | 769 | write_config_text('C compiler flags', conf.env['CFLAGS']) | ||
784 | 770 | write_config_text('C++ compiler flags', conf.env['CXXFLAGS']) | ||
785 | 771 | write_config_text('Linker flags', conf.env['LINKFLAGS']) | ||
786 | 772 | |||
787 | 773 | config_text.write ('";\n}\n') | ||
788 | 774 | config_text.close () | ||
789 | 775 | print('') | ||
790 | 776 | |||
791 | 777 | def build(bld): | ||
792 | 778 | create_stored_revision() | ||
793 | 779 | |||
794 | 780 | # add directories that contain only headers, to workaround an issue with waf | ||
795 | 781 | |||
796 | 782 | bld.path.find_dir ('libs/evoral/evoral') | ||
797 | 783 | if not bld.is_defined('USE_EXTERNAL_LIBS'): | ||
798 | 784 | bld.path.find_dir ('libs/vamp-sdk/vamp-sdk') | ||
799 | 785 | bld.path.find_dir ('libs/surfaces/control_protocol/control_protocol') | ||
800 | 786 | bld.path.find_dir ('libs/timecode/timecode') | ||
801 | 787 | if not bld.is_defined('USE_EXTERNAL_LIBS'): | ||
802 | 788 | bld.path.find_dir ('libs/libltc/ltc') | ||
803 | 789 | bld.path.find_dir ('libs/rubberband/rubberband') | ||
804 | 790 | bld.path.find_dir ('libs/gtkmm2ext/gtkmm2ext') | ||
805 | 791 | bld.path.find_dir ('libs/ardour/ardour') | ||
806 | 792 | if not bld.is_defined('USE_EXTERNAL_LIBS'): | ||
807 | 793 | bld.path.find_dir ('libs/taglib/taglib') | ||
808 | 794 | bld.path.find_dir ('libs/pbd/pbd') | ||
809 | 795 | |||
810 | 796 | autowaf.set_recursive() | ||
811 | 797 | |||
812 | 798 | for i in children: | ||
813 | 799 | bld.recurse(i) | ||
814 | 800 | |||
815 | 801 | bld.install_files (os.path.join(bld.env['SYSCONFDIR'], 'ardour3', ), 'ardour_system.rc') | ||
816 | 802 | |||
817 | 803 | if bld.env['RUN_TESTS']: | ||
818 | 804 | bld.add_post_fun(test) | ||
819 | 805 | |||
820 | 806 | def i18n(bld): | ||
821 | 807 | bld.recurse (i18n_children) | ||
822 | 808 | |||
823 | 809 | def i18n_pot(bld): | ||
824 | 810 | bld.recurse (i18n_children) | ||
825 | 811 | |||
826 | 812 | def i18n_po(bld): | ||
827 | 813 | bld.recurse (i18n_children) | ||
828 | 814 | |||
829 | 815 | def i18n_mo(bld): | ||
830 | 816 | bld.recurse (i18n_children) | ||
831 | 817 | |||
832 | 818 | def tarball(bld): | ||
833 | 819 | create_stored_revision() | ||
834 | 820 | |||
835 | 821 | def test(bld): | ||
836 | 822 | subprocess.call("gtk2_ardour/artest") | ||
837 | 0 | 823 | ||
838 | === added directory '.pc/midi-data-loss.patch' | |||
839 | === added directory '.pc/midi-data-loss.patch/libs' | |||
840 | === added directory '.pc/midi-data-loss.patch/libs/ardour' | |||
841 | === added file '.pc/midi-data-loss.patch/libs/ardour/smf_source.cc' | |||
842 | --- .pc/midi-data-loss.patch/libs/ardour/smf_source.cc 1970-01-01 00:00:00 +0000 | |||
843 | +++ .pc/midi-data-loss.patch/libs/ardour/smf_source.cc 2015-05-02 14:23:30 +0000 | |||
844 | @@ -0,0 +1,764 @@ | |||
845 | 1 | /* | ||
846 | 2 | Copyright (C) 2006 Paul Davis | ||
847 | 3 | Author: David Robillard | ||
848 | 4 | |||
849 | 5 | This program is free software; you can redistribute it and/or modify | ||
850 | 6 | it under the terms of the GNU General Public License as published by | ||
851 | 7 | the Free Software Foundation; either version 2 of the License, or | ||
852 | 8 | (at your option) any later version. | ||
853 | 9 | |||
854 | 10 | This program is distributed in the hope that it will be useful, | ||
855 | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
856 | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
857 | 13 | GNU General Public License for more details. | ||
858 | 14 | |||
859 | 15 | You should have received a copy of the GNU General Public License | ||
860 | 16 | along with this program; if not, write to the Free Software | ||
861 | 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
862 | 18 | |||
863 | 19 | */ | ||
864 | 20 | |||
865 | 21 | #include <vector> | ||
866 | 22 | |||
867 | 23 | #include <sys/time.h> | ||
868 | 24 | #include <sys/stat.h> | ||
869 | 25 | #include <unistd.h> | ||
870 | 26 | #include <errno.h> | ||
871 | 27 | #include <regex.h> | ||
872 | 28 | |||
873 | 29 | #include "pbd/pathscanner.h" | ||
874 | 30 | #include "pbd/stl_delete.h" | ||
875 | 31 | #include "pbd/strsplit.h" | ||
876 | 32 | |||
877 | 33 | #include <glibmm/miscutils.h> | ||
878 | 34 | #include <glibmm/fileutils.h> | ||
879 | 35 | |||
880 | 36 | #include "evoral/Control.hpp" | ||
881 | 37 | #include "evoral/evoral/SMF.hpp" | ||
882 | 38 | |||
883 | 39 | #include "ardour/event_type_map.h" | ||
884 | 40 | #include "ardour/midi_model.h" | ||
885 | 41 | #include "ardour/midi_ring_buffer.h" | ||
886 | 42 | #include "ardour/midi_state_tracker.h" | ||
887 | 43 | #include "ardour/session.h" | ||
888 | 44 | #include "ardour/smf_source.h" | ||
889 | 45 | #include "ardour/debug.h" | ||
890 | 46 | |||
891 | 47 | #include "i18n.h" | ||
892 | 48 | |||
893 | 49 | using namespace ARDOUR; | ||
894 | 50 | using namespace Glib; | ||
895 | 51 | using namespace PBD; | ||
896 | 52 | using namespace Evoral; | ||
897 | 53 | |||
898 | 54 | /** Constructor used for new internal-to-session files. File cannot exist. */ | ||
899 | 55 | SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags) | ||
900 | 56 | : Source(s, DataType::MIDI, path, flags) | ||
901 | 57 | , MidiSource(s, path, flags) | ||
902 | 58 | , FileSource(s, DataType::MIDI, path, string(), flags) | ||
903 | 59 | , Evoral::SMF() | ||
904 | 60 | , _last_ev_time_beats(0.0) | ||
905 | 61 | , _last_ev_time_frames(0) | ||
906 | 62 | , _smf_last_read_end (0) | ||
907 | 63 | , _smf_last_read_time (0) | ||
908 | 64 | { | ||
909 | 65 | /* note that origin remains empty */ | ||
910 | 66 | |||
911 | 67 | if (init (_path, false)) { | ||
912 | 68 | throw failed_constructor (); | ||
913 | 69 | } | ||
914 | 70 | |||
915 | 71 | assert (!Glib::file_test (_path, Glib::FILE_TEST_EXISTS)); | ||
916 | 72 | existence_check (); | ||
917 | 73 | |||
918 | 74 | _flags = Source::Flag (_flags | Empty); | ||
919 | 75 | |||
920 | 76 | /* file is not opened until write */ | ||
921 | 77 | |||
922 | 78 | if (flags & Writable) { | ||
923 | 79 | return; | ||
924 | 80 | } | ||
925 | 81 | |||
926 | 82 | if (open (_path)) { | ||
927 | 83 | throw failed_constructor (); | ||
928 | 84 | } | ||
929 | 85 | |||
930 | 86 | _open = true; | ||
931 | 87 | } | ||
932 | 88 | |||
933 | 89 | /** Constructor used for external-to-session files. File must exist. */ | ||
934 | 90 | SMFSource::SMFSource (Session& s, const string& path) | ||
935 | 91 | : Source(s, DataType::MIDI, path, Source::Flag (0)) | ||
936 | 92 | , MidiSource(s, path, Source::Flag (0)) | ||
937 | 93 | , FileSource(s, DataType::MIDI, path, string(), Source::Flag (0)) | ||
938 | 94 | , Evoral::SMF() | ||
939 | 95 | , _last_ev_time_beats(0.0) | ||
940 | 96 | , _last_ev_time_frames(0) | ||
941 | 97 | , _smf_last_read_end (0) | ||
942 | 98 | , _smf_last_read_time (0) | ||
943 | 99 | { | ||
944 | 100 | /* note that origin remains empty */ | ||
945 | 101 | |||
946 | 102 | if (init (_path, true)) { | ||
947 | 103 | throw failed_constructor (); | ||
948 | 104 | } | ||
949 | 105 | |||
950 | 106 | assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)); | ||
951 | 107 | existence_check (); | ||
952 | 108 | |||
953 | 109 | if (_flags & Writable) { | ||
954 | 110 | /* file is not opened until write */ | ||
955 | 111 | return; | ||
956 | 112 | } | ||
957 | 113 | |||
958 | 114 | if (open (_path)) { | ||
959 | 115 | throw failed_constructor (); | ||
960 | 116 | } | ||
961 | 117 | |||
962 | 118 | _open = true; | ||
963 | 119 | } | ||
964 | 120 | |||
965 | 121 | /** Constructor used for existing internal-to-session files. */ | ||
966 | 122 | SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist) | ||
967 | 123 | : Source(s, node) | ||
968 | 124 | , MidiSource(s, node) | ||
969 | 125 | , FileSource(s, node, must_exist) | ||
970 | 126 | , _last_ev_time_beats(0.0) | ||
971 | 127 | , _last_ev_time_frames(0) | ||
972 | 128 | , _smf_last_read_end (0) | ||
973 | 129 | , _smf_last_read_time (0) | ||
974 | 130 | { | ||
975 | 131 | if (set_state(node, Stateful::loading_state_version)) { | ||
976 | 132 | throw failed_constructor (); | ||
977 | 133 | } | ||
978 | 134 | |||
979 | 135 | /* we expect the file to exist, but if no MIDI data was ever added | ||
980 | 136 | it will have been removed at last session close. so, we don't | ||
981 | 137 | require it to exist if it was marked Empty. | ||
982 | 138 | */ | ||
983 | 139 | |||
984 | 140 | try { | ||
985 | 141 | |||
986 | 142 | if (init (_path, true)) { | ||
987 | 143 | throw failed_constructor (); | ||
988 | 144 | } | ||
989 | 145 | |||
990 | 146 | } catch (MissingSource& err) { | ||
991 | 147 | |||
992 | 148 | if (_flags & Source::Empty) { | ||
993 | 149 | /* we don't care that the file was not found, because | ||
994 | 150 | it was empty. But FileSource::init() will have | ||
995 | 151 | failed to set our _path correctly, so we have to do | ||
996 | 152 | this ourselves. Use the first entry in the search | ||
997 | 153 | path for MIDI files, which is assumed to be the | ||
998 | 154 | correct "main" location. | ||
999 | 155 | */ | ||
1000 | 156 | std::vector<Glib::ustring> sdirs; | ||
1001 | 157 | split (s.source_search_path (DataType::MIDI), sdirs, ':'); | ||
1002 | 158 | if (sdirs.empty()) { | ||
1003 | 159 | fatal << _("Empty MIDI source search path!") << endmsg; | ||
1004 | 160 | /*NOTREACHED*/ | ||
1005 | 161 | } | ||
1006 | 162 | _path = Glib::build_filename (sdirs.front(), _path); | ||
1007 | 163 | /* This might be important, too */ | ||
1008 | 164 | _file_is_new = true; | ||
1009 | 165 | } else { | ||
1010 | 166 | /* pass it on */ | ||
1011 | 167 | throw; | ||
1012 | 168 | } | ||
1013 | 169 | } | ||
1014 | 170 | |||
1015 | 171 | if (!(_flags & Source::Empty)) { | ||
1016 | 172 | assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)); | ||
1017 | 173 | existence_check (); | ||
1018 | 174 | } else { | ||
1019 | 175 | assert (_flags & Source::Writable); | ||
1020 | 176 | /* file will be opened on write */ | ||
1021 | 177 | return; | ||
1022 | 178 | } | ||
1023 | 179 | |||
1024 | 180 | if (open(_path)) { | ||
1025 | 181 | throw failed_constructor (); | ||
1026 | 182 | } | ||
1027 | 183 | |||
1028 | 184 | _open = true; | ||
1029 | 185 | } | ||
1030 | 186 | |||
1031 | 187 | SMFSource::~SMFSource () | ||
1032 | 188 | { | ||
1033 | 189 | if (removable()) { | ||
1034 | 190 | unlink (_path.c_str()); | ||
1035 | 191 | } | ||
1036 | 192 | } | ||
1037 | 193 | |||
1038 | 194 | int | ||
1039 | 195 | SMFSource::open_for_write () | ||
1040 | 196 | { | ||
1041 | 197 | if (create (_path)) { | ||
1042 | 198 | return -1; | ||
1043 | 199 | } | ||
1044 | 200 | _open = true; | ||
1045 | 201 | return 0; | ||
1046 | 202 | } | ||
1047 | 203 | |||
1048 | 204 | /** All stamps in audio frames */ | ||
1049 | 205 | framecnt_t | ||
1050 | 206 | SMFSource::read_unlocked (Evoral::EventSink<framepos_t>& destination, | ||
1051 | 207 | framepos_t const source_start, | ||
1052 | 208 | framepos_t start, | ||
1053 | 209 | framecnt_t duration, | ||
1054 | 210 | MidiStateTracker* tracker) const | ||
1055 | 211 | { | ||
1056 | 212 | int ret = 0; | ||
1057 | 213 | uint64_t time = 0; // in SMF ticks, 1 tick per _ppqn | ||
1058 | 214 | |||
1059 | 215 | if (writable() && !_open) { | ||
1060 | 216 | /* nothing to read since nothing has ben written */ | ||
1061 | 217 | return duration; | ||
1062 | 218 | } | ||
1063 | 219 | |||
1064 | 220 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: start %1 duration %2\n", start, duration)); | ||
1065 | 221 | |||
1066 | 222 | // Output parameters for read_event (which will allocate scratch in buffer as needed) | ||
1067 | 223 | uint32_t ev_delta_t = 0; | ||
1068 | 224 | uint32_t ev_type = 0; | ||
1069 | 225 | uint32_t ev_size = 0; | ||
1070 | 226 | uint8_t* ev_buffer = 0; | ||
1071 | 227 | |||
1072 | 228 | size_t scratch_size = 0; // keep track of scratch to minimize reallocs | ||
1073 | 229 | |||
1074 | 230 | BeatsFramesConverter converter(_session.tempo_map(), source_start); | ||
1075 | 231 | |||
1076 | 232 | const uint64_t start_ticks = (uint64_t)(converter.from(start) * ppqn()); | ||
1077 | 233 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: start in ticks %1\n", start_ticks)); | ||
1078 | 234 | |||
1079 | 235 | if (_smf_last_read_end == 0 || start != _smf_last_read_end) { | ||
1080 | 236 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: seek to %1\n", start)); | ||
1081 | 237 | Evoral::SMF::seek_to_start(); | ||
1082 | 238 | while (time < start_ticks) { | ||
1083 | 239 | gint ignored; | ||
1084 | 240 | |||
1085 | 241 | ret = read_event(&ev_delta_t, &ev_size, &ev_buffer, &ignored); | ||
1086 | 242 | if (ret == -1) { // EOF | ||
1087 | 243 | _smf_last_read_end = start + duration; | ||
1088 | 244 | return duration; | ||
1089 | 245 | } | ||
1090 | 246 | time += ev_delta_t; // accumulate delta time | ||
1091 | 247 | } | ||
1092 | 248 | } else { | ||
1093 | 249 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked: set time to %1\n", _smf_last_read_time)); | ||
1094 | 250 | time = _smf_last_read_time; | ||
1095 | 251 | } | ||
1096 | 252 | |||
1097 | 253 | _smf_last_read_end = start + duration; | ||
1098 | 254 | |||
1099 | 255 | while (true) { | ||
1100 | 256 | gint ignored; /* XXX don't ignore note id's ??*/ | ||
1101 | 257 | |||
1102 | 258 | ret = read_event(&ev_delta_t, &ev_size, &ev_buffer, &ignored); | ||
1103 | 259 | if (ret == -1) { // EOF | ||
1104 | 260 | break; | ||
1105 | 261 | } | ||
1106 | 262 | |||
1107 | 263 | time += ev_delta_t; // accumulate delta time | ||
1108 | 264 | _smf_last_read_time = time; | ||
1109 | 265 | |||
1110 | 266 | if (ret == 0) { // meta-event (skipped, just accumulate time) | ||
1111 | 267 | continue; | ||
1112 | 268 | } | ||
1113 | 269 | |||
1114 | 270 | ev_type = EventTypeMap::instance().midi_event_type(ev_buffer[0]); | ||
1115 | 271 | |||
1116 | 272 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF read_unlocked delta %1, time %2, buf[0] %3, type %4\n", | ||
1117 | 273 | ev_delta_t, time, ev_buffer[0], ev_type)); | ||
1118 | 274 | |||
1119 | 275 | assert(time >= start_ticks); | ||
1120 | 276 | |||
1121 | 277 | /* Note that we add on the source start time (in session frames) here so that ev_frame_time | ||
1122 | 278 | is in session frames. | ||
1123 | 279 | */ | ||
1124 | 280 | const framepos_t ev_frame_time = converter.to(time / (double)ppqn()) + source_start; | ||
1125 | 281 | |||
1126 | 282 | if (ev_frame_time < start + duration) { | ||
1127 | 283 | destination.write (ev_frame_time, ev_type, ev_size, ev_buffer); | ||
1128 | 284 | |||
1129 | 285 | if (tracker) { | ||
1130 | 286 | if (ev_buffer[0] & MIDI_CMD_NOTE_ON) { | ||
1131 | 287 | tracker->add (ev_buffer[1], ev_buffer[0] & 0xf); | ||
1132 | 288 | } else if (ev_buffer[0] & MIDI_CMD_NOTE_OFF) { | ||
1133 | 289 | tracker->remove (ev_buffer[1], ev_buffer[0] & 0xf); | ||
1134 | 290 | } | ||
1135 | 291 | } | ||
1136 | 292 | } else { | ||
1137 | 293 | break; | ||
1138 | 294 | } | ||
1139 | 295 | |||
1140 | 296 | if (ev_size > scratch_size) { | ||
1141 | 297 | scratch_size = ev_size; | ||
1142 | 298 | } | ||
1143 | 299 | ev_size = scratch_size; // ensure read_event only allocates if necessary | ||
1144 | 300 | } | ||
1145 | 301 | |||
1146 | 302 | return duration; | ||
1147 | 303 | } | ||
1148 | 304 | |||
1149 | 305 | framecnt_t | ||
1150 | 306 | SMFSource::write_unlocked (MidiRingBuffer<framepos_t>& source, | ||
1151 | 307 | framepos_t position, | ||
1152 | 308 | framecnt_t cnt) | ||
1153 | 309 | { | ||
1154 | 310 | if (!_writing) { | ||
1155 | 311 | mark_streaming_write_started (); | ||
1156 | 312 | } | ||
1157 | 313 | |||
1158 | 314 | framepos_t time; | ||
1159 | 315 | Evoral::EventType type; | ||
1160 | 316 | uint32_t size; | ||
1161 | 317 | |||
1162 | 318 | size_t buf_capacity = 4; | ||
1163 | 319 | uint8_t* buf = (uint8_t*)malloc(buf_capacity); | ||
1164 | 320 | |||
1165 | 321 | if (_model && !_model->writing()) { | ||
1166 | 322 | _model->start_write(); | ||
1167 | 323 | } | ||
1168 | 324 | |||
1169 | 325 | Evoral::MIDIEvent<framepos_t> ev; | ||
1170 | 326 | while (true) { | ||
1171 | 327 | /* Get the event time, in frames since session start but ignoring looping. */ | ||
1172 | 328 | bool ret; | ||
1173 | 329 | if (!(ret = source.peek ((uint8_t*)&time, sizeof (time)))) { | ||
1174 | 330 | /* Ring is empty, no more events. */ | ||
1175 | 331 | break; | ||
1176 | 332 | } | ||
1177 | 333 | |||
1178 | 334 | if ((cnt != max_framecnt) && | ||
1179 | 335 | (time > position + _capture_length + cnt)) { | ||
1180 | 336 | /* The diskstream doesn't want us to write everything, and this | ||
1181 | 337 | event is past the end of this block, so we're done for now. */ | ||
1182 | 338 | break; | ||
1183 | 339 | } | ||
1184 | 340 | |||
1185 | 341 | /* Read the time, type, and size of the event. */ | ||
1186 | 342 | if (!(ret = source.read_prefix (&time, &type, &size))) { | ||
1187 | 343 | error << _("Unable to read event prefix, corrupt MIDI ring") << endmsg; | ||
1188 | 344 | break; | ||
1189 | 345 | } | ||
1190 | 346 | |||
1191 | 347 | /* Enlarge body buffer if necessary now that we know the size. */ | ||
1192 | 348 | if (size > buf_capacity) { | ||
1193 | 349 | buf_capacity = size; | ||
1194 | 350 | buf = (uint8_t*)realloc(buf, size); | ||
1195 | 351 | } | ||
1196 | 352 | |||
1197 | 353 | /* Read the event body into buffer. */ | ||
1198 | 354 | ret = source.read_contents(size, buf); | ||
1199 | 355 | if (!ret) { | ||
1200 | 356 | error << _("Event has time and size but no body, corrupt MIDI ring") << endmsg; | ||
1201 | 357 | break; | ||
1202 | 358 | } | ||
1203 | 359 | |||
1204 | 360 | /* Convert event time from absolute to source relative. */ | ||
1205 | 361 | if (time < position) { | ||
1206 | 362 | error << _("Event time is before MIDI source position") << endmsg; | ||
1207 | 363 | break; | ||
1208 | 364 | } | ||
1209 | 365 | time -= position; | ||
1210 | 366 | |||
1211 | 367 | ev.set(buf, size, time); | ||
1212 | 368 | ev.set_event_type(EventTypeMap::instance().midi_event_type(ev.buffer()[0])); | ||
1213 | 369 | ev.set_id(Evoral::next_event_id()); | ||
1214 | 370 | |||
1215 | 371 | if (!(ev.is_channel_event() || ev.is_smf_meta_event() || ev.is_sysex())) { | ||
1216 | 372 | continue; | ||
1217 | 373 | } | ||
1218 | 374 | |||
1219 | 375 | append_event_unlocked_frames(ev, position); | ||
1220 | 376 | } | ||
1221 | 377 | |||
1222 | 378 | Evoral::SMF::flush (); | ||
1223 | 379 | free (buf); | ||
1224 | 380 | |||
1225 | 381 | return cnt; | ||
1226 | 382 | } | ||
1227 | 383 | |||
1228 | 384 | /** Append an event with a timestamp in beats (double) */ | ||
1229 | 385 | void | ||
1230 | 386 | SMFSource::append_event_unlocked_beats (const Evoral::Event<double>& ev) | ||
1231 | 387 | { | ||
1232 | 388 | if (!_writing || ev.size() == 0) { | ||
1233 | 389 | return; | ||
1234 | 390 | } | ||
1235 | 391 | |||
1236 | 392 | /*printf("SMFSource: %s - append_event_unlocked_beats ID = %d time = %lf, size = %u, data = ", | ||
1237 | 393 | name().c_str(), ev.id(), ev.time(), ev.size()); | ||
1238 | 394 | for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/ | ||
1239 | 395 | |||
1240 | 396 | if (ev.time() < _last_ev_time_beats) { | ||
1241 | 397 | warning << string_compose(_("Skipping event with unordered time %1"), ev.time()) | ||
1242 | 398 | << endmsg; | ||
1243 | 399 | return; | ||
1244 | 400 | } | ||
1245 | 401 | |||
1246 | 402 | Evoral::event_id_t event_id; | ||
1247 | 403 | |||
1248 | 404 | if (ev.id() < 0) { | ||
1249 | 405 | event_id = Evoral::next_event_id(); | ||
1250 | 406 | } else { | ||
1251 | 407 | event_id = ev.id(); | ||
1252 | 408 | } | ||
1253 | 409 | |||
1254 | 410 | if (_model) { | ||
1255 | 411 | _model->append (ev, event_id); | ||
1256 | 412 | } | ||
1257 | 413 | |||
1258 | 414 | _length_beats = max(_length_beats, ev.time()); | ||
1259 | 415 | |||
1260 | 416 | const double delta_time_beats = ev.time() - _last_ev_time_beats; | ||
1261 | 417 | const uint32_t delta_time_ticks = (uint32_t)lrint(delta_time_beats * (double)ppqn()); | ||
1262 | 418 | |||
1263 | 419 | Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id); | ||
1264 | 420 | _last_ev_time_beats = ev.time(); | ||
1265 | 421 | _flags = Source::Flag (_flags & ~Empty); | ||
1266 | 422 | } | ||
1267 | 423 | |||
1268 | 424 | /** Append an event with a timestamp in frames (framepos_t) */ | ||
1269 | 425 | void | ||
1270 | 426 | SMFSource::append_event_unlocked_frames (const Evoral::Event<framepos_t>& ev, framepos_t position) | ||
1271 | 427 | { | ||
1272 | 428 | if (!_writing || ev.size() == 0) { | ||
1273 | 429 | return; | ||
1274 | 430 | } | ||
1275 | 431 | |||
1276 | 432 | // printf("SMFSource: %s - append_event_unlocked_frames ID = %d time = %u, size = %u, data = ", | ||
1277 | 433 | // name().c_str(), ev.id(), ev.time(), ev.size()); | ||
1278 | 434 | // for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n"); | ||
1279 | 435 | |||
1280 | 436 | if (ev.time() < _last_ev_time_frames) { | ||
1281 | 437 | warning << string_compose(_("Skipping event with unordered time %1"), ev.time()) | ||
1282 | 438 | << endmsg; | ||
1283 | 439 | return; | ||
1284 | 440 | } | ||
1285 | 441 | |||
1286 | 442 | BeatsFramesConverter converter(_session.tempo_map(), position); | ||
1287 | 443 | const double ev_time_beats = converter.from(ev.time()); | ||
1288 | 444 | Evoral::event_id_t event_id; | ||
1289 | 445 | |||
1290 | 446 | if (ev.id() < 0) { | ||
1291 | 447 | event_id = Evoral::next_event_id(); | ||
1292 | 448 | } else { | ||
1293 | 449 | event_id = ev.id(); | ||
1294 | 450 | } | ||
1295 | 451 | |||
1296 | 452 | if (_model) { | ||
1297 | 453 | const Evoral::Event<double> beat_ev (ev.event_type(), | ||
1298 | 454 | ev_time_beats, | ||
1299 | 455 | ev.size(), | ||
1300 | 456 | const_cast<uint8_t*>(ev.buffer())); | ||
1301 | 457 | _model->append (beat_ev, event_id); | ||
1302 | 458 | } | ||
1303 | 459 | |||
1304 | 460 | _length_beats = max(_length_beats, ev_time_beats); | ||
1305 | 461 | |||
1306 | 462 | const Evoral::MusicalTime last_time_beats = converter.from (_last_ev_time_frames); | ||
1307 | 463 | const Evoral::MusicalTime delta_time_beats = ev_time_beats - last_time_beats; | ||
1308 | 464 | const uint32_t delta_time_ticks = (uint32_t)(lrint(delta_time_beats * (double)ppqn())); | ||
1309 | 465 | |||
1310 | 466 | Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id); | ||
1311 | 467 | _last_ev_time_frames = ev.time(); | ||
1312 | 468 | _flags = Source::Flag (_flags & ~Empty); | ||
1313 | 469 | } | ||
1314 | 470 | |||
1315 | 471 | XMLNode& | ||
1316 | 472 | SMFSource::get_state () | ||
1317 | 473 | { | ||
1318 | 474 | XMLNode& node = MidiSource::get_state(); | ||
1319 | 475 | node.add_property (X_("origin"), _origin); | ||
1320 | 476 | return node; | ||
1321 | 477 | } | ||
1322 | 478 | |||
1323 | 479 | int | ||
1324 | 480 | SMFSource::set_state (const XMLNode& node, int version) | ||
1325 | 481 | { | ||
1326 | 482 | if (Source::set_state (node, version)) { | ||
1327 | 483 | return -1; | ||
1328 | 484 | } | ||
1329 | 485 | |||
1330 | 486 | if (MidiSource::set_state (node, version)) { | ||
1331 | 487 | return -1; | ||
1332 | 488 | } | ||
1333 | 489 | |||
1334 | 490 | if (FileSource::set_state (node, version)) { | ||
1335 | 491 | return -1; | ||
1336 | 492 | } | ||
1337 | 493 | |||
1338 | 494 | return 0; | ||
1339 | 495 | } | ||
1340 | 496 | |||
1341 | 497 | void | ||
1342 | 498 | SMFSource::mark_streaming_midi_write_started (NoteMode mode) | ||
1343 | 499 | { | ||
1344 | 500 | /* CALLER MUST HOLD LOCK */ | ||
1345 | 501 | |||
1346 | 502 | if (!_open && open_for_write()) { | ||
1347 | 503 | error << string_compose (_("cannot open MIDI file %1 for write"), _path) << endmsg; | ||
1348 | 504 | /* XXX should probably throw or return something */ | ||
1349 | 505 | return; | ||
1350 | 506 | } | ||
1351 | 507 | |||
1352 | 508 | MidiSource::mark_streaming_midi_write_started (mode); | ||
1353 | 509 | Evoral::SMF::begin_write (); | ||
1354 | 510 | _last_ev_time_beats = 0.0; | ||
1355 | 511 | _last_ev_time_frames = 0; | ||
1356 | 512 | } | ||
1357 | 513 | |||
1358 | 514 | void | ||
1359 | 515 | SMFSource::mark_streaming_write_completed () | ||
1360 | 516 | { | ||
1361 | 517 | mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::DeleteStuckNotes); | ||
1362 | 518 | } | ||
1363 | 519 | |||
1364 | 520 | void | ||
1365 | 521 | SMFSource::mark_midi_streaming_write_completed (Evoral::Sequence<Evoral::MusicalTime>::StuckNoteOption stuck_notes_option, Evoral::MusicalTime when) | ||
1366 | 522 | { | ||
1367 | 523 | Glib::Threads::Mutex::Lock lm (_lock); | ||
1368 | 524 | MidiSource::mark_midi_streaming_write_completed (stuck_notes_option, when); | ||
1369 | 525 | |||
1370 | 526 | if (!writable()) { | ||
1371 | 527 | warning << string_compose ("attempt to write to unwritable SMF file %1", _path) << endmsg; | ||
1372 | 528 | return; | ||
1373 | 529 | } | ||
1374 | 530 | |||
1375 | 531 | if (_model) { | ||
1376 | 532 | _model->set_edited(false); | ||
1377 | 533 | } | ||
1378 | 534 | |||
1379 | 535 | Evoral::SMF::end_write (); | ||
1380 | 536 | |||
1381 | 537 | /* data in the file now, not removable */ | ||
1382 | 538 | |||
1383 | 539 | mark_nonremovable (); | ||
1384 | 540 | } | ||
1385 | 541 | |||
1386 | 542 | bool | ||
1387 | 543 | SMFSource::valid_midi_file (const string& file) | ||
1388 | 544 | { | ||
1389 | 545 | if (safe_midi_file_extension (file) ) { | ||
1390 | 546 | return (SMF::test (file) ); | ||
1391 | 547 | } | ||
1392 | 548 | return false; | ||
1393 | 549 | } | ||
1394 | 550 | |||
1395 | 551 | bool | ||
1396 | 552 | SMFSource::safe_midi_file_extension (const string& file) | ||
1397 | 553 | { | ||
1398 | 554 | static regex_t compiled_pattern; | ||
1399 | 555 | static bool compile = true; | ||
1400 | 556 | const int nmatches = 2; | ||
1401 | 557 | regmatch_t matches[nmatches]; | ||
1402 | 558 | |||
1403 | 559 | if (Glib::file_test (file, Glib::FILE_TEST_EXISTS)) { | ||
1404 | 560 | if (!Glib::file_test (file, Glib::FILE_TEST_IS_REGULAR)) { | ||
1405 | 561 | /* exists but is not a regular file */ | ||
1406 | 562 | return false; | ||
1407 | 563 | } | ||
1408 | 564 | } | ||
1409 | 565 | |||
1410 | 566 | if (compile && regcomp (&compiled_pattern, "\\.[mM][iI][dD][iI]?$", REG_EXTENDED)) { | ||
1411 | 567 | return false; | ||
1412 | 568 | } else { | ||
1413 | 569 | compile = false; | ||
1414 | 570 | } | ||
1415 | 571 | |||
1416 | 572 | if (regexec (&compiled_pattern, file.c_str(), nmatches, matches, 0)) { | ||
1417 | 573 | return false; | ||
1418 | 574 | } | ||
1419 | 575 | |||
1420 | 576 | return true; | ||
1421 | 577 | } | ||
1422 | 578 | |||
1423 | 579 | static bool compare_eventlist ( | ||
1424 | 580 | const std::pair< Evoral::Event<double>*, gint >& a, | ||
1425 | 581 | const std::pair< Evoral::Event<double>*, gint >& b) { | ||
1426 | 582 | return ( a.first->time() < b.first->time() ); | ||
1427 | 583 | } | ||
1428 | 584 | |||
1429 | 585 | void | ||
1430 | 586 | SMFSource::load_model (bool lock, bool force_reload) | ||
1431 | 587 | { | ||
1432 | 588 | if (_writing) { | ||
1433 | 589 | return; | ||
1434 | 590 | } | ||
1435 | 591 | |||
1436 | 592 | boost::shared_ptr<Glib::Threads::Mutex::Lock> lm; | ||
1437 | 593 | if (lock) | ||
1438 | 594 | lm = boost::shared_ptr<Glib::Threads::Mutex::Lock>(new Glib::Threads::Mutex::Lock(_lock)); | ||
1439 | 595 | |||
1440 | 596 | if (_model && !force_reload) { | ||
1441 | 597 | return; | ||
1442 | 598 | } | ||
1443 | 599 | |||
1444 | 600 | if (!_model) { | ||
1445 | 601 | _model = boost::shared_ptr<MidiModel> (new MidiModel (shared_from_this ())); | ||
1446 | 602 | } else { | ||
1447 | 603 | _model->clear(); | ||
1448 | 604 | } | ||
1449 | 605 | |||
1450 | 606 | if (writable() && !_open) { | ||
1451 | 607 | return; | ||
1452 | 608 | } | ||
1453 | 609 | |||
1454 | 610 | _model->start_write(); | ||
1455 | 611 | Evoral::SMF::seek_to_start(); | ||
1456 | 612 | |||
1457 | 613 | uint64_t time = 0; /* in SMF ticks */ | ||
1458 | 614 | Evoral::Event<double> ev; | ||
1459 | 615 | |||
1460 | 616 | uint32_t scratch_size = 0; // keep track of scratch and minimize reallocs | ||
1461 | 617 | |||
1462 | 618 | uint32_t delta_t = 0; | ||
1463 | 619 | uint32_t size = 0; | ||
1464 | 620 | uint8_t* buf = NULL; | ||
1465 | 621 | int ret; | ||
1466 | 622 | gint event_id; | ||
1467 | 623 | bool have_event_id; | ||
1468 | 624 | |||
1469 | 625 | // TODO simplify event allocation | ||
1470 | 626 | std::list< std::pair< Evoral::Event<double>*, gint > > eventlist; | ||
1471 | 627 | |||
1472 | 628 | for (unsigned i = 1; i <= num_tracks(); ++i) { | ||
1473 | 629 | if (seek_to_track(i)) continue; | ||
1474 | 630 | |||
1475 | 631 | time = 0; | ||
1476 | 632 | have_event_id = false; | ||
1477 | 633 | |||
1478 | 634 | while ((ret = read_event (&delta_t, &size, &buf, &event_id)) >= 0) { | ||
1479 | 635 | |||
1480 | 636 | time += delta_t; | ||
1481 | 637 | |||
1482 | 638 | if (ret == 0) { | ||
1483 | 639 | /* meta-event : did we get an event ID ? */ | ||
1484 | 640 | if (event_id >= 0) { | ||
1485 | 641 | have_event_id = true; | ||
1486 | 642 | } | ||
1487 | 643 | continue; | ||
1488 | 644 | } | ||
1489 | 645 | |||
1490 | 646 | if (ret > 0) { | ||
1491 | 647 | /* not a meta-event */ | ||
1492 | 648 | |||
1493 | 649 | if (!have_event_id) { | ||
1494 | 650 | event_id = Evoral::next_event_id(); | ||
1495 | 651 | } | ||
1496 | 652 | uint32_t event_type = EventTypeMap::instance().midi_event_type(buf[0]); | ||
1497 | 653 | double event_time = time / (double) ppqn(); | ||
1498 | 654 | #ifndef NDEBUG | ||
1499 | 655 | std::string ss; | ||
1500 | 656 | |||
1501 | 657 | for (uint32_t xx = 0; xx < size; ++xx) { | ||
1502 | 658 | char b[8]; | ||
1503 | 659 | snprintf (b, sizeof (b), "0x%x ", buf[xx]); | ||
1504 | 660 | ss += b; | ||
1505 | 661 | } | ||
1506 | 662 | |||
1507 | 663 | DEBUG_TRACE (DEBUG::MidiSourceIO, string_compose ("SMF %6 load model delta %1, time %2, size %3 buf %4, type %5\n", | ||
1508 | 664 | delta_t, time, size, ss , event_type, name())); | ||
1509 | 665 | #endif | ||
1510 | 666 | |||
1511 | 667 | eventlist.push_back(make_pair ( | ||
1512 | 668 | new Evoral::Event<double> ( | ||
1513 | 669 | event_type, event_time, | ||
1514 | 670 | size, buf, true) | ||
1515 | 671 | , event_id)); | ||
1516 | 672 | |||
1517 | 673 | // Set size to max capacity to minimize allocs in read_event | ||
1518 | 674 | scratch_size = std::max(size, scratch_size); | ||
1519 | 675 | size = scratch_size; | ||
1520 | 676 | |||
1521 | 677 | _length_beats = max(_length_beats, event_time); | ||
1522 | 678 | } | ||
1523 | 679 | |||
1524 | 680 | /* event ID's must immediately precede the event they are for */ | ||
1525 | 681 | have_event_id = false; | ||
1526 | 682 | } | ||
1527 | 683 | } | ||
1528 | 684 | |||
1529 | 685 | eventlist.sort(compare_eventlist); | ||
1530 | 686 | |||
1531 | 687 | std::list< std::pair< Evoral::Event<double>*, gint > >::iterator it; | ||
1532 | 688 | for (it=eventlist.begin(); it!=eventlist.end(); ++it) { | ||
1533 | 689 | _model->append (*it->first, it->second); | ||
1534 | 690 | delete it->first; | ||
1535 | 691 | } | ||
1536 | 692 | |||
1537 | 693 | _model->end_write (Evoral::Sequence<Evoral::MusicalTime>::ResolveStuckNotes, _length_beats); | ||
1538 | 694 | _model->set_edited (false); | ||
1539 | 695 | |||
1540 | 696 | _model_iter = _model->begin(); | ||
1541 | 697 | |||
1542 | 698 | free(buf); | ||
1543 | 699 | } | ||
1544 | 700 | |||
1545 | 701 | void | ||
1546 | 702 | SMFSource::destroy_model () | ||
1547 | 703 | { | ||
1548 | 704 | //cerr << _name << " destroying model " << _model.get() << endl; | ||
1549 | 705 | _model.reset(); | ||
1550 | 706 | } | ||
1551 | 707 | |||
1552 | 708 | void | ||
1553 | 709 | SMFSource::flush_midi () | ||
1554 | 710 | { | ||
1555 | 711 | if (!writable() || _length_beats == 0.0) { | ||
1556 | 712 | return; | ||
1557 | 713 | } | ||
1558 | 714 | |||
1559 | 715 | ensure_disk_file (); | ||
1560 | 716 | |||
1561 | 717 | Evoral::SMF::end_write (); | ||
1562 | 718 | /* data in the file means its no longer removable */ | ||
1563 | 719 | mark_nonremovable (); | ||
1564 | 720 | } | ||
1565 | 721 | |||
1566 | 722 | void | ||
1567 | 723 | SMFSource::set_path (const string& p) | ||
1568 | 724 | { | ||
1569 | 725 | FileSource::set_path (p); | ||
1570 | 726 | SMF::set_path (_path); | ||
1571 | 727 | } | ||
1572 | 728 | |||
1573 | 729 | /** Ensure that this source has some file on disk, even if it's just a SMF header */ | ||
1574 | 730 | void | ||
1575 | 731 | SMFSource::ensure_disk_file () | ||
1576 | 732 | { | ||
1577 | 733 | if (!writable()) { | ||
1578 | 734 | return; | ||
1579 | 735 | } | ||
1580 | 736 | |||
1581 | 737 | if (_model) { | ||
1582 | 738 | /* We have a model, so write it to disk; see MidiSource::session_saved | ||
1583 | 739 | for an explanation of what we are doing here. | ||
1584 | 740 | */ | ||
1585 | 741 | boost::shared_ptr<MidiModel> mm = _model; | ||
1586 | 742 | _model.reset (); | ||
1587 | 743 | mm->sync_to_source (); | ||
1588 | 744 | _model = mm; | ||
1589 | 745 | } else { | ||
1590 | 746 | /* No model; if it's not already open, it's an empty source, so create | ||
1591 | 747 | and open it for writing. | ||
1592 | 748 | */ | ||
1593 | 749 | if (!_open) { | ||
1594 | 750 | open_for_write (); | ||
1595 | 751 | } | ||
1596 | 752 | } | ||
1597 | 753 | } | ||
1598 | 754 | |||
1599 | 755 | void | ||
1600 | 756 | SMFSource::prevent_deletion () | ||
1601 | 757 | { | ||
1602 | 758 | /* Unlike the audio case, the MIDI file remains mutable (because we can | ||
1603 | 759 | edit MIDI data) | ||
1604 | 760 | */ | ||
1605 | 761 | |||
1606 | 762 | _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy)); | ||
1607 | 763 | } | ||
1608 | 764 | |||
1609 | 0 | 765 | ||
1610 | === modified file '.pc/wscript.patch/wscript' | |||
1611 | --- .pc/wscript.patch/wscript 2014-01-24 16:31:54 +0000 | |||
1612 | +++ .pc/wscript.patch/wscript 2015-05-02 14:23:30 +0000 | |||
1613 | @@ -177,10 +177,6 @@ | |||
1614 | 177 | if opt.gprofile: | 177 | if opt.gprofile: |
1615 | 178 | debug_flags = [ '-pg' ] | 178 | debug_flags = [ '-pg' ] |
1616 | 179 | 179 | ||
1617 | 180 | if opt.backtrace: | ||
1618 | 181 | if platform != 'darwin' and not is_clang: | ||
1619 | 182 | debug_flags = [ '-rdynamic' ] | ||
1620 | 183 | |||
1621 | 184 | # Autodetect | 180 | # Autodetect |
1622 | 185 | if opt.dist_target == 'auto': | 181 | if opt.dist_target == 'auto': |
1623 | 186 | if platform == 'darwin': | 182 | if platform == 'darwin': |
1624 | @@ -415,6 +411,10 @@ | |||
1625 | 415 | conf.env.append_value('CFLAGS', optimization_flags) | 411 | conf.env.append_value('CFLAGS', optimization_flags) |
1626 | 416 | conf.env.append_value('CXXFLAGS', optimization_flags) | 412 | conf.env.append_value('CXXFLAGS', optimization_flags) |
1627 | 417 | 413 | ||
1628 | 414 | if opt.backtrace: | ||
1629 | 415 | if platform != 'darwin' and not is_clang: | ||
1630 | 416 | linker_flags += [ '-rdynamic' ] | ||
1631 | 417 | |||
1632 | 418 | conf.env.append_value('CFLAGS', compiler_flags) | 418 | conf.env.append_value('CFLAGS', compiler_flags) |
1633 | 419 | conf.env.append_value('CFLAGS', c_flags) | 419 | conf.env.append_value('CFLAGS', c_flags) |
1634 | 420 | conf.env.append_value('CXXFLAGS', compiler_flags) | 420 | conf.env.append_value('CXXFLAGS', compiler_flags) |
1635 | 421 | 421 | ||
1636 | === modified file 'debian/changelog' | |||
1637 | --- debian/changelog 2014-01-24 16:31:54 +0000 | |||
1638 | +++ debian/changelog 2015-05-02 14:23:30 +0000 | |||
1639 | @@ -1,15 +1,78 @@ | |||
1652 | 1 | ardour3 (3.5.308~dfsg-1) unstable; urgency=low | 1 | <<<<<<< TREE |
1653 | 2 | 2 | ardour3 (3.5.308~dfsg-1) unstable; urgency=low | |
1654 | 3 | [ Jaromír Mikeš ] | 3 | |
1655 | 4 | * Use higher resolution picture for desktop icon (Closes: #729890). | 4 | [ Jaromír Mikeš ] |
1656 | 5 | 5 | * Use higher resolution picture for desktop icon (Closes: #729890). | |
1657 | 6 | [ Adrian Knoth ] | 6 | |
1658 | 7 | * Change Name entry in desktop file (Closes: #729890) | 7 | [ Adrian Knoth ] |
1659 | 8 | * Remove python runtime dependencies | 8 | * Change Name entry in desktop file (Closes: #729890) |
1660 | 9 | * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969) | 9 | * Remove python runtime dependencies |
1661 | 10 | 10 | * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969) | |
1662 | 11 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +0100 | 11 | |
1663 | 12 | 12 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +0100 | |
1664 | 13 | |||
1665 | 14 | ======= | ||
1666 | 15 | ardour3 (3.5.403~dfsg-3) unstable; urgency=medium | ||
1667 | 16 | |||
1668 | 17 | * Fix MIDI data loss when editing (Closes: #772118) | ||
1669 | 18 | |||
1670 | 19 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Thu, 04 Dec 2014 19:34:45 +0100 | ||
1671 | 20 | |||
1672 | 21 | ardour3 (3.5.403~dfsg-2) unstable; urgency=high | ||
1673 | 22 | |||
1674 | 23 | * Reupload with waf fixes from 3.5.380~dfsg-2 and -3 | ||
1675 | 24 | |||
1676 | 25 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 03 Oct 2014 14:01:07 +0200 | ||
1677 | 26 | |||
1678 | 27 | ardour3 (3.5.403~dfsg-1) unstable; urgency=high | ||
1679 | 28 | |||
1680 | 29 | * Imported Upstream version 3.5.403~dfsg | ||
1681 | 30 | * Critical bugfix release. All users are recommended to upgrade. | ||
1682 | 31 | * Details: https://community.ardour.org/node/8457 | ||
1683 | 32 | |||
1684 | 33 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 03 Oct 2014 13:02:45 +0200 | ||
1685 | 34 | |||
1686 | 35 | ardour3 (3.5.380~dfsg-3) unstable; urgency=medium | ||
1687 | 36 | |||
1688 | 37 | * Prevent build failures in slower architectures by | ||
1689 | 38 | forcing waf logging to stdout instead of stderr. | ||
1690 | 39 | |||
1691 | 40 | -- Felipe Sateler <fsateler@debian.org> Fri, 11 Jul 2014 12:46:37 -0400 | ||
1692 | 41 | |||
1693 | 42 | ardour3 (3.5.380~dfsg-2) unstable; urgency=medium | ||
1694 | 43 | |||
1695 | 44 | * Team upload. | ||
1696 | 45 | * Pass correct -j flag to waf. Closes: #748584 | ||
1697 | 46 | |||
1698 | 47 | -- Felipe Sateler <fsateler@debian.org> Mon, 16 Jun 2014 11:03:20 -0400 | ||
1699 | 48 | |||
1700 | 49 | ardour3 (3.5.380~dfsg-1) unstable; urgency=low | ||
1701 | 50 | |||
1702 | 51 | * Imported Upstream version 3.5.380~dfsg | ||
1703 | 52 | |||
1704 | 53 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Thu, 15 May 2014 14:33:48 +0200 | ||
1705 | 54 | |||
1706 | 55 | ardour3 (3.5.357~dfsg-1) unstable; urgency=high | ||
1707 | 56 | |||
1708 | 57 | * Imported Upstream version 3.5.357~dfsg | ||
1709 | 58 | * Critical bugfix release. All users are recommended to upgrade. | ||
1710 | 59 | * Details: https://community.ardour.org/node/8015 | ||
1711 | 60 | |||
1712 | 61 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Tue, 25 Feb 2014 14:13:18 +0100 | ||
1713 | 62 | |||
1714 | 63 | ardour3 (3.5.308~dfsg-1) unstable; urgency=low | ||
1715 | 64 | |||
1716 | 65 | [ Jaromír Mikeš ] | ||
1717 | 66 | * Use higher resolution picture for desktop icon (Closes: #729890). | ||
1718 | 67 | |||
1719 | 68 | [ Adrian Knoth ] | ||
1720 | 69 | * Change Name entry in desktop file (Closes: #729890) | ||
1721 | 70 | * Remove python runtime dependencies | ||
1722 | 71 | * Imported Upstream version 3.5.308~dfsg (Closes: #734079 #733969) | ||
1723 | 72 | |||
1724 | 73 | -- Adrian Knoth <adi@drcomp.erfurt.thur.de> Fri, 24 Jan 2014 16:31:54 +0100 | ||
1725 | 74 | |||
1726 | 75 | >>>>>>> MERGE-SOURCE | ||
1727 | 13 | ardour3 (3.5.143~dfsg-1) unstable; urgency=low | 76 | ardour3 (3.5.143~dfsg-1) unstable; urgency=low |
1728 | 14 | 77 | ||
1729 | 15 | * Imported Upstream version 3.5.143~dfsg | 78 | * Imported Upstream version 3.5.143~dfsg |
1730 | 16 | 79 | ||
1731 | === modified file 'debian/control' | |||
1732 | --- debian/control 2014-01-24 16:31:54 +0000 | |||
1733 | +++ debian/control 2015-05-02 14:23:30 +0000 | |||
1734 | @@ -47,9 +47,15 @@ | |||
1735 | 47 | vamp-plugin-sdk (>=2.1), | 47 | vamp-plugin-sdk (>=2.1), |
1736 | 48 | python-setuptools, | 48 | python-setuptools, |
1737 | 49 | python-isodate, | 49 | python-isodate, |
1738 | 50 | <<<<<<< TREE | ||
1739 | 50 | libpcre3-dev, | 51 | libpcre3-dev, |
1740 | 51 | python-rdflib | 52 | python-rdflib |
1741 | 52 | Standards-Version: 3.9.4 | 53 | Standards-Version: 3.9.4 |
1742 | 54 | ======= | ||
1743 | 55 | libpcre3-dev, | ||
1744 | 56 | python-rdflib | ||
1745 | 57 | Standards-Version: 3.9.6 | ||
1746 | 58 | >>>>>>> MERGE-SOURCE | ||
1747 | 53 | Homepage: http://www.ardour.org/ | 59 | Homepage: http://www.ardour.org/ |
1748 | 54 | Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git | 60 | Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git |
1749 | 55 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git | 61 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git |
1750 | 56 | 62 | ||
1751 | === modified file 'debian/control.in' | |||
1752 | --- debian/control.in 2014-01-24 16:31:54 +0000 | |||
1753 | +++ debian/control.in 2015-05-02 14:23:30 +0000 | |||
1754 | @@ -7,7 +7,7 @@ | |||
1755 | 7 | Jaromír Mikeš <mira.mikes@seznam.cz> | 7 | Jaromír Mikeš <mira.mikes@seznam.cz> |
1756 | 8 | Build-Depends: | 8 | Build-Depends: |
1757 | 9 | @cdbs@ | 9 | @cdbs@ |
1759 | 10 | Standards-Version: 3.9.4 | 10 | Standards-Version: 3.9.6 |
1760 | 11 | Homepage: http://www.ardour.org/ | 11 | Homepage: http://www.ardour.org/ |
1761 | 12 | Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git | 12 | Vcs-Git: git://anonscm.debian.org/pkg-multimedia/ardour3.git |
1762 | 13 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git | 13 | Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/ardour3.git |
1763 | 14 | 14 | ||
1764 | === added file 'debian/patches/log-stdout.patch' | |||
1765 | --- debian/patches/log-stdout.patch 1970-01-01 00:00:00 +0000 | |||
1766 | +++ debian/patches/log-stdout.patch 2015-05-02 14:23:30 +0000 | |||
1767 | @@ -0,0 +1,25 @@ | |||
1768 | 1 | Description: Log waf messages to stdout, not stderr | ||
1769 | 2 | The buildds kill the build if they don't see messages in stdout for a | ||
1770 | 3 | long time. Unfortunately, waf defaults to printing such messages to | ||
1771 | 4 | stderr, so ardour takes too long on slower archs. Work around that | ||
1772 | 5 | by printing to stdout. | ||
1773 | 6 | Author: Felipe Sateler <fsateler@debian.org> | ||
1774 | 7 | Forwarded: no | ||
1775 | 8 | --- ardour3-3.5.380~dfsg.orig/wscript | ||
1776 | 9 | +++ ardour3-3.5.380~dfsg/wscript | ||
1777 | 10 | @@ -777,6 +777,15 @@ const char* const ardour_config_info = " | ||
1778 | 11 | def build(bld): | ||
1779 | 12 | create_stored_revision() | ||
1780 | 13 | |||
1781 | 14 | + # Log command executions to stdout, not err | ||
1782 | 15 | + def our_log(msg): | ||
1783 | 16 | + if not msg: | ||
1784 | 17 | + return | ||
1785 | 18 | + sys.stdout.write(str(msg)) | ||
1786 | 19 | + sys.stdout.flush() | ||
1787 | 20 | + | ||
1788 | 21 | + bld.to_log = our_log | ||
1789 | 22 | + | ||
1790 | 23 | # add directories that contain only headers, to workaround an issue with waf | ||
1791 | 24 | |||
1792 | 25 | bld.path.find_dir ('libs/evoral/evoral') | ||
1793 | 0 | 26 | ||
1794 | === added file 'debian/patches/midi-data-loss.patch' | |||
1795 | --- debian/patches/midi-data-loss.patch 1970-01-01 00:00:00 +0000 | |||
1796 | +++ debian/patches/midi-data-loss.patch 2015-05-02 14:23:30 +0000 | |||
1797 | @@ -0,0 +1,62 @@ | |||
1798 | 1 | From: David Robillard <d@drobilla.net> | ||
1799 | 2 | Description: Fix MIDI data loss when editing | ||
1800 | 3 | Forwarded: not-needed | ||
1801 | 4 | Last-Update: 2014-12-04 | ||
1802 | 5 | Bug-Vendor: http://tracker.ardour.org/view.php?id=5669 | ||
1803 | 6 | Applied-Upstream: 3.5.404; https://github.com/Ardour/ardour/commit/94954f852ead97bcda7afa548d543222733228ef | ||
1804 | 7 | --- ardour3.orig/libs/ardour/smf_source.cc | ||
1805 | 8 | +++ ardour3/libs/ardour/smf_source.cc | ||
1806 | 9 | @@ -393,10 +393,22 @@ SMFSource::append_event_unlocked_beats ( | ||
1807 | 10 | name().c_str(), ev.id(), ev.time(), ev.size()); | ||
1808 | 11 | for (size_t i = 0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/ | ||
1809 | 12 | |||
1810 | 13 | - if (ev.time() < _last_ev_time_beats) { | ||
1811 | 14 | - warning << string_compose(_("Skipping event with unordered time %1"), ev.time()) | ||
1812 | 15 | - << endmsg; | ||
1813 | 16 | - return; | ||
1814 | 17 | + double time = ev.time(); | ||
1815 | 18 | + if (time < _last_ev_time_beats) { | ||
1816 | 19 | + const double difference = _last_ev_time_beats - time; | ||
1817 | 20 | + if (difference / (double)ppqn() < 1.0) { | ||
1818 | 21 | + /* Close enough. This problem occurs because Sequence is not | ||
1819 | 22 | + actually ordered due to fuzzy time comparison. I'm pretty sure | ||
1820 | 23 | + this is inherently a bad idea which causes problems all over the | ||
1821 | 24 | + place, but tolerate it here for now anyway. */ | ||
1822 | 25 | + time = _last_ev_time_beats; | ||
1823 | 26 | + } else { | ||
1824 | 27 | + /* Out of order by more than a tick. */ | ||
1825 | 28 | + warning << string_compose(_("Skipping event with unordered beat time %1 < %2 (off by %3 beats, %4 ticks)"), | ||
1826 | 29 | + ev.time(), _last_ev_time_beats, difference, difference / (double)ppqn()) | ||
1827 | 30 | + << endmsg; | ||
1828 | 31 | + return; | ||
1829 | 32 | + } | ||
1830 | 33 | } | ||
1831 | 34 | |||
1832 | 35 | Evoral::event_id_t event_id; | ||
1833 | 36 | @@ -411,13 +423,13 @@ SMFSource::append_event_unlocked_beats ( | ||
1834 | 37 | _model->append (ev, event_id); | ||
1835 | 38 | } | ||
1836 | 39 | |||
1837 | 40 | - _length_beats = max(_length_beats, ev.time()); | ||
1838 | 41 | + _length_beats = max(_length_beats, time); | ||
1839 | 42 | |||
1840 | 43 | - const double delta_time_beats = ev.time() - _last_ev_time_beats; | ||
1841 | 44 | + const double delta_time_beats = time - _last_ev_time_beats; | ||
1842 | 45 | const uint32_t delta_time_ticks = (uint32_t)lrint(delta_time_beats * (double)ppqn()); | ||
1843 | 46 | |||
1844 | 47 | Evoral::SMF::append_event_delta(delta_time_ticks, ev.size(), ev.buffer(), event_id); | ||
1845 | 48 | - _last_ev_time_beats = ev.time(); | ||
1846 | 49 | + _last_ev_time_beats = time; | ||
1847 | 50 | _flags = Source::Flag (_flags & ~Empty); | ||
1848 | 51 | } | ||
1849 | 52 | |||
1850 | 53 | @@ -434,7 +446,8 @@ SMFSource::append_event_unlocked_frames | ||
1851 | 54 | // for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n"); | ||
1852 | 55 | |||
1853 | 56 | if (ev.time() < _last_ev_time_frames) { | ||
1854 | 57 | - warning << string_compose(_("Skipping event with unordered time %1"), ev.time()) | ||
1855 | 58 | + warning << string_compose(_("Skipping event with unordered frame time %1 < %2"), | ||
1856 | 59 | + ev.time(), _last_ev_time_frames) | ||
1857 | 60 | << endmsg; | ||
1858 | 61 | return; | ||
1859 | 62 | } | ||
1860 | 0 | 63 | ||
1861 | === modified file 'debian/patches/series' | |||
1862 | --- debian/patches/series 2013-11-06 13:22:44 +0000 | |||
1863 | +++ debian/patches/series 2015-05-02 14:23:30 +0000 | |||
1864 | @@ -1,2 +1,4 @@ | |||
1865 | 1 | waf.patch | 1 | waf.patch |
1866 | 2 | wscript.patch | 2 | wscript.patch |
1867 | 3 | log-stdout.patch | ||
1868 | 4 | midi-data-loss.patch | ||
1869 | 3 | 5 | ||
1870 | === modified file 'debian/rules' | |||
1871 | --- debian/rules 2014-01-24 16:31:54 +0000 | |||
1872 | +++ debian/rules 2015-05-02 14:23:30 +0000 | |||
1873 | @@ -37,7 +37,8 @@ | |||
1874 | 37 | --optimize \ | 37 | --optimize \ |
1875 | 38 | 38 | ||
1876 | 39 | 39 | ||
1878 | 40 | DEB_MAKE_EXTRA_ARGS = -v --destdir=$(CURDIR)/debian/tmp | 40 | DEB_MAKE_PARALLEL = -j$(if $(DEB_PARALLEL_JOBS),$(DEB_PARALLEL_JOBS),1) |
1879 | 41 | DEB_MAKE_EXTRA_ARGS = -v --destdir=$(CURDIR)/debian/tmp $(DEB_MAKE_PARALLEL) | ||
1880 | 41 | DEB_MAKE_BUILD_TARGET = build i18n_mo | 42 | DEB_MAKE_BUILD_TARGET = build i18n_mo |
1881 | 42 | DEB_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))" | 43 | DEB_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))" |
1882 | 43 | DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(CURDIR)/waf-light $(DEB_MAKE_EXTRA_ARGS) | 44 | DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(CURDIR)/waf-light $(DEB_MAKE_EXTRA_ARGS) |
1883 | 44 | 45 | ||
1884 | === modified file 'gtk2_ardour/add_video_dialog.cc' | |||
1885 | --- gtk2_ardour/add_video_dialog.cc 2013-09-21 19:05:02 +0000 | |||
1886 | +++ gtk2_ardour/add_video_dialog.cc 2015-05-02 14:23:30 +0000 | |||
1887 | @@ -258,7 +258,8 @@ | |||
1888 | 258 | ".ogg" , ".OGG" , | 258 | ".ogg" , ".OGG" , |
1889 | 259 | ".ogv" , ".OGV" , | 259 | ".ogv" , ".OGV" , |
1890 | 260 | ".mpg" , ".MPG" , | 260 | ".mpg" , ".MPG" , |
1892 | 261 | ".mov" , ".MOV" , | 261 | ".mpeg" , ".MPEG" , |
1893 | 262 | ".mts" , ".MTS" , | ||
1894 | 262 | ".mp4" , ".MP4" , | 263 | ".mp4" , ".MP4" , |
1895 | 263 | ".mkv" , ".MKV" , | 264 | ".mkv" , ".MKV" , |
1896 | 264 | ".vob" , ".VOB" , | 265 | ".vob" , ".VOB" , |
1897 | @@ -272,6 +273,8 @@ | |||
1898 | 272 | ".dv" , ".DV" , | 273 | ".dv" , ".DV" , |
1899 | 273 | ".dirac" , ".DIRAC" , | 274 | ".dirac" , ".DIRAC" , |
1900 | 274 | ".webm" , ".WEBM" , | 275 | ".webm" , ".WEBM" , |
1901 | 276 | ".wmv" , ".wmv" , | ||
1902 | 277 | ".ts" , ".ts" , | ||
1903 | 275 | }; | 278 | }; |
1904 | 276 | 279 | ||
1905 | 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) { |
1906 | 278 | 281 | ||
1907 | === modified file 'gtk2_ardour/ardev_common.sh.in' | |||
1908 | --- gtk2_ardour/ardev_common.sh.in 2014-01-24 16:31:54 +0000 | |||
1909 | +++ gtk2_ardour/ardev_common.sh.in 2015-05-02 14:23:30 +0000 | |||
1910 | @@ -18,6 +18,7 @@ | |||
1911 | 18 | export ARDOUR_MCP_PATH=$TOP/mcp:. | 18 | export ARDOUR_MCP_PATH=$TOP/mcp:. |
1912 | 19 | export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:. | 19 | export ARDOUR_EXPORT_FORMATS_PATH=$TOP/export:. |
1913 | 20 | export ARDOUR_BACKEND_PATH=$libs/backends/jack | 20 | export ARDOUR_BACKEND_PATH=$libs/backends/jack |
1914 | 21 | export ARDOUR_TEST_PATH=$libs/ardour/test/data | ||
1915 | 21 | 22 | ||
1916 | 22 | # | 23 | # |
1917 | 23 | # even though we set the above variables, ardour requires that these | 24 | # even though we set the above variables, ardour requires that these |
1918 | 24 | 25 | ||
1919 | === modified file 'gtk2_ardour/ardour.menus.in' | |||
1920 | --- gtk2_ardour/ardour.menus.in 2014-01-24 16:31:54 +0000 | |||
1921 | +++ gtk2_ardour/ardour.menus.in 2015-05-02 14:23:30 +0000 | |||
1922 | @@ -341,6 +341,7 @@ | |||
1923 | 341 | 341 | ||
1924 | 342 | <menu name='View' action = 'View'> | 342 | <menu name='View' action = 'View'> |
1925 | 343 | <menuitem action='ToggleMaximalEditor'/> | 343 | <menuitem action='ToggleMaximalEditor'/> |
1926 | 344 | <menuitem action='ToggleMaximalMixer'/> | ||
1927 | 344 | <menuitem action='KeepTearoffs'/> | 345 | <menuitem action='KeepTearoffs'/> |
1928 | 345 | 346 | ||
1929 | 346 | <separator/> | 347 | <separator/> |
1930 | 347 | 348 | ||
1931 | === modified file 'gtk2_ardour/ardour_ui.cc' | |||
1932 | --- gtk2_ardour/ardour_ui.cc 2014-01-24 16:31:54 +0000 | |||
1933 | +++ gtk2_ardour/ardour_ui.cc 2015-05-02 14:23:30 +0000 | |||
1934 | @@ -496,10 +496,13 @@ | |||
1935 | 496 | 496 | ||
1936 | 497 | vector<string>::iterator n; | 497 | vector<string>::iterator n; |
1937 | 498 | vector<string>::iterator k; | 498 | vector<string>::iterator k; |
1940 | 499 | for (n = names.begin(), k = keys.begin(); n != names.end(); ++n, ++k) { | 499 | vector<string>::iterator p; |
1941 | 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) { |
1942 | 501 | cout << "Action: '" << (*n) << "' bound to '" << (*k) << "' Path: '" << (*p) << "'" << endl; | ||
1943 | 501 | } | 502 | } |
1944 | 502 | 503 | ||
1945 | 504 | halt_connection.disconnect (); | ||
1946 | 505 | AudioEngine::instance()->stop (); | ||
1947 | 503 | exit (0); | 506 | exit (0); |
1948 | 504 | } | 507 | } |
1949 | 505 | 508 | ||
1950 | @@ -3264,7 +3267,7 @@ | |||
1951 | 3264 | } else { | 3267 | } else { |
1952 | 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) { |
1953 | 3266 | RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s); | 3269 | RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s); |
1955 | 3267 | if (tav->route()->order_key() > order_hint) { | 3270 | if (tav && tav->route() && tav->route()->order_key() > order_hint) { |
1956 | 3268 | order_hint = tav->route()->order_key(); | 3271 | order_hint = tav->route()->order_key(); |
1957 | 3269 | } | 3272 | } |
1958 | 3270 | } | 3273 | } |
1959 | 3271 | 3274 | ||
1960 | === modified file 'gtk2_ardour/ardour_ui.h' | |||
1961 | --- gtk2_ardour/ardour_ui.h 2013-11-06 13:22:44 +0000 | |||
1962 | +++ gtk2_ardour/ardour_ui.h 2015-05-02 14:23:30 +0000 | |||
1963 | @@ -171,6 +171,7 @@ | |||
1964 | 171 | 171 | ||
1965 | 172 | void new_midi_tracer_window (); | 172 | void new_midi_tracer_window (); |
1966 | 173 | void toggle_editing_space(); | 173 | void toggle_editing_space(); |
1967 | 174 | void toggle_mixer_space(); | ||
1968 | 174 | void toggle_keep_tearoffs(); | 175 | void toggle_keep_tearoffs(); |
1969 | 175 | 176 | ||
1970 | 176 | Gtk::Tooltips& tooltips() { return _tooltips; } | 177 | Gtk::Tooltips& tooltips() { return _tooltips; } |
1971 | 177 | 178 | ||
1972 | === modified file 'gtk2_ardour/ardour_ui_dialogs.cc' | |||
1973 | --- gtk2_ardour/ardour_ui_dialogs.cc 2013-12-23 22:07:52 +0000 | |||
1974 | +++ gtk2_ardour/ardour_ui_dialogs.cc 2015-05-02 14:23:30 +0000 | |||
1975 | @@ -565,3 +565,18 @@ | |||
1976 | 565 | } | 565 | } |
1977 | 566 | return true; | 566 | return true; |
1978 | 567 | } | 567 | } |
1979 | 568 | |||
1980 | 569 | void | ||
1981 | 570 | ARDOUR_UI::toggle_mixer_space() | ||
1982 | 571 | { | ||
1983 | 572 | Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer"); | ||
1984 | 573 | |||
1985 | 574 | if (act) { | ||
1986 | 575 | Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); | ||
1987 | 576 | if (tact->get_active()) { | ||
1988 | 577 | mixer->maximise_mixer_space (); | ||
1989 | 578 | } else { | ||
1990 | 579 | mixer->restore_mixer_space (); | ||
1991 | 580 | } | ||
1992 | 581 | } | ||
1993 | 582 | } | ||
1994 | 568 | 583 | ||
1995 | === modified file 'gtk2_ardour/ardour_ui_ed.cc' | |||
1996 | --- gtk2_ardour/ardour_ui_ed.cc 2013-10-17 11:16:21 +0000 | |||
1997 | +++ gtk2_ardour/ardour_ui_ed.cc 2015-05-02 14:23:30 +0000 | |||
1998 | @@ -191,6 +191,7 @@ | |||
1999 | 191 | /* windows visibility actions */ | 191 | /* windows visibility actions */ |
2000 | 192 | 192 | ||
2001 | 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)); |
2002 | 194 | ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalMixer"), _("Maximise Mixer Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_space)); | ||
2003 | 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)); |
2004 | 195 | ActionManager::session_sensitive_actions.push_back (act); | 196 | ActionManager::session_sensitive_actions.push_back (act); |
2005 | 196 | 197 | ||
2006 | 197 | 198 | ||
2007 | === modified file 'gtk2_ardour/audio_region_view.cc' | |||
2008 | --- gtk2_ardour/audio_region_view.cc 2013-09-21 19:05:02 +0000 | |||
2009 | +++ gtk2_ardour/audio_region_view.cc 2015-05-02 14:23:30 +0000 | |||
2010 | @@ -963,7 +963,7 @@ | |||
2011 | 963 | } | 963 | } |
2012 | 964 | 964 | ||
2013 | 965 | void | 965 | void |
2015 | 966 | AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev) | 966 | AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, bool with_guard_points) |
2016 | 967 | { | 967 | { |
2017 | 968 | if (!gain_line) { | 968 | if (!gain_line) { |
2018 | 969 | return; | 969 | return; |
2019 | @@ -1008,7 +1008,7 @@ | |||
2020 | 1008 | trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after)); | 1008 | trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after)); |
2021 | 1009 | } | 1009 | } |
2022 | 1010 | 1010 | ||
2024 | 1011 | audio_region()->envelope()->add (fx, y); | 1011 | audio_region()->envelope()->add (fx, y, with_guard_points); |
2025 | 1012 | 1012 | ||
2026 | 1013 | XMLNode &after = audio_region()->envelope()->get_state(); | 1013 | XMLNode &after = audio_region()->envelope()->get_state(); |
2027 | 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)); |
2028 | 1015 | 1015 | ||
2029 | === modified file 'gtk2_ardour/audio_region_view.h' | |||
2030 | --- gtk2_ardour/audio_region_view.h 2013-09-21 19:05:02 +0000 | |||
2031 | +++ gtk2_ardour/audio_region_view.h 2015-05-02 14:23:30 +0000 | |||
2032 | @@ -81,7 +81,7 @@ | |||
2033 | 81 | 81 | ||
2034 | 82 | void update_envelope_visibility (); | 82 | void update_envelope_visibility (); |
2035 | 83 | 83 | ||
2037 | 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); |
2038 | 85 | void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event); | 85 | void remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent *event); |
2039 | 86 | 86 | ||
2040 | 87 | boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; } | 87 | boost::shared_ptr<AudioRegionGainLine> get_gain_line() const { return gain_line; } |
2041 | 88 | 88 | ||
2042 | === modified file 'gtk2_ardour/automation_region_view.cc' | |||
2043 | --- gtk2_ardour/automation_region_view.cc 2013-09-21 19:05:02 +0000 | |||
2044 | +++ gtk2_ardour/automation_region_view.cc 2015-05-02 14:23:30 +0000 | |||
2045 | @@ -27,6 +27,8 @@ | |||
2046 | 27 | #include "ardour/midi_region.h" | 27 | #include "ardour/midi_region.h" |
2047 | 28 | #include "ardour/session.h" | 28 | #include "ardour/session.h" |
2048 | 29 | 29 | ||
2049 | 30 | #include "gtkmm2ext/keyboard.h" | ||
2050 | 31 | |||
2051 | 30 | #include "automation_region_view.h" | 32 | #include "automation_region_view.h" |
2052 | 31 | #include "editing.h" | 33 | #include "editing.h" |
2053 | 32 | #include "editor.h" | 34 | #include "editor.h" |
2054 | @@ -120,7 +122,11 @@ | |||
2055 | 120 | y = std::max (y, 0.0); | 122 | y = std::max (y, 0.0); |
2056 | 121 | y = std::min (y, _height - NAME_HIGHLIGHT_SIZE); | 123 | y = std::min (y, _height - NAME_HIGHLIGHT_SIZE); |
2057 | 122 | 124 | ||
2059 | 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 */ |
2060 | 126 | |||
2061 | 127 | bool with_guard_points = Gtkmm2ext::Keyboard::modifier_state_equals (ev->button.state, Gtkmm2ext::Keyboard::PrimaryModifier); | ||
2062 | 128 | |||
2063 | 129 | add_automation_event (ev, trackview.editor().pixel_to_frame (x) - _region->position() + _region->start(), y, with_guard_points); | ||
2064 | 124 | } | 130 | } |
2065 | 125 | 131 | ||
2066 | 126 | return false; | 132 | return false; |
2067 | @@ -130,7 +136,7 @@ | |||
2068 | 130 | * @param y y position, relative to our TimeAxisView. | 136 | * @param y y position, relative to our TimeAxisView. |
2069 | 131 | */ | 137 | */ |
2070 | 132 | void | 138 | void |
2072 | 133 | AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y) | 139 | AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y, bool with_guard_points) |
2073 | 134 | { | 140 | { |
2074 | 135 | if (!_line) { | 141 | if (!_line) { |
2075 | 136 | boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true); | 142 | boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true); |
2076 | @@ -160,7 +166,7 @@ | |||
2077 | 160 | view->session()->begin_reversible_command (_("add automation event")); | 166 | view->session()->begin_reversible_command (_("add automation event")); |
2078 | 161 | XMLNode& before = _line->the_list()->get_state(); | 167 | XMLNode& before = _line->the_list()->get_state(); |
2079 | 162 | 168 | ||
2081 | 163 | _line->the_list()->add (when_d, y); | 169 | _line->the_list()->add (when_d, y, with_guard_points); |
2082 | 164 | 170 | ||
2083 | 165 | XMLNode& after = _line->the_list()->get_state(); | 171 | XMLNode& after = _line->the_list()->get_state(); |
2084 | 166 | 172 | ||
2085 | 167 | 173 | ||
2086 | === modified file 'gtk2_ardour/automation_region_view.h' | |||
2087 | --- gtk2_ardour/automation_region_view.h 2013-09-21 19:05:02 +0000 | |||
2088 | +++ gtk2_ardour/automation_region_view.h 2015-05-02 14:23:30 +0000 | |||
2089 | @@ -66,7 +66,7 @@ | |||
2090 | 66 | bool set_position(framepos_t pos, void* src, double* ignored); | 66 | bool set_position(framepos_t pos, void* src, double* ignored); |
2091 | 67 | void region_resized (const PBD::PropertyChange&); | 67 | void region_resized (const PBD::PropertyChange&); |
2092 | 68 | bool canvas_event(GdkEvent* ev); | 68 | bool canvas_event(GdkEvent* ev); |
2094 | 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); |
2095 | 70 | void entered (bool); | 70 | void entered (bool); |
2096 | 71 | void exited(); | 71 | void exited(); |
2097 | 72 | 72 | ||
2098 | 73 | 73 | ||
2099 | === modified file 'gtk2_ardour/automation_time_axis.cc' | |||
2100 | --- gtk2_ardour/automation_time_axis.cc 2013-09-21 19:05:02 +0000 | |||
2101 | +++ gtk2_ardour/automation_time_axis.cc 2015-05-02 14:23:30 +0000 | |||
2102 | @@ -550,7 +550,7 @@ | |||
2103 | 550 | } | 550 | } |
2104 | 551 | 551 | ||
2105 | 552 | void | 552 | void |
2107 | 553 | AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y) | 553 | AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points) |
2108 | 554 | { | 554 | { |
2109 | 555 | if (!_line) { | 555 | if (!_line) { |
2110 | 556 | return; | 556 | return; |
2111 | @@ -583,7 +583,7 @@ | |||
2112 | 583 | _session->begin_reversible_command (_("add automation event")); | 583 | _session->begin_reversible_command (_("add automation event")); |
2113 | 584 | XMLNode& before = list->get_state(); | 584 | XMLNode& before = list->get_state(); |
2114 | 585 | 585 | ||
2116 | 586 | list->add (when, y); | 586 | list->add (when, y, with_guard_points); |
2117 | 587 | 587 | ||
2118 | 588 | XMLNode& after = list->get_state(); | 588 | XMLNode& after = list->get_state(); |
2119 | 589 | _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after)); | 589 | _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after)); |
2120 | 590 | 590 | ||
2121 | === modified file 'gtk2_ardour/automation_time_axis.h' | |||
2122 | --- gtk2_ardour/automation_time_axis.h 2013-09-21 19:05:02 +0000 | |||
2123 | +++ gtk2_ardour/automation_time_axis.h 2015-05-02 14:23:30 +0000 | |||
2124 | @@ -72,7 +72,7 @@ | |||
2125 | 72 | void set_samples_per_unit (double); | 72 | void set_samples_per_unit (double); |
2126 | 73 | std::string name() const { return _name; } | 73 | std::string name() const { return _name; } |
2127 | 74 | 74 | ||
2129 | 75 | void add_automation_event (GdkEvent *, framepos_t, double); | 75 | void add_automation_event (GdkEvent *, framepos_t, double, bool with_guard_points); |
2130 | 76 | 76 | ||
2131 | 77 | void clear_lines (); | 77 | void clear_lines (); |
2132 | 78 | 78 | ||
2133 | 79 | 79 | ||
2134 | === modified file 'gtk2_ardour/editor.bindings' | |||
2135 | --- gtk2_ardour/editor.bindings 2013-09-21 19:05:02 +0000 | |||
2136 | +++ gtk2_ardour/editor.bindings 2015-05-02 14:23:30 +0000 | |||
2137 | @@ -167,6 +167,7 @@ | |||
2138 | 167 | <Binding action="Editor/pitch-shift-region" key="F5"/> | 167 | <Binding action="Editor/pitch-shift-region" key="F5"/> |
2139 | 168 | <Binding action="Editor/select-range-between-cursors" key="F6"/> | 168 | <Binding action="Editor/select-range-between-cursors" key="F6"/> |
2140 | 169 | <Binding action="Common/ToggleMaximalEditor" key="F11"/> | 169 | <Binding action="Common/ToggleMaximalEditor" key="F11"/> |
2141 | 170 | <Binding action="Common/ToggleMaximalMixer" key="F12"/> | ||
2142 | 170 | <Binding action="Editor/save-visual-state-1" key="Primary-F1"/> | 171 | <Binding action="Editor/save-visual-state-1" key="Primary-F1"/> |
2143 | 171 | <Binding action="Editor/save-visual-state-2" key="Primary-F2"/> | 172 | <Binding action="Editor/save-visual-state-2" key="Primary-F2"/> |
2144 | 172 | <Binding action="Editor/save-visual-state-3" key="Primary-F3"/> | 173 | <Binding action="Editor/save-visual-state-3" key="Primary-F3"/> |
2145 | 173 | 174 | ||
2146 | === modified file 'gtk2_ardour/editor.h' | |||
2147 | --- gtk2_ardour/editor.h 2014-01-24 16:31:54 +0000 | |||
2148 | +++ gtk2_ardour/editor.h 2015-05-02 14:23:30 +0000 | |||
2149 | @@ -1262,7 +1262,7 @@ | |||
2150 | 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); |
2151 | 1263 | 1263 | ||
2152 | 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, |
2154 | 1265 | boost::shared_ptr<ARDOUR::Track>& existing_track); | 1265 | boost::shared_ptr<ARDOUR::Track>& existing_track, const std::string& new_track_name); |
2155 | 1266 | 1266 | ||
2156 | 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; |
2157 | 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; |
2158 | 1269 | 1269 | ||
2159 | === modified file 'gtk2_ardour/editor_actions.cc' | |||
2160 | --- gtk2_ardour/editor_actions.cc 2013-09-21 19:05:02 +0000 | |||
2161 | +++ gtk2_ardour/editor_actions.cc 2015-05-02 14:23:30 +0000 | |||
2162 | @@ -1143,94 +1143,94 @@ | |||
2163 | 1143 | { | 1143 | { |
2164 | 1144 | switch (_snap_type) { | 1144 | switch (_snap_type) { |
2165 | 1145 | case Editing::SnapToCDFrame: | 1145 | case Editing::SnapToCDFrame: |
2167 | 1146 | set_snap_to (Editing::SnapToTimecodeFrame); | 1146 | set_snap_to (Editing::SnapToRegionBoundary); |
2168 | 1147 | break; | 1147 | break; |
2169 | 1148 | case Editing::SnapToTimecodeFrame: | 1148 | case Editing::SnapToTimecodeFrame: |
2171 | 1149 | set_snap_to (Editing::SnapToTimecodeSeconds); | 1149 | set_snap_to (Editing::SnapToCDFrame); |
2172 | 1150 | break; | 1150 | break; |
2173 | 1151 | case Editing::SnapToTimecodeSeconds: | 1151 | case Editing::SnapToTimecodeSeconds: |
2175 | 1152 | set_snap_to (Editing::SnapToTimecodeMinutes); | 1152 | set_snap_to (Editing::SnapToTimecodeFrame); |
2176 | 1153 | break; | 1153 | break; |
2177 | 1154 | case Editing::SnapToTimecodeMinutes: | 1154 | case Editing::SnapToTimecodeMinutes: |
2179 | 1155 | set_snap_to (Editing::SnapToSeconds); | 1155 | set_snap_to (Editing::SnapToTimecodeSeconds); |
2180 | 1156 | break; | 1156 | break; |
2181 | 1157 | case Editing::SnapToSeconds: | 1157 | case Editing::SnapToSeconds: |
2183 | 1158 | set_snap_to (Editing::SnapToMinutes); | 1158 | set_snap_to (Editing::SnapToTimecodeMinutes); |
2184 | 1159 | break; | 1159 | break; |
2185 | 1160 | case Editing::SnapToMinutes: | 1160 | case Editing::SnapToMinutes: |
2187 | 1161 | set_snap_to (Editing::SnapToBeatDiv128); | 1161 | set_snap_to (Editing::SnapToSeconds); |
2188 | 1162 | break; | 1162 | break; |
2189 | 1163 | case Editing::SnapToBeatDiv128: | 1163 | case Editing::SnapToBeatDiv128: |
2191 | 1164 | set_snap_to (Editing::SnapToBeatDiv64); | 1164 | set_snap_to (Editing::SnapToMinutes); |
2192 | 1165 | break; | 1165 | break; |
2193 | 1166 | case Editing::SnapToBeatDiv64: | 1166 | case Editing::SnapToBeatDiv64: |
2195 | 1167 | set_snap_to (Editing::SnapToBeatDiv32); | 1167 | set_snap_to (Editing::SnapToBeatDiv128); |
2196 | 1168 | break; | 1168 | break; |
2197 | 1169 | case Editing::SnapToBeatDiv32: | 1169 | case Editing::SnapToBeatDiv32: |
2199 | 1170 | set_snap_to (Editing::SnapToBeatDiv28); | 1170 | set_snap_to (Editing::SnapToBeatDiv64); |
2200 | 1171 | break; | 1171 | break; |
2201 | 1172 | case Editing::SnapToBeatDiv28: | 1172 | case Editing::SnapToBeatDiv28: |
2203 | 1173 | set_snap_to (Editing::SnapToBeatDiv24); | 1173 | set_snap_to (Editing::SnapToBeatDiv32); |
2204 | 1174 | break; | 1174 | break; |
2205 | 1175 | case Editing::SnapToBeatDiv24: | 1175 | case Editing::SnapToBeatDiv24: |
2207 | 1176 | set_snap_to (Editing::SnapToBeatDiv20); | 1176 | set_snap_to (Editing::SnapToBeatDiv28); |
2208 | 1177 | break; | 1177 | break; |
2209 | 1178 | case Editing::SnapToBeatDiv20: | 1178 | case Editing::SnapToBeatDiv20: |
2211 | 1179 | set_snap_to (Editing::SnapToBeatDiv16); | 1179 | set_snap_to (Editing::SnapToBeatDiv24); |
2212 | 1180 | break; | 1180 | break; |
2213 | 1181 | case Editing::SnapToBeatDiv16: | 1181 | case Editing::SnapToBeatDiv16: |
2215 | 1182 | set_snap_to (Editing::SnapToBeatDiv14); | 1182 | set_snap_to (Editing::SnapToBeatDiv20); |
2216 | 1183 | break; | 1183 | break; |
2217 | 1184 | case Editing::SnapToBeatDiv14: | 1184 | case Editing::SnapToBeatDiv14: |
2219 | 1185 | set_snap_to (Editing::SnapToBeatDiv12); | 1185 | set_snap_to (Editing::SnapToBeatDiv16); |
2220 | 1186 | break; | 1186 | break; |
2221 | 1187 | case Editing::SnapToBeatDiv12: | 1187 | case Editing::SnapToBeatDiv12: |
2223 | 1188 | set_snap_to (Editing::SnapToBeatDiv10); | 1188 | set_snap_to (Editing::SnapToBeatDiv14); |
2224 | 1189 | break; | 1189 | break; |
2225 | 1190 | case Editing::SnapToBeatDiv10: | 1190 | case Editing::SnapToBeatDiv10: |
2227 | 1191 | set_snap_to (Editing::SnapToBeatDiv8); | 1191 | set_snap_to (Editing::SnapToBeatDiv12); |
2228 | 1192 | break; | 1192 | break; |
2229 | 1193 | case Editing::SnapToBeatDiv8: | 1193 | case Editing::SnapToBeatDiv8: |
2231 | 1194 | set_snap_to (Editing::SnapToBeatDiv7); | 1194 | set_snap_to (Editing::SnapToBeatDiv10); |
2232 | 1195 | break; | 1195 | break; |
2233 | 1196 | case Editing::SnapToBeatDiv7: | 1196 | case Editing::SnapToBeatDiv7: |
2235 | 1197 | set_snap_to (Editing::SnapToBeatDiv6); | 1197 | set_snap_to (Editing::SnapToBeatDiv8); |
2236 | 1198 | break; | 1198 | break; |
2237 | 1199 | case Editing::SnapToBeatDiv6: | 1199 | case Editing::SnapToBeatDiv6: |
2239 | 1200 | set_snap_to (Editing::SnapToBeatDiv5); | 1200 | set_snap_to (Editing::SnapToBeatDiv7); |
2240 | 1201 | break; | 1201 | break; |
2241 | 1202 | case Editing::SnapToBeatDiv5: | 1202 | case Editing::SnapToBeatDiv5: |
2243 | 1203 | set_snap_to (Editing::SnapToBeatDiv4); | 1203 | set_snap_to (Editing::SnapToBeatDiv6); |
2244 | 1204 | break; | 1204 | break; |
2245 | 1205 | case Editing::SnapToBeatDiv4: | 1205 | case Editing::SnapToBeatDiv4: |
2247 | 1206 | set_snap_to (Editing::SnapToBeatDiv3); | 1206 | set_snap_to (Editing::SnapToBeatDiv5); |
2248 | 1207 | break; | 1207 | break; |
2249 | 1208 | case Editing::SnapToBeatDiv3: | 1208 | case Editing::SnapToBeatDiv3: |
2251 | 1209 | set_snap_to (Editing::SnapToBeatDiv2); | 1209 | set_snap_to (Editing::SnapToBeatDiv4); |
2252 | 1210 | break; | 1210 | break; |
2253 | 1211 | case Editing::SnapToBeatDiv2: | 1211 | case Editing::SnapToBeatDiv2: |
2255 | 1212 | set_snap_to (Editing::SnapToBeat); | 1212 | set_snap_to (Editing::SnapToBeatDiv3); |
2256 | 1213 | break; | 1213 | break; |
2257 | 1214 | case Editing::SnapToBeat: | 1214 | case Editing::SnapToBeat: |
2259 | 1215 | set_snap_to (Editing::SnapToBar); | 1215 | set_snap_to (Editing::SnapToBeatDiv2); |
2260 | 1216 | break; | 1216 | break; |
2261 | 1217 | case Editing::SnapToBar: | 1217 | case Editing::SnapToBar: |
2263 | 1218 | set_snap_to (Editing::SnapToMark); | 1218 | set_snap_to (Editing::SnapToBeat); |
2264 | 1219 | break; | 1219 | break; |
2265 | 1220 | case Editing::SnapToMark: | 1220 | case Editing::SnapToMark: |
2267 | 1221 | set_snap_to (Editing::SnapToRegionStart); | 1221 | set_snap_to (Editing::SnapToBar); |
2268 | 1222 | break; | 1222 | break; |
2269 | 1223 | case Editing::SnapToRegionStart: | 1223 | case Editing::SnapToRegionStart: |
2271 | 1224 | set_snap_to (Editing::SnapToRegionEnd); | 1224 | set_snap_to (Editing::SnapToMark); |
2272 | 1225 | break; | 1225 | break; |
2273 | 1226 | case Editing::SnapToRegionEnd: | 1226 | case Editing::SnapToRegionEnd: |
2275 | 1227 | set_snap_to (Editing::SnapToRegionSync); | 1227 | set_snap_to (Editing::SnapToRegionStart); |
2276 | 1228 | break; | 1228 | break; |
2277 | 1229 | case Editing::SnapToRegionSync: | 1229 | case Editing::SnapToRegionSync: |
2279 | 1230 | set_snap_to (Editing::SnapToRegionBoundary); | 1230 | set_snap_to (Editing::SnapToRegionEnd); |
2280 | 1231 | break; | 1231 | break; |
2281 | 1232 | case Editing::SnapToRegionBoundary: | 1232 | case Editing::SnapToRegionBoundary: |
2283 | 1233 | set_snap_to (Editing::SnapToCDFrame); | 1233 | set_snap_to (Editing::SnapToRegionSync); |
2284 | 1234 | break; | 1234 | break; |
2285 | 1235 | } | 1235 | } |
2286 | 1236 | } | 1236 | } |
2287 | 1237 | 1237 | ||
2288 | === modified file 'gtk2_ardour/editor_audio_import.cc' | |||
2289 | --- gtk2_ardour/editor_audio_import.cc 2014-01-24 16:31:54 +0000 | |||
2290 | +++ gtk2_ardour/editor_audio_import.cc 2015-05-02 14:23:30 +0000 | |||
2291 | @@ -611,7 +611,7 @@ | |||
2292 | 611 | 611 | ||
2293 | 612 | boost::shared_ptr<Source> s; | 612 | boost::shared_ptr<Source> s; |
2294 | 613 | 613 | ||
2296 | 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) { |
2297 | 615 | 615 | ||
2298 | 616 | source = boost::dynamic_pointer_cast<AudioFileSource> ( | 616 | source = boost::dynamic_pointer_cast<AudioFileSource> ( |
2299 | 617 | SourceFactory::createExternal (DataType::AUDIO, *_session, | 617 | SourceFactory::createExternal (DataType::AUDIO, *_session, |
2300 | @@ -657,7 +657,8 @@ | |||
2301 | 657 | uint32_t input_chan = 0; | 657 | uint32_t input_chan = 0; |
2302 | 658 | uint32_t output_chan = 0; | 658 | uint32_t output_chan = 0; |
2303 | 659 | bool use_timestamp; | 659 | bool use_timestamp; |
2305 | 660 | 660 | vector<string> track_names; | |
2306 | 661 | |||
2307 | 661 | use_timestamp = (pos == -1); | 662 | use_timestamp = (pos == -1); |
2308 | 662 | 663 | ||
2309 | 663 | // kludge (for MIDI we're abusing "channel" for "track" here) | 664 | // kludge (for MIDI we're abusing "channel" for "track" here) |
2310 | @@ -694,6 +695,11 @@ | |||
2311 | 694 | 695 | ||
2312 | 695 | regions.push_back (r); | 696 | regions.push_back (r); |
2313 | 696 | 697 | ||
2314 | 698 | /* if we're creating a new track, name it after the cleaned-up | ||
2315 | 699 | * and "merged" region name. | ||
2316 | 700 | */ | ||
2317 | 701 | |||
2318 | 702 | track_names.push_back (region_name); | ||
2319 | 697 | 703 | ||
2320 | 698 | } else if (target_regions == -1 || target_regions > 1) { | 704 | } else if (target_regions == -1 || target_regions > 1) { |
2321 | 699 | 705 | ||
2322 | @@ -724,29 +730,26 @@ | |||
2323 | 724 | region_name = (*x)->name(); | 730 | region_name = (*x)->name(); |
2324 | 725 | } | 731 | } |
2325 | 726 | 732 | ||
2331 | 727 | switch (sources.size()) { | 733 | if (sources.size() == 2) { |
2327 | 728 | /* zero and one channel handled | ||
2328 | 729 | by previous if() condition | ||
2329 | 730 | */ | ||
2330 | 731 | case 2: | ||
2332 | 732 | if (n == 0) { | 734 | if (n == 0) { |
2333 | 733 | region_name += "-L"; | 735 | region_name += "-L"; |
2334 | 734 | } else { | 736 | } else { |
2335 | 735 | region_name += "-R"; | 737 | region_name += "-R"; |
2336 | 736 | } | 738 | } |
2342 | 737 | break; | 739 | } else if (sources.size() > 2) { |
2343 | 738 | default: | 740 | region_name += string_compose ("-%1", n+1); |
2339 | 739 | region_name += (char) '-'; | ||
2340 | 740 | region_name += (char) ('1' + n); | ||
2341 | 741 | break; | ||
2344 | 742 | } | 741 | } |
2345 | 743 | 742 | ||
2346 | 743 | track_names.push_back (region_name); | ||
2347 | 744 | |||
2348 | 744 | } else { | 745 | } else { |
2349 | 745 | if (fs) { | 746 | if (fs) { |
2350 | 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); |
2352 | 747 | } else{ | 748 | } else { |
2353 | 748 | region_name = (*x)->name(); | 749 | region_name = (*x)->name(); |
2354 | 749 | } | 750 | } |
2355 | 751 | |||
2356 | 752 | track_names.push_back (PBD::basename_nosuffix (paths[n])); | ||
2357 | 750 | } | 753 | } |
2358 | 751 | 754 | ||
2359 | 752 | PropertyList plist; | 755 | PropertyList plist; |
2360 | @@ -798,6 +801,12 @@ | |||
2361 | 798 | framepos_t rlen = 0; | 801 | framepos_t rlen = 0; |
2362 | 799 | 802 | ||
2363 | 800 | begin_reversible_command (Operations::insert_file); | 803 | begin_reversible_command (Operations::insert_file); |
2364 | 804 | |||
2365 | 805 | /* we only use tracks names when importing to new tracks, but we | ||
2366 | 806 | * require that one is defined for every region, just to keep | ||
2367 | 807 | * the API simpler. | ||
2368 | 808 | */ | ||
2369 | 809 | assert (regions.size() == track_names.size()); | ||
2370 | 801 | 810 | ||
2371 | 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) { |
2372 | 803 | boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r); | 812 | boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion> (*r); |
2373 | @@ -830,9 +839,8 @@ | |||
2374 | 830 | pos = get_preferred_edit_position (); | 839 | pos = get_preferred_edit_position (); |
2375 | 831 | } | 840 | } |
2376 | 832 | } | 841 | } |
2380 | 833 | 842 | ||
2381 | 834 | 843 | finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track, track_names[n]); | |
2379 | 835 | finish_bringing_in_material (*r, input_chan, output_chan, pos, mode, track); | ||
2382 | 836 | 844 | ||
2383 | 837 | rlen = (*r)->length(); | 845 | rlen = (*r)->length(); |
2384 | 838 | 846 | ||
2385 | @@ -859,7 +867,7 @@ | |||
2386 | 859 | 867 | ||
2387 | 860 | int | 868 | int |
2388 | 861 | Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos, | 869 | Editor::finish_bringing_in_material (boost::shared_ptr<Region> region, uint32_t in_chans, uint32_t out_chans, framepos_t& pos, |
2390 | 862 | ImportMode mode, boost::shared_ptr<Track>& existing_track) | 870 | ImportMode mode, boost::shared_ptr<Track>& existing_track, const string& new_track_name) |
2391 | 863 | { | 871 | { |
2392 | 864 | boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region); | 872 | boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(region); |
2393 | 865 | boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region); | 873 | boost::shared_ptr<MidiRegion> mr = boost::dynamic_pointer_cast<MidiRegion>(region); |
2394 | @@ -916,7 +924,11 @@ | |||
2395 | 916 | existing_track = mt.front(); | 924 | existing_track = mt.front(); |
2396 | 917 | } | 925 | } |
2397 | 918 | 926 | ||
2399 | 919 | existing_track->set_name (region->name()); | 927 | if (!new_track_name.empty()) { |
2400 | 928 | existing_track->set_name (new_track_name); | ||
2401 | 929 | } else { | ||
2402 | 930 | existing_track->set_name (region->name()); | ||
2403 | 931 | } | ||
2404 | 920 | } | 932 | } |
2405 | 921 | 933 | ||
2406 | 922 | boost::shared_ptr<Playlist> playlist = existing_track->playlist(); | 934 | boost::shared_ptr<Playlist> playlist = existing_track->playlist(); |
2407 | 923 | 935 | ||
2408 | === modified file 'gtk2_ardour/editor_drag.cc' | |||
2409 | --- gtk2_ardour/editor_drag.cc 2013-11-06 13:22:44 +0000 | |||
2410 | +++ gtk2_ardour/editor_drag.cc 2015-05-02 14:23:30 +0000 | |||
2411 | @@ -3275,10 +3275,24 @@ | |||
2412 | 3275 | } | 3275 | } |
2413 | 3276 | 3276 | ||
2414 | 3277 | void | 3277 | void |
2416 | 3278 | LineDrag::finished (GdkEvent* event, bool) | 3278 | LineDrag::finished (GdkEvent* event, bool movement_occured) |
2417 | 3279 | { | 3279 | { |
2420 | 3280 | motion (event, false); | 3280 | if (movement_occured) { |
2421 | 3281 | _line->end_drag (false, 0); | 3281 | motion (event, false); |
2422 | 3282 | _line->end_drag (false, 0); | ||
2423 | 3283 | } else { | ||
2424 | 3284 | /* add a new control point on the line */ | ||
2425 | 3285 | |||
2426 | 3286 | AutomationTimeAxisView* atv; | ||
2427 | 3287 | |||
2428 | 3288 | _line->end_drag (false, 0); | ||
2429 | 3289 | |||
2430 | 3290 | if ((atv = dynamic_cast<AutomationTimeAxisView*>(_editor->clicked_axisview)) != 0) { | ||
2431 | 3291 | framepos_t where = _editor->event_frame (event, 0, 0); | ||
2432 | 3292 | atv->add_automation_event (event, where, event->button.y, false); | ||
2433 | 3293 | } | ||
2434 | 3294 | } | ||
2435 | 3295 | |||
2436 | 3282 | _editor->session()->commit_reversible_command (); | 3296 | _editor->session()->commit_reversible_command (); |
2437 | 3283 | } | 3297 | } |
2438 | 3284 | 3298 | ||
2439 | 3285 | 3299 | ||
2440 | === modified file 'gtk2_ardour/editor_mouse.cc' | |||
2441 | --- gtk2_ardour/editor_mouse.cc 2013-11-06 13:22:44 +0000 | |||
2442 | +++ gtk2_ardour/editor_mouse.cc 2015-05-02 14:23:30 +0000 | |||
2443 | @@ -1682,7 +1682,8 @@ | |||
2444 | 1682 | case AutomationTrackItem: | 1682 | case AutomationTrackItem: |
2445 | 1683 | atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview); | 1683 | atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview); |
2446 | 1684 | if (atv) { | 1684 | if (atv) { |
2448 | 1685 | atv->add_automation_event (event, where, event->button.y); | 1685 | bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); |
2449 | 1686 | atv->add_automation_event (event, where, event->button.y, with_guard_points); | ||
2450 | 1686 | } | 1687 | } |
2451 | 1687 | return true; | 1688 | return true; |
2452 | 1688 | break; | 1689 | break; |
2453 | @@ -1701,17 +1702,20 @@ | |||
2454 | 1701 | */ | 1702 | */ |
2455 | 1702 | AudioRegionView* arv = dynamic_cast<AudioRegionView*> (clicked_regionview); | 1703 | AudioRegionView* arv = dynamic_cast<AudioRegionView*> (clicked_regionview); |
2456 | 1703 | if (!were_dragging && arv) { | 1704 | if (!were_dragging && arv) { |
2458 | 1704 | arv->add_gain_point_event (item, event); | 1705 | bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); |
2459 | 1706 | arv->add_gain_point_event (item, event, with_guard_points); | ||
2460 | 1705 | } | 1707 | } |
2461 | 1706 | return true; | 1708 | return true; |
2462 | 1707 | break; | 1709 | break; |
2463 | 1708 | } | 1710 | } |
2464 | 1709 | 1711 | ||
2466 | 1710 | case AutomationTrackItem: | 1712 | case AutomationTrackItem: { |
2467 | 1713 | bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier); | ||
2468 | 1711 | dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)-> | 1714 | dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)-> |
2470 | 1712 | add_automation_event (event, where, event->button.y); | 1715 | add_automation_event (event, where, event->button.y, with_guard_points); |
2471 | 1713 | return true; | 1716 | return true; |
2472 | 1714 | break; | 1717 | break; |
2473 | 1718 | } | ||
2474 | 1715 | default: | 1719 | default: |
2475 | 1716 | break; | 1720 | break; |
2476 | 1717 | } | 1721 | } |
2477 | 1718 | 1722 | ||
2478 | === modified file 'gtk2_ardour/editor_ops.cc' | |||
2479 | --- gtk2_ardour/editor_ops.cc 2013-11-06 13:22:44 +0000 | |||
2480 | +++ gtk2_ardour/editor_ops.cc 2015-05-02 14:23:30 +0000 | |||
2481 | @@ -4772,12 +4772,17 @@ | |||
2482 | 4772 | MidiRegionView* const mrv = dynamic_cast<MidiRegionView*>(*r); | 4772 | MidiRegionView* const mrv = dynamic_cast<MidiRegionView*>(*r); |
2483 | 4773 | 4773 | ||
2484 | 4774 | if (mrv) { | 4774 | if (mrv) { |
2491 | 4775 | boost::shared_ptr<Playlist> playlist = mrv->region()->playlist(); | 4775 | try { |
2492 | 4776 | boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone (); | 4776 | boost::shared_ptr<Playlist> playlist = mrv->region()->playlist(); |
2493 | 4777 | 4777 | boost::shared_ptr<MidiSource> new_source = _session->create_midi_source_by_stealing_name (mrv->midi_view()->track()); | |
2494 | 4778 | playlist->clear_changes (); | 4778 | boost::shared_ptr<MidiRegion> newregion = mrv->midi_region()->clone (new_source); |
2495 | 4779 | playlist->replace_region (mrv->region(), newregion, mrv->region()->position()); | 4779 | |
2496 | 4780 | _session->add_command(new StatefulDiffCommand (playlist)); | 4780 | playlist->clear_changes (); |
2497 | 4781 | playlist->replace_region (mrv->region(), newregion, mrv->region()->position()); | ||
2498 | 4782 | _session->add_command(new StatefulDiffCommand (playlist)); | ||
2499 | 4783 | } catch (...) { | ||
2500 | 4784 | error << string_compose (_("Could not unlink %1"), mrv->region()->name()) << endmsg; | ||
2501 | 4785 | } | ||
2502 | 4781 | } | 4786 | } |
2503 | 4782 | 4787 | ||
2504 | 4783 | r = tmp; | 4788 | r = tmp; |
2505 | 4784 | 4789 | ||
2506 | === modified file 'gtk2_ardour/editor_regions.cc' | |||
2507 | --- gtk2_ardour/editor_regions.cc 2013-12-23 22:07:52 +0000 | |||
2508 | +++ gtk2_ardour/editor_regions.cc 2015-05-02 14:23:30 +0000 | |||
2509 | @@ -114,7 +114,7 @@ | |||
2510 | 114 | { 3, _("Length"), _("Length of the region") }, | 114 | { 3, _("Length"), _("Length of the region") }, |
2511 | 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") }, |
2512 | 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") }, |
2514 | 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") }, |
2515 | 118 | { 7, _("L"), _("Region position locked?") }, | 118 | { 7, _("L"), _("Region position locked?") }, |
2516 | 119 | { 8, _("G"), _("Region position glued to Bars|Beats time?") }, | 119 | { 8, _("G"), _("Region position glued to Bars|Beats time?") }, |
2517 | 120 | { 9, _("M"), _("Region muted?") }, | 120 | { 9, _("M"), _("Region muted?") }, |
2518 | 121 | 121 | ||
2519 | === modified file 'gtk2_ardour/editor_rulers.cc' | |||
2520 | --- gtk2_ardour/editor_rulers.cc 2013-09-21 19:05:02 +0000 | |||
2521 | +++ gtk2_ardour/editor_rulers.cc 2015-05-02 14:23:30 +0000 | |||
2522 | @@ -1862,13 +1862,13 @@ | |||
2523 | 1862 | long millisecs; | 1862 | long millisecs; |
2524 | 1863 | 1863 | ||
2525 | 1864 | left = sample; | 1864 | left = sample; |
2533 | 1865 | hrs = left / (sample_rate * 60 * 60); | 1865 | hrs = left / (sample_rate * 60 * 60 * 1000); |
2534 | 1866 | left -= hrs * sample_rate * 60 * 60; | 1866 | left -= hrs * sample_rate * 60 * 60 * 1000; |
2535 | 1867 | mins = left / (sample_rate * 60); | 1867 | mins = left / (sample_rate * 60 * 1000); |
2536 | 1868 | left -= mins * sample_rate * 60; | 1868 | left -= mins * sample_rate * 60 * 1000; |
2537 | 1869 | secs = left / sample_rate; | 1869 | secs = left / (sample_rate * 1000); |
2538 | 1870 | left -= secs * sample_rate; | 1870 | left -= secs * sample_rate * 1000; |
2539 | 1871 | millisecs = left * 1000 / sample_rate; | 1871 | millisecs = left / sample_rate; |
2540 | 1872 | 1872 | ||
2541 | 1873 | *millisecs_p = millisecs; | 1873 | *millisecs_p = millisecs; |
2542 | 1874 | *secs_p = secs; | 1874 | *secs_p = secs; |
2543 | @@ -1888,7 +1888,7 @@ | |||
2544 | 1888 | return; | 1888 | return; |
2545 | 1889 | } | 1889 | } |
2546 | 1890 | 1890 | ||
2548 | 1891 | fr = _session->frame_rate(); | 1891 | fr = _session->frame_rate() * 1000; |
2549 | 1892 | 1892 | ||
2550 | 1893 | /* to prevent 'flashing' */ | 1893 | /* to prevent 'flashing' */ |
2551 | 1894 | if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) { | 1894 | if (lower > (spacer = (framepos_t)(128 * Editor::get_current_zoom ()))) { |
2552 | @@ -1897,7 +1897,7 @@ | |||
2553 | 1897 | lower = 0; | 1897 | lower = 0; |
2554 | 1898 | } | 1898 | } |
2555 | 1899 | upper += spacer; | 1899 | upper += spacer; |
2557 | 1900 | framecnt_t const range = upper - lower; | 1900 | framecnt_t const range = (upper - lower) * 1000; |
2558 | 1901 | 1901 | ||
2559 | 1902 | if (range < (fr / 50)) { | 1902 | if (range < (fr / 50)) { |
2560 | 1903 | minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */ | 1903 | minsec_mark_interval = fr / 1000; /* show 1/1000 seconds */ |
2561 | @@ -1997,7 +1997,7 @@ | |||
2562 | 1997 | } | 1997 | } |
2563 | 1998 | 1998 | ||
2564 | 1999 | *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * minsec_nmarks); | 1999 | *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * minsec_nmarks); |
2566 | 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; |
2567 | 2001 | switch (minsec_ruler_scale) { | 2001 | switch (minsec_ruler_scale) { |
2568 | 2002 | case minsec_show_seconds: | 2002 | case minsec_show_seconds: |
2569 | 2003 | for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { | 2003 | for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { |
2570 | @@ -2014,7 +2014,7 @@ | |||
2571 | 2014 | (*marks)[n].style = GtkCustomRulerMarkMicro; | 2014 | (*marks)[n].style = GtkCustomRulerMarkMicro; |
2572 | 2015 | } | 2015 | } |
2573 | 2016 | (*marks)[n].label = g_strdup (buf); | 2016 | (*marks)[n].label = g_strdup (buf); |
2575 | 2017 | (*marks)[n].position = pos; | 2017 | (*marks)[n].position = pos/1000.0; |
2576 | 2018 | } | 2018 | } |
2577 | 2019 | break; | 2019 | break; |
2578 | 2020 | case minsec_show_minutes: | 2020 | case minsec_show_minutes: |
2579 | @@ -2032,7 +2032,7 @@ | |||
2580 | 2032 | (*marks)[n].style = GtkCustomRulerMarkMicro; | 2032 | (*marks)[n].style = GtkCustomRulerMarkMicro; |
2581 | 2033 | } | 2033 | } |
2582 | 2034 | (*marks)[n].label = g_strdup (buf); | 2034 | (*marks)[n].label = g_strdup (buf); |
2584 | 2035 | (*marks)[n].position = pos; | 2035 | (*marks)[n].position = pos/1000.0; |
2585 | 2036 | } | 2036 | } |
2586 | 2037 | break; | 2037 | break; |
2587 | 2038 | case minsec_show_hours: | 2038 | case minsec_show_hours: |
2588 | @@ -2046,14 +2046,14 @@ | |||
2589 | 2046 | (*marks)[n].style = GtkCustomRulerMarkMicro; | 2046 | (*marks)[n].style = GtkCustomRulerMarkMicro; |
2590 | 2047 | } | 2047 | } |
2591 | 2048 | (*marks)[n].label = g_strdup (buf); | 2048 | (*marks)[n].label = g_strdup (buf); |
2593 | 2049 | (*marks)[n].position = pos; | 2049 | (*marks)[n].position = pos/1000.0; |
2594 | 2050 | } | 2050 | } |
2595 | 2051 | break; | 2051 | break; |
2596 | 2052 | case minsec_show_frames: | 2052 | case minsec_show_frames: |
2597 | 2053 | for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { | 2053 | for (n = 0; n < minsec_nmarks; pos += minsec_mark_interval, ++n) { |
2598 | 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); |
2599 | 2055 | if (millisecs % minsec_mark_modulo == 0) { | 2055 | if (millisecs % minsec_mark_modulo == 0) { |
2601 | 2056 | if (secs == 0) { | 2056 | if (millisecs == 0) { |
2602 | 2057 | (*marks)[n].style = GtkCustomRulerMarkMajor; | 2057 | (*marks)[n].style = GtkCustomRulerMarkMajor; |
2603 | 2058 | } else { | 2058 | } else { |
2604 | 2059 | (*marks)[n].style = GtkCustomRulerMarkMinor; | 2059 | (*marks)[n].style = GtkCustomRulerMarkMinor; |
2605 | @@ -2064,7 +2064,7 @@ | |||
2606 | 2064 | (*marks)[n].style = GtkCustomRulerMarkMicro; | 2064 | (*marks)[n].style = GtkCustomRulerMarkMicro; |
2607 | 2065 | } | 2065 | } |
2608 | 2066 | (*marks)[n].label = g_strdup (buf); | 2066 | (*marks)[n].label = g_strdup (buf); |
2610 | 2067 | (*marks)[n].position = pos; | 2067 | (*marks)[n].position = pos/1000.0; |
2611 | 2068 | } | 2068 | } |
2612 | 2069 | break; | 2069 | break; |
2613 | 2070 | } | 2070 | } |
2614 | 2071 | 2071 | ||
2615 | === modified file 'gtk2_ardour/ergonomic-us.bindings.in' | |||
2616 | --- gtk2_ardour/ergonomic-us.bindings.in 2013-09-21 19:05:02 +0000 | |||
2617 | +++ gtk2_ardour/ergonomic-us.bindings.in 2015-05-02 14:23:30 +0000 | |||
2618 | @@ -163,6 +163,7 @@ | |||
2619 | 163 | ; (gtk_accel_path "<Actions>/Snap/snap-to-eighths" "") | 163 | ; (gtk_accel_path "<Actions>/Snap/snap-to-eighths" "") |
2620 | 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") |
2621 | 165 | (gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11") | 165 | (gtk_accel_path "<Actions>/Common/ToggleMaximalEditor" "F11") |
2622 | 166 | (gtk_accel_path "<Actions>/Common/ToggleMaximalMixer" "F12") | ||
2623 | 166 | ; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileLength" "") | 167 | ; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileLength" "") |
2624 | 167 | ; (gtk_accel_path "<Actions>/Editor/Timecode" "") | 168 | ; (gtk_accel_path "<Actions>/Editor/Timecode" "") |
2625 | 168 | ; (gtk_accel_path "<Actions>/Transport/PlaySelection" "") | 169 | ; (gtk_accel_path "<Actions>/Transport/PlaySelection" "") |
2626 | 169 | 170 | ||
2627 | === modified file 'gtk2_ardour/gain_meter.cc' | |||
2628 | --- gtk2_ardour/gain_meter.cc 2014-01-24 16:31:54 +0000 | |||
2629 | +++ gtk2_ardour/gain_meter.cc 2015-05-02 14:23:30 +0000 | |||
2630 | @@ -274,18 +274,24 @@ | |||
2631 | 274 | GainMeterBase::setup_meters (int len) | 274 | GainMeterBase::setup_meters (int len) |
2632 | 275 | { | 275 | { |
2633 | 276 | int meter_width = 5; | 276 | int meter_width = 5; |
2634 | 277 | uint32_t meter_channels = 0; | ||
2635 | 278 | if (_meter) { | ||
2636 | 279 | meter_channels = _meter->input_streams().n_total(); | ||
2637 | 280 | } else if (_route) { | ||
2638 | 281 | meter_channels = _route->shared_peak_meter()->input_streams().n_total(); | ||
2639 | 282 | } | ||
2640 | 277 | 283 | ||
2641 | 278 | switch (_width) { | 284 | switch (_width) { |
2642 | 279 | case Wide: | 285 | case Wide: |
2643 | 280 | //meter_ticks1_area.show(); | 286 | //meter_ticks1_area.show(); |
2644 | 281 | //meter_ticks2_area.show(); | 287 | //meter_ticks2_area.show(); |
2645 | 282 | meter_metric_area.show(); | 288 | meter_metric_area.show(); |
2647 | 283 | if (_route && _route->shared_peak_meter()->input_streams().n_total() == 1) { | 289 | if (meter_channels == 1) { |
2648 | 284 | meter_width = 10; | 290 | meter_width = 10; |
2649 | 285 | } | 291 | } |
2650 | 286 | break; | 292 | break; |
2651 | 287 | case Narrow: | 293 | case Narrow: |
2653 | 288 | if (_route && _route->shared_peak_meter()->input_streams().n_total() > 1) { | 294 | if (meter_channels > 1) { |
2654 | 289 | meter_width = 4; | 295 | meter_width = 4; |
2655 | 290 | } | 296 | } |
2656 | 291 | //meter_ticks1_area.hide(); | 297 | //meter_ticks1_area.hide(); |
2657 | 292 | 298 | ||
2658 | === modified file 'gtk2_ardour/level_meter.cc' | |||
2659 | --- gtk2_ardour/level_meter.cc 2013-12-23 22:07:52 +0000 | |||
2660 | +++ gtk2_ardour/level_meter.cc 2015-05-02 14:23:30 +0000 | |||
2661 | @@ -78,6 +78,7 @@ | |||
2662 | 78 | _meter_type_connection.disconnect(); | 78 | _meter_type_connection.disconnect(); |
2663 | 79 | 79 | ||
2664 | 80 | _meter = meter; | 80 | _meter = meter; |
2665 | 81 | color_changed = true; | ||
2666 | 81 | 82 | ||
2667 | 82 | if (_meter) { | 83 | if (_meter) { |
2668 | 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()); |
2669 | 84 | 85 | ||
2670 | === modified file 'gtk2_ardour/midi_time_axis.cc' | |||
2671 | --- gtk2_ardour/midi_time_axis.cc 2014-01-24 16:31:54 +0000 | |||
2672 | +++ gtk2_ardour/midi_time_axis.cc 2015-05-02 14:23:30 +0000 | |||
2673 | @@ -757,7 +757,7 @@ | |||
2674 | 757 | Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl); | 757 | Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl); |
2675 | 758 | ctl_items.push_back ( | 758 | ctl_items.push_back ( |
2676 | 759 | CheckMenuElem ( | 759 | CheckMenuElem ( |
2678 | 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)), |
2679 | 761 | sigc::bind ( | 761 | sigc::bind ( |
2680 | 762 | sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track), | 762 | sigc::mem_fun (*this, &RouteTimeAxisView::toggle_automation_track), |
2681 | 763 | fully_qualified_param))); | 763 | fully_qualified_param))); |
2682 | @@ -1199,16 +1199,56 @@ | |||
2683 | 1199 | void | 1199 | void |
2684 | 1200 | MidiTimeAxisView::show_all_automation (bool apply_to_selection) | 1200 | MidiTimeAxisView::show_all_automation (bool apply_to_selection) |
2685 | 1201 | { | 1201 | { |
2686 | 1202 | using namespace MIDI::Name; | ||
2687 | 1203 | |||
2688 | 1202 | if (apply_to_selection) { | 1204 | if (apply_to_selection) { |
2689 | 1203 | _editor.get_selection().tracks.foreach_midi_time_axis ( | 1205 | _editor.get_selection().tracks.foreach_midi_time_axis ( |
2690 | 1204 | boost::bind (&MidiTimeAxisView::show_all_automation, _1, false)); | 1206 | boost::bind (&MidiTimeAxisView::show_all_automation, _1, false)); |
2691 | 1205 | } else { | 1207 | } else { |
2692 | 1206 | if (midi_track()) { | 1208 | if (midi_track()) { |
2693 | 1209 | // Show existing automation | ||
2694 | 1207 | const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation(); | 1210 | const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation(); |
2695 | 1208 | 1211 | ||
2696 | 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) { |
2697 | 1210 | create_automation_child(*i, true); | 1213 | create_automation_child(*i, true); |
2698 | 1211 | } | 1214 | } |
2699 | 1215 | |||
2700 | 1216 | // Show automation for all controllers named in midnam file | ||
2701 | 1217 | boost::shared_ptr<MasterDeviceNames> device_names = get_device_names(); | ||
2702 | 1218 | if (gui_property (X_("midnam-model-name")) != "Generic" && | ||
2703 | 1219 | device_names && !device_names->controls().empty()) { | ||
2704 | 1220 | const std::string device_mode = _midnam_custom_device_mode_selector.get_active_text(); | ||
2705 | 1221 | const uint16_t selected_channels = midi_track()->get_playback_channel_mask(); | ||
2706 | 1222 | for (uint32_t chn = 0; chn < 16; ++chn) { | ||
2707 | 1223 | if ((selected_channels & (0x0001 << chn)) == 0) { | ||
2708 | 1224 | // Channel not in use | ||
2709 | 1225 | continue; | ||
2710 | 1226 | } | ||
2711 | 1227 | |||
2712 | 1228 | boost::shared_ptr<ChannelNameSet> chan_names = device_names->channel_name_set_by_channel( | ||
2713 | 1229 | device_mode, chn); | ||
2714 | 1230 | if (!chan_names) { | ||
2715 | 1231 | continue; | ||
2716 | 1232 | } | ||
2717 | 1233 | |||
2718 | 1234 | boost::shared_ptr<ControlNameList> control_names = device_names->control_name_list( | ||
2719 | 1235 | chan_names->control_list_name()); | ||
2720 | 1236 | if (!control_names) { | ||
2721 | 1237 | continue; | ||
2722 | 1238 | } | ||
2723 | 1239 | |||
2724 | 1240 | for (ControlNameList::Controls::const_iterator c = control_names->controls().begin(); | ||
2725 | 1241 | c != control_names->controls().end(); | ||
2726 | 1242 | ++c) { | ||
2727 | 1243 | const uint16_t ctl = c->second->number(); | ||
2728 | 1244 | if (ctl != MIDI_CTL_MSB_BANK && ctl != MIDI_CTL_LSB_BANK) { | ||
2729 | 1245 | /* Skip bank select controllers since they're handled specially */ | ||
2730 | 1246 | const Evoral::Parameter param(MidiCCAutomation, chn, ctl); | ||
2731 | 1247 | create_automation_child(param, true); | ||
2732 | 1248 | } | ||
2733 | 1249 | } | ||
2734 | 1250 | } | ||
2735 | 1251 | } | ||
2736 | 1212 | } | 1252 | } |
2737 | 1213 | 1253 | ||
2738 | 1214 | RouteTimeAxisView::show_all_automation (); | 1254 | RouteTimeAxisView::show_all_automation (); |
2739 | @@ -1524,8 +1564,7 @@ | |||
2740 | 1524 | 1564 | ||
2741 | 1525 | real_editor->snap_to (pos, 0); | 1565 | real_editor->snap_to (pos, 0); |
2742 | 1526 | 1566 | ||
2745 | 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()); |
2744 | 1528 | view()->trackview().track().get(), view()->trackview().track()->name()); | ||
2746 | 1529 | PropertyList plist; | 1568 | PropertyList plist; |
2747 | 1530 | 1569 | ||
2748 | 1531 | plist.add (ARDOUR::Properties::start, 0); | 1570 | plist.add (ARDOUR::Properties::start, 0); |
2749 | 1532 | 1571 | ||
2750 | === modified file 'gtk2_ardour/mixer_strip.cc' | |||
2751 | --- gtk2_ardour/mixer_strip.cc 2014-01-24 16:31:54 +0000 | |||
2752 | +++ gtk2_ardour/mixer_strip.cc 2015-05-02 14:23:30 +0000 | |||
2753 | @@ -37,6 +37,7 @@ | |||
2754 | 37 | #include "ardour/audio_track.h" | 37 | #include "ardour/audio_track.h" |
2755 | 38 | #include "ardour/audioengine.h" | 38 | #include "ardour/audioengine.h" |
2756 | 39 | #include "ardour/internal_send.h" | 39 | #include "ardour/internal_send.h" |
2757 | 40 | #include "ardour/meter.h" | ||
2758 | 40 | #include "ardour/midi_track.h" | 41 | #include "ardour/midi_track.h" |
2759 | 41 | #include "ardour/pannable.h" | 42 | #include "ardour/pannable.h" |
2760 | 42 | #include "ardour/panner.h" | 43 | #include "ardour/panner.h" |
2761 | @@ -1023,32 +1024,62 @@ | |||
2762 | 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()); |
2763 | 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()); |
2764 | 1025 | 1026 | ||
2791 | 1026 | /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself | 1027 | <<<<<<< TREE |
2792 | 1027 | * However, that only works a panner was previously set. | 1028 | /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself |
2793 | 1028 | * | 1029 | * However, that only works a panner was previously set. |
2794 | 1029 | * PannerUI must remain subscribed to _panshell->Changed() in case | 1030 | * |
2795 | 1030 | * we switch the panner eg. AUX-Send and back | 1031 | * PannerUI must remain subscribed to _panshell->Changed() in case |
2796 | 1031 | * _route->panner_shell()->Changed() vs _panshell->Changed | 1032 | * we switch the panner eg. AUX-Send and back |
2797 | 1032 | */ | 1033 | * _route->panner_shell()->Changed() vs _panshell->Changed |
2798 | 1033 | if (panners._panner == 0) { | 1034 | */ |
2799 | 1034 | panners.panshell_changed (); | 1035 | if (panners._panner == 0) { |
2800 | 1035 | } | 1036 | panners.panshell_changed (); |
2801 | 1036 | } | 1037 | } |
2802 | 1037 | 1038 | } | |
2803 | 1038 | void | 1039 | |
2804 | 1039 | MixerStrip::update_panner_choices () | 1040 | void |
2805 | 1040 | { | 1041 | MixerStrip::update_panner_choices () |
2806 | 1041 | ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices) | 1042 | { |
2807 | 1042 | if (!_route->panner_shell()) { return; } | 1043 | ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices) |
2808 | 1043 | 1044 | if (!_route->panner_shell()) { return; } | |
2809 | 1044 | uint32_t in = _route->output()->n_ports().n_audio(); | 1045 | |
2810 | 1045 | uint32_t out = in; | 1046 | uint32_t in = _route->output()->n_ports().n_audio(); |
2811 | 1046 | if (_route->panner()) { | 1047 | uint32_t out = in; |
2812 | 1047 | in = _route->panner()->in().n_audio(); | 1048 | if (_route->panner()) { |
2813 | 1048 | } | 1049 | in = _route->panner()->in().n_audio(); |
2814 | 1049 | 1050 | } | |
2815 | 1050 | panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out)); | 1051 | |
2816 | 1051 | } | 1052 | panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out)); |
2817 | 1053 | } | ||
2818 | 1054 | ======= | ||
2819 | 1055 | /* This call reduncant, PannerUI::set_panner() connects to _panshell->Changed itself | ||
2820 | 1056 | * However, that only works a panner was previously set. | ||
2821 | 1057 | * | ||
2822 | 1058 | * PannerUI must remain subscribed to _panshell->Changed() in case | ||
2823 | 1059 | * we switch the panner eg. AUX-Send and back | ||
2824 | 1060 | * _route->panner_shell()->Changed() vs _panshell->Changed | ||
2825 | 1061 | */ | ||
2826 | 1062 | if (panners._panner == 0) { | ||
2827 | 1063 | panners.panshell_changed (); | ||
2828 | 1064 | } | ||
2829 | 1065 | update_panner_choices(); | ||
2830 | 1066 | } | ||
2831 | 1067 | |||
2832 | 1068 | void | ||
2833 | 1069 | MixerStrip::update_panner_choices () | ||
2834 | 1070 | { | ||
2835 | 1071 | ENSURE_GUI_THREAD (*this, &MixerStrip::update_panner_choices) | ||
2836 | 1072 | if (!_route->panner_shell()) { return; } | ||
2837 | 1073 | |||
2838 | 1074 | uint32_t in = _route->output()->n_ports().n_audio(); | ||
2839 | 1075 | uint32_t out = in; | ||
2840 | 1076 | if (_route->panner()) { | ||
2841 | 1077 | in = _route->panner()->in().n_audio(); | ||
2842 | 1078 | } | ||
2843 | 1079 | |||
2844 | 1080 | panners.set_available_panners(PannerManager::instance().PannerManager::get_available_panners(in, out)); | ||
2845 | 1081 | } | ||
2846 | 1082 | >>>>>>> MERGE-SOURCE | ||
2847 | 1052 | 1083 | ||
2848 | 1053 | /* | 1084 | /* |
2849 | 1054 | * Output port labelling | 1085 | * Output port labelling |
2850 | @@ -1869,6 +1900,7 @@ | |||
2851 | 1869 | 1900 | ||
2852 | 1870 | set_current_delivery (send); | 1901 | set_current_delivery (send); |
2853 | 1871 | 1902 | ||
2854 | 1903 | send->meter()->set_type(_route->shared_peak_meter()->get_type()); | ||
2855 | 1872 | send->set_metering (true); | 1904 | send->set_metering (true); |
2856 | 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()); |
2857 | 1874 | 1906 | ||
2858 | @@ -2159,8 +2191,8 @@ | |||
2859 | 2159 | 2191 | ||
2860 | 2160 | _suspend_menu_callbacks = true; | 2192 | _suspend_menu_callbacks = true; |
2861 | 2161 | add_level_meter_item_point (items, group, _("Input"), MeterInput); | 2193 | add_level_meter_item_point (items, group, _("Input"), MeterInput); |
2864 | 2162 | add_level_meter_item_point (items, group, _("Pre-fader"), MeterPreFader); | 2194 | add_level_meter_item_point (items, group, _("Pre Fader"), MeterPreFader); |
2865 | 2163 | add_level_meter_item_point (items, group, _("Post-fader"), MeterPostFader); | 2195 | add_level_meter_item_point (items, group, _("Post Fader"), MeterPostFader); |
2866 | 2164 | add_level_meter_item_point (items, group, _("Output"), MeterOutput); | 2196 | add_level_meter_item_point (items, group, _("Output"), MeterOutput); |
2867 | 2165 | add_level_meter_item_point (items, group, _("Custom"), MeterCustom); | 2197 | add_level_meter_item_point (items, group, _("Custom"), MeterCustom); |
2868 | 2166 | 2198 | ||
2869 | 2167 | 2199 | ||
2870 | === modified file 'gtk2_ardour/mixer_ui.cc' | |||
2871 | --- gtk2_ardour/mixer_ui.cc 2013-11-06 13:22:44 +0000 | |||
2872 | +++ gtk2_ardour/mixer_ui.cc 2015-05-02 14:23:30 +0000 | |||
2873 | @@ -240,6 +240,7 @@ | |||
2874 | 240 | group_display.show(); | 240 | group_display.show(); |
2875 | 241 | 241 | ||
2876 | 242 | _in_group_rebuild_or_clear = false; | 242 | _in_group_rebuild_or_clear = false; |
2877 | 243 | _maximised = false; | ||
2878 | 243 | 244 | ||
2879 | 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()); |
2880 | 245 | 246 | ||
2881 | @@ -1559,6 +1560,19 @@ | |||
2882 | 1559 | } | 1560 | } |
2883 | 1560 | } | 1561 | } |
2884 | 1561 | 1562 | ||
2885 | 1563 | if ((prop = node.property ("maximised"))) { | ||
2886 | 1564 | bool yn = string_is_affirmative (prop->value()); | ||
2887 | 1565 | Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMaximalMixer")); | ||
2888 | 1566 | assert (act); | ||
2889 | 1567 | Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act); | ||
2890 | 1568 | bool fs = tact && tact->get_active(); | ||
2891 | 1569 | if (yn ^ fs) { | ||
2892 | 1570 | ActionManager::do_action ("Common", | ||
2893 | 1571 | "ToggleMaximalMixer"); | ||
2894 | 1572 | } | ||
2895 | 1573 | } | ||
2896 | 1574 | |||
2897 | 1575 | |||
2898 | 1562 | return 0; | 1576 | return 0; |
2899 | 1563 | } | 1577 | } |
2900 | 1564 | 1578 | ||
2901 | @@ -1601,6 +1615,8 @@ | |||
2902 | 1601 | 1615 | ||
2903 | 1602 | node->add_property ("show-mixer", _visible ? "yes" : "no"); | 1616 | node->add_property ("show-mixer", _visible ? "yes" : "no"); |
2904 | 1603 | 1617 | ||
2905 | 1618 | node->add_property ("maximised", _maximised ? "yes" : "no"); | ||
2906 | 1619 | |||
2907 | 1604 | return *node; | 1620 | return *node; |
2908 | 1605 | } | 1621 | } |
2909 | 1606 | 1622 | ||
2910 | @@ -1942,3 +1958,26 @@ | |||
2911 | 1942 | _session->set_exclusive_input_active (rl, onoff, flip_others); | 1958 | _session->set_exclusive_input_active (rl, onoff, flip_others); |
2912 | 1943 | } | 1959 | } |
2913 | 1944 | 1960 | ||
2914 | 1961 | void | ||
2915 | 1962 | Mixer_UI::maximise_mixer_space () | ||
2916 | 1963 | { | ||
2917 | 1964 | if (_maximised) { | ||
2918 | 1965 | return; | ||
2919 | 1966 | } | ||
2920 | 1967 | |||
2921 | 1968 | fullscreen (); | ||
2922 | 1969 | |||
2923 | 1970 | _maximised = true; | ||
2924 | 1971 | } | ||
2925 | 1972 | |||
2926 | 1973 | void | ||
2927 | 1974 | Mixer_UI::restore_mixer_space () | ||
2928 | 1975 | { | ||
2929 | 1976 | if (!_maximised) { | ||
2930 | 1977 | return; | ||
2931 | 1978 | } | ||
2932 | 1979 | |||
2933 | 1980 | unfullscreen(); | ||
2934 | 1981 | |||
2935 | 1982 | _maximised = false; | ||
2936 | 1983 | } | ||
2937 | 1945 | 1984 | ||
2938 | === modified file 'gtk2_ardour/mixer_ui.h' | |||
2939 | --- gtk2_ardour/mixer_ui.h 2013-11-06 13:22:44 +0000 | |||
2940 | +++ gtk2_ardour/mixer_ui.h 2015-05-02 14:23:30 +0000 | |||
2941 | @@ -80,6 +80,9 @@ | |||
2942 | 80 | void show_strip (MixerStrip *); | 80 | void show_strip (MixerStrip *); |
2943 | 81 | void hide_strip (MixerStrip *); | 81 | void hide_strip (MixerStrip *); |
2944 | 82 | 82 | ||
2945 | 83 | void maximise_mixer_space(); | ||
2946 | 84 | void restore_mixer_space(); | ||
2947 | 85 | |||
2948 | 83 | void ensure_float (Gtk::Window&); | 86 | void ensure_float (Gtk::Window&); |
2949 | 84 | 87 | ||
2950 | 85 | MonitorSection* monitor_section() const { return _monitor_section; } | 88 | MonitorSection* monitor_section() const { return _monitor_section; } |
2951 | @@ -279,6 +282,9 @@ | |||
2952 | 279 | bool _following_editor_selection; | 282 | bool _following_editor_selection; |
2953 | 280 | 283 | ||
2954 | 281 | void monitor_section_going_away (); | 284 | void monitor_section_going_away (); |
2955 | 285 | |||
2956 | 286 | /// true if we are in fullscreen mode | ||
2957 | 287 | bool _maximised; | ||
2958 | 282 | }; | 288 | }; |
2959 | 283 | 289 | ||
2960 | 284 | #endif /* __ardour_mixer_ui_h__ */ | 290 | #endif /* __ardour_mixer_ui_h__ */ |
2961 | 285 | 291 | ||
2962 | === modified file 'gtk2_ardour/mnemonic-us.bindings.in' | |||
2963 | --- gtk2_ardour/mnemonic-us.bindings.in 2013-09-21 19:05:02 +0000 | |||
2964 | +++ gtk2_ardour/mnemonic-us.bindings.in 2015-05-02 14:23:30 +0000 | |||
2965 | @@ -189,6 +189,7 @@ | |||
2966 | 189 | @trans|Editor/toggle-follow-playhead|<@PRIMARY@>f|toggle playhead tracking | 189 | @trans|Editor/toggle-follow-playhead|<@PRIMARY@>f|toggle playhead tracking |
2967 | 190 | @trans|Transport/ToggleFollowEdits|<@TERTIARY@>f|toggle playhead follows edits | 190 | @trans|Transport/ToggleFollowEdits|<@TERTIARY@>f|toggle playhead follows edits |
2968 | 191 | @wvis|Common/ToggleMaximalEditor|<@PRIMARY@><@SECONDARY@>f|maximise editor space | 191 | @wvis|Common/ToggleMaximalEditor|<@PRIMARY@><@SECONDARY@>f|maximise editor space |
2969 | 192 | @wvis|Common/ToggleMaximalMixer|F12|maximise mixer space | ||
2970 | 192 | @wvis|Region/show-rhythm-ferret|<@WINDOW@>f|show rhythm ferret window | 193 | @wvis|Region/show-rhythm-ferret|<@WINDOW@>f|show rhythm ferret window |
2971 | 193 | @mmode|MouseMode/set-mouse-mode-gain|g|region gain mode | 194 | @mmode|MouseMode/set-mouse-mode-gain|g|region gain mode |
2972 | 194 | @epp|Region/play-selected-regions|h|play selected region(s) | 195 | @epp|Region/play-selected-regions|h|play selected region(s) |
2973 | @@ -338,7 +339,7 @@ | |||
2974 | 338 | @trans|Transport/ToggleAutoPlay|5|toggle auto play | 339 | @trans|Transport/ToggleAutoPlay|5|toggle auto play |
2975 | 339 | @trans|Transport/ToggleAutoReturn|6|toggle auto return | 340 | @trans|Transport/ToggleAutoReturn|6|toggle auto return |
2976 | 340 | @trans|Transport/ToggleClick|7|toggle click (metronome) | 341 | @trans|Transport/ToggleClick|7|toggle click (metronome) |
2978 | 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) |
2979 | 342 | @ranges|Editor/set-tempo-from-edit-range|0|set tempo (1 bar) from edit range | 343 | @ranges|Editor/set-tempo-from-edit-range|0|set tempo (1 bar) from edit range |
2980 | 343 | 344 | ||
2981 | 344 | ; mouse stuff | 345 | ; mouse stuff |
2982 | 345 | 346 | ||
2983 | === modified file 'gtk2_ardour/opts.cc' | |||
2984 | --- gtk2_ardour/opts.cc 2013-10-17 11:16:21 +0000 | |||
2985 | +++ gtk2_ardour/opts.cc 2015-05-02 14:23:30 +0000 | |||
2986 | @@ -102,7 +102,7 @@ | |||
2987 | 102 | { "help", 0, 0, 'h' }, | 102 | { "help", 0, 0, 'h' }, |
2988 | 103 | { "no-announcements", 0, 0, 'a' }, | 103 | { "no-announcements", 0, 0, 'a' }, |
2989 | 104 | { "bindings", 0, 0, 'b' }, | 104 | { "bindings", 0, 0, 'b' }, |
2991 | 105 | { "disable-plugins", 1, 0, 'd' }, | 105 | { "disable-plugins", 0, 0, 'd' }, |
2992 | 106 | { "debug", 1, 0, 'D' }, | 106 | { "debug", 1, 0, 'D' }, |
2993 | 107 | { "no-splash", 0, 0, 'n' }, | 107 | { "no-splash", 0, 0, 'n' }, |
2994 | 108 | { "menus", 1, 0, 'm' }, | 108 | { "menus", 1, 0, 'm' }, |
2995 | 109 | 109 | ||
2996 | === modified file 'gtk2_ardour/panner_ui.cc' | |||
2997 | --- gtk2_ardour/panner_ui.cc 2014-01-24 16:31:54 +0000 | |||
2998 | +++ gtk2_ardour/panner_ui.cc 2015-05-02 14:23:30 +0000 | |||
2999 | @@ -49,6 +49,7 @@ | |||
3000 | 49 | PannerUI::PannerUI (Session* s) | 49 | PannerUI::PannerUI (Session* s) |
3001 | 50 | : _current_nouts (-1) | 50 | : _current_nouts (-1) |
3002 | 51 | , _current_nins (-1) | 51 | , _current_nins (-1) |
3003 | 52 | , _current_uri ("") | ||
3004 | 52 | , pan_automation_style_button ("") | 53 | , pan_automation_style_button ("") |
3005 | 53 | , pan_automation_state_button ("") | 54 | , pan_automation_state_button ("") |
3006 | 54 | , _panner_list() | 55 | , _panner_list() |
3007 | @@ -214,12 +215,17 @@ | |||
3008 | 214 | int const nouts = _panner ? _panner->out().n_audio() : -1; | 215 | int const nouts = _panner ? _panner->out().n_audio() : -1; |
3009 | 215 | int const nins = _panner ? _panner->in().n_audio() : -1; | 216 | int const nins = _panner ? _panner->in().n_audio() : -1; |
3010 | 216 | 217 | ||
3012 | 217 | if (nouts == _current_nouts && nins == _current_nins) { | 218 | if (nouts == _current_nouts |
3013 | 219 | && nins == _current_nins | ||
3014 | 220 | && _current_uri == _panshell->panner_gui_uri() | ||
3015 | 221 | ) | ||
3016 | 222 | { | ||
3017 | 218 | return; | 223 | return; |
3018 | 219 | } | 224 | } |
3019 | 220 | 225 | ||
3020 | 221 | _current_nins = nins; | 226 | _current_nins = nins; |
3021 | 222 | _current_nouts = nouts; | 227 | _current_nouts = nouts; |
3022 | 228 | _current_uri = _panshell->panner_gui_uri(); | ||
3023 | 223 | 229 | ||
3024 | 224 | container_clear (pan_vbox); | 230 | container_clear (pan_vbox); |
3025 | 225 | 231 | ||
3026 | @@ -236,6 +242,7 @@ | |||
3027 | 236 | return; | 242 | return; |
3028 | 237 | } | 243 | } |
3029 | 238 | 244 | ||
3030 | 245 | <<<<<<< TREE | ||
3031 | 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") |
3032 | 240 | { | 247 | { |
3033 | 241 | delete big_window; | 248 | delete big_window; |
3034 | @@ -286,6 +293,58 @@ | |||
3035 | 286 | } | 293 | } |
3036 | 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") |
3037 | 288 | { | 295 | { |
3038 | 296 | ======= | ||
3039 | 297 | if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui") | ||
3040 | 298 | { | ||
3041 | 299 | delete big_window; | ||
3042 | 300 | big_window = 0; | ||
3043 | 301 | |||
3044 | 302 | boost::shared_ptr<Pannable> pannable = _panner->pannable(); | ||
3045 | 303 | |||
3046 | 304 | _stereo_panner = new StereoPanner (_panshell); | ||
3047 | 305 | _stereo_panner->set_size_request (-1, pan_bar_height); | ||
3048 | 306 | pan_vbox.pack_start (*_stereo_panner, false, false); | ||
3049 | 307 | |||
3050 | 308 | boost::shared_ptr<AutomationControl> ac; | ||
3051 | 309 | |||
3052 | 310 | ac = pannable->pan_azimuth_control; | ||
3053 | 311 | _stereo_panner->StartPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch), | ||
3054 | 312 | boost::weak_ptr<AutomationControl> (ac))); | ||
3055 | 313 | _stereo_panner->StopPositionGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch), | ||
3056 | 314 | boost::weak_ptr<AutomationControl>(ac))); | ||
3057 | 315 | |||
3058 | 316 | ac = pannable->pan_width_control; | ||
3059 | 317 | _stereo_panner->StartWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch), | ||
3060 | 318 | boost::weak_ptr<AutomationControl> (ac))); | ||
3061 | 319 | _stereo_panner->StopWidthGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch), | ||
3062 | 320 | boost::weak_ptr<AutomationControl>(ac))); | ||
3063 | 321 | _stereo_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event)); | ||
3064 | 322 | } | ||
3065 | 323 | else if (_current_uri == "http://ardour.org/plugin/panner_1in2out#ui" | ||
3066 | 324 | || _current_uri == "http://ardour.org/plugin/panner_balance#ui") | ||
3067 | 325 | { | ||
3068 | 326 | delete big_window; | ||
3069 | 327 | big_window = 0; | ||
3070 | 328 | boost::shared_ptr<Pannable> pannable = _panner->pannable(); | ||
3071 | 329 | boost::shared_ptr<AutomationControl> ac = pannable->pan_azimuth_control; | ||
3072 | 330 | |||
3073 | 331 | _mono_panner = new MonoPanner (_panshell); | ||
3074 | 332 | |||
3075 | 333 | _mono_panner->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch), | ||
3076 | 334 | boost::weak_ptr<AutomationControl> (ac))); | ||
3077 | 335 | _mono_panner->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch), | ||
3078 | 336 | boost::weak_ptr<AutomationControl>(ac))); | ||
3079 | 337 | |||
3080 | 338 | _mono_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event)); | ||
3081 | 339 | |||
3082 | 340 | _mono_panner->set_size_request (-1, pan_bar_height); | ||
3083 | 341 | |||
3084 | 342 | update_pan_sensitive (); | ||
3085 | 343 | pan_vbox.pack_start (*_mono_panner, false, false); | ||
3086 | 344 | } | ||
3087 | 345 | else if (_current_uri == "http://ardour.org/plugin/panner_vbap#ui") | ||
3088 | 346 | { | ||
3089 | 347 | >>>>>>> MERGE-SOURCE | ||
3090 | 289 | if (!twod_panner) { | 348 | if (!twod_panner) { |
3091 | 290 | twod_panner = new Panner2d (_panshell, 61); | 349 | twod_panner = new Panner2d (_panshell, 61); |
3092 | 291 | twod_panner->set_name ("MixerPanZone"); | 350 | twod_panner->set_name ("MixerPanZone"); |
3093 | @@ -383,6 +442,7 @@ | |||
3094 | 383 | bypass_menu_item->set_active (_panshell->bypassed()); | 442 | bypass_menu_item->set_active (_panshell->bypassed()); |
3095 | 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)); |
3096 | 385 | 444 | ||
3097 | 445 | <<<<<<< TREE | ||
3098 | 386 | if (!_panshell->bypassed()) { | 446 | if (!_panshell->bypassed()) { |
3099 | 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))); |
3100 | 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))); |
3101 | @@ -404,6 +464,26 @@ | |||
3102 | 404 | } | 464 | } |
3103 | 405 | _suspend_menu_callbacks = false; | 465 | _suspend_menu_callbacks = false; |
3104 | 406 | } | 466 | } |
3105 | 467 | ======= | ||
3106 | 468 | if (!_panshell->bypassed()) { | ||
3107 | 469 | items.push_back (MenuElem (_("Reset"), sigc::mem_fun (*this, &PannerUI::pan_reset))); | ||
3108 | 470 | items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit))); | ||
3109 | 471 | } | ||
3110 | 472 | |||
3111 | 473 | if (_panner_list.size() > 1 && !_panshell->bypassed()) { | ||
3112 | 474 | RadioMenuItem::Group group; | ||
3113 | 475 | items.push_back (SeparatorElem()); | ||
3114 | 476 | |||
3115 | 477 | _suspend_menu_callbacks = true; | ||
3116 | 478 | for (std::map<std::string,std::string>::const_iterator p = _panner_list.begin(); p != _panner_list.end(); ++p) { | ||
3117 | 479 | items.push_back (RadioMenuElem (group, p->second, | ||
3118 | 480 | sigc::bind(sigc::mem_fun (*this, &PannerUI::pan_set_custom_type), p->first))); | ||
3119 | 481 | RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&items.back ()); | ||
3120 | 482 | i->set_active (_panshell->current_panner_uri() == p->first); | ||
3121 | 483 | } | ||
3122 | 484 | _suspend_menu_callbacks = false; | ||
3123 | 485 | } | ||
3124 | 486 | >>>>>>> MERGE-SOURCE | ||
3125 | 407 | } | 487 | } |
3126 | 408 | 488 | ||
3127 | 409 | void | 489 | void |
3128 | 410 | 490 | ||
3129 | === modified file 'gtk2_ardour/panner_ui.h' | |||
3130 | --- gtk2_ardour/panner_ui.h 2014-01-24 16:31:54 +0000 | |||
3131 | +++ gtk2_ardour/panner_ui.h 2015-05-02 14:23:30 +0000 | |||
3132 | @@ -96,6 +96,7 @@ | |||
3133 | 96 | bool in_pan_update; | 96 | bool in_pan_update; |
3134 | 97 | int _current_nouts; | 97 | int _current_nouts; |
3135 | 98 | int _current_nins; | 98 | int _current_nins; |
3136 | 99 | std::string _current_uri; | ||
3137 | 99 | 100 | ||
3138 | 100 | static const int pan_bar_height; | 101 | static const int pan_bar_height; |
3139 | 101 | 102 | ||
3140 | 102 | 103 | ||
3141 | === modified file 'gtk2_ardour/plugin_ui.cc' | |||
3142 | --- gtk2_ardour/plugin_ui.cc 2013-10-17 11:16:21 +0000 | |||
3143 | +++ gtk2_ardour/plugin_ui.cc 2015-05-02 14:23:30 +0000 | |||
3144 | @@ -161,7 +161,9 @@ | |||
3145 | 161 | 161 | ||
3146 | 162 | PluginUIWindow::~PluginUIWindow () | 162 | PluginUIWindow::~PluginUIWindow () |
3147 | 163 | { | 163 | { |
3148 | 164 | #ifndef NDEBUG | ||
3149 | 164 | cerr << "PluginWindow deleted for " << this << endl; | 165 | cerr << "PluginWindow deleted for " << this << endl; |
3150 | 166 | #endif | ||
3151 | 165 | delete _pluginui; | 167 | delete _pluginui; |
3152 | 166 | } | 168 | } |
3153 | 167 | 169 | ||
3154 | 168 | 170 | ||
3155 | === modified file 'gtk2_ardour/processor_box.cc' | |||
3156 | --- gtk2_ardour/processor_box.cc 2014-01-24 16:31:54 +0000 | |||
3157 | +++ gtk2_ardour/processor_box.cc 2015-05-02 14:23:30 +0000 | |||
3158 | @@ -820,6 +820,7 @@ | |||
3159 | 820 | Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL); | 820 | Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL); |
3160 | 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 ()); |
3161 | 822 | 822 | ||
3162 | 823 | <<<<<<< TREE | ||
3163 | 823 | const uint32_t sources = _sources.n_total(); | 824 | const uint32_t sources = _sources.n_total(); |
3164 | 824 | const uint32_t sinks = _sinks.n_total(); | 825 | const uint32_t sinks = _sinks.n_total(); |
3165 | 825 | 826 | ||
3166 | @@ -878,6 +879,75 @@ | |||
3167 | 878 | cairo_stroke (cr); | 879 | cairo_stroke (cr); |
3168 | 879 | } | 880 | } |
3169 | 880 | cairo_destroy(cr); | 881 | cairo_destroy(cr); |
3170 | 882 | ======= | ||
3171 | 883 | const uint32_t sources = _sources.n_total(); | ||
3172 | 884 | const uint32_t sinks = _sinks.n_total(); | ||
3173 | 885 | |||
3174 | 886 | /* MIDI */ | ||
3175 | 887 | const uint32_t midi_sources = _sources.n_midi(); | ||
3176 | 888 | const uint32_t midi_sinks = _sinks.n_midi(); | ||
3177 | 889 | |||
3178 | 890 | cairo_set_source_rgb (cr, | ||
3179 | 891 | UINT_RGBA_R_FLT(midi_port_color), | ||
3180 | 892 | UINT_RGBA_G_FLT(midi_port_color), | ||
3181 | 893 | UINT_RGBA_B_FLT(midi_port_color)); | ||
3182 | 894 | if (midi_sources > 0 && midi_sinks > 0 && sinks > 1 && sources > 1) { | ||
3183 | 895 | for (uint32_t i = 0 ; i < midi_sources; ++i) { | ||
3184 | 896 | const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f; | ||
3185 | 897 | const float si_x0 = rintf(width * (.2f + .6f * i / (sources - 1.f))) + .5f; | ||
3186 | 898 | cairo_move_to (cr, si_x, height); | ||
3187 | 899 | cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); | ||
3188 | 900 | cairo_stroke (cr); | ||
3189 | 901 | } | ||
3190 | 902 | } else if (midi_sources == 1 && midi_sinks == 1 && sinks == 1 && sources == 1) { | ||
3191 | 903 | const float si_x = rintf(width * .5f) + .5f; | ||
3192 | 904 | cairo_move_to (cr, si_x, height); | ||
3193 | 905 | cairo_line_to (cr, si_x, 0); | ||
3194 | 906 | cairo_stroke (cr); | ||
3195 | 907 | } else if (midi_sources == 1 && midi_sinks == 1) { | ||
3196 | 908 | /* unusual cases -- removed synth, midi-track w/audio plugins */ | ||
3197 | 909 | const float si_x = rintf(width * (sinks > 1 ? .2f : .5f)) + .5f; | ||
3198 | 910 | const float si_x0 = rintf(width * (sources > 1 ? .2f : .5f)) + .5f; | ||
3199 | 911 | cairo_move_to (cr, si_x, height); | ||
3200 | 912 | cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); | ||
3201 | 913 | cairo_stroke (cr); | ||
3202 | 914 | } | ||
3203 | 915 | |||
3204 | 916 | /* AUDIO */ | ||
3205 | 917 | const uint32_t audio_sources = _sources.n_audio(); | ||
3206 | 918 | const uint32_t audio_sinks = _sinks.n_audio(); | ||
3207 | 919 | cairo_set_source_rgb (cr, | ||
3208 | 920 | UINT_RGBA_R_FLT(audio_port_color), | ||
3209 | 921 | UINT_RGBA_G_FLT(audio_port_color), | ||
3210 | 922 | UINT_RGBA_B_FLT(audio_port_color)); | ||
3211 | 923 | |||
3212 | 924 | if (_splitting) { | ||
3213 | 925 | assert(audio_sources < 2); | ||
3214 | 926 | assert(audio_sinks > 1); | ||
3215 | 927 | /* assume there is only ever one MIDI port */ | ||
3216 | 928 | const float si_x0 = rintf(width * (midi_sources > 0 ? .8f : .5f)) + .5f; | ||
3217 | 929 | for (uint32_t i = midi_sinks; i < sinks; ++i) { | ||
3218 | 930 | const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f; | ||
3219 | 931 | cairo_move_to (cr, si_x, height); | ||
3220 | 932 | cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); | ||
3221 | 933 | cairo_stroke (cr); | ||
3222 | 934 | } | ||
3223 | 935 | } else if (audio_sources > 1) { | ||
3224 | 936 | for (uint32_t i = 0 ; i < audio_sources; ++i) { | ||
3225 | 937 | const float si_x = rintf(width * (.2f + .6f * (i + midi_sinks) / (sinks - 1.f))) + .5f; | ||
3226 | 938 | const float si_x0 = rintf(width * (.2f + .6f * (i + midi_sources) / (sources - 1.f))) + .5f; | ||
3227 | 939 | cairo_move_to (cr, si_x, height); | ||
3228 | 940 | cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); | ||
3229 | 941 | cairo_stroke (cr); | ||
3230 | 942 | } | ||
3231 | 943 | } else if (audio_sources == 1 && audio_sinks == 1) { | ||
3232 | 944 | const float si_x = rintf(width * .5f) + .5f; | ||
3233 | 945 | cairo_move_to (cr, si_x, height); | ||
3234 | 946 | cairo_line_to (cr, si_x, 0); | ||
3235 | 947 | cairo_stroke (cr); | ||
3236 | 948 | } | ||
3237 | 949 | cairo_destroy(cr); | ||
3238 | 950 | >>>>>>> MERGE-SOURCE | ||
3239 | 881 | return true; | 951 | return true; |
3240 | 882 | } | 952 | } |
3241 | 883 | 953 | ||
3242 | 884 | 954 | ||
3243 | === modified file 'gtk2_ardour/route_ui.cc' | |||
3244 | --- gtk2_ardour/route_ui.cc 2013-11-06 13:22:44 +0000 | |||
3245 | +++ gtk2_ardour/route_ui.cc 2015-05-02 14:23:30 +0000 | |||
3246 | @@ -1237,13 +1237,13 @@ | |||
3247 | 1237 | 1237 | ||
3248 | 1238 | MenuList& items = mute_menu->items(); | 1238 | MenuList& items = mute_menu->items(); |
3249 | 1239 | 1239 | ||
3251 | 1240 | pre_fader_mute_check = manage (new CheckMenuItem(_("Pre Fader"))); | 1240 | pre_fader_mute_check = manage (new CheckMenuItem(_("Pre Fader Sends"))); |
3252 | 1241 | init_mute_menu(MuteMaster::PreFader, pre_fader_mute_check); | 1241 | init_mute_menu(MuteMaster::PreFader, pre_fader_mute_check); |
3253 | 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)); |
3254 | 1243 | items.push_back (CheckMenuElem(*pre_fader_mute_check)); | 1243 | items.push_back (CheckMenuElem(*pre_fader_mute_check)); |
3255 | 1244 | pre_fader_mute_check->show_all(); | 1244 | pre_fader_mute_check->show_all(); |
3256 | 1245 | 1245 | ||
3258 | 1246 | post_fader_mute_check = manage (new CheckMenuItem(_("Post Fader"))); | 1246 | post_fader_mute_check = manage (new CheckMenuItem(_("Post Fader Sends"))); |
3259 | 1247 | init_mute_menu(MuteMaster::PostFader, post_fader_mute_check); | 1247 | init_mute_menu(MuteMaster::PostFader, post_fader_mute_check); |
3260 | 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)); |
3261 | 1249 | items.push_back (CheckMenuElem(*post_fader_mute_check)); | 1249 | items.push_back (CheckMenuElem(*post_fader_mute_check)); |
3262 | 1250 | 1250 | ||
3263 | === modified file 'gtk2_ardour/sfdb_ui.cc' | |||
3264 | --- gtk2_ardour/sfdb_ui.cc 2014-01-24 16:31:54 +0000 | |||
3265 | +++ gtk2_ardour/sfdb_ui.cc 2015-05-02 14:23:30 +0000 | |||
3266 | @@ -116,7 +116,7 @@ | |||
3267 | 116 | return _("as new tracks"); | 116 | return _("as new tracks"); |
3268 | 117 | } | 117 | } |
3269 | 118 | 118 | ||
3271 | 119 | SoundFileBox::SoundFileBox (bool persistent) | 119 | SoundFileBox::SoundFileBox (bool /*persistent*/) |
3272 | 120 | : table (6, 2), | 120 | : table (6, 2), |
3273 | 121 | length_clock ("sfboxLengthClock", true, "", false, false, true, false), | 121 | length_clock ("sfboxLengthClock", true, "", false, false, true, false), |
3274 | 122 | timecode_clock ("sfboxTimecodeClock", true, "", false, false, false, false), | 122 | timecode_clock ("sfboxTimecodeClock", true, "", false, false, false, false), |
3275 | @@ -279,6 +279,7 @@ | |||
3276 | 279 | 279 | ||
3277 | 280 | string error_msg; | 280 | string error_msg; |
3278 | 281 | 281 | ||
3279 | 282 | <<<<<<< TREE | ||
3280 | 282 | if (SMFSource::safe_midi_file_extension (path)) { | 283 | if (SMFSource::safe_midi_file_extension (path)) { |
3281 | 283 | 284 | ||
3282 | 284 | boost::shared_ptr<SMFSource> ms = | 285 | boost::shared_ptr<SMFSource> ms = |
3283 | @@ -311,6 +312,40 @@ | |||
3284 | 311 | return true; | 312 | return true; |
3285 | 312 | } | 313 | } |
3286 | 313 | 314 | ||
3287 | 315 | ======= | ||
3288 | 316 | if (SMFSource::valid_midi_file (path)) { | ||
3289 | 317 | |||
3290 | 318 | boost::shared_ptr<SMFSource> ms = | ||
3291 | 319 | boost::dynamic_pointer_cast<SMFSource> ( | ||
3292 | 320 | SourceFactory::createExternal (DataType::MIDI, *_session, | ||
3293 | 321 | path, 0, Source::Flag (0), false)); | ||
3294 | 322 | |||
3295 | 323 | preview_label.set_markup (_("<b>Midi File Information</b>")); | ||
3296 | 324 | |||
3297 | 325 | format_text.set_text ("MIDI"); | ||
3298 | 326 | samplerate_value.set_text ("-"); | ||
3299 | 327 | tags_entry.get_buffer()->set_text (""); | ||
3300 | 328 | timecode_clock.set (0); | ||
3301 | 329 | tags_entry.set_sensitive (false); | ||
3302 | 330 | |||
3303 | 331 | if (ms) { | ||
3304 | 332 | channels_value.set_text (to_string(ms->num_tracks(), std::dec)); | ||
3305 | 333 | length_clock.set (ms->length(ms->timeline_position())); | ||
3306 | 334 | } else { | ||
3307 | 335 | channels_value.set_text (""); | ||
3308 | 336 | length_clock.set (0); | ||
3309 | 337 | } | ||
3310 | 338 | |||
3311 | 339 | if (_session && ms) { | ||
3312 | 340 | play_btn.set_sensitive (true); | ||
3313 | 341 | } else { | ||
3314 | 342 | play_btn.set_sensitive (false); | ||
3315 | 343 | } | ||
3316 | 344 | |||
3317 | 345 | return true; | ||
3318 | 346 | } | ||
3319 | 347 | |||
3320 | 348 | >>>>>>> MERGE-SOURCE | ||
3321 | 314 | if(!AudioFileSource::get_soundfile_info (filename, sf_info, error_msg)) { | 349 | if(!AudioFileSource::get_soundfile_info (filename, sf_info, error_msg)) { |
3322 | 315 | 350 | ||
3323 | 316 | preview_label.set_markup (_("<b>Sound File Information</b>")); | 351 | preview_label.set_markup (_("<b>Sound File Information</b>")); |
3324 | @@ -403,6 +438,7 @@ | |||
3325 | 403 | } | 438 | } |
3326 | 404 | 439 | ||
3327 | 405 | boost::shared_ptr<Region> r; | 440 | boost::shared_ptr<Region> r; |
3328 | 441 | <<<<<<< TREE | ||
3329 | 406 | 442 | ||
3330 | 407 | if (SMFSource::safe_midi_file_extension (path)) { | 443 | if (SMFSource::safe_midi_file_extension (path)) { |
3331 | 408 | 444 | ||
3332 | @@ -456,6 +492,61 @@ | |||
3333 | 456 | AudioSource::set_build_peakfiles (old_sbp); | 492 | AudioSource::set_build_peakfiles (old_sbp); |
3334 | 457 | 493 | ||
3335 | 458 | if (srclist.empty()) { | 494 | if (srclist.empty()) { |
3336 | 495 | ======= | ||
3337 | 496 | |||
3338 | 497 | if (SMFSource::valid_midi_file (path)) { | ||
3339 | 498 | |||
3340 | 499 | boost::shared_ptr<SMFSource> ms = | ||
3341 | 500 | boost::dynamic_pointer_cast<SMFSource> ( | ||
3342 | 501 | SourceFactory::createExternal (DataType::MIDI, *_session, | ||
3343 | 502 | path, 0, Source::Flag (0), false)); | ||
3344 | 503 | |||
3345 | 504 | string rname = region_name_from_path (ms->path(), false); | ||
3346 | 505 | |||
3347 | 506 | PropertyList plist; | ||
3348 | 507 | |||
3349 | 508 | plist.add (ARDOUR::Properties::start, 0); | ||
3350 | 509 | plist.add (ARDOUR::Properties::length, ms->length(ms->timeline_position())); | ||
3351 | 510 | plist.add (ARDOUR::Properties::name, rname); | ||
3352 | 511 | plist.add (ARDOUR::Properties::layer, 0); | ||
3353 | 512 | |||
3354 | 513 | r = boost::dynamic_pointer_cast<MidiRegion> (RegionFactory::create (boost::dynamic_pointer_cast<Source>(ms), plist, false)); | ||
3355 | 514 | assert(r); | ||
3356 | 515 | |||
3357 | 516 | } else { | ||
3358 | 517 | |||
3359 | 518 | SourceList srclist; | ||
3360 | 519 | boost::shared_ptr<AudioFileSource> afs; | ||
3361 | 520 | bool old_sbp = AudioSource::get_build_peakfiles (); | ||
3362 | 521 | |||
3363 | 522 | /* don't even think of building peakfiles for these files */ | ||
3364 | 523 | |||
3365 | 524 | AudioSource::set_build_peakfiles (false); | ||
3366 | 525 | |||
3367 | 526 | for (int n = 0; n < sf_info.channels; ++n) { | ||
3368 | 527 | try { | ||
3369 | 528 | afs = boost::dynamic_pointer_cast<AudioFileSource> ( | ||
3370 | 529 | SourceFactory::createExternal (DataType::AUDIO, *_session, | ||
3371 | 530 | path, n, | ||
3372 | 531 | Source::Flag (0), false)); | ||
3373 | 532 | if (afs->sample_rate() != _session->nominal_frame_rate()) { | ||
3374 | 533 | boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, _src_quality)); | ||
3375 | 534 | srclist.push_back(sfs); | ||
3376 | 535 | } else { | ||
3377 | 536 | srclist.push_back(afs); | ||
3378 | 537 | } | ||
3379 | 538 | |||
3380 | 539 | } catch (failed_constructor& err) { | ||
3381 | 540 | error << _("Could not access soundfile: ") << path << endmsg; | ||
3382 | 541 | AudioSource::set_build_peakfiles (old_sbp); | ||
3383 | 542 | return; | ||
3384 | 543 | } | ||
3385 | 544 | } | ||
3386 | 545 | |||
3387 | 546 | AudioSource::set_build_peakfiles (old_sbp); | ||
3388 | 547 | |||
3389 | 548 | if (srclist.empty()) { | ||
3390 | 549 | >>>>>>> MERGE-SOURCE | ||
3391 | 459 | return; | 550 | return; |
3392 | 460 | } | 551 | } |
3393 | 461 | 552 | ||
3394 | @@ -1307,7 +1398,7 @@ | |||
3395 | 1307 | 1398 | ||
3396 | 1308 | /* See if we are thinking about importing any MIDI files */ | 1399 | /* See if we are thinking about importing any MIDI files */ |
3397 | 1309 | vector<string>::iterator i = paths.begin (); | 1400 | vector<string>::iterator i = paths.begin (); |
3399 | 1310 | while (i != paths.end() && SMFSource::safe_midi_file_extension (*i) == false) { | 1401 | while (i != paths.end() && SMFSource::valid_midi_file (*i) == false) { |
3400 | 1311 | ++i; | 1402 | ++i; |
3401 | 1312 | } | 1403 | } |
3402 | 1313 | bool const have_a_midi_file = (i != paths.end ()); | 1404 | bool const have_a_midi_file = (i != paths.end ()); |
3403 | @@ -1535,7 +1626,7 @@ | |||
3404 | 1535 | src_needed = true; | 1626 | src_needed = true; |
3405 | 1536 | } | 1627 | } |
3406 | 1537 | 1628 | ||
3408 | 1538 | } else if (SMFSource::safe_midi_file_extension (*i)) { | 1629 | } else if (SMFSource::valid_midi_file (*i)) { |
3409 | 1539 | 1630 | ||
3410 | 1540 | Evoral::SMF reader; | 1631 | Evoral::SMF reader; |
3411 | 1541 | reader.open(*i); | 1632 | reader.open(*i); |
3412 | 1542 | 1633 | ||
3413 | === modified file 'gtk2_ardour/stereo_panner.cc' | |||
3414 | --- gtk2_ardour/stereo_panner.cc 2014-01-24 16:31:54 +0000 | |||
3415 | +++ gtk2_ardour/stereo_panner.cc 2015-05-02 14:23:30 +0000 | |||
3416 | @@ -83,22 +83,42 @@ | |||
3417 | 83 | set_colors (); | 83 | set_colors (); |
3418 | 84 | have_colors = true; | 84 | have_colors = true; |
3419 | 85 | } | 85 | } |
3436 | 86 | if (!have_font) { | 86 | <<<<<<< TREE |
3437 | 87 | Pango::FontDescription font; | 87 | if (!have_font) { |
3438 | 88 | Pango::AttrFontDesc* font_attr; | 88 | Pango::FontDescription font; |
3439 | 89 | font = Pango::FontDescription ("ArdourMono"); | 89 | Pango::AttrFontDesc* font_attr; |
3440 | 90 | font.set_weight (Pango::WEIGHT_BOLD); | 90 | font = Pango::FontDescription ("ArdourMono"); |
3441 | 91 | font.set_size(9 * PANGO_SCALE); | 91 | font.set_weight (Pango::WEIGHT_BOLD); |
3442 | 92 | font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font)); | 92 | font.set_size(9 * PANGO_SCALE); |
3443 | 93 | panner_font_attributes.change(*font_attr); | 93 | font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font)); |
3444 | 94 | delete font_attr; | 94 | panner_font_attributes.change(*font_attr); |
3445 | 95 | have_font = true; | 95 | delete font_attr; |
3446 | 96 | } | 96 | have_font = true; |
3447 | 97 | 97 | } | |
3448 | 98 | position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context()); | 98 | |
3449 | 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()); |
3450 | 100 | 100 | width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context()); | |
3451 | 101 | _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context()); | 101 | |
3452 | 102 | _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context()); | ||
3453 | 103 | ======= | ||
3454 | 104 | if (!have_font) { | ||
3455 | 105 | Pango::FontDescription font; | ||
3456 | 106 | Pango::AttrFontDesc* font_attr; | ||
3457 | 107 | font = Pango::FontDescription ("ArdourMono"); | ||
3458 | 108 | font.set_weight (Pango::WEIGHT_BOLD); | ||
3459 | 109 | font.set_size(9 * PANGO_SCALE); | ||
3460 | 110 | font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font)); | ||
3461 | 111 | panner_font_attributes.change(*font_attr); | ||
3462 | 112 | delete font_attr; | ||
3463 | 113 | have_font = true; | ||
3464 | 114 | } | ||
3465 | 115 | |||
3466 | 116 | position_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context()); | ||
3467 | 117 | width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context()); | ||
3468 | 118 | |||
3469 | 119 | _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context()); | ||
3470 | 120 | _panner_shell->PannableChanged.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::pannable_handler, this), gui_context()); | ||
3471 | 121 | >>>>>>> MERGE-SOURCE | ||
3472 | 102 | 122 | ||
3473 | 103 | ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler)); | 123 | ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler)); |
3474 | 104 | 124 | ||
3475 | 105 | 125 | ||
3476 | === modified file 'gtk2_ardour/transcode_ffmpeg.cc' | |||
3477 | --- gtk2_ardour/transcode_ffmpeg.cc 2013-09-21 19:05:02 +0000 | |||
3478 | +++ gtk2_ardour/transcode_ffmpeg.cc 2015-05-02 14:23:30 +0000 | |||
3479 | @@ -46,6 +46,7 @@ | |||
3480 | 46 | m_avoffset = m_lead_in = m_lead_out = 0; | 46 | m_avoffset = m_lead_in = m_lead_out = 0; |
3481 | 47 | m_width = m_height = 0; | 47 | m_width = m_height = 0; |
3482 | 48 | m_aspect = m_fps = 0; | 48 | m_aspect = m_fps = 0; |
3483 | 49 | m_sar = ""; | ||
3484 | 49 | #if 1 /* tentative debug mode */ | 50 | #if 1 /* tentative debug mode */ |
3485 | 50 | debug_enable = false; | 51 | debug_enable = false; |
3486 | 51 | #endif | 52 | #endif |
3487 | @@ -70,17 +71,19 @@ | |||
3488 | 70 | if (ffmpeg_exe.empty() || ffprobe_exe.empty()) { | 71 | if (ffmpeg_exe.empty() || ffprobe_exe.empty()) { |
3489 | 71 | warning << string_compose( | 72 | warning << string_compose( |
3490 | 72 | _( | 73 | _( |
3502 | 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" |
3503 | 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" |
3504 | 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" |
3505 | 76 | "\n" | 77 | "\n" |
3506 | 77 | "The tools are included with the %1 releases from ardour.org " | 78 | "The tools are included with the %1 releases from ardour.org " |
3507 | 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" |
3508 | 79 | "\n" | 80 | "\n" |
3509 | 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" |
3510 | 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 " |
3511 | 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" |
3512 | 83 | ), PROGRAM_NAME) << endmsg; | 84 | "\n" |
3513 | 85 | "see also http://manual.ardour.org/video-timeline/setup/" | ||
3514 | 86 | ), PROGRAM_NAME) << endmsg; | ||
3515 | 84 | return; | 87 | return; |
3516 | 85 | } | 88 | } |
3517 | 86 | ffexecok = true; | 89 | ffexecok = true; |
3518 | @@ -138,6 +141,7 @@ | |||
3519 | 138 | m_width = m_height = 0; | 141 | m_width = m_height = 0; |
3520 | 139 | m_fps = m_aspect = 0; | 142 | m_fps = m_aspect = 0; |
3521 | 140 | m_duration = 0; | 143 | m_duration = 0; |
3522 | 144 | m_sar.clear(); | ||
3523 | 141 | m_codec.clear(); | 145 | m_codec.clear(); |
3524 | 142 | m_audio.clear(); | 146 | m_audio.clear(); |
3525 | 143 | 147 | ||
3526 | @@ -199,6 +203,13 @@ | |||
3527 | 199 | m_duration = atof(value) * m_fps * timebase; | 203 | m_duration = atof(value) * m_fps * timebase; |
3528 | 200 | } else if (key == X_("duration") && m_fps != 0 && m_duration == 0) { | 204 | } else if (key == X_("duration") && m_fps != 0 && m_duration == 0) { |
3529 | 201 | m_duration = atof(value) * m_fps; | 205 | m_duration = atof(value) * m_fps; |
3530 | 206 | } else if (key == X_("sample_aspect_ratio")) { | ||
3531 | 207 | std::string::size_type pos; | ||
3532 | 208 | pos = value.find_first_of(':'); | ||
3533 | 209 | if (pos != std::string::npos && atof(value.substr(pos+1)) != 0) { | ||
3534 | 210 | m_sar = value; | ||
3535 | 211 | m_sar.replace(pos, 1, "/"); | ||
3536 | 212 | } | ||
3537 | 202 | } else if (key == X_("display_aspect_ratio")) { | 213 | } else if (key == X_("display_aspect_ratio")) { |
3538 | 203 | std::string::size_type pos; | 214 | std::string::size_type pos; |
3539 | 204 | pos = value.find_first_of(':'); | 215 | pos = value.find_first_of(':'); |
3540 | @@ -340,20 +351,28 @@ | |||
3541 | 340 | if (m_lead_in != 0 && m_lead_out != 0) { | 351 | if (m_lead_in != 0 && m_lead_out != 0) { |
3542 | 341 | std::ostringstream osstream; | 352 | std::ostringstream osstream; |
3543 | 342 | argp[a++] = strdup("-vf"); | 353 | argp[a++] = strdup("-vf"); |
3546 | 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; |
3547 | 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; |
3548 | 356 | osstream << X_(" [pre]; "); | ||
3549 | 357 | osstream << X_("color=c=black:s=") << m_width << X_("x") << m_height << X_(":d=") << m_lead_out; | ||
3550 | 358 | if (!m_sar.empty()) osstream << X_(":sar=") << m_sar; | ||
3551 | 359 | osstream << X_(" [post]; "); | ||
3552 | 345 | osstream << X_("[pre] [in] [post] concat=n=3"); | 360 | osstream << X_("[pre] [in] [post] concat=n=3"); |
3553 | 346 | argp[a++] = strdup(osstream.str().c_str()); | 361 | argp[a++] = strdup(osstream.str().c_str()); |
3554 | 347 | } else if (m_lead_in != 0) { | 362 | } else if (m_lead_in != 0) { |
3555 | 348 | std::ostringstream osstream; | 363 | std::ostringstream osstream; |
3556 | 349 | argp[a++] = strdup("-vf"); | 364 | argp[a++] = strdup("-vf"); |
3558 | 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; |
3559 | 366 | if (!m_sar.empty()) osstream << X_(":sar=") << m_sar; | ||
3560 | 367 | osstream << X_(" [pre]; "); | ||
3561 | 351 | osstream << X_("[pre] [in] concat=n=2"); | 368 | osstream << X_("[pre] [in] concat=n=2"); |
3562 | 352 | argp[a++] = strdup(osstream.str().c_str()); | 369 | argp[a++] = strdup(osstream.str().c_str()); |
3563 | 353 | } else if (m_lead_out != 0) { | 370 | } else if (m_lead_out != 0) { |
3564 | 354 | std::ostringstream osstream; | 371 | std::ostringstream osstream; |
3565 | 355 | argp[a++] = strdup("-vf"); | 372 | argp[a++] = strdup("-vf"); |
3567 | 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; |
3568 | 374 | if (!m_sar.empty()) osstream << X_(":sar=") << m_sar; | ||
3569 | 375 | osstream << X_(" [post]; "); | ||
3570 | 357 | osstream << X_("[in] [post] concat=n=2"); | 376 | osstream << X_("[in] [post] concat=n=2"); |
3571 | 358 | argp[a++] = strdup(osstream.str().c_str()); | 377 | argp[a++] = strdup(osstream.str().c_str()); |
3572 | 359 | } | 378 | } |
3573 | 360 | 379 | ||
3574 | === modified file 'gtk2_ardour/transcode_ffmpeg.h' | |||
3575 | --- gtk2_ardour/transcode_ffmpeg.h 2013-09-21 19:05:02 +0000 | |||
3576 | +++ gtk2_ardour/transcode_ffmpeg.h 2015-05-02 14:23:30 +0000 | |||
3577 | @@ -134,6 +134,7 @@ | |||
3578 | 134 | 134 | ||
3579 | 135 | double m_fps; | 135 | double m_fps; |
3580 | 136 | double m_aspect; | 136 | double m_aspect; |
3581 | 137 | std::string m_sar; | ||
3582 | 137 | ARDOUR::framecnt_t m_duration; | 138 | ARDOUR::framecnt_t m_duration; |
3583 | 138 | int m_width; | 139 | int m_width; |
3584 | 139 | int m_height; | 140 | int m_height; |
3585 | 140 | 141 | ||
3586 | === modified file 'gtk2_ardour/transcode_video_dialog.cc' | |||
3587 | --- gtk2_ardour/transcode_video_dialog.cc 2013-10-17 11:16:21 +0000 | |||
3588 | +++ gtk2_ardour/transcode_video_dialog.cc 2015-05-02 14:23:30 +0000 | |||
3589 | @@ -177,16 +177,18 @@ | |||
3590 | 177 | options_box->pack_start (*l, false, true, 4); | 177 | options_box->pack_start (*l, false, true, 4); |
3591 | 178 | 178 | ||
3592 | 179 | video_combo.set_name ("PaddedButton"); | 179 | video_combo.set_name ("PaddedButton"); |
3595 | 180 | video_combo.append_text(_("Do Not Import Video")); | 180 | video_combo.append_text(_("Reference From Current Location (Previously Transcoded Files Only)")); |
3594 | 181 | video_combo.append_text(_("Reference From Current Location")); | ||
3596 | 182 | if (ffok) { | 181 | if (ffok) { |
3597 | 183 | video_combo.append_text(_("Import/Transcode Video to Session")); | 182 | video_combo.append_text(_("Import/Transcode Video to Session")); |
3598 | 184 | video_combo.set_active(2); | ||
3599 | 185 | } else { | ||
3600 | 186 | video_combo.set_active(1); | 183 | video_combo.set_active(1); |
3601 | 184 | } else { | ||
3602 | 185 | video_combo.set_active(0); | ||
3603 | 187 | video_combo.set_sensitive(false); | 186 | video_combo.set_sensitive(false); |
3604 | 188 | audio_combo.set_sensitive(false); | 187 | audio_combo.set_sensitive(false); |
3605 | 189 | } | 188 | } |
3606 | 189 | if (as.size() > 0) { | ||
3607 | 190 | video_combo.append_text(_("Do Not Import Video (Audio Import Only)")); | ||
3608 | 191 | } | ||
3609 | 190 | 192 | ||
3610 | 191 | options_box->pack_start (video_combo, false, false, 4); | 193 | options_box->pack_start (video_combo, false, false, 4); |
3611 | 192 | 194 | ||
3612 | @@ -225,8 +227,11 @@ | |||
3613 | 225 | t->attach (*l, 0, 1, 2, 3); | 227 | t->attach (*l, 0, 1, 2, 3); |
3614 | 226 | audio_combo.set_name ("PaddedButton"); | 228 | audio_combo.set_name ("PaddedButton"); |
3615 | 227 | t->attach (audio_combo, 1, 4, 2, 3); | 229 | t->attach (audio_combo, 1, 4, 2, 3); |
3618 | 228 | audio_combo.append_text("No audio"); | 230 | if (as.size() == 0) { |
3619 | 229 | if (as.size() > 0) { | 231 | audio_combo.append_text(_("No Audio Track Present")); |
3620 | 232 | audio_combo.set_sensitive(false); | ||
3621 | 233 | } else { | ||
3622 | 234 | audio_combo.append_text(_("Do Not Extract Audio")); | ||
3623 | 230 | for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) { | 235 | for (TranscodeFfmpeg::FFAudioStreams::iterator it = as.begin(); it < as.end(); ++it) { |
3624 | 231 | audio_combo.append_text((*it).name); | 236 | audio_combo.append_text((*it).name); |
3625 | 232 | } | 237 | } |
3626 | @@ -364,7 +369,7 @@ | |||
3627 | 364 | void | 369 | void |
3628 | 365 | TranscodeVideoDialog::launch_transcode () | 370 | TranscodeVideoDialog::launch_transcode () |
3629 | 366 | { | 371 | { |
3631 | 367 | if (video_combo.get_active_row_number() != 2) { | 372 | if (video_combo.get_active_row_number() != 1) { |
3632 | 368 | launch_audioonly(); | 373 | launch_audioonly(); |
3633 | 369 | return; | 374 | return; |
3634 | 370 | } | 375 | } |
3635 | @@ -413,8 +418,8 @@ | |||
3636 | 413 | void | 418 | void |
3637 | 414 | TranscodeVideoDialog::video_combo_changed () | 419 | TranscodeVideoDialog::video_combo_changed () |
3638 | 415 | { | 420 | { |
3641 | 416 | int i = video_combo.get_active_row_number(); | 421 | const int i = video_combo.get_active_row_number(); |
3642 | 417 | if (i != 2) { | 422 | if (i != 1) { |
3643 | 418 | scale_combo.set_sensitive(false); | 423 | scale_combo.set_sensitive(false); |
3644 | 419 | aspect_checkbox.set_sensitive(false); | 424 | aspect_checkbox.set_sensitive(false); |
3645 | 420 | height_spinner.set_sensitive(false); | 425 | height_spinner.set_sensitive(false); |
3646 | @@ -427,12 +432,19 @@ | |||
3647 | 427 | bitrate_checkbox.set_sensitive(true); | 432 | bitrate_checkbox.set_sensitive(true); |
3648 | 428 | bitrate_spinner.set_sensitive(true); | 433 | bitrate_spinner.set_sensitive(true); |
3649 | 429 | } | 434 | } |
3650 | 435 | if (i == 2 && audio_combo.get_active_row_number() == 0) { | ||
3651 | 436 | audio_combo.set_active(1); | ||
3652 | 437 | } | ||
3653 | 430 | } | 438 | } |
3654 | 431 | 439 | ||
3655 | 432 | void | 440 | void |
3656 | 433 | TranscodeVideoDialog::audio_combo_changed () | 441 | TranscodeVideoDialog::audio_combo_changed () |
3657 | 434 | { | 442 | { |
3659 | 435 | ; | 443 | if (video_combo.get_active_row_number() == 2 |
3660 | 444 | && audio_combo.get_active_row_number() == 0) | ||
3661 | 445 | { | ||
3662 | 446 | audio_combo.set_active(1); | ||
3663 | 447 | } | ||
3664 | 436 | } | 448 | } |
3665 | 437 | 449 | ||
3666 | 438 | void | 450 | void |
3667 | 439 | 451 | ||
3668 | === modified file 'gtk2_ardour/transcode_video_dialog.h' | |||
3669 | --- gtk2_ardour/transcode_video_dialog.h 2013-09-21 19:05:02 +0000 | |||
3670 | +++ gtk2_ardour/transcode_video_dialog.h 2015-05-02 14:23:30 +0000 | |||
3671 | @@ -31,9 +31,9 @@ | |||
3672 | 31 | #include "transcode_ffmpeg.h" | 31 | #include "transcode_ffmpeg.h" |
3673 | 32 | 32 | ||
3674 | 33 | enum VtlTranscodeOption { | 33 | enum VtlTranscodeOption { |
3678 | 34 | VTL_IMPORT_NO_VIDEO = 0, | 34 | VTL_IMPORT_REFERENCE = 0, |
3679 | 35 | VTL_IMPORT_REFERENCE = 1, | 35 | VTL_IMPORT_TRANSCODED = 1, |
3680 | 36 | VTL_IMPORT_TRANSCODED = 2 | 36 | VTL_IMPORT_NO_VIDEO = 2 |
3681 | 37 | }; | 37 | }; |
3682 | 38 | 38 | ||
3683 | 39 | /** @class TranscodeVideoDialog | 39 | /** @class TranscodeVideoDialog |
3684 | 40 | 40 | ||
3685 | === modified file 'gtk2_ardour/video_server_dialog.cc' | |||
3686 | --- gtk2_ardour/video_server_dialog.cc 2013-10-17 11:16:21 +0000 | |||
3687 | +++ gtk2_ardour/video_server_dialog.cc 2015-05-02 14:23:30 +0000 | |||
3688 | @@ -89,8 +89,13 @@ | |||
3689 | 89 | else { | 89 | else { |
3690 | 90 | PBD::warning << | 90 | PBD::warning << |
3691 | 91 | string_compose( | 91 | string_compose( |
3694 | 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" |
3695 | 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, " |
3696 | 94 | "alternatively you can download it from http://x42.github.com/harvid/ " | ||
3697 | 95 | "or acquire it from your distribution.\n" | ||
3698 | 96 | "\n" | ||
3699 | 97 | "see also http://manual.ardour.org/video-timeline/setup/" | ||
3700 | 98 | ), PROGRAM_NAME) | ||
3701 | 94 | << endmsg; | 99 | << endmsg; |
3702 | 95 | } | 100 | } |
3703 | 96 | 101 | ||
3704 | 97 | 102 | ||
3705 | === modified file 'gtk2_ardour/video_timeline.cc' | |||
3706 | --- gtk2_ardour/video_timeline.cc 2013-09-21 19:05:02 +0000 | |||
3707 | +++ gtk2_ardour/video_timeline.cc 2015-05-02 14:23:30 +0000 | |||
3708 | @@ -39,6 +39,10 @@ | |||
3709 | 39 | #include <pthread.h> | 39 | #include <pthread.h> |
3710 | 40 | #include <curl/curl.h> | 40 | #include <curl/curl.h> |
3711 | 41 | 41 | ||
3712 | 42 | #ifdef PLATFORM_WINDOWS | ||
3713 | 43 | #include <windows.h> | ||
3714 | 44 | #endif | ||
3715 | 45 | |||
3716 | 42 | #include "i18n.h" | 46 | #include "i18n.h" |
3717 | 43 | 47 | ||
3718 | 44 | using namespace std; | 48 | using namespace std; |
3719 | @@ -718,25 +722,52 @@ | |||
3720 | 718 | VideoTimeLine::find_xjadeo () { | 722 | VideoTimeLine::find_xjadeo () { |
3721 | 719 | std::string xjadeo_file_path; | 723 | std::string xjadeo_file_path; |
3722 | 720 | if (getenv("XJREMOTE")) { | 724 | if (getenv("XJREMOTE")) { |
3726 | 721 | _xjadeo_bin = strdup(getenv("XJREMOTE")); // XXX TODO: free it?! | 725 | _xjadeo_bin = getenv("XJREMOTE"); |
3727 | 722 | } else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) { | 726 | } |
3728 | 723 | _xjadeo_bin = xjadeo_file_path; | 727 | else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjremote"), xjadeo_file_path)) { |
3729 | 728 | _xjadeo_bin = xjadeo_file_path; | ||
3730 | 729 | } | ||
3731 | 730 | else if (find_file_in_search_path (SearchPath(Glib::getenv("PATH")), X_("xjadeo"), xjadeo_file_path)) { | ||
3732 | 731 | _xjadeo_bin = xjadeo_file_path; | ||
3733 | 732 | } | ||
3734 | 733 | #ifdef __APPLE__ | ||
3735 | 734 | else if (Glib::file_test(X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote"), Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_EXECUTABLE)) { | ||
3736 | 735 | _xjadeo_bin = X_("/Applications/Xjadeo.app/Contents/MacOS/xjremote"); | ||
3737 | 724 | } | 736 | } |
3738 | 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)) { |
3739 | 726 | _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"); | 738 | _xjadeo_bin = X_("/Applications/Jadeo.app/Contents/MacOS/xjremote"); |
3740 | 727 | } | 739 | } |
3742 | 728 | /* TODO: win32: allow to configure PATH to xjremote */ | 740 | #endif |
3743 | 741 | #ifdef PLATFORM_WINDOWS | ||
3744 | 742 | else { | ||
3745 | 743 | HKEY key; | ||
3746 | 744 | DWORD size = PATH_MAX; | ||
3747 | 745 | char path[PATH_MAX+1]; | ||
3748 | 746 | xjadeo_file_path = X_(""); | ||
3749 | 747 | if ( (ERROR_SUCCESS == RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\RSS\\xjadeo", 0, KEY_READ, &key)) | ||
3750 | 748 | && (ERROR_SUCCESS == RegQueryValueExA (key, "Install_Dir", 0, NULL, (LPBYTE)path, &size)) | ||
3751 | 749 | ) | ||
3752 | 750 | { | ||
3753 | 751 | xjadeo_file_path = g_build_filename(path, X_("xjadeo.exe")); | ||
3754 | 752 | } | ||
3755 | 753 | } | ||
3756 | 754 | if (Glib::file_test(xjadeo_file_path, Glib::FILE_TEST_EXISTS)) { | ||
3757 | 755 | _xjadeo_bin = xjadeo_file_path; | ||
3758 | 756 | } | ||
3759 | 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)) { |
3760 | 730 | _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe"); | 758 | _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.exe"); |
3761 | 731 | } | 759 | } |
3762 | 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)) { |
3763 | 733 | _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat"); | 761 | _xjadeo_bin = X_("C:\\Program Files\\xjadeo\\xjremote.bat"); |
3764 | 734 | } | 762 | } |
3765 | 763 | #endif | ||
3766 | 735 | else { | 764 | else { |
3767 | 736 | _xjadeo_bin = X_(""); | 765 | _xjadeo_bin = X_(""); |
3768 | 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/ " |
3769 | 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. " |
3771 | 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" |
3772 | 769 | "\n" | ||
3773 | 770 | "see also http://manual.ardour.org/video-timeline/setup/") | ||
3774 | 740 | << endmsg; | 771 | << endmsg; |
3775 | 741 | } | 772 | } |
3776 | 742 | } | 773 | } |
3777 | 743 | 774 | ||
3778 | === modified file 'libs/ardour/amp.cc' | |||
3779 | --- libs/ardour/amp.cc 2013-09-21 19:05:02 +0000 | |||
3780 | +++ libs/ardour/amp.cc 2015-05-02 14:23:30 +0000 | |||
3781 | @@ -372,19 +372,9 @@ | |||
3782 | 372 | } | 372 | } |
3783 | 373 | 373 | ||
3784 | 374 | void | 374 | void |
3786 | 375 | Amp::set_gain (gain_t val, void *src) | 375 | Amp::set_gain (gain_t val, void *) |
3787 | 376 | { | 376 | { |
3799 | 377 | val = min (val, max_gain_coefficient); | 377 | _gain_control->set_value (val); |
3789 | 378 | |||
3790 | 379 | if (src != _gain_control.get()) { | ||
3791 | 380 | _gain_control->set_value (val); | ||
3792 | 381 | // bit twisty, this will come back and call us again | ||
3793 | 382 | // (this keeps control in sync with reality) | ||
3794 | 383 | return; | ||
3795 | 384 | } | ||
3796 | 385 | |||
3797 | 386 | _gain_control->set_double (val); | ||
3798 | 387 | _session.set_dirty(); | ||
3800 | 388 | } | 378 | } |
3801 | 389 | 379 | ||
3802 | 390 | XMLNode& | 380 | XMLNode& |
3803 | @@ -414,13 +404,8 @@ | |||
3804 | 414 | void | 404 | void |
3805 | 415 | Amp::GainControl::set_value (double val) | 405 | Amp::GainControl::set_value (double val) |
3806 | 416 | { | 406 | { |
3814 | 417 | if (val > max_gain_coefficient) { | 407 | AutomationControl::set_value (min (val, (double) max_gain_coefficient)); |
3815 | 418 | val = max_gain_coefficient; | 408 | _amp->session().set_dirty (); |
3809 | 419 | } | ||
3810 | 420 | |||
3811 | 421 | _amp->set_gain (val, this); | ||
3812 | 422 | |||
3813 | 423 | AutomationControl::set_value(val); | ||
3816 | 424 | } | 409 | } |
3817 | 425 | 410 | ||
3818 | 426 | double | 411 | double |
3819 | 427 | 412 | ||
3820 | === modified file 'libs/ardour/ardour/audio_buffer.h' | |||
3821 | --- libs/ardour/ardour/audio_buffer.h 2014-01-24 16:31:54 +0000 | |||
3822 | +++ libs/ardour/ardour/audio_buffer.h 2015-05-02 14:23:30 +0000 | |||
3823 | @@ -62,7 +62,7 @@ | |||
3824 | 62 | assert(&src != this); | 62 | assert(&src != this); |
3825 | 63 | assert(_capacity > 0); | 63 | assert(_capacity > 0); |
3826 | 64 | assert(src.type() == DataType::AUDIO); | 64 | assert(src.type() == DataType::AUDIO); |
3828 | 65 | assert(len <= _capacity); | 65 | assert(dst_offset + len <= _capacity); |
3829 | 66 | assert( src_offset <= ((framecnt_t) src.capacity()-len)); | 66 | assert( src_offset <= ((framecnt_t) src.capacity()-len)); |
3830 | 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); |
3831 | 68 | if (dst_offset == 0 && src_offset == 0 && len == _capacity) { | 68 | if (dst_offset == 0 && src_offset == 0 && len == _capacity) { |
3832 | @@ -173,7 +173,6 @@ | |||
3833 | 173 | void set_data (Sample* data, size_t size) { | 173 | void set_data (Sample* data, size_t size) { |
3834 | 174 | assert(!_owns_data); // prevent leaks | 174 | assert(!_owns_data); // prevent leaks |
3835 | 175 | _capacity = size; | 175 | _capacity = size; |
3836 | 176 | _size = size; | ||
3837 | 177 | _data = data; | 176 | _data = data; |
3838 | 178 | _silent = false; | 177 | _silent = false; |
3839 | 179 | _written = false; | 178 | _written = false; |
3840 | @@ -185,8 +184,6 @@ | |||
3841 | 185 | */ | 184 | */ |
3842 | 186 | void resize (size_t nframes); | 185 | void resize (size_t nframes); |
3843 | 187 | 186 | ||
3844 | 188 | bool empty() const { return _size == 0; } | ||
3845 | 189 | |||
3846 | 190 | const Sample* data (framecnt_t offset = 0) const { | 187 | const Sample* data (framecnt_t offset = 0) const { |
3847 | 191 | assert(offset <= _capacity); | 188 | assert(offset <= _capacity); |
3848 | 192 | return _data + offset; | 189 | return _data + offset; |
3849 | @@ -198,7 +195,11 @@ | |||
3850 | 198 | return _data + offset; | 195 | return _data + offset; |
3851 | 199 | } | 196 | } |
3852 | 200 | 197 | ||
3853 | 198 | <<<<<<< TREE | ||
3854 | 201 | bool check_silence (pframes_t, bool, pframes_t&) const; | 199 | bool check_silence (pframes_t, bool, pframes_t&) const; |
3855 | 200 | ======= | ||
3856 | 201 | bool check_silence (pframes_t, pframes_t&) const; | ||
3857 | 202 | >>>>>>> MERGE-SOURCE | ||
3858 | 202 | 203 | ||
3859 | 203 | void prepare () { _written = false; _silent = false; } | 204 | void prepare () { _written = false; _silent = false; } |
3860 | 204 | bool written() const { return _written; } | 205 | bool written() const { return _written; } |
3861 | 205 | 206 | ||
3862 | === modified file 'libs/ardour/ardour/audio_diskstream.h' | |||
3863 | --- libs/ardour/ardour/audio_diskstream.h 2014-01-24 16:31:54 +0000 | |||
3864 | +++ libs/ardour/ardour/audio_diskstream.h 2015-05-02 14:23:30 +0000 | |||
3865 | @@ -139,7 +139,6 @@ | |||
3866 | 139 | void set_block_size (pframes_t); | 139 | void set_block_size (pframes_t); |
3867 | 140 | int internal_playback_seek (framecnt_t distance); | 140 | int internal_playback_seek (framecnt_t distance); |
3868 | 141 | int can_internal_playback_seek (framecnt_t distance); | 141 | int can_internal_playback_seek (framecnt_t distance); |
3869 | 142 | std::list<boost::shared_ptr<Source> > steal_write_sources(); | ||
3870 | 143 | void reset_write_sources (bool, bool force = false); | 142 | void reset_write_sources (bool, bool force = false); |
3871 | 144 | void non_realtime_input_change (); | 143 | void non_realtime_input_change (); |
3872 | 145 | void non_realtime_locate (framepos_t location); | 144 | void non_realtime_locate (framepos_t location); |
3873 | 146 | 145 | ||
3874 | === modified file 'libs/ardour/ardour/audiofilesource.h' | |||
3875 | --- libs/ardour/ardour/audiofilesource.h 2013-09-21 19:05:02 +0000 | |||
3876 | +++ libs/ardour/ardour/audiofilesource.h 2015-05-02 14:23:30 +0000 | |||
3877 | @@ -39,10 +39,6 @@ | |||
3878 | 39 | public: | 39 | public: |
3879 | 40 | virtual ~AudioFileSource (); | 40 | virtual ~AudioFileSource (); |
3880 | 41 | 41 | ||
3881 | 42 | bool set_name (const std::string& newname) { | ||
3882 | 43 | return (set_source_name(newname, destructive()) == 0); | ||
3883 | 44 | } | ||
3884 | 45 | |||
3885 | 46 | std::string peak_path (std::string audio_path); | 42 | std::string peak_path (std::string audio_path); |
3886 | 47 | std::string find_broken_peakfile (std::string missing_peak_path, | 43 | std::string find_broken_peakfile (std::string missing_peak_path, |
3887 | 48 | std::string audio_path); | 44 | std::string audio_path); |
3888 | @@ -97,6 +93,12 @@ | |||
3889 | 97 | /** Constructor to be called for existing in-session files */ | 93 | /** Constructor to be called for existing in-session files */ |
3890 | 98 | AudioFileSource (Session&, const XMLNode&, bool must_exist = true); | 94 | AudioFileSource (Session&, const XMLNode&, bool must_exist = true); |
3891 | 99 | 95 | ||
3892 | 96 | /** Constructor to be called for crash recovery. Final argument is not | ||
3893 | 97 | * used but exists to differentiate from the external-to-session | ||
3894 | 98 | * constructor above. | ||
3895 | 99 | */ | ||
3896 | 100 | AudioFileSource (Session&, const std::string& path, Source::Flag flags, bool); | ||
3897 | 101 | |||
3898 | 100 | int init (const std::string& idstr, bool must_exist); | 102 | int init (const std::string& idstr, bool must_exist); |
3899 | 101 | 103 | ||
3900 | 102 | virtual void set_header_timeline_position () = 0; | 104 | virtual void set_header_timeline_position () = 0; |
3901 | 103 | 105 | ||
3902 | === modified file 'libs/ardour/ardour/buffer.h' | |||
3903 | --- libs/ardour/ardour/buffer.h 2014-01-24 16:31:54 +0000 | |||
3904 | +++ libs/ardour/ardour/buffer.h 2015-05-02 14:23:30 +0000 | |||
3905 | @@ -46,16 +46,9 @@ | |||
3906 | 46 | /** Factory function */ | 46 | /** Factory function */ |
3907 | 47 | static Buffer* create(DataType type, size_t capacity); | 47 | static Buffer* create(DataType type, size_t capacity); |
3908 | 48 | 48 | ||
3911 | 49 | /** Maximum capacity of buffer. | 49 | /** Maximum capacity of buffer. */ |
3910 | 50 | * Note in some cases the entire buffer may not contain valid data, use size. */ | ||
3912 | 51 | size_t capacity() const { return _capacity; } | 50 | size_t capacity() const { return _capacity; } |
3913 | 52 | 51 | ||
3914 | 53 | /** Amount of valid data in buffer. Use this over capacity almost always. */ | ||
3915 | 54 | size_t size() const { return _size; } | ||
3916 | 55 | |||
3917 | 56 | /** Return true if the buffer contains no data, false otherwise */ | ||
3918 | 57 | virtual bool empty() const { return _size == 0; } | ||
3919 | 58 | |||
3920 | 59 | /** Type of this buffer. | 52 | /** Type of this buffer. |
3921 | 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. */ |
3922 | 61 | DataType type() const { return _type; } | 54 | DataType type() const { return _type; } |
3923 | @@ -80,12 +73,11 @@ | |||
3924 | 80 | 73 | ||
3925 | 81 | protected: | 74 | protected: |
3926 | 82 | Buffer(DataType type) | 75 | Buffer(DataType type) |
3928 | 83 | : _type(type), _capacity(0), _size(0), _silent (true) | 76 | : _type(type), _capacity(0), _silent (true) |
3929 | 84 | {} | 77 | {} |
3930 | 85 | 78 | ||
3931 | 86 | DataType _type; | 79 | DataType _type; |
3932 | 87 | pframes_t _capacity; | 80 | pframes_t _capacity; |
3933 | 88 | pframes_t _size; | ||
3934 | 89 | bool _silent; | 81 | bool _silent; |
3935 | 90 | }; | 82 | }; |
3936 | 91 | 83 | ||
3937 | 92 | 84 | ||
3938 | === modified file 'libs/ardour/ardour/diskstream.h' | |||
3939 | --- libs/ardour/ardour/diskstream.h 2013-10-17 11:16:21 +0000 | |||
3940 | +++ libs/ardour/ardour/diskstream.h 2015-05-02 14:23:30 +0000 | |||
3941 | @@ -70,6 +70,8 @@ | |||
3942 | 70 | 70 | ||
3943 | 71 | virtual bool set_name (const std::string& str); | 71 | virtual bool set_name (const std::string& str); |
3944 | 72 | 72 | ||
3945 | 73 | virtual std::string steal_write_source_name () { return std::string(); } | ||
3946 | 74 | |||
3947 | 73 | boost::shared_ptr<ARDOUR::IO> io() const { return _io; } | 75 | boost::shared_ptr<ARDOUR::IO> io() const { return _io; } |
3948 | 74 | void set_track (ARDOUR::Track *); | 76 | void set_track (ARDOUR::Track *); |
3949 | 75 | 77 | ||
3950 | 76 | 78 | ||
3951 | === modified file 'libs/ardour/ardour/file_source.h' | |||
3952 | --- libs/ardour/ardour/file_source.h 2013-09-21 19:05:02 +0000 | |||
3953 | +++ libs/ardour/ardour/file_source.h 2015-05-02 14:23:30 +0000 | |||
3954 | @@ -44,7 +44,7 @@ | |||
3955 | 44 | /** A source associated with a file on disk somewhere */ | 44 | /** A source associated with a file on disk somewhere */ |
3956 | 45 | class FileSource : virtual public Source { | 45 | class FileSource : virtual public Source { |
3957 | 46 | public: | 46 | public: |
3959 | 47 | virtual ~FileSource () {} | 47 | virtual ~FileSource (); |
3960 | 48 | 48 | ||
3961 | 49 | virtual const std::string& path() const { return _path; } | 49 | virtual const std::string& path() const { return _path; } |
3962 | 50 | 50 | ||
3963 | @@ -74,6 +74,7 @@ | |||
3964 | 74 | 74 | ||
3965 | 75 | void inc_use_count (); | 75 | void inc_use_count (); |
3966 | 76 | bool removable () const; | 76 | bool removable () const; |
3967 | 77 | bool is_stub () const; | ||
3968 | 77 | 78 | ||
3969 | 78 | const std::string& origin() const { return _origin; } | 79 | const std::string& origin() const { return _origin; } |
3970 | 79 | 80 | ||
3971 | @@ -81,6 +82,13 @@ | |||
3972 | 81 | 82 | ||
3973 | 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; |
3974 | 83 | 84 | ||
3975 | 85 | void existence_check (); | ||
3976 | 86 | virtual void prevent_deletion (); | ||
3977 | 87 | |||
3978 | 88 | /** Rename the file on disk referenced by this source to \param newname | ||
3979 | 89 | */ | ||
3980 | 90 | int rename (const std::string& name); | ||
3981 | 91 | |||
3982 | 84 | protected: | 92 | protected: |
3983 | 85 | FileSource (Session& session, DataType type, | 93 | FileSource (Session& session, DataType type, |
3984 | 86 | const std::string& path, | 94 | const std::string& path, |
3985 | @@ -102,7 +110,6 @@ | |||
3986 | 102 | std::string _origin; | 110 | std::string _origin; |
3987 | 103 | bool _open; | 111 | bool _open; |
3988 | 104 | 112 | ||
3989 | 105 | void prevent_deletion (); | ||
3990 | 106 | }; | 113 | }; |
3991 | 107 | 114 | ||
3992 | 108 | } // namespace ARDOUR | 115 | } // namespace ARDOUR |
3993 | 109 | 116 | ||
3994 | === modified file 'libs/ardour/ardour/midi_buffer.h' | |||
3995 | --- libs/ardour/ardour/midi_buffer.h 2013-10-17 11:16:21 +0000 | |||
3996 | +++ libs/ardour/ardour/midi_buffer.h 2015-05-02 14:23:30 +0000 | |||
3997 | @@ -48,6 +48,8 @@ | |||
3998 | 48 | uint8_t* reserve(TimeType time, size_t size); | 48 | uint8_t* reserve(TimeType time, size_t size); |
3999 | 49 | 49 | ||
4000 | 50 | void resize(size_t); | 50 | void resize(size_t); |
4001 | 51 | size_t size() const { return _size; } | ||
4002 | 52 | bool empty() const { return _size == 0; } | ||
4003 | 51 | 53 | ||
4004 | 52 | bool merge_in_place(const MidiBuffer &other); | 54 | bool merge_in_place(const MidiBuffer &other); |
4005 | 53 | 55 | ||
4006 | @@ -159,6 +161,7 @@ | |||
4007 | 159 | friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >; | 161 | friend class iterator_base< const MidiBuffer, const Evoral::MIDIEvent<TimeType> >; |
4008 | 160 | 162 | ||
4009 | 161 | uint8_t* _data; ///< timestamp, event, timestamp, event, ... | 163 | uint8_t* _data; ///< timestamp, event, timestamp, event, ... |
4010 | 164 | pframes_t _size; | ||
4011 | 162 | }; | 165 | }; |
4012 | 163 | 166 | ||
4013 | 164 | 167 | ||
4014 | 165 | 168 | ||
4015 | === modified file 'libs/ardour/ardour/midi_diskstream.h' | |||
4016 | --- libs/ardour/ardour/midi_diskstream.h 2014-01-24 16:31:54 +0000 | |||
4017 | +++ libs/ardour/ardour/midi_diskstream.h 2015-05-02 14:23:30 +0000 | |||
4018 | @@ -111,7 +111,7 @@ | |||
4019 | 111 | void set_block_size (pframes_t); | 111 | void set_block_size (pframes_t); |
4020 | 112 | int internal_playback_seek (framecnt_t distance); | 112 | int internal_playback_seek (framecnt_t distance); |
4021 | 113 | int can_internal_playback_seek (framecnt_t distance); | 113 | int can_internal_playback_seek (framecnt_t distance); |
4023 | 114 | std::list<boost::shared_ptr<Source> > steal_write_sources(); | 114 | std::string steal_write_source_name(); |
4024 | 115 | void reset_write_sources (bool, bool force = false); | 115 | void reset_write_sources (bool, bool force = false); |
4025 | 116 | void non_realtime_input_change (); | 116 | void non_realtime_input_change (); |
4026 | 117 | void non_realtime_locate (framepos_t location); | 117 | void non_realtime_locate (framepos_t location); |
4027 | 118 | 118 | ||
4028 | === modified file 'libs/ardour/ardour/midi_region.h' | |||
4029 | --- libs/ardour/ardour/midi_region.h 2013-09-21 19:05:02 +0000 | |||
4030 | +++ libs/ardour/ardour/midi_region.h 2015-05-02 14:23:30 +0000 | |||
4031 | @@ -63,6 +63,7 @@ | |||
4032 | 63 | ~MidiRegion(); | 63 | ~MidiRegion(); |
4033 | 64 | 64 | ||
4034 | 65 | boost::shared_ptr<MidiRegion> clone (std::string path = std::string()) const; | 65 | boost::shared_ptr<MidiRegion> clone (std::string path = std::string()) const; |
4035 | 66 | boost::shared_ptr<MidiRegion> clone (boost::shared_ptr<MidiSource>) const; | ||
4036 | 66 | 67 | ||
4037 | 67 | boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const; | 68 | boost::shared_ptr<MidiSource> midi_source (uint32_t n=0) const; |
4038 | 68 | 69 | ||
4039 | 69 | 70 | ||
4040 | === modified file 'libs/ardour/ardour/midi_source.h' | |||
4041 | --- libs/ardour/ardour/midi_source.h 2013-09-21 19:05:02 +0000 | |||
4042 | +++ libs/ardour/ardour/midi_source.h 2015-05-02 14:23:30 +0000 | |||
4043 | @@ -48,9 +48,21 @@ | |||
4044 | 48 | MidiSource (Session& session, const XMLNode&); | 48 | MidiSource (Session& session, const XMLNode&); |
4045 | 49 | virtual ~MidiSource (); | 49 | virtual ~MidiSource (); |
4046 | 50 | 50 | ||
4050 | 51 | boost::shared_ptr<MidiSource> clone (const std::string& path, | 51 | /** Write the data in the given time range to another MidiSource |
4051 | 52 | Evoral::MusicalTime begin = Evoral::MinMusicalTime, | 52 | * \param newsrc MidiSource to which data will be written. Should be a |
4052 | 53 | Evoral::MusicalTime end = Evoral::MaxMusicalTime); | 53 | * new, empty source. If it already has contents, the results are |
4053 | 54 | * undefined. Source must be writable. | ||
4054 | 55 | * | ||
4055 | 56 | * \param begin time of earliest event that can be written. | ||
4056 | 57 | * \param end time of latest event that can be written. | ||
4057 | 58 | * | ||
4058 | 59 | * Returns zero on success, non-zero if the write failed for any | ||
4059 | 60 | * reason. | ||
4060 | 61 | * | ||
4061 | 62 | */ | ||
4062 | 63 | int write_to (boost::shared_ptr<MidiSource> newsrc, | ||
4063 | 64 | Evoral::MusicalTime begin = Evoral::MinMusicalTime, | ||
4064 | 65 | Evoral::MusicalTime end = Evoral::MaxMusicalTime); | ||
4065 | 54 | 66 | ||
4066 | 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. |
4067 | 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). |
4068 | 57 | 69 | ||
4069 | === modified file 'libs/ardour/ardour/public_diskstream.h' | |||
4070 | --- libs/ardour/ardour/public_diskstream.h 2013-10-17 11:16:21 +0000 | |||
4071 | +++ libs/ardour/ardour/public_diskstream.h 2015-05-02 14:23:30 +0000 | |||
4072 | @@ -38,7 +38,7 @@ | |||
4073 | 38 | virtual bool destructive () const = 0; | 38 | virtual bool destructive () const = 0; |
4074 | 39 | virtual std::list<boost::shared_ptr<Source> > & last_capture_sources () = 0; | 39 | virtual std::list<boost::shared_ptr<Source> > & last_capture_sources () = 0; |
4075 | 40 | virtual void set_capture_offset () = 0; | 40 | virtual void set_capture_offset () = 0; |
4077 | 41 | virtual std::list<boost::shared_ptr<Source> > steal_write_sources () = 0; | 41 | virtual std::string steal_write_source_name () = 0; |
4078 | 42 | virtual void reset_write_sources (bool, bool force = false) = 0; | 42 | virtual void reset_write_sources (bool, bool force = false) = 0; |
4079 | 43 | virtual float playback_buffer_load () const = 0; | 43 | virtual float playback_buffer_load () const = 0; |
4080 | 44 | virtual float capture_buffer_load () const = 0; | 44 | virtual float capture_buffer_load () const = 0; |
4081 | 45 | 45 | ||
4082 | === modified file 'libs/ardour/ardour/session.h' | |||
4083 | --- libs/ardour/ardour/session.h 2014-01-24 16:31:54 +0000 | |||
4084 | +++ libs/ardour/ardour/session.h 2015-05-02 14:23:30 +0000 | |||
4085 | @@ -194,13 +194,11 @@ | |||
4086 | 194 | 194 | ||
4087 | 195 | std::string peak_path (std::string) const; | 195 | std::string peak_path (std::string) const; |
4088 | 196 | 196 | ||
4089 | 197 | std::string change_source_path_by_name (std::string oldpath, std::string oldname, std::string newname, bool destructive); | ||
4090 | 198 | |||
4091 | 199 | std::string peak_path_from_audio_path (std::string) const; | 197 | std::string peak_path_from_audio_path (std::string) const; |
4095 | 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); |
4096 | 201 | std::string new_midi_source_name (const std::string&); | 199 | std::string new_midi_source_path (const std::string&); |
4094 | 202 | std::string new_source_path_from_name (DataType type, const std::string&); | ||
4097 | 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); |
4098 | 201 | std::vector<std::string> get_paths_for_new_sources (bool allow_replacing, const std::string& import_file_path, uint32_t channels); | ||
4099 | 204 | 202 | ||
4100 | 205 | void process (pframes_t nframes); | 203 | void process (pframes_t nframes); |
4101 | 206 | 204 | ||
4102 | @@ -528,8 +526,6 @@ | |||
4103 | 528 | 526 | ||
4104 | 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; |
4105 | 530 | 528 | ||
4106 | 531 | std::string path_from_region_name (DataType type, std::string name, std::string identifier); | ||
4107 | 532 | |||
4108 | 533 | boost::shared_ptr<Region> XMLRegionFactory (const XMLNode&, bool full); | 529 | boost::shared_ptr<Region> XMLRegionFactory (const XMLNode&, bool full); |
4109 | 534 | boost::shared_ptr<AudioRegion> XMLAudioRegionFactory (const XMLNode&, bool full); | 530 | boost::shared_ptr<AudioRegion> XMLAudioRegionFactory (const XMLNode&, bool full); |
4110 | 535 | boost::shared_ptr<MidiRegion> XMLMidiRegionFactory (const XMLNode&, bool full); | 531 | boost::shared_ptr<MidiRegion> XMLMidiRegionFactory (const XMLNode&, bool full); |
4111 | @@ -582,11 +578,12 @@ | |||
4112 | 582 | boost::shared_ptr<AudioFileSource> create_audio_source_for_session ( | 578 | boost::shared_ptr<AudioFileSource> create_audio_source_for_session ( |
4113 | 583 | size_t, std::string const &, uint32_t, bool destructive); | 579 | size_t, std::string const &, uint32_t, bool destructive); |
4114 | 584 | 580 | ||
4117 | 585 | boost::shared_ptr<MidiSource> create_midi_source_for_session ( | 581 | boost::shared_ptr<MidiSource> create_midi_source_for_session (std::string const &); |
4118 | 586 | Track*, std::string const &); | 582 | boost::shared_ptr<MidiSource> create_midi_source_by_stealing_name (boost::shared_ptr<Track>); |
4119 | 587 | 583 | ||
4120 | 588 | boost::shared_ptr<Source> source_by_id (const PBD::ID&); | 584 | boost::shared_ptr<Source> source_by_id (const PBD::ID&); |
4122 | 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; |
4123 | 586 | boost::shared_ptr<MidiSource> midi_source_by_path (const std::string&) const; | ||
4124 | 590 | uint32_t count_sources_by_origin (const std::string&); | 587 | uint32_t count_sources_by_origin (const std::string&); |
4125 | 591 | 588 | ||
4126 | 592 | void add_playlist (boost::shared_ptr<Playlist>, bool unused = false); | 589 | void add_playlist (boost::shared_ptr<Playlist>, bool unused = false); |
4127 | @@ -1434,7 +1431,7 @@ | |||
4128 | 1434 | 1431 | ||
4129 | 1435 | bool no_questions_about_missing_files; | 1432 | bool no_questions_about_missing_files; |
4130 | 1436 | 1433 | ||
4132 | 1437 | std::string get_best_session_directory_for_new_source (); | 1434 | std::string get_best_session_directory_for_new_audio (); |
4133 | 1438 | 1435 | ||
4134 | 1439 | mutable gint _playback_load; | 1436 | mutable gint _playback_load; |
4135 | 1440 | mutable gint _capture_load; | 1437 | mutable gint _capture_load; |
4136 | 1441 | 1438 | ||
4137 | === modified file 'libs/ardour/ardour/smf_source.h' | |||
4138 | --- libs/ardour/ardour/smf_source.h 2013-09-21 19:05:02 +0000 | |||
4139 | +++ libs/ardour/ardour/smf_source.h 2015-05-02 14:23:30 +0000 | |||
4140 | @@ -36,9 +36,11 @@ | |||
4141 | 36 | /** Standard Midi File (Type 0) Source */ | 36 | /** Standard Midi File (Type 0) Source */ |
4142 | 37 | class SMFSource : public MidiSource, public FileSource, public Evoral::SMF { | 37 | class SMFSource : public MidiSource, public FileSource, public Evoral::SMF { |
4143 | 38 | public: | 38 | public: |
4144 | 39 | /** Constructor for new internal-to-session files */ | ||
4145 | 40 | SMFSource (Session& session, const std::string& path, Source::Flag flags); | ||
4146 | 41 | |||
4147 | 39 | /** Constructor for existing external-to-session files */ | 42 | /** Constructor for existing external-to-session files */ |
4150 | 40 | SMFSource (Session& session, const std::string& path, | 43 | SMFSource (Session& session, const std::string& path); |
4149 | 41 | Source::Flag flags = Source::Flag(0)); | ||
4151 | 42 | 44 | ||
4152 | 43 | /** Constructor for existing in-session files */ | 45 | /** Constructor for existing in-session files */ |
4153 | 44 | SMFSource (Session& session, const XMLNode&, bool must_exist = false); | 46 | SMFSource (Session& session, const XMLNode&, bool must_exist = false); |
4154 | @@ -49,8 +51,6 @@ | |||
4155 | 49 | return safe_midi_file_extension(path); | 51 | return safe_midi_file_extension(path); |
4156 | 50 | } | 52 | } |
4157 | 51 | 53 | ||
4158 | 52 | bool set_name (const std::string& newname) { return (set_source_name(newname, false) == 0); } | ||
4159 | 53 | |||
4160 | 54 | void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev); | 54 | void append_event_unlocked_beats (const Evoral::Event<Evoral::MusicalTime>& ev); |
4161 | 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); |
4162 | 56 | 56 | ||
4163 | @@ -68,6 +68,9 @@ | |||
4164 | 68 | void ensure_disk_file (); | 68 | void ensure_disk_file (); |
4165 | 69 | 69 | ||
4166 | 70 | static bool safe_midi_file_extension (const std::string& path); | 70 | static bool safe_midi_file_extension (const std::string& path); |
4167 | 71 | static bool valid_midi_file (const std::string& path); | ||
4168 | 72 | |||
4169 | 73 | void prevent_deletion (); | ||
4170 | 71 | 74 | ||
4171 | 72 | protected: | 75 | protected: |
4172 | 73 | void set_path (const std::string& newpath); | 76 | void set_path (const std::string& newpath); |
4173 | 74 | 77 | ||
4174 | === modified file 'libs/ardour/ardour/sndfilesource.h' | |||
4175 | --- libs/ardour/ardour/sndfilesource.h 2013-09-21 19:05:02 +0000 | |||
4176 | +++ libs/ardour/ardour/sndfilesource.h 2015-05-02 14:23:30 +0000 | |||
4177 | @@ -38,7 +38,16 @@ | |||
4178 | 38 | SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate, | 38 | SampleFormat samp_format, HeaderFormat hdr_format, framecnt_t rate, |
4179 | 39 | Flag flags = SndFileSource::default_writable_flags); | 39 | Flag flags = SndFileSource::default_writable_flags); |
4180 | 40 | 40 | ||
4182 | 41 | /** Constructor to be called for existing in-session files */ | 41 | /* Constructor to be called for recovering files being used for |
4183 | 42 | * capture. They are in-session, they already exist, they should not | ||
4184 | 43 | * be writable. They are an odd hybrid (from a constructor point of | ||
4185 | 44 | * view) of the previous two constructors. | ||
4186 | 45 | */ | ||
4187 | 46 | SndFileSource (Session&, const std::string& path, int chn); | ||
4188 | 47 | |||
4189 | 48 | /** Constructor to be called for existing in-session files during | ||
4190 | 49 | * session loading | ||
4191 | 50 | */ | ||
4192 | 42 | SndFileSource (Session&, const XMLNode&); | 51 | SndFileSource (Session&, const XMLNode&); |
4193 | 43 | 52 | ||
4194 | 44 | ~SndFileSource (); | 53 | ~SndFileSource (); |
4195 | 45 | 54 | ||
4196 | === modified file 'libs/ardour/ardour/source.h' | |||
4197 | --- libs/ardour/ardour/source.h 2013-09-21 19:05:02 +0000 | |||
4198 | +++ libs/ardour/ardour/source.h 2015-05-02 14:23:30 +0000 | |||
4199 | @@ -47,7 +47,8 @@ | |||
4200 | 47 | RemovableIfEmpty = 0x10, | 47 | RemovableIfEmpty = 0x10, |
4201 | 48 | RemoveAtDestroy = 0x20, | 48 | RemoveAtDestroy = 0x20, |
4202 | 49 | NoPeakFile = 0x40, | 49 | NoPeakFile = 0x40, |
4204 | 50 | Destructive = 0x80 | 50 | Destructive = 0x80, |
4205 | 51 | Empty = 0x100, /* used for MIDI only */ | ||
4206 | 51 | }; | 52 | }; |
4207 | 52 | 53 | ||
4208 | 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)); |
4209 | 54 | 55 | ||
4210 | === modified file 'libs/ardour/ardour/source_factory.h' | |||
4211 | --- libs/ardour/ardour/source_factory.h 2013-09-21 19:05:02 +0000 | |||
4212 | +++ libs/ardour/ardour/source_factory.h 2015-05-02 14:23:30 +0000 | |||
4213 | @@ -57,6 +57,9 @@ | |||
4214 | 57 | bool destructive, framecnt_t rate, bool announce = true, bool async = false); | 57 | bool destructive, framecnt_t rate, bool announce = true, bool async = false); |
4215 | 58 | 58 | ||
4216 | 59 | 59 | ||
4217 | 60 | static boost::shared_ptr<Source> createForRecovery | ||
4218 | 61 | (DataType type, Session&, const std::string& path, int chn); | ||
4219 | 62 | |||
4220 | 60 | static boost::shared_ptr<Source> createFromPlaylist | 63 | static boost::shared_ptr<Source> createFromPlaylist |
4221 | 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, |
4222 | 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); |
4223 | 63 | 66 | ||
4224 | === modified file 'libs/ardour/ardour/track.h' | |||
4225 | --- libs/ardour/ardour/track.h 2013-10-17 11:16:21 +0000 | |||
4226 | +++ libs/ardour/ardour/track.h 2015-05-02 14:23:30 +0000 | |||
4227 | @@ -120,7 +120,7 @@ | |||
4228 | 120 | bool destructive () const; | 120 | bool destructive () const; |
4229 | 121 | std::list<boost::shared_ptr<Source> > & last_capture_sources (); | 121 | std::list<boost::shared_ptr<Source> > & last_capture_sources (); |
4230 | 122 | void set_capture_offset (); | 122 | void set_capture_offset (); |
4232 | 123 | std::list<boost::shared_ptr<Source> > steal_write_sources(); | 123 | std::string steal_write_source_name (); |
4233 | 124 | void reset_write_sources (bool, bool force = false); | 124 | void reset_write_sources (bool, bool force = false); |
4234 | 125 | float playback_buffer_load () const; | 125 | float playback_buffer_load () const; |
4235 | 126 | float capture_buffer_load () const; | 126 | float capture_buffer_load () const; |
4236 | 127 | 127 | ||
4237 | === modified file 'libs/ardour/ardour/vestige/aeffectx.h' | |||
4238 | --- libs/ardour/ardour/vestige/aeffectx.h 2014-01-24 16:31:54 +0000 | |||
4239 | +++ libs/ardour/ardour/vestige/aeffectx.h 2015-05-02 14:23:30 +0000 | |||
4240 | @@ -251,6 +251,7 @@ | |||
4241 | 251 | 251 | ||
4242 | 252 | typedef struct _VstTimeInfo | 252 | typedef struct _VstTimeInfo |
4243 | 253 | { | 253 | { |
4244 | 254 | <<<<<<< TREE | ||
4245 | 254 | /* info from online documentation of VST provided by Steinberg */ | 255 | /* info from online documentation of VST provided by Steinberg */ |
4246 | 255 | 256 | ||
4247 | 256 | double samplePos; | 257 | double samplePos; |
4248 | @@ -271,6 +272,26 @@ | |||
4249 | 271 | } VstTimeInfo; | 272 | } VstTimeInfo; |
4250 | 272 | 273 | ||
4251 | 273 | typedef struct _VstTimeInfo VstTimeInfo; | 274 | typedef struct _VstTimeInfo VstTimeInfo; |
4252 | 275 | ======= | ||
4253 | 276 | /* info from online documentation of VST provided by Steinberg */ | ||
4254 | 277 | |||
4255 | 278 | double samplePos; | ||
4256 | 279 | double sampleRate; | ||
4257 | 280 | double nanoSeconds; | ||
4258 | 281 | double ppqPos; | ||
4259 | 282 | double tempo; | ||
4260 | 283 | double barStartPos; | ||
4261 | 284 | double cycleStartPos; | ||
4262 | 285 | double cycleEndPos; | ||
4263 | 286 | int32_t timeSigNumerator; | ||
4264 | 287 | int32_t timeSigDenominator; | ||
4265 | 288 | int32_t smpteOffset; | ||
4266 | 289 | int32_t smpteFrameRate; | ||
4267 | 290 | int32_t samplesToNextClock; | ||
4268 | 291 | int32_t flags; | ||
4269 | 292 | |||
4270 | 293 | } VstTimeInfo; | ||
4271 | 294 | >>>>>>> MERGE-SOURCE | ||
4272 | 274 | 295 | ||
4273 | 275 | typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float); | 296 | typedef intptr_t (* audioMasterCallback) (AEffect *, int32_t, int32_t, intptr_t, void *, float); |
4274 | 276 | 297 | ||
4275 | 277 | 298 | ||
4276 | === modified file 'libs/ardour/audio_buffer.cc' | |||
4277 | --- libs/ardour/audio_buffer.cc 2014-01-24 16:31:54 +0000 | |||
4278 | +++ libs/ardour/audio_buffer.cc 2015-05-02 14:23:30 +0000 | |||
4279 | @@ -57,12 +57,6 @@ | |||
4280 | 57 | 57 | ||
4281 | 58 | if (_data && size < _capacity) { | 58 | if (_data && size < _capacity) { |
4282 | 59 | /* buffer is already large enough */ | 59 | /* buffer is already large enough */ |
4283 | 60 | |||
4284 | 61 | if (size < _size) { | ||
4285 | 62 | /* truncate */ | ||
4286 | 63 | _size = size; | ||
4287 | 64 | } | ||
4288 | 65 | |||
4289 | 66 | return; | 60 | return; |
4290 | 67 | } | 61 | } |
4291 | 68 | 62 | ||
4292 | @@ -71,14 +65,17 @@ | |||
4293 | 71 | cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size); | 65 | cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size); |
4294 | 72 | 66 | ||
4295 | 73 | _capacity = size; | 67 | _capacity = size; |
4296 | 74 | _size = 0; | ||
4297 | 75 | _silent = false; | 68 | _silent = false; |
4298 | 76 | } | 69 | } |
4299 | 77 | 70 | ||
4300 | 78 | bool | 71 | bool |
4301 | 79 | AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) const | 72 | AudioBuffer::check_silence (pframes_t nframes, bool wholebuffer, pframes_t& n) const |
4302 | 80 | { | 73 | { |
4303 | 74 | <<<<<<< TREE | ||
4304 | 81 | for (n = 0; (wholebuffer || n < _size) && n < nframes; ++n) { | 75 | for (n = 0; (wholebuffer || n < _size) && n < nframes; ++n) { |
4305 | 76 | ======= | ||
4306 | 77 | for (n = 0; n < nframes; ++n) { | ||
4307 | 78 | >>>>>>> MERGE-SOURCE | ||
4308 | 82 | if (_data[n] != Sample (0)) { | 79 | if (_data[n] != Sample (0)) { |
4309 | 83 | return false; | 80 | return false; |
4310 | 84 | } | 81 | } |
4311 | 85 | 82 | ||
4312 | === modified file 'libs/ardour/audio_diskstream.cc' | |||
4313 | --- libs/ardour/audio_diskstream.cc 2013-10-17 11:16:21 +0000 | |||
4314 | +++ libs/ardour/audio_diskstream.cc 2015-05-02 14:23:30 +0000 | |||
4315 | @@ -1928,14 +1928,6 @@ | |||
4316 | 1928 | return 0; | 1928 | return 0; |
4317 | 1929 | } | 1929 | } |
4318 | 1930 | 1930 | ||
4319 | 1931 | list<boost::shared_ptr<Source> > | ||
4320 | 1932 | AudioDiskstream::steal_write_sources() | ||
4321 | 1933 | { | ||
4322 | 1934 | /* not possible to steal audio write sources */ | ||
4323 | 1935 | list<boost::shared_ptr<Source> > ret; | ||
4324 | 1936 | return ret; | ||
4325 | 1937 | } | ||
4326 | 1938 | |||
4327 | 1939 | void | 1931 | void |
4328 | 1940 | AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/) | 1932 | AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/) |
4329 | 1941 | { | 1933 | { |
4330 | @@ -2189,11 +2181,16 @@ | |||
4331 | 2189 | continue; | 2181 | continue; |
4332 | 2190 | } | 2182 | } |
4333 | 2191 | 2183 | ||
4334 | 2184 | /* XXX as of June 2014, we always record to mono | ||
4335 | 2185 | files. Since this Source is being created as part of | ||
4336 | 2186 | crash recovery, we know that we need the first | ||
4337 | 2187 | channel (the final argument to the SourceFactory | ||
4338 | 2188 | call below). If we ever support non-mono files for | ||
4339 | 2189 | capture, this will need rethinking. | ||
4340 | 2190 | */ | ||
4341 | 2191 | |||
4342 | 2192 | try { | 2192 | try { |
4347 | 2193 | fs = boost::dynamic_pointer_cast<AudioFileSource> ( | 2193 | fs = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createForRecovery (DataType::AUDIO, _session, prop->value(), 0)); |
4344 | 2194 | SourceFactory::createWritable ( | ||
4345 | 2195 | DataType::AUDIO, _session, | ||
4346 | 2196 | prop->value(), false, _session.frame_rate())); | ||
4348 | 2197 | } | 2194 | } |
4349 | 2198 | 2195 | ||
4350 | 2199 | catch (failed_constructor& err) { | 2196 | catch (failed_constructor& err) { |
4351 | @@ -2224,21 +2221,31 @@ | |||
4352 | 2224 | return -1; | 2221 | return -1; |
4353 | 2225 | } | 2222 | } |
4354 | 2226 | 2223 | ||
4355 | 2227 | boost::shared_ptr<AudioRegion> region; | ||
4356 | 2228 | |||
4357 | 2229 | try { | 2224 | try { |
4358 | 2230 | 2225 | ||
4359 | 2226 | boost::shared_ptr<AudioRegion> wf_region; | ||
4360 | 2227 | boost::shared_ptr<AudioRegion> region; | ||
4361 | 2228 | |||
4362 | 2229 | /* First create the whole file region */ | ||
4363 | 2230 | |||
4364 | 2231 | PropertyList plist; | 2231 | PropertyList plist; |
4366 | 2232 | 2232 | ||
4367 | 2233 | plist.add (Properties::start, 0); | 2233 | plist.add (Properties::start, 0); |
4368 | 2234 | plist.add (Properties::length, first_fs->length (first_fs->timeline_position())); | 2234 | plist.add (Properties::length, first_fs->length (first_fs->timeline_position())); |
4369 | 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)); |
4370 | 2236 | 2236 | ||
4371 | 2237 | wf_region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist)); | ||
4372 | 2238 | |||
4373 | 2239 | wf_region->set_automatic (true); | ||
4374 | 2240 | wf_region->set_whole_file (true); | ||
4375 | 2241 | wf_region->special_set_position (position); | ||
4376 | 2242 | |||
4377 | 2243 | /* Now create a region that isn't the whole file for adding to | ||
4378 | 2244 | * the playlist */ | ||
4379 | 2245 | |||
4380 | 2237 | region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist)); | 2246 | region = boost::dynamic_pointer_cast<AudioRegion> (RegionFactory::create (pending_sources, plist)); |
4385 | 2238 | 2247 | ||
4386 | 2239 | region->set_automatic (true); | 2248 | _playlist->add_region (region, position); |
4383 | 2240 | region->set_whole_file (true); | ||
4384 | 2241 | region->special_set_position (0); | ||
4387 | 2242 | } | 2249 | } |
4388 | 2243 | 2250 | ||
4389 | 2244 | catch (failed_constructor& err) { | 2251 | catch (failed_constructor& err) { |
4390 | @@ -2249,7 +2256,6 @@ | |||
4391 | 2249 | return -1; | 2256 | return -1; |
4392 | 2250 | } | 2257 | } |
4393 | 2251 | 2258 | ||
4394 | 2252 | _playlist->add_region (region, position); | ||
4395 | 2253 | 2259 | ||
4396 | 2254 | return 0; | 2260 | return 0; |
4397 | 2255 | } | 2261 | } |
4398 | 2256 | 2262 | ||
4399 | === modified file 'libs/ardour/audiofilesource.cc' | |||
4400 | --- libs/ardour/audiofilesource.cc 2013-09-21 19:05:02 +0000 | |||
4401 | +++ libs/ardour/audiofilesource.cc 2015-05-02 14:23:30 +0000 | |||
4402 | @@ -36,6 +36,7 @@ | |||
4403 | 36 | #include "pbd/stl_delete.h" | 36 | #include "pbd/stl_delete.h" |
4404 | 37 | #include "pbd/strsplit.h" | 37 | #include "pbd/strsplit.h" |
4405 | 38 | #include "pbd/shortpath.h" | 38 | #include "pbd/shortpath.h" |
4406 | 39 | #include "pbd/stacktrace.h" | ||
4407 | 39 | #include "pbd/enumwriter.h" | 40 | #include "pbd/enumwriter.h" |
4408 | 40 | 41 | ||
4409 | 41 | #include <sndfile.h> | 42 | #include <sndfile.h> |
4410 | @@ -114,6 +115,22 @@ | |||
4411 | 114 | } | 115 | } |
4412 | 115 | } | 116 | } |
4413 | 116 | 117 | ||
4414 | 118 | /** Constructor used for existing internal-to-session files during crash | ||
4415 | 119 | * recovery. File must exist | ||
4416 | 120 | */ | ||
4417 | 121 | AudioFileSource::AudioFileSource (Session& s, const string& path, Source::Flag flags, bool /* ignored-exists-for-prototype differentiation */) | ||
4418 | 122 | : Source (s, DataType::AUDIO, path, flags) | ||
4419 | 123 | , AudioSource (s, path) | ||
4420 | 124 | , FileSource (s, DataType::AUDIO, path, string(), flags) | ||
4421 | 125 | { | ||
4422 | 126 | /* note that origin remains empty */ | ||
4423 | 127 | |||
4424 | 128 | if (init (_path, true)) { | ||
4425 | 129 | throw failed_constructor (); | ||
4426 | 130 | } | ||
4427 | 131 | } | ||
4428 | 132 | |||
4429 | 133 | |||
4430 | 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. */ |
4431 | 118 | AudioFileSource::AudioFileSource (Session& s, const XMLNode& node, bool must_exist) | 135 | AudioFileSource::AudioFileSource (Session& s, const XMLNode& node, bool must_exist) |
4432 | 119 | : Source (s, node) | 136 | : Source (s, node) |
4433 | 120 | 137 | ||
4434 | === modified file 'libs/ardour/automation_control.cc' | |||
4435 | --- libs/ardour/automation_control.cc 2013-09-21 19:05:02 +0000 | |||
4436 | +++ libs/ardour/automation_control.cc 2015-05-02 14:23:30 +0000 | |||
4437 | @@ -117,15 +117,23 @@ | |||
4438 | 117 | void | 117 | void |
4439 | 118 | AutomationControl::start_touch(double when) | 118 | AutomationControl::start_touch(double when) |
4440 | 119 | { | 119 | { |
4444 | 120 | set_touching (true); | 120 | if (!touching()) { |
4445 | 121 | alist()->start_touch(when); | 121 | if (alist()->automation_state() == Touch) { |
4446 | 122 | AutomationWatch::instance().add_automation_watch (shared_from_this()); | 122 | alist()->start_touch (when); |
4447 | 123 | AutomationWatch::instance().add_automation_watch (shared_from_this()); | ||
4448 | 124 | } | ||
4449 | 125 | set_touching (true); | ||
4450 | 126 | } | ||
4451 | 123 | } | 127 | } |
4452 | 124 | 128 | ||
4453 | 125 | void | 129 | void |
4454 | 126 | AutomationControl::stop_touch(bool mark, double when) | 130 | AutomationControl::stop_touch(bool mark, double when) |
4455 | 127 | { | 131 | { |
4459 | 128 | set_touching (false); | 132 | if (touching()) { |
4460 | 129 | alist()->stop_touch (mark, when); | 133 | set_touching (false); |
4461 | 130 | AutomationWatch::instance().remove_automation_watch (shared_from_this()); | 134 | if (alist()->automation_state() == Touch) { |
4462 | 135 | alist()->stop_touch (mark, when); | ||
4463 | 136 | AutomationWatch::instance().remove_automation_watch (shared_from_this()); | ||
4464 | 137 | } | ||
4465 | 138 | } | ||
4466 | 131 | } | 139 | } |
4467 | 132 | 140 | ||
4468 | === modified file 'libs/ardour/automation_watch.cc' | |||
4469 | --- libs/ardour/automation_watch.cc 2013-09-21 19:05:02 +0000 | |||
4470 | +++ libs/ardour/automation_watch.cc 2015-05-02 14:23:30 +0000 | |||
4471 | @@ -122,7 +122,7 @@ | |||
4472 | 122 | 122 | ||
4473 | 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) { |
4474 | 124 | if ((*aw)->alist()->automation_write()) { | 124 | if ((*aw)->alist()->automation_write()) { |
4476 | 125 | (*aw)->list()->add (time, (*aw)->user_double()); | 125 | (*aw)->list()->add (time, (*aw)->user_double(), true); |
4477 | 126 | } | 126 | } |
4478 | 127 | } | 127 | } |
4479 | 128 | } | 128 | } |
4480 | 129 | 129 | ||
4481 | === modified file 'libs/ardour/coreaudiosource.cc' | |||
4482 | --- libs/ardour/coreaudiosource.cc 2013-09-21 19:05:02 +0000 | |||
4483 | +++ libs/ardour/coreaudiosource.cc 2015-05-02 14:23:30 +0000 | |||
4484 | @@ -28,6 +28,8 @@ | |||
4485 | 28 | #include <appleutility/CAAudioFile.h> | 28 | #include <appleutility/CAAudioFile.h> |
4486 | 29 | #include <appleutility/CAStreamBasicDescription.h> | 29 | #include <appleutility/CAStreamBasicDescription.h> |
4487 | 30 | 30 | ||
4488 | 31 | #include <glibmm/fileutils.h> | ||
4489 | 32 | |||
4490 | 31 | #include "i18n.h" | 33 | #include "i18n.h" |
4491 | 32 | 34 | ||
4492 | 33 | #include <AudioToolbox/AudioFormat.h> | 35 | #include <AudioToolbox/AudioFormat.h> |
4493 | @@ -36,21 +38,32 @@ | |||
4494 | 36 | using namespace ARDOUR; | 38 | using namespace ARDOUR; |
4495 | 37 | using namespace PBD; | 39 | using namespace PBD; |
4496 | 38 | 40 | ||
4497 | 41 | /** Create a new CoreAudioSource using session state, which implies that the | ||
4498 | 42 | * file must already exist. | ||
4499 | 43 | */ | ||
4500 | 39 | CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node) | 44 | CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node) |
4501 | 40 | : Source (s, node) | 45 | : Source (s, node) |
4502 | 41 | , AudioFileSource (s, node) | 46 | , AudioFileSource (s, node) |
4503 | 42 | { | 47 | { |
4504 | 43 | init_cafile (); | 48 | init_cafile (); |
4505 | 49 | |||
4506 | 50 | assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)); | ||
4507 | 51 | existence_check (); | ||
4508 | 44 | } | 52 | } |
4509 | 45 | 53 | ||
4510 | 54 | /** Create a new CoreAudioSource from an existing file. Sources created with this | ||
4511 | 55 | * method are never writable or removable. | ||
4512 | 56 | */ | ||
4513 | 46 | CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags) | 57 | CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags) |
4514 | 47 | /* files created this way are never writable or removable */ | ||
4515 | 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))), |
4516 | 49 | AudioFileSource (s, path, | 59 | AudioFileSource (s, path, |
4517 | 50 | Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))) | 60 | Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))) |
4518 | 51 | { | 61 | { |
4519 | 52 | _channel = chn; | 62 | _channel = chn; |
4520 | 53 | init_cafile (); | 63 | init_cafile (); |
4521 | 64 | |||
4522 | 65 | assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)); | ||
4523 | 66 | existence_check (); | ||
4524 | 54 | } | 67 | } |
4525 | 55 | 68 | ||
4526 | 56 | void | 69 | void |
4527 | 57 | 70 | ||
4528 | === modified file 'libs/ardour/delivery.cc' | |||
4529 | --- libs/ardour/delivery.cc 2014-01-24 16:31:54 +0000 | |||
4530 | +++ libs/ardour/delivery.cc 2015-05-02 14:23:30 +0000 | |||
4531 | @@ -397,7 +397,11 @@ | |||
4532 | 397 | if (panners_legal) { | 397 | if (panners_legal) { |
4533 | 398 | if (!_no_panner_reset) { | 398 | if (!_no_panner_reset) { |
4534 | 399 | 399 | ||
4535 | 400 | <<<<<<< TREE | ||
4536 | 400 | if (_panshell && _role != Insert) { | 401 | if (_panshell && _role != Insert) { |
4537 | 402 | ======= | ||
4538 | 403 | if (_panshell && _role != Insert && _role != Listen) { | ||
4539 | 404 | >>>>>>> MERGE-SOURCE | ||
4540 | 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())); |
4541 | 402 | } | 406 | } |
4542 | 403 | } | 407 | } |
4543 | 404 | 408 | ||
4544 | === modified file 'libs/ardour/diskstream.cc' | |||
4545 | --- libs/ardour/diskstream.cc 2013-09-21 19:05:02 +0000 | |||
4546 | +++ libs/ardour/diskstream.cc 2015-05-02 14:23:30 +0000 | |||
4547 | @@ -739,4 +739,3 @@ | |||
4548 | 739 | { | 739 | { |
4549 | 740 | g_atomic_int_set (&_record_enabled, 0); | 740 | g_atomic_int_set (&_record_enabled, 0); |
4550 | 741 | } | 741 | } |
4551 | 742 | |||
4552 | 743 | 742 | ||
4553 | === modified file 'libs/ardour/enums.cc' | |||
4554 | --- libs/ardour/enums.cc 2013-12-23 22:07:52 +0000 | |||
4555 | +++ libs/ardour/enums.cc 2015-05-02 14:23:30 +0000 | |||
4556 | @@ -447,6 +447,7 @@ | |||
4557 | 447 | REGISTER_CLASS_ENUM (Source, RemoveAtDestroy); | 447 | REGISTER_CLASS_ENUM (Source, RemoveAtDestroy); |
4558 | 448 | REGISTER_CLASS_ENUM (Source, NoPeakFile); | 448 | REGISTER_CLASS_ENUM (Source, NoPeakFile); |
4559 | 449 | REGISTER_CLASS_ENUM (Source, Destructive); | 449 | REGISTER_CLASS_ENUM (Source, Destructive); |
4560 | 450 | REGISTER_CLASS_ENUM (Source, Empty); | ||
4561 | 450 | REGISTER_BITS (_Source_Flag); | 451 | REGISTER_BITS (_Source_Flag); |
4562 | 451 | 452 | ||
4563 | 452 | REGISTER_ENUM (FadeLinear); | 453 | REGISTER_ENUM (FadeLinear); |
4564 | 453 | 454 | ||
4565 | === modified file 'libs/ardour/export_channel.cc' | |||
4566 | --- libs/ardour/export_channel.cc 2013-12-23 22:07:52 +0000 | |||
4567 | +++ libs/ardour/export_channel.cc 2015-05-02 14:23:30 +0000 | |||
4568 | @@ -239,7 +239,7 @@ | |||
4569 | 239 | { | 239 | { |
4570 | 240 | assert(processor); | 240 | assert(processor); |
4571 | 241 | AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel); | 241 | AudioBuffer const & buffer = processor->get_capture_buffers().get_audio (channel); |
4573 | 242 | assert (frames <= (framecnt_t) buffer.size()); | 242 | assert (frames <= (framecnt_t) buffer.capacity()); |
4574 | 243 | data = buffer.data(); | 243 | data = buffer.data(); |
4575 | 244 | } | 244 | } |
4576 | 245 | 245 | ||
4577 | 246 | 246 | ||
4578 | === modified file 'libs/ardour/file_source.cc' | |||
4579 | --- libs/ardour/file_source.cc 2013-09-21 19:05:02 +0000 | |||
4580 | +++ libs/ardour/file_source.cc 2015-05-02 14:23:30 +0000 | |||
4581 | @@ -56,14 +56,12 @@ | |||
4582 | 56 | FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag) | 56 | FileSource::FileSource (Session& session, DataType type, const string& path, const string& origin, Source::Flag flag) |
4583 | 57 | : Source(session, type, path, flag) | 57 | : Source(session, type, path, flag) |
4584 | 58 | , _path (path) | 58 | , _path (path) |
4586 | 59 | , _file_is_new (!origin.empty()) // origin empty => new file VS. origin !empty => new file | 59 | , _file_is_new (!origin.empty()) // if origin is left unspecified (empty string) then file must exist |
4587 | 60 | , _channel (0) | 60 | , _channel (0) |
4588 | 61 | , _origin (origin) | 61 | , _origin (origin) |
4589 | 62 | , _open (false) | 62 | , _open (false) |
4590 | 63 | { | 63 | { |
4591 | 64 | set_within_session_from_path (path); | 64 | set_within_session_from_path (path); |
4592 | 65 | |||
4593 | 66 | prevent_deletion (); | ||
4594 | 67 | } | 65 | } |
4595 | 68 | 66 | ||
4596 | 69 | FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist*/) | 67 | FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist*/) |
4597 | @@ -77,23 +75,28 @@ | |||
4598 | 77 | 75 | ||
4599 | 78 | _path = _name; | 76 | _path = _name; |
4600 | 79 | _within_session = true; | 77 | _within_session = true; |
4603 | 80 | 78 | } | |
4604 | 81 | prevent_deletion (); | 79 | |
4605 | 80 | FileSource::~FileSource() | ||
4606 | 81 | { | ||
4607 | 82 | } | ||
4608 | 83 | |||
4609 | 84 | void | ||
4610 | 85 | FileSource::existence_check () | ||
4611 | 86 | { | ||
4612 | 87 | if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) { | ||
4613 | 88 | prevent_deletion (); | ||
4614 | 89 | } | ||
4615 | 82 | } | 90 | } |
4616 | 83 | 91 | ||
4617 | 84 | void | 92 | void |
4618 | 85 | FileSource::prevent_deletion () | 93 | FileSource::prevent_deletion () |
4619 | 86 | { | 94 | { |
4630 | 87 | /* if this file already exists, it cannot be removed, ever | 95 | if (!(_flags & Destructive)) { |
4631 | 88 | */ | 96 | mark_immutable (); |
4632 | 89 | 97 | } else { | |
4633 | 90 | if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) { | 98 | _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy)); |
4634 | 91 | if (!(_flags & Destructive)) { | 99 | } |
4625 | 92 | mark_immutable (); | ||
4626 | 93 | } else { | ||
4627 | 94 | _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy)); | ||
4628 | 95 | } | ||
4629 | 96 | } | ||
4635 | 97 | } | 100 | } |
4636 | 98 | 101 | ||
4637 | 99 | bool | 102 | bool |
4638 | @@ -101,7 +104,7 @@ | |||
4639 | 101 | { | 104 | { |
4640 | 102 | bool r = ((_flags & Removable) | 105 | bool r = ((_flags & Removable) |
4641 | 103 | && ((_flags & RemoveAtDestroy) || | 106 | && ((_flags & RemoveAtDestroy) || |
4643 | 104 | ((_flags & RemovableIfEmpty) && empty() == 0))); | 107 | ((_flags & RemovableIfEmpty) && empty()))); |
4644 | 105 | 108 | ||
4645 | 106 | return r; | 109 | return r; |
4646 | 107 | } | 110 | } |
4647 | @@ -211,7 +214,7 @@ | |||
4648 | 211 | 214 | ||
4649 | 212 | if (move_dependents_to_trash() != 0) { | 215 | if (move_dependents_to_trash() != 0) { |
4650 | 213 | /* try to back out */ | 216 | /* try to back out */ |
4652 | 214 | rename (newpath.c_str(), _path.c_str()); | 217 | ::rename (newpath.c_str(), _path.c_str()); |
4653 | 215 | return -1; | 218 | return -1; |
4654 | 216 | } | 219 | } |
4655 | 217 | 220 | ||
4656 | @@ -253,8 +256,6 @@ | |||
4657 | 253 | 256 | ||
4658 | 254 | split (search_path, dirs, ':'); | 257 | split (search_path, dirs, ':'); |
4659 | 255 | 258 | ||
4660 | 256 | hits.clear (); | ||
4661 | 257 | |||
4662 | 258 | for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) { | 259 | for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) { |
4663 | 259 | 260 | ||
4664 | 260 | fullpath = Glib::build_filename (*i, path); | 261 | fullpath = Glib::build_filename (*i, path); |
4665 | @@ -309,9 +310,9 @@ | |||
4666 | 309 | /* no match: error */ | 310 | /* no match: error */ |
4667 | 310 | 311 | ||
4668 | 311 | if (must_exist) { | 312 | if (must_exist) { |
4672 | 312 | error << string_compose( | 313 | /* do not generate an error here, leave that to |
4673 | 313 | _("Filesource: cannot find required file (%1): while searching %2"), | 314 | whoever deals with the false return value. |
4674 | 314 | path, search_path) << endmsg; | 315 | */ |
4675 | 315 | goto out; | 316 | goto out; |
4676 | 316 | } else { | 317 | } else { |
4677 | 317 | isnew = true; | 318 | isnew = true; |
4678 | @@ -322,16 +323,17 @@ | |||
4679 | 322 | 323 | ||
4680 | 323 | keeppath = de_duped_hits[0]; | 324 | keeppath = de_duped_hits[0]; |
4681 | 324 | } | 325 | } |
4684 | 325 | 326 | ||
4685 | 326 | } else { | 327 | } else { |
4686 | 327 | keeppath = path; | 328 | keeppath = path; |
4687 | 328 | } | 329 | } |
4688 | 329 | 330 | ||
4689 | 330 | /* Current find() is unable to parse relative path names to yet non-existant | 331 | /* Current find() is unable to parse relative path names to yet non-existant |
4690 | 331 | sources. QuickFix(tm) | 332 | sources. QuickFix(tm) |
4691 | 332 | */ | 333 | */ |
4694 | 333 | if (keeppath == "") { | 334 | |
4695 | 334 | if (must_exist) { | 335 | if (keeppath.empty()) { |
4696 | 336 | if (must_exist) { | ||
4697 | 335 | error << "FileSource::find(), keeppath = \"\", but the file must exist" << endl; | 337 | error << "FileSource::find(), keeppath = \"\", but the file must exist" << endl; |
4698 | 336 | } else { | 338 | } else { |
4699 | 337 | keeppath = path; | 339 | keeppath = path; |
4700 | @@ -518,35 +520,6 @@ | |||
4701 | 518 | return ret; | 520 | return ret; |
4702 | 519 | } | 521 | } |
4703 | 520 | 522 | ||
4704 | 521 | int | ||
4705 | 522 | FileSource::set_source_name (const string& newname, bool destructive) | ||
4706 | 523 | { | ||
4707 | 524 | Glib::Threads::Mutex::Lock lm (_lock); | ||
4708 | 525 | string oldpath = _path; | ||
4709 | 526 | string newpath = _session.change_source_path_by_name (oldpath, _name, newname, destructive); | ||
4710 | 527 | |||
4711 | 528 | if (newpath.empty()) { | ||
4712 | 529 | error << string_compose (_("programming error: %1"), "cannot generate a changed file path") << endmsg; | ||
4713 | 530 | return -1; | ||
4714 | 531 | } | ||
4715 | 532 | |||
4716 | 533 | // Test whether newpath exists, if yes notify the user but continue. | ||
4717 | 534 | if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) { | ||
4718 | 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; | ||
4719 | 536 | return -1; | ||
4720 | 537 | } | ||
4721 | 538 | |||
4722 | 539 | if (::rename (oldpath.c_str(), newpath.c_str()) != 0) { | ||
4723 | 540 | error << string_compose (_("cannot rename file %1 to %2 (%3)"), oldpath, newpath, strerror(errno)) << endmsg; | ||
4724 | 541 | return -1; | ||
4725 | 542 | } | ||
4726 | 543 | |||
4727 | 544 | _name = Glib::path_get_basename (newpath); | ||
4728 | 545 | _path = newpath; | ||
4729 | 546 | |||
4730 | 547 | return 0; | ||
4731 | 548 | } | ||
4732 | 549 | |||
4733 | 550 | void | 523 | void |
4734 | 551 | FileSource::mark_immutable () | 524 | FileSource::mark_immutable () |
4735 | 552 | { | 525 | { |
4736 | @@ -589,3 +562,46 @@ | |||
4737 | 589 | Source::inc_use_count (); | 562 | Source::inc_use_count (); |
4738 | 590 | } | 563 | } |
4739 | 591 | 564 | ||
4740 | 565 | bool | ||
4741 | 566 | FileSource::is_stub () const | ||
4742 | 567 | { | ||
4743 | 568 | if (!empty()) { | ||
4744 | 569 | return false; | ||
4745 | 570 | } | ||
4746 | 571 | |||
4747 | 572 | if (!removable()) { | ||
4748 | 573 | return false; | ||
4749 | 574 | } | ||
4750 | 575 | |||
4751 | 576 | if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) { | ||
4752 | 577 | return false; | ||
4753 | 578 | } | ||
4754 | 579 | |||
4755 | 580 | return true; | ||
4756 | 581 | } | ||
4757 | 582 | |||
4758 | 583 | int | ||
4759 | 584 | FileSource::rename (const string& newpath) | ||
4760 | 585 | { | ||
4761 | 586 | Glib::Threads::Mutex::Lock lm (_lock); | ||
4762 | 587 | string oldpath = _path; | ||
4763 | 588 | |||
4764 | 589 | // Test whether newpath exists, if yes notify the user but continue. | ||
4765 | 590 | if (Glib::file_test (newpath, Glib::FILE_TEST_EXISTS)) { | ||
4766 | 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; | ||
4767 | 592 | return -1; | ||
4768 | 593 | } | ||
4769 | 594 | |||
4770 | 595 | if (Glib::file_test (oldpath.c_str(), Glib::FILE_TEST_EXISTS)) { | ||
4771 | 596 | /* rename only needed if file exists on disk */ | ||
4772 | 597 | if (::rename (oldpath.c_str(), newpath.c_str()) != 0) { | ||
4773 | 598 | error << string_compose (_("cannot rename file %1 to %2 (%3)"), oldpath, newpath, strerror(errno)) << endmsg; | ||
4774 | 599 | return -1; | ||
4775 | 600 | } | ||
4776 | 601 | } | ||
4777 | 602 | |||
4778 | 603 | _name = Glib::path_get_basename (newpath); | ||
4779 | 604 | _path = newpath; | ||
4780 | 605 | |||
4781 | 606 | return 0; | ||
4782 | 607 | } | ||
4783 | 592 | 608 | ||
4784 | === modified file 'libs/ardour/filter.cc' | |||
4785 | --- libs/ardour/filter.cc 2013-09-21 19:05:02 +0000 | |||
4786 | +++ libs/ardour/filter.cc 2015-05-02 14:23:30 +0000 | |||
4787 | @@ -59,10 +59,9 @@ | |||
4788 | 59 | } | 59 | } |
4789 | 60 | } | 60 | } |
4790 | 61 | 61 | ||
4793 | 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); |
4792 | 63 | PBD::basename_nosuffix (names[i]), string ("")); | ||
4794 | 64 | 63 | ||
4796 | 65 | if (path.length() == 0) { | 64 | if (path.empty()) { |
4797 | 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()) |
4798 | 67 | << endmsg; | 66 | << endmsg; |
4799 | 68 | return -1; | 67 | return -1; |
4800 | 69 | 68 | ||
4801 | === modified file 'libs/ardour/import.cc' | |||
4802 | --- libs/ardour/import.cc 2013-09-21 19:05:02 +0000 | |||
4803 | +++ libs/ardour/import.cc 2015-05-02 14:23:30 +0000 | |||
4804 | @@ -116,78 +116,31 @@ | |||
4805 | 116 | } | 116 | } |
4806 | 117 | } | 117 | } |
4807 | 118 | 118 | ||
4865 | 119 | static std::string | 119 | vector<string> |
4866 | 120 | get_non_existent_filename (HeaderFormat hf, DataType type, const bool allow_replacing, const std::string& destdir, const std::string& basename, uint channel, uint channels) | 120 | Session::get_paths_for_new_sources (bool /*allow_replacing*/, const string& import_file_path, uint32_t channels) |
4810 | 121 | { | ||
4811 | 122 | char buf[PATH_MAX+1]; | ||
4812 | 123 | bool goodfile = false; | ||
4813 | 124 | string base = basename; | ||
4814 | 125 | string ext = native_header_format_extension (hf, type); | ||
4815 | 126 | uint32_t cnt = 1; | ||
4816 | 127 | |||
4817 | 128 | do { | ||
4818 | 129 | |||
4819 | 130 | if (type == DataType::AUDIO && channels == 2) { | ||
4820 | 131 | if (channel == 0) { | ||
4821 | 132 | if (cnt == 1) { | ||
4822 | 133 | snprintf (buf, sizeof(buf), "%s-L%s", base.c_str(), ext.c_str()); | ||
4823 | 134 | } else { | ||
4824 | 135 | snprintf (buf, sizeof(buf), "%s-%d-L%s", base.c_str(), cnt, ext.c_str()); | ||
4825 | 136 | } | ||
4826 | 137 | } else { | ||
4827 | 138 | if (cnt == 1) { | ||
4828 | 139 | snprintf (buf, sizeof(buf), "%s-R%s", base.c_str(), ext.c_str()); | ||
4829 | 140 | } else { | ||
4830 | 141 | snprintf (buf, sizeof(buf), "%s-%d-R%s", base.c_str(), cnt, ext.c_str()); | ||
4831 | 142 | } | ||
4832 | 143 | } | ||
4833 | 144 | } else if (channels > 1) { | ||
4834 | 145 | if (cnt == 1) { | ||
4835 | 146 | snprintf (buf, sizeof(buf), "%s-c%d%s", base.c_str(), channel, ext.c_str()); | ||
4836 | 147 | } else { | ||
4837 | 148 | snprintf (buf, sizeof(buf), "%s-%d-c%d%s", base.c_str(), cnt, channel, ext.c_str()); | ||
4838 | 149 | } | ||
4839 | 150 | } else { | ||
4840 | 151 | if (cnt == 1) { | ||
4841 | 152 | snprintf (buf, sizeof(buf), "%s%s", base.c_str(), ext.c_str()); | ||
4842 | 153 | } else { | ||
4843 | 154 | snprintf (buf, sizeof(buf), "%s-%d%s", base.c_str(), cnt, ext.c_str()); | ||
4844 | 155 | } | ||
4845 | 156 | } | ||
4846 | 157 | |||
4847 | 158 | string tempname = destdir + "/" + buf; | ||
4848 | 159 | |||
4849 | 160 | if (!allow_replacing && Glib::file_test (tempname, Glib::FILE_TEST_EXISTS)) { | ||
4850 | 161 | |||
4851 | 162 | cnt++; | ||
4852 | 163 | |||
4853 | 164 | } else { | ||
4854 | 165 | |||
4855 | 166 | goodfile = true; | ||
4856 | 167 | } | ||
4857 | 168 | |||
4858 | 169 | } while (!goodfile); | ||
4859 | 170 | |||
4860 | 171 | return buf; | ||
4861 | 172 | } | ||
4862 | 173 | |||
4863 | 174 | static vector<string> | ||
4864 | 175 | get_paths_for_new_sources (HeaderFormat hf, const bool allow_replacing, const string& import_file_path, const string& session_dir, uint channels) | ||
4867 | 176 | { | 121 | { |
4868 | 177 | vector<string> new_paths; | 122 | vector<string> new_paths; |
4869 | 178 | const string basename = basename_nosuffix (import_file_path); | 123 | const string basename = basename_nosuffix (import_file_path); |
4870 | 179 | 124 | ||
4871 | 180 | SessionDirectory sdir(session_dir); | ||
4872 | 181 | |||
4873 | 182 | for (uint n = 0; n < channels; ++n) { | 125 | for (uint n = 0; n < channels; ++n) { |
4874 | 183 | 126 | ||
4875 | 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; |
4882 | 185 | 128 | string filepath; | |
4883 | 186 | std::string filepath = (type == DataType::MIDI) | 129 | |
4884 | 187 | ? sdir.midi_path() : sdir.sound_path(); | 130 | switch (type) { |
4885 | 188 | 131 | case DataType::MIDI: | |
4886 | 189 | filepath = Glib::build_filename (filepath, | 132 | filepath = new_midi_source_path (basename); |
4887 | 190 | get_non_existent_filename (hf, type, allow_replacing, filepath, basename, n, channels)); | 133 | break; |
4888 | 134 | case DataType::AUDIO: | ||
4889 | 135 | filepath = new_audio_source_path (basename, channels, n, false, false); | ||
4890 | 136 | break; | ||
4891 | 137 | } | ||
4892 | 138 | |||
4893 | 139 | if (filepath.empty()) { | ||
4894 | 140 | error << string_compose (_("Cannot find new filename for imported file %1"), import_file_path) << endmsg; | ||
4895 | 141 | return vector<string>(); | ||
4896 | 142 | } | ||
4897 | 143 | |||
4898 | 191 | new_paths.push_back (filepath); | 144 | new_paths.push_back (filepath); |
4899 | 192 | } | 145 | } |
4900 | 193 | 146 | ||
4901 | @@ -201,7 +154,7 @@ | |||
4902 | 201 | for (vector<string>::const_iterator i = new_paths.begin(); | 154 | for (vector<string>::const_iterator i = new_paths.begin(); |
4903 | 202 | i != new_paths.end(); ++i) | 155 | i != new_paths.end(); ++i) |
4904 | 203 | { | 156 | { |
4906 | 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); |
4907 | 205 | 158 | ||
4908 | 206 | if (source == 0) { | 159 | if (source == 0) { |
4909 | 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; |
4910 | @@ -274,12 +227,12 @@ | |||
4911 | 274 | { | 227 | { |
4912 | 275 | const framecnt_t nframes = ResampledImportableSource::blocksize; | 228 | const framecnt_t nframes = ResampledImportableSource::blocksize; |
4913 | 276 | boost::shared_ptr<AudioFileSource> afs; | 229 | boost::shared_ptr<AudioFileSource> afs; |
4915 | 277 | uint channels = source->channels(); | 230 | uint32_t channels = source->channels(); |
4916 | 278 | 231 | ||
4917 | 279 | boost::scoped_array<float> data(new float[nframes * channels]); | 232 | boost::scoped_array<float> data(new float[nframes * channels]); |
4918 | 280 | vector<boost::shared_array<Sample> > channel_data; | 233 | vector<boost::shared_array<Sample> > channel_data; |
4919 | 281 | 234 | ||
4921 | 282 | for (uint n = 0; n < channels; ++n) { | 235 | for (uint32_t n = 0; n < channels; ++n) { |
4922 | 283 | channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes])); | 236 | channel_data.push_back(boost::shared_array<Sample>(new Sample[nframes])); |
4923 | 284 | } | 237 | } |
4924 | 285 | 238 | ||
4925 | @@ -323,14 +276,14 @@ | |||
4926 | 323 | progress_multiplier = 0.5; | 276 | progress_multiplier = 0.5; |
4927 | 324 | progress_base = 0.5; | 277 | progress_base = 0.5; |
4928 | 325 | } | 278 | } |
4931 | 326 | 279 | ||
4932 | 327 | uint read_count = 0; | 280 | framecnt_t read_count = 0; |
4933 | 328 | 281 | ||
4934 | 329 | while (!status.cancel) { | 282 | while (!status.cancel) { |
4935 | 330 | 283 | ||
4936 | 331 | framecnt_t nread, nfread; | 284 | framecnt_t nread, nfread; |
4939 | 332 | uint x; | 285 | uint32_t x; |
4940 | 333 | uint chn; | 286 | uint32_t chn; |
4941 | 334 | 287 | ||
4942 | 335 | if ((nread = source->read (data.get(), nframes)) == 0) { | 288 | if ((nread = source->read (data.get(), nframes)) == 0) { |
4943 | 336 | break; | 289 | break; |
4944 | @@ -513,10 +466,7 @@ | |||
4945 | 513 | } | 466 | } |
4946 | 514 | } | 467 | } |
4947 | 515 | 468 | ||
4952 | 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); |
4949 | 517 | status.replace_existing_source, *p, | ||
4950 | 518 | get_best_session_directory_for_new_source (), | ||
4951 | 519 | channels); | ||
4953 | 520 | Sources newfiles; | 470 | Sources newfiles; |
4954 | 521 | framepos_t natural_position = source ? source->natural_position() : 0; | 471 | framepos_t natural_position = source ? source->natural_position() : 0; |
4955 | 522 | 472 | ||
4956 | 523 | 473 | ||
4957 | === modified file 'libs/ardour/internal_send.cc' | |||
4958 | --- libs/ardour/internal_send.cc 2014-01-24 16:31:54 +0000 | |||
4959 | +++ libs/ardour/internal_send.cc 2015-05-02 14:23:30 +0000 | |||
4960 | @@ -129,7 +129,7 @@ | |||
4961 | 129 | // we have to copy the input, because we may alter the buffers with the amp | 129 | // we have to copy the input, because we may alter the buffers with the amp |
4962 | 130 | // in-place, which a send must never do. | 130 | // in-place, which a send must never do. |
4963 | 131 | 131 | ||
4965 | 132 | if (_panshell && !_panshell->bypassed()) { | 132 | if (_panshell && !_panshell->bypassed() && role() != Listen) { |
4966 | 133 | _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); | 133 | _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); |
4967 | 134 | } else { | 134 | } else { |
4968 | 135 | if (role() == Listen) { | 135 | if (role() == Listen) { |
4969 | 136 | 136 | ||
4970 | === modified file 'libs/ardour/lv2_evbuf.c' | |||
4971 | --- libs/ardour/lv2_evbuf.c 2013-09-21 19:05:02 +0000 | |||
4972 | +++ libs/ardour/lv2_evbuf.c 2015-05-02 14:23:30 +0000 | |||
4973 | @@ -203,7 +203,7 @@ | |||
4974 | 203 | switch (iter.evbuf->type) { | 203 | switch (iter.evbuf->type) { |
4975 | 204 | case LV2_EVBUF_EVENT: | 204 | case LV2_EVBUF_EVENT: |
4976 | 205 | ebuf = &iter.evbuf->buf.event; | 205 | ebuf = &iter.evbuf->buf.event; |
4978 | 206 | ev = (LV2_Event*)ebuf->data + iter.offset; | 206 | ev = (LV2_Event*)((char*)ebuf->data + iter.offset); |
4979 | 207 | *frames = ev->frames; | 207 | *frames = ev->frames; |
4980 | 208 | *subframes = ev->subframes; | 208 | *subframes = ev->subframes; |
4981 | 209 | *type = ev->type; | 209 | *type = ev->type; |
4982 | 210 | 210 | ||
4983 | === modified file 'libs/ardour/lv2_plugin.cc' | |||
4984 | --- libs/ardour/lv2_plugin.cc 2014-01-24 16:31:54 +0000 | |||
4985 | +++ libs/ardour/lv2_plugin.cc 2015-05-02 14:23:30 +0000 | |||
4986 | @@ -31,6 +31,7 @@ | |||
4987 | 31 | 31 | ||
4988 | 32 | #include <boost/utility.hpp> | 32 | #include <boost/utility.hpp> |
4989 | 33 | 33 | ||
4990 | 34 | #include "pbd/clear_dir.h" | ||
4991 | 34 | #include "pbd/pathscanner.h" | 35 | #include "pbd/pathscanner.h" |
4992 | 35 | #include "pbd/compose.h" | 36 | #include "pbd/compose.h" |
4993 | 36 | #include "pbd/error.h" | 37 | #include "pbd/error.h" |
4994 | @@ -880,27 +881,6 @@ | |||
4995 | 880 | return g_strndup(abs_path.c_str(), abs_path.length()); | 881 | return g_strndup(abs_path.c_str(), abs_path.length()); |
4996 | 881 | } | 882 | } |
4997 | 882 | 883 | ||
4998 | 883 | static void | ||
4999 | 884 | remove_directory(const std::string& path) | ||
5000 | 885 | { |
Rejecting in favor of a full backport SRU