Commit Graph

595 Commits

Author SHA1 Message Date
Tim Mayberry
689862cafb Decouple Session from MidiPatchManager and reduce parsing of midnam xml files
The MidiPatchManager only requires a reference to the session to get the path
to the Session midnam directory so change it so that the path is passed to
MidiPatchManager::add_search_path on Session construction and removed on
Session Destruction. This will also make it easier to test and reduce compile
times etc.

For the common case where the Session doesn't have a Session specific midnam
patch files directory(for instance a new session) it won't cause a refresh and
reparsing of all the midnam files. This saves about 2 seconds to load a Session
on my machine(fast machine with SSD), or about half the time spent in the
Session constructor for a new session.

There is still going to be that initial cost of parsing the midnam files when
the first session is created after starting Ardour. Options to remove that
would be to parse the files asynchronously and or use a faster xml
parser(eventually), neither of which seem worth doing at this stage.

This change will cause a performance regression for the uncommon case where a
Session with Session specific midnam files is unloaded and then another Session
with Session specific midnam files is loaded as it will cause the common midnam
files in midi_patch_path to be parsed twice(unload and load).
2015-10-22 11:51:03 -04:00
André Nusser
67f557b1f4 Add overwrite option to save_template. (default = false)
Before it could not overwrite.
2015-10-21 23:28:44 -04:00
Robin Gareus
f53dc5945e extend session-save dirty-flag logic
Snapshot and continue working on current session incorrectly marks 
the session as clean.
2015-10-16 20:54:15 +02:00
Robin Gareus
2397429e99 use quotes for in-tree pbd/glib wrapper include 2015-10-05 22:15:18 +02:00
Robin Gareus
dc36b063bf remove unused fstream includes 2015-10-05 22:15:18 +02:00
Paul Davis
297e80e020 attempt to stop transport, finish butler work, and close all files as part of Session > Cleanup 2015-10-04 14:18:04 -04:00
Paul Davis
e63de172d5 NOOP: delete trailing whitespace 2015-10-04 14:18:04 -04:00
John Emmas
c68736bc02 Change a few instances of 'stat()' to use 'g_stat()' (for UTF8 compatibility on Windows) 2015-10-04 14:18:54 +01:00
Robin Gareus
fedec84d3b fix iterator after map::erase().
The iterator referring to the removed element is invalidated.
Other iterators remain valid.
2015-09-23 22:26:44 +02:00
Robin Gareus
7ac691ec82 use pbd's gstdio compatibility wrapper 2015-09-17 14:37:57 +02:00
Robin Gareus
04e7cfabbe prepare peak-file cleanup/recreate. 2015-09-15 14:44:05 +02:00
John Emmas
551e20b926 Remove ifstream / ofstream when accessing session template files (or creating a new session from a template file)
On Windows, the above classes don't support UTF-8 so let's get rid of them and use g_fopen / stringstream / fwrite() etc.
2015-09-15 13:17:22 +01:00
Robin Gareus
cb6c975417 remove cruft 2015-09-12 17:55:04 +02:00
Robin Gareus
390ea007c5 rework peakfile handling:
- copy old peak-files to new (do not require re-calc)
- keep old peak-files (for now, backwards compat)
- fix cleanup-sources to remove *new* peak-file
- include channel-number in hash (like it was done before)

see also 624f76b

TODO: add Session > Cleanup > remove/re-create peaks
2015-09-10 00:55:58 +02:00
Mathias Buhr
624f76b229 Fixes case where audiofiles used wrong peakfiles 2015-09-03 09:54:23 +02:00
Tim Mayberry
b4e13cbbb7 Add undo history related debug output for debugging Undo/Redo issues 2015-08-19 13:56:11 +10:00
Paul Davis
b8b5d0b4c7 alternative fix for the same problem that 9e2048decf was addressing 2015-07-02 14:15:11 -04:00
Robin Gareus
9e2048decf Don’t use invalid iterator during cleanup. fixes #6403 2015-07-02 19:46:38 +02:00
Paul Davis
205f9bca96 push seek-after-state-loaded into butler thread, to avoid multiple threads doing disk i/o related stuff 2015-06-29 14:18:16 -04:00
Paul Davis
8e9bb12f92 no-op: fix whitespace/indentation 2015-06-29 14:18:15 -04:00
GZharun
dd0a73e2d4 Fixed use case when session is being replaced with new session with the same name.
We should check session state file (*.ardour) presence to determine if the session is new for TracksLive as TracksLive has a use case which gives user a possibility to replace existing session by clicking on it's state file when new session is being created.
[To be Reviewed by] Paul Davis
2015-06-29 14:18:15 -04:00
Paul Davis
6bdac56998 some more information output to log during save-as, for debugging 2015-06-29 14:18:15 -04:00
Paul Davis
8ac5ef15f0 add more directory names to set managed via various APIs (automation, analysis, plugins, externals) 2015-06-29 14:18:14 -04:00
Paul Davis
68aab0153c rename Session::add_session_range_location() to ::set_session_range_location() 2015-06-29 14:18:14 -04:00
Paul Davis
ab2e23db9a follow various events related to playhead priority (loop changes, parameter changes); remove debug output 2015-06-29 14:18:13 -04:00
Paul Davis
e2a76746e6 fix accidentally deleted return value 2015-06-29 14:18:13 -04:00
Paul Davis
5927fb4997 fix timing of Butler mapping config parameters to avoid crash.
Amazing that this didn't show up on Linux at all, or on the first run after build. Computers ... sigh.

