Problem:
Applying macro to project always sets first track as focus.
The problem was introduced by commit 06cddda, which accidentally declared cleanup2 in the wrong scope.
This meant that ProjectHistory::RollBackState() was always called, which eventually causes TrackPanel::OnUndoReset() to be called, which sets the first track to be the focus.
Fix:
Declare cleanup2 in the correct scope.
Preliminary tests show it to be a bit faster than the default
4KB. For a simple example, generate 2-hour chirp dropped from
11 seconds to 7 seconds. Not a lot, but...
* Define SampleBlockFactory replacing static members of SampleBlock...
... This will become an abstract base class
* Sequence and WaveTrack only store SampleBlockFactory not Project...
... This adds a dependency from Track to SampleBlock which temporarily enlarges
a cycle in the dependency graph
* Register a global factory of SampleBlockFactory...
... so that later we can make an abstract SampleBlockFactory, separate from the
concrete implementation in terms of sqlite, and inject the dependency at startup
avoiding static dependency
* New concrete classes SqliteSampleBlock, SqliteSampleBlockFactory...
... separated from abstract base classes and put into a new source file,
breaking dependency cycles, and perhaps allowing easy reimplementation for other
databases in the future.
Note that the new file is a header-less plug-in! Nothing depends on it. It
uses static initialization to influence the program's behavior.
* Compile dependency on sqlite3.h limited to just two .cpp files...
... these are ProjectFileIO.cpp and SqliteSampleBlock.cpp.
But there is still close cooperation of ProjectFileIO and SqliteSampleBlock.cpp.
This suggests that these files ought to be merged, and perhaps ProjectFileIO
also needs to be split into abstract and concrete classes, and there should be
another injection of a factory function at startup. That will make the choice
of database implementation even more modular.
Also removed one unnecessary inclusion of ProjectFileIO.h
* Fix crashes cutting and pasting cross-project...
... in case the source project is closed before the paste happens.
This caused destruction of the ProjectFileIO object and a closing of the sqlite
database with the sample data in it, leaving dangling references in the
SqliteSampleBlock objects.
The fix is that the SqliteSampleBlockFactory object holds a shared_ptr to the
ProjectFileIO object. So the clipboard may own WaveTracks, which own WaveClips,
which own Sequences, which own SqliteSampleBlockFactories, which keep the
ProjectFileIO and the database connection alive until the clipboard is cleared.
The consequence of the fix is delayed closing of the entire database associated
with the source project.
If the source project is reopened before the clipboard is cleared, will there
be correct concurrent access to the same persistent store? My preliminary
trials suggest this is so (reopening a saved project, deleting from it, closing
it again -- the clipboard contents are still unchanged and available).
* Eliminate unneeded back-pointer to project from non-wave Tracks...
... now that DirManager is gone
* Remove unused declarations
* SampleData::mProject was not used
* Correct ProjectFileIO::GetLibraryError
* Remove unnecessary #include directives
These mainly address the bugs that Steve reported and a couple
more I found along the way.
Corrected ProjectFileIO::GetMinMaxRMS() - It was still using the
original method of keep all block data in memory. I missed it
when I redid everything. Fixes his Amplify crash.
Temporary filenames should no longer be shown to the user.
Resaves will no longer present a Save As dialog.
Cleaned up duplicate pathname handling in ProjectFileIO.
Returned proper errors when loading a project
- SQLite added to libs in readme.txt
- User message 'aup not associated' updated to 'aup3'
- Typos strind -> string, in -> is
- No translation of debug message
!!! THERE WILL NO DOUBT BE BUGS !!!
This is a big one and there's still several things to
complete. Just want to get this in the wild to start
receiving feedback.
One big thing right now is that it will NOT load pre-aup3
files. An importer is on the way for that.
This removes all of the OnDemand code embedded throughout
the main codebase. Individual files related specifically
to OD have been left in place, but removed from the build.
If the grid is empty or does not have a selected cell, the current
row and column must still maintain these class invariants:
-1 <= current_row < rows
-1 <= current_column < columns
if either current_row or current_column is -1, then the other
shall also be -1
wxGrid uses wxGridNoCellCoords to test for current_row == -1 &&
current_column == -1. We treat the case where only one
of the coordinates is -1 as if both are -1.
The conversion from Python2 to Python3 had some issues.
- Characters outside the ASCII range got converted to \xe2\x80 numbers
- Single quotes got escaped.
- The entire doc was enclosed in quotes.
These changes address those, and also remove html comments.
Problem: Newly added track which is set as the focus can be only partially visible or invisible.
If TrackPanel::OnEnsureVisible is called after a new track has been added, then in that function the line:
mListener->TP_ScrollUpDown(height);
can lead to incorrect results, as the vertical scrollbars have not yet been updated to take into account the additional track.
Fix:
Update the scrollbars in TrackPanel::OnTrackListResizing().