1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-26 17:18:41 +02:00

145 Commits

Author SHA1 Message Date
Paul Licameli
ce9f2e2538 Include Menus.h directly, only where needed, not via Project.h 2018-10-16 16:45:26 -04:00
James Crook
657159d542 Fix C4189 and C4100 Warnings
C4189 is 'Local variable initialised but not used'
C4100 is 'Unreferenced parameter'

Fixed some other warnings, e.g. about empty if, too.
2018-10-10 19:46:24 +01:00
Paul Licameli
968d63d5fd Rewrite many iterations over tracks and channels in various places 2018-10-01 13:35:51 -04:00
Paul Licameli
51842fc78b Use TypeSwitch and track_cast 2018-10-01 10:58:47 -04:00
Paul Licameli
9481587fa8 Move menu handling functions out of class AudacityProject 2018-09-29 12:10:27 -04:00
James Crook
9eab948fb1 Bug 1905 - Labels with more than 260 characters fail to load (with no warning) 2018-08-07 11:46:21 +01:00
David Bailes
a13e7191c4 Add an option to use a dialog to enter the name of a new label
Motivation:
1. The text boxes in the label track are not fully accessible for users of screen readers, and I don't think that they can be made to be fully accessible using the accessibility API used by wxWidgets. When such an edit box becomes the focus, this is not announced, and for NVDA users typed characters are not echoed.

2. Provides a work around for bugs 1778 (cannot type diacritics into text label), and 1804 (Windows: Labels do not accept IME (Chinese/Japanese) input).

Fix: Provide an option for a dialog for entering the name. The text box in the dialog is accessible for screen readers. On windows the text box receives wm_keydown and wm_char messages and so is a work around for bug 1804. Being a standard text box, it will presumably be a work around for bug 1778.

1. There is a new option in track behaviors: "Use dialog for the name of new label", which is off by default.

2. When using the commands "Add label at selection" and "Add label at playback position", when the dialog closes, focus is returned to the track which was the focus before the dialog opened. I think this is more convenient for users of screen readers.
2018-05-11 10:23:48 +01:00
James Crook
21e330d0e7 Bug 1551 - Active transport inhibits the operation of "Type to create a label" 2018-03-17 19:17:53 +00:00
James Crook
2cb76e0820 Bug 1852 - Ctrl+M does not open label for editing
- Now when recording, the recording track has a number >=0 and so the modified
test will set the cursor for editing the label.
- Bug 305 is still fixed, because Nyquist will pass -2 for the restore track.
2018-03-16 20:14:33 +00:00
andheh
dd41df237c fixed an unused variable warning in src/LabelTrack.cpp 2018-03-06 21:29:50 +00:00
andheh
ade7854c1d fixed "statement has no effect" warnings 2018-03-06 21:29:31 +00:00
Paul Licameli
7fd78183d2 Remove needless uses of wxString::c_str() in wxString::Format...
... and similar wx "variadics," which all treat wxString smartly enough that
you don't need this.

Don't need c_str either to convert wxString to const wxChar * because
wxString has a conversion operator that does the same.
2018-01-01 20:34:33 -05:00
Paul Licameli
ccb4bbac33 Translate "Message" as default title of message box...
... This required a sweeping change of all calls to wxMessageBox!  But it seems
safe to me, despite the great number of touched files.
2018-01-01 17:50:02 -05:00
James Crook
63de7f0884 Bug 305 - Analysis effects produce false indication that a label is open for editing
This was true of any Nyquist or VAMP effect that created labels.
2017-12-17 21:18:07 +00:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Antonio Ospite
d70eb74c4c Make exported label tracks locale-independent
Currently, when Audacity exports labels tracks numbers are formatted
with the "%f" specifier, which relies on the current user locale to pick
up the decimal separator.

This means that the numbers indicating the start and the end of the
labeled interval could end up using a comma as a decimal separator.

This makes the exported file less portable, especially in the case of
parsing the exported file with an external tool.

Audacity is already able to _import_ labels tracks independently of the
locale because it uses Internat::CompatibleToDouble(), so do something
symmetric at _export_ time, using Internat::ToString() to make the
exported data locale-independent (i.e. always using a dot as the decimal
separator).

Proposed in https://sourceforge.net/p/audacity/mailman/message/35534945/

NOTE:

When converting numbers to strings FLT_DIG is passed as the
digitsAfterDecimalPoint argument of Internat::ToString(), this is in
order to preserve the look and the alignment of the previous "%f" format
specifier; without that Internat::ToString() would strip trailing zeros.

Audacity requires C++11, this ensures that FLT_DIG is defined.
2017-11-29 11:30:48 -05:00
James Crook
c28be778e2 Linty fixes
This commit fixes a number of warnings shown in compilation with MSVC.  No behavioral changes intended.  I did not fix signed/unsigned warnings.
2017-11-07 14:23:30 +00:00
James Crook
68897d8932 Some cppcheck fixes by David Binderman 2017-11-04 17:47:39 +00:00
Paul Licameli
4a28645869 Fix bug found by Bill Wharrie in hightlighting of labels 2017-07-28 22:54:36 -04:00
Paul Licameli
050824f467 Remove some unnecessary #includes 2017-07-12 14:15:16 -04:00
Paul Licameli
a4d53b43da Highlighting of label text boxes 2017-07-11 13:57:58 -04:00
Paul Licameli
ada4b6307d Pass more context information into drawing routines 2017-07-09 12:34:27 -04:00
Paul Licameli
b3d62e2ab6 Simplify by removing class HitTestResult...
... Because all hit tests returned all fields blank, or else, returned a
UIHandle object whose Preview method gives the rest of the information; so
the other fields were redundant.
2017-07-09 07:57:34 -04:00
Paul Licameli
f5b0afc2fc Rename TrackPanel::HandleCursor as HandleMotion...
Call HitTest in just one place

