1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-20 06:10:06 +02:00

277 Commits

Author SHA1 Message Date
Paul Licameli
ce5a67a9e9 Iterate over the pending tracks for drawing 2018-01-14 19:04:03 -05:00
Paul Licameli
4ccb695c61 Disable Undo and Redo while there are pending changes in TrackList...
... But perhaps we are developing the means to relax even this ban safely.

For instance, why not undo a mistaken AddLabelPlaying command (Ctrl+M) without
stopping the recording?
2018-01-14 19:03:59 -05:00
Paul Licameli
0265b8792d More stl idiom for TrackList and its iterators 2018-01-14 16:58:19 -05:00
Paul Licameli
c975de8c5e More use of shared_ptr to Track, for safety...
... This even makes it possible to remove the prohibition of undo and redo
during transport, not that we want to though.  Playback and recording will
continue, using track objects that might not be in the current project.
2018-01-10 20:05:11 -05:00
James Crook
0cc9c6bc3b Zoom Toggle
Added preferences for Zoom-Toggle and put into menus.
New helper functions for determining zoom scaling.

Optional EXPERIMENTAL_ZOOM_TOGGLE_BUTTON added, and Light theme updated.
Not enabled for 2.2.2.
2018-01-07 17:14:33 +00:00
James Crook
2108515938 Bug 63 - Analysis effects that create labels should give focus to label Track
If a generator, effect or analyser has created a new track, scroll to the bottom of the track list.
Acheived using new function, VerticalScroll()
2017-12-17 14:59:59 +00:00
Paul Licameli
95560ad510 Bug1676, more: don't bother caching the first visible track...
... because the sequence of update of the cache and the use of it were wrong
on Linux, resulting in wrong display when dragging tracks.  Finding the
first visible track is too cheap to justify this memoizing of it.

Commit 8eb64f5f71d19a4c634cb8312fd1fa93ac75f17f was not sufficient to fix
the bug, but I think remains necessary.

It feels good to throw away this needless complication.
2017-08-07 18:51:06 -04:00
Paul Licameli
503f3548a1 Bug1432 partial, keep correct focus in more cases, not all...
Works by using the newer and better logic of ToolManager for remembering which
window to focus.

It seems, at least on Windows, that when the toolbar with the focused control
is docked after the end of a docking (of itself or another bar), then focus
remains.

If the bar with the focus is undocked and another bar docks or undocks, focus
is still lost.
2017-07-23 14:57:19 -04:00
Paul Licameli
f0de38dec1 Scanned for bad naked new; found none; changed comments, used safenew 2017-07-23 09:35:01 -04:00
Paul Licameli
cfeb7bced1 Zoom to fit after any import (labels, audio, or midi) 2017-07-19 22:10:22 -04:00
Paul Licameli
8bf3791edf TrackList constructed only by factory function, to avoid more trouble 2017-07-14 21:55:32 -04:00
Paul Licameli
2c1a16f593 Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)

This also fixes bug 1677 by other means and avoids similar problems.

A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.

And the objects will surely be destroyed after drag-release, or ESC key.

For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-09 07:23:28 -04:00
Paul Licameli
2806b509e2 Fix crashes in repainting, and update first visible track correctly 2017-06-26 15:20:35 -04:00
Paul Licameli
750fc34fac Clarify what the TrackList events are for...
Also fixes this bug:

Vertical rulers did not narrow as needed after deletion of the lowest track.
2017-06-25 03:00:28 -04:00
James Crook
86901a00a1 Fix MixerBoard Theming
Fixed so that updates to theme are applied immediately.  Previously theming only worked properly after a restart with the new theme.  Paul found that you could create a Chimera MixerBoard with a track in each of the four different themes.

I chose to completely recreate the MixerBoard on a prefs update, rather than the more fiddly detail of retheming each component of it.
2017-06-22 11:53:49 +01:00
Paul Licameli
8ef5f696d8 Define BackgoundCell, move some things into it 2017-06-15 08:21:41 -04:00
Paul Licameli
c3f5fea5fc TrackPanel still draws Miminize and Close, but no longer handles...
clicks on them...

... also implemented ESC key for those drags
2017-06-15 08:21:36 -04:00
Paul Licameli
d834bcdbd1 Move some command handlers for selection and focus out of TrackPanel 2017-06-11 11:03:28 -04:00
Paul Licameli
a9f7cb26e7 Move selection state into AudacityProject, out of TrackPanel 2017-06-11 10:40:55 -04:00
James Crook
adc7312954 Auto-Select off by default.
I've implemented three states for what to do if no selection:
0 - Grey out (no longer used)
1 - Auto-select
2 - Give the warning message and try again.
2017-06-09 19:40:28 +01:00
David Bailes
b2d8f36969 Fix for bugs in keyboard clip commands due to rounding errors
When When two clips are immediately next to each other, the GetEndTime() of the first clip and the GetStartTime() of the second clip may not be exactly equal due to rounding errors. The existing code assumed they were equal, and this lead to the wrong clip boundaries or clips being found.

There are a number of ways of fixing this which could be explored. The current solution involves changing only the code for the keyboard interaction with clips.

