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

222 Commits

Author SHA1 Message Date
Paul Licameli
f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli
f6adeed47b Remove some unnecessary #include directives 2019-05-15 14:14:18 -04:00
James Crook
f4aa75f4fc Make TypeToCreateLabel off by default.
Following a lengthen discussion on the quality list, consensus is this option
should always have been off by default.  The main argument for not changing
it now was that 'on' is what users have come to expect.
2019-04-12 17:33:31 +01:00
James Crook
9ba023d607 Bug 1965 - Enh: Track name overlay display for all track types
OK now that we have translucent name background.  Includes logic to move first label down to avoid the name (if it is shown).
2019-04-06 22:26:59 +01:00
Paul Licameli
4018b191b4 Remove Get/Set functions for selection bounds from AudacityProject 2019-03-27 13:32:53 -04:00
Paul Licameli
9569cfddf5 More comments for including Audacity.h; fix one #ifdef in AudioIO.cpp 2019-03-23 14:09:05 -04:00
Paul Licameli
0dd0a5cb5a Remove <wx/menu.h> from CommandManager.h, moving inline functions out 2019-03-23 10:56:43 -04:00
Paul Licameli
26f1aea2d4 Fix inconsistent config key path 2019-03-23 02:44:08 -04:00
Paul Licameli
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... except Audacity.h; and in no others.

Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.

This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.

Also move inclusions of Experimental.h earlier.

Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
15777834e0 Remove calls to TrackPanel::FindTrackRect for finding control area 2019-03-17 15:23:51 -04:00
Paul Licameli
a0aa69a248 All tracks allocated with make_shared, no more make_unique...
... so that we can use Track::SharedPointer without undefined behavior even on
tracks that don't yet belong to any TrackList.

Also fix the return type of function template TrackList::Add and remove some
casts.
2019-03-16 13:11:33 -04:00
Paul Licameli
4dbe88df26 Remove rectangle calculation that became unused at cb3e5e6 2019-03-16 07:59:40 -04:00
Paul Licameli
50074f2cfe Replace comparisons against "" with empty() 2019-03-14 13:23:41 -04:00
Paul Licameli
795b6a2e42 More std:: style for wxString and wxArrayString...
... Replacing:

Insert => insert
RemoveAt => erase
Remove => erase
IsSameAs => operator == or operator !=
   (but only when second argument was true or default)
2019-03-10 14:45:12 -04:00
Paul Licameli
c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -04:00
James Crook
bd2547828e Bug 2044 - Mac: no context menu when right clicking in label after copying label text to another app 2018-12-03 16:17:17 +00:00
James Crook
5e1ec8dbe5 Bug 2028 - Mac: Audacity crashes when right clicking in label after copying label text to another app
With the steps in bug 2028, FindFocus() could return a nullPtr - which is now safe.
No right context menu will appear though.

This looks like a bug in wxWidgets.

We could take more/different steps to find the parent for the LabelTrack, if we really want to do that.  However, this change is enough to close the bug.
2018-12-02 18:54:35 +00:00
Steve Daulton
d26b17eea5 bug 2011 - dlg.Raise() only required for GTK 2018-11-26 21:06:45 +00:00
Steve Daulton
7c0d05fc18 Fix for bug 2011 - Label Editor
Linux: Audacity may stop responding to GUI after opening Label Editor
2018-11-20 19:52:31 +00:00
Paul Licameli
2d650fa0e8 Rename LabelTrack::IsSelected so it doesn't shadow Track::IsSelected 2018-11-08 11:08:19 -05:00
Paul Licameli
4ebfbd9c50 Split class TrackArtist from namespace TrackArt...
... The first is just extended drawing context info, and the second has
functions that retrieve TrackArtist from TrackPanelDrawingContext as needed.
2018-11-05 09:16:50 -05:00
Paul Licameli
99106e3ed3 Carry more information in TrackPanelDrawingContext; fewer arguments 2018-11-05 09:12:45 -05:00
Paul Licameli
c866ed4bf7 Reimplement the logic for drawing label track selection background 2018-11-05 07:48:36 -05:00
Paul Licameli
8ca9edc2a4 Move some label editing functions into class LabelTrack 2018-10-24 11:02:33 -04:00
David Bailes
5494185a88 Dialog for the name of a label: positioning fixes
Problems fixed:
1. When adding a label at playback position, the position of the dialog was calculated using the position of the edit cursor
2. When adding a label at selection, the dialog could be to the left of the Audacity Window, and indeed offscreen.
2018-10-24 11:07:17 +01:00
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