Can now preserve repeatedly hit UIHandle objects during pre-click motion

Fields of HitTestResult besides the handle pointer are now unused

The need to repaint a track during mouse movement can be indicated when
constructing a UIHandle or when updating it for move; HitPreview no longer
does this

And the last allows simplifications of LabelTrack glyph highlighting

Also move the temporary state for label glyph dragging out of LabelTrack
2017-07-09 07:56:47 -04:00
Paul Licameli
efdb9889b1 TrackPanel no longer implements label keystrokes, drags, text selection...
... also implemented ESC key for those drags

... temporarily loses the special CTRL click handling
2017-06-15 08:54:58 -04:00
Paul Licameli
251976d93d TrackPanel no longer implements the time shift tool...
... also implement ESC key for it
2017-06-15 08:21:01 -04:00
James Crook
0caad3efe6 Bug 502 - Labels may disappear if partly before time zero 2017-05-15 11:07:44 +01:00
Paul Licameli
da28a45d67 User visible message when there are errors importing labels 2017-04-03 23:22:07 -04:00
Paul Licameli
e1473dfe76 void return, not boolean success, from some Track virtual functions...
... The return codes were mostly ignored anyway, and exceptions will be thrown
instead.

It seems there was also confusion whether the return values of Track::Paste
and Track::SyncLockAdjust were to indicate success or indicate whether there
was any change.  No matter now.
2017-03-31 18:26:52 -04:00
Paul Licameli
6b84dc1c1d Factory methods will return non-NULL or throw 2017-03-31 18:14:29 -04:00
Paul Licameli
b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli
25619fb46e Don't create placeholder clips in Duplicate command ...
... when there is no clip at the right edge of the selection.
2017-03-17 17:52:39 -04:00
Paul Licameli
0be66296cd Sort labels after warping time, just in case...
... Time warping functions should be nondecreasing, but let's not assume so.
If not, the insertion sort just takes linear time to check that there are no
disorders.
2017-03-17 17:52:36 -04:00
Paul Licameli
81285ee0c1 More const and override 2017-03-17 17:52:20 -04:00
David Bailes
edb99485da Adjustment of fix for bug 1442
Issue was that an empty selection at time zero was included in the tab cycle.

This has been removed.
2016-10-27 10:21:58 +01:00
David Bailes
a79596fb4e Add a setting for whether labels can be created by typing
Added a setting for whether labels can be created by typing in a label track.
The setting can be changed in either the Tracks menu, or the Tracks category in Preferences.
By default the setting is set to on.
2016-10-26 13:11:07 +01:00
David Bailes
cf547077d5 Fix for bug# 1535: some text can be selected when tabbing to label
Problem was that mInitialCursorPos was not being set when tabbing to a label.
2016-10-25 11:43:08 +01:00
David Bailes
ff9763f984 Add two commands to move the cursor/selection to next/prev label
The two commands are "selection to next label" and "selection to previous label".
They have default shortcuts alt+right and alt+left.

A label track does not have to be the focus. If there is a single label track in the project, that it used. If there is more than one label track, then the first label track, if any, starting at the focused track is used.

If the commands are used during playback of the project, playback continues from the new cursor/selection.

The commands provide feedback to screen readers: the name of the label, and position in the form of "i of n".
2016-10-24 14:24:20 +01:00
Paul Licameli
d783762737 Remove unnecessary std::move in return statements...
... and comment where it is necessary.
2016-09-15 07:39:46 -04:00
James Crook
b44ad7cd71 More unused parameters. 2016-09-11 20:52:04 +01:00
Paul Licameli
46f38708ed Dir manager uses std::shared_ptr 2016-08-13 12:23:05 -04:00
Paul Licameli
6e4e710d3b Remove seeming naked new and deletes in comments and uncompiled code 2016-08-10 11:05:51 -04:00
Paul Licameli
13e056de43 More uses of safenew 2016-08-08 10:07:37 -04:00
Paul Licameli
9b7e66b30f Bug1442 again: Fix TAB cycle through labels, special case...
... of a point label exactly at zero, with or without other labels.
2016-07-13 14:17:14 -04:00
Paul Licameli
f1799521aa Bug1349 again: Fix export and import of no-name labels 2016-07-12 22:16:15 -04:00
Paul Licameli
26676652d7 Bug1443 again: Mac label shift-click should differ, per David Bailes 2016-07-12 12:13:08 -04:00
Paul Licameli
cb3e5e6d4f Bug1443: Various odd behavior of label text editor, fixed...
... And label track selection code is simpler to understand, without delayed
side effects happening during drawing.

Left and right arrow keys collapse text range selection correctly
Shift-click adjusts the end of selection nearest the pick
Right (and middle) click and drag do not affect the selection
Copying empty selection has no effect on the clipboard
Left-drag behaves independently of previous selection state
2016-07-11 19:01:28 -04:00
Paul Licameli
3b7e61fc6e Export and import the frequency information in labels 2016-07-10 20:02:14 -04:00
Paul Licameli
ac2730170d Import and Export are methods of LabelStruct 2016-07-10 20:02:14 -04:00
Paul Licameli
519f4d6cf6 Simplify the label import routine 2016-07-10 20:02:14 -04:00