The fix:
1. The test used for two clips being immediately next to each other is that GetEndSample() on the first clip is equal to to GetStartSample() on the second clip.
2. When searching for the start/end times of clips, the cases where GetEndTime() and GetStartTime() are not equal are taken into account. This is done in the two functions AudacityProject::AdjustForFindingStartTimes and AudacityProject::AdjustForFindingEndTimes.
2017-05-10 09:24:25 +01:00
James Crook
fefc856901 Update slider in tracks on theme change. 2017-04-05 20:16:12 +01:00
Paul Licameli
0d7250578d Other methods of WaveTrack return void, will throw on failure instead 2017-03-31 18:26:52 -04:00
Paul Licameli
1552ff188f When opening a file into a new project, delete the project on failure 2017-03-21 14:11:28 -04:00
Paul Licameli
54c1b0c955 Exception safety in: opening and saving of projects 2017-03-21 14:11:25 -04:00
Paul Licameli
82dd7545c9 Reviewed uses of release(); prefer Destroy_ptr to hold window objects 2017-03-21 14:11:18 -04:00
James Crook
5c1f4d24b5 Menu rearrangement merged from DarkAudacity 2017-03-19 16:43:51 +00:00
Paul Licameli
5036583549 Fewer inclusions of AudacityApp.h 2017-03-17 17:52:24 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
Paul Licameli
93c0b5a92d Add button to History dialog to clear the clipboard & space calc 2016-11-07 11:25:27 -05:00
Mark Young
a4ae301a5b Bug 1402, rewrite logic for the display of hours and minutes and ensure we use one routine for this. 2016-10-02 22:56:04 +01:00
Paul Licameli
88611a4530 Fewer C-style pointer casts of tracks; comments justify static_cast 2016-09-15 12:12:43 -04:00
James Crook
83e355dc65 Bug 322 - (Residual) Project numbers renumbered after closing a project.
Now the project number is the order of creation.  Once assigned, project numbers do not change.
2016-09-10 16:59:23 +01:00
James Crook
bf06b0485f Bug 1507 - Project may be overwritten by new project without warning 2016-09-08 17:51:00 +01:00
James Crook
9cb7e23e05 Bug 322 - "Save Changes?" dialog does not indicate which project is being closed
When there is ambiguity about which project is being saved, the project title bars now change to be more informative.
2016-09-05 19:20:08 +01:00
Paul Licameli
5761972dfa BHug1488: Don't crash exiting from command-line benchmark test...
Problem was that cfd7648fce2388ec8ae35b38004f2ae111c484af fixed a memory leak
but created a dangling pointer bug, which does not happen during usual run
of Audacity because AudacityProject::OnCloseWindow is reached then before
destroying AudacityProject.

Fixed it by using a std::shared_pointer for the TrackList that both
AudacityProject and TrackPanel must use.
2016-08-20 13:58:56 -04:00
James Crook
05fe684114 Ungrey more actions, if paused.
This introduces a new variable, mStopIfWasPaused (default true).  Actions which require AudioIONotBusyFlag will now stop the audio, if audio was busy but paused and attempt to continue.

We could perhaps make mStopAudioIfWasPaused into a preference, but I don't think we need to keep even the option of the old behaviour.
2016-08-20 18:52:30 +01:00
Paul Licameli
5752dbab02 shared_ptr manages AudacityProject objects, so weak_ptr may be used 2016-08-15 12:43:50 -04:00
Paul Licameli
fe5ab9a462 Remove the naked new in allocation of AudacityProject 2016-08-14 15:24:59 -04:00
Paul Licameli
46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -04:00
Paul Licameli
a52f7f8410 new -> NEW in comments, so text search for naked new excludes them 2016-08-08 10:07:37 -04:00
Paul Licameli
27527ebf5c One less indirection for arrays of capture and playback tracks 2016-08-08 07:51:26 -04:00
Paul Licameli
186679b3a6 RAII for locking the all-projects mutex 2016-08-08 07:40:16 -04:00
Paul Licameli
cfd7648fce Remove some naked new amd delete in: Project 2016-08-08 07:40:15 -04:00
Paul Licameli
c9422aaea1 Bug1438: Fix horizontal scrollbar, while still fixing Bug 1197 2016-07-08 02:16:00 -04:00
Paul Licameli
4f1c8a3f2f Bug1438: Fix horizontal scrollbar, while still fixing Bug 1197 2016-07-08 02:14:47 -04:00
Paul Licameli
625584d99a Bug1431: Undocked toolbars should hide when project window minimizes 2016-06-29 15:13:38 -04:00
Paul Licameli
ae14cb0dbc Allow tabbing to the button on the time ruler...
... by making the ruler and the upper tool dock part of one panel
2016-06-25 16:08:38 -04:00
Paul Licameli
1b1b0ba5e7 Remove forward declaration of nonexistent type 2016-06-12 08:24:27 -04:00
Paul Licameli
a610070038 May always scroll before zero during transport when head is pinned...
... regardless of preferences, but if the Tracks preference is not checked,
don't stay scrolled left of zero after stopping.
2016-06-08 18:33:02 -04:00