Conflicts:
	libs/ardour/butler.cc
2015-06-29 14:18:13 -04:00
Paul Davis
5f4f40205b clean up cherry-pick of varifill tweaks from Waves Tracks 2015-06-29 14:18:12 -04:00
Paul Davis
ca09a4a355 more tweaks for varifill model, and avoid filling playback buffers during session loading
Conflicts:
	libs/ardour/diskstream.cc
	libs/ardour/session.cc
	libs/ardour/session_state.cc

Conflicts:
	libs/ardour/session.cc
2015-06-29 14:18:12 -04:00
Valeriy Kamyshniy
8505c16057 [Summary] Just adding comment for better code-maintaining. 2015-06-29 14:18:12 -04:00
Paul Davis
f116455280 after changing session SR, reset all write sources to use new rate 2015-06-29 14:18:12 -04:00
Paul Davis
32224ee608 add in more Tracks-related auto-(re)connect changes 2015-06-29 14:18:11 -04:00
Paul Davis
bebb03a0a4 add in more Tracks-related auto-(re)connect changes, all conditionalized by Profile 2015-06-29 14:18:11 -04:00
nikolay
ed291ee8d0 [Summary] Changed function name update_route_active_state() on update_route_record_state()
[Reviewed] GZharun

Conflicts:
	libs/ardour/ardour/session.h
	libs/ardour/session.cc
	libs/ardour/session_state.cc
2015-06-29 14:18:10 -04:00
Paul Davis
4235367acd fixed previous commit from Tracks to work correctly in all cases 2015-06-29 14:18:10 -04:00
Valeriy Kamyshniy
07c81a763f [Summary] BUG FIXED: New name of a session saved with “save as”, was not stored in the session recent list.
[Reviewed] YPozdnyakov
2015-06-29 14:18:10 -04:00
Valeriy Kamyshniy
1f98535b52 [Summary] Adding informative message to failed file copy exception in Session::save_as.
[Review required] Paul Davis
2015-06-29 14:18:10 -04:00
Paul Davis
445d742af1 save recent templates analogously to recent sessions 2015-06-29 14:18:10 -04:00
Paul Davis
0365c5cc47 Tracks-specific handling of template dir 2015-06-29 14:18:10 -04:00
Paul Davis
893cb3460c fix cherry-pick logic failure with Session::save_template() - Tracks case already taken care of 2015-06-29 14:18:10 -04:00
Valeriy Kamyshniy
1acee68037 [Summary] a) On MAC OS, .DS_Store files are ignored when saving a session by “Save As”.
b) plugins folder is not created for Templates.

[Required review] Paul Davis, YPozdnyakov

Conflicts:
	libs/ardour/session_state.cc
2015-06-29 14:18:10 -04:00
Valeriy Kamyshniy
7c5d849247 [Summary] For tracks when saving templates, we need stored the Auto Loop Range and all MIDI markers. As well, just to follow canonical rule: dealing with a pointer (_location in Session::state) check it for NULL prior to any operation (s), accessing the pointer.
[Review required] YPozdnyakov, GZharun, Paul Davis
2015-06-29 14:18:10 -04:00
Paul Davis
2a1d0e20f0 emit SessionSaveUnderWay signal during template save 2015-06-29 14:18:10 -04:00
Paul Davis
fba9bff5b0 improved error handling and checking for Session::save_template() 2015-06-29 14:18:10 -04:00
Paul Davis
ec991ae047 expand comment 2015-06-02 12:27:39 -04:00
Paul Davis
59028b6c80 close all source files before renaming interchange tree in Session::rename() 2015-06-02 12:09:04 -04:00
Paul Davis
0412060b44 tweaks and improvements to Save-As
Always copy MIDI files, they are small and they get rewritten for lots of reasons, which can cause confusion
if the user elected to NOT "copy media" since the file ends up existing in both the new and old (but in use)
session.

Avoid copying analysis files on Windows, where for now the files contain illegal colon characters
2015-05-28 19:26:21 -04:00
Paul Davis
7f902ae1b6 some more information output to log during save-as, for debugging 2015-05-27 10:57:40 -04:00
Paul Davis
e73b4e6f55 fix cleanup (code is self-evident). From Yevgeny @ waves 2015-05-14 07:01:01 -04:00
Paul Davis
f082e45298 extend save-as API to allow for new empty sessions based on current 2015-05-07 22:35:35 -04:00