Skip to content

Commit 406b23c

Browse files
committed
More uses of AUDACITY_DLL_API...
... in many places where the function call will later need to be between modules (or libraries, or the executable) and the annotation will be a necessity to keep the linkage working on Windows. That's all that this sweeping commit does.
1 parent fbfccf1 commit 406b23c

File tree

151 files changed

+429
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+429
-311
lines changed

images/Cursors.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@
3030
#endif
3131
#include "Cursors32/SubViewsCursor.xpm"
3232

33+
AUDACITY_DLL_API
3334
std::unique_ptr<wxCursor> MakeCursor(int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY);

include/audacity/PluginInterface.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class ModuleInterface;
5252

5353

54-
class PluginManagerInterface /* not final */
54+
class AUDACITY_DLL_API PluginManagerInterface /* not final */
5555
{
5656
public:
5757

include/audacity/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ using CommandIDs = std::vector<CommandID>;
287287
// The msgid should be used only in unusual cases and the translation more often
288288
//
289289
// Implicit conversions to and from wxString are intentionally disabled
290-
class TranslatableString {
290+
class AUDACITY_DLL_API TranslatableString {
291291
enum class Request;
292292
template< size_t N > struct PluralTemp;
293293

src/AColor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class wxDC;
2222
class wxGraphicsContext;
2323
class wxRect;
2424

25-
class AColor {
25+
class AUDACITY_DLL_API AColor {
2626
public:
2727

2828
enum ColorGradientChoice {

src/AboutDialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct AboutDialogCreditItem {
2929

3030
using AboutDialogCreditItemsList = std::vector<AboutDialogCreditItem>;
3131

32-
class AboutDialog final : public wxDialogWrapper {
32+
class AUDACITY_DLL_API AboutDialog final : public wxDialogWrapper {
3333
DECLARE_DYNAMIC_CLASS(AboutDialog)
3434

3535
public:

src/AudacityException.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class AudacityException /* not final */
4545
//! Abstract AudacityException subclass displays a message, specified by further subclass
4646
/*! At most one message will be displayed for each pass through the main event idle loop,
4747
no matter how many exceptions were caught. */
48-
class MessageBoxException /* not final */ : public AudacityException
48+
class AUDACITY_DLL_API MessageBoxException /* not final */
49+
: public AudacityException
4950
{
5051
//! Privatize the inherited function
5152
using AudacityException::DelayedHandlerAction;
@@ -74,7 +75,8 @@ class MessageBoxException /* not final */ : public AudacityException
7475
};
7576

7677
//! A MessageBoxException that shows a given, unvarying string.
77-
class SimpleMessageBoxException /* not final */ : public MessageBoxException
78+
class AUDACITY_DLL_API SimpleMessageBoxException /* not final */
79+
: public MessageBoxException
7880
{
7981
public:
8082
explicit SimpleMessageBoxException(

src/AudacityLogger.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
class wxFrame;
2727
class wxTextCtrl;
2828

29-
class AudacityLogger final : public wxEvtHandler,
29+
class AUDACITY_DLL_API AudacityLogger final : public wxEvtHandler,
3030
public wxLog,
3131
public PrefsListener
3232
{

src/Benchmark.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
class wxWindow;
1515
class AudacityProject;
1616

17+
AUDACITY_DLL_API
1718
void RunBenchmark( wxWindow *parent, AudacityProject &project );
1819

1920
#endif // define __AUDACITY_BENCHMARK__

src/ClientData.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ template< typename Object > using BarePtr = Object*;
4444
*/
4545
template<
4646
template<typename> class Owner = UniquePtr
47-
> struct Cloneable
47+
> struct AUDACITY_DLL_API Cloneable
4848
{
4949
using Base = Cloneable;
5050
using PointerType = Owner< Base >;

src/Clipboard.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TrackList;
2323
wxDECLARE_EXPORTED_EVENT( AUDACITY_DLL_API,
2424
EVT_CLIPBOARD_CHANGE, wxCommandEvent );
2525

26-
class Clipboard final
26+
class AUDACITY_DLL_API Clipboard final
2727
: public wxEvtHandler
2828
{
2929
public:

src/CommonCommandFlags.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@ Paul Licameli split from Menus.cpp
1515

1616
#include "commands/CommandFlag.h"
1717

18+
AUDACITY_DLL_API
1819
bool EditableTracksSelectedPred( const AudacityProject &project );
20+
21+
AUDACITY_DLL_API
1922
bool AudioIOBusyPred( const AudacityProject &project );
23+
24+
AUDACITY_DLL_API
2025
bool TimeSelectedPred( const AudacityProject &project );
21-
extern const CommandFlagOptions &cutCopyOptions();
26+
27+
AUDACITY_DLL_API
28+
const CommandFlagOptions &cutCopyOptions();
2229

2330
extern AUDACITY_DLL_API const ReservedCommandFlag
2431
&AudioIONotBusyFlag(),

src/CrashReport.h

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
namespace CrashReport
2828
{
29+
AUDACITY_DLL_API
2930
void Generate(wxDebugReport::Context ctx);
3031
}
3132
#endif

src/DBConnection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class DBConnection
131131
Commit() must not be called again after one successful call.
132132
An exception is thrown from the constructor if the transaction cannot open.
133133
*/
134-
class TransactionScope
134+
class AUDACITY_DLL_API TransactionScope
135135
{
136136
public:
137137
TransactionScope(DBConnection &connection, const char *name);

src/DeviceManager.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#ifndef __AUDACITY_DEVICEMANAGER__
1919
#define __AUDACITY_DEVICEMANAGER__
2020

21-
22-
2321
#include <chrono>
2422
#include <vector>
2523

@@ -45,9 +43,10 @@ typedef struct DeviceSourceMap {
4543
wxString hostString;
4644
} DeviceSourceMap;
4745

46+
AUDACITY_DLL_API
4847
wxString MakeDeviceSourceString(const DeviceSourceMap *map);
4948

50-
class DeviceManager final
49+
class AUDACITY_DLL_API DeviceManager final
5150
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
5251
#if defined(HAVE_DEVICE_CHANGE)
5352
: public DeviceChangeHandler

src/Dither.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Dither
2525
static DitherType FastDitherChoice();
2626
static DitherType BestDitherChoice();
2727

28-
static EnumSetting< DitherType > FastSetting, BestSetting;
28+
static AUDACITY_DLL_API EnumSetting< DitherType > FastSetting, BestSetting;
2929

3030
/// Default constructor
3131
Dither();

src/Envelope.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class EnvPoint final : public XMLTagHandler {
6868
typedef std::vector<EnvPoint> EnvArray;
6969
struct TrackPanelDrawingContext;
7070

71-
class Envelope /* not final */ : public XMLTagHandler {
71+
class AUDACITY_DLL_API Envelope /* not final */ : public XMLTagHandler {
7272
public:
7373
// Envelope can define a piecewise linear function, or piecewise exponential.
7474
Envelope(bool exponential, double minValue, double maxValue, double defaultValue);

src/EnvelopeEditor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ZoomInfo;
1919

2020
// A class that holds state for the duration of dragging
2121
// of an envelope point.
22-
class EnvelopeEditor
22+
class AUDACITY_DLL_API EnvelopeEditor
2323
{
2424
public:
2525
static void DrawPoints(

src/FFT.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void PowerSpectrum(size_t NumSamples, const float *In, float *Out);
7272
* NumSamples must be a power of two.
7373
*/
7474

75+
AUDACITY_DLL_API
7576
void RealFFT(size_t NumSamples,
7677
const float *RealIn, float *RealOut, float *ImagOut);
7778

@@ -80,6 +81,7 @@ void RealFFT(size_t NumSamples,
8081
* so the output is purely real. NumSamples must be a power of
8182
* two.
8283
*/
84+
AUDACITY_DLL_API
8385
void InverseRealFFT(size_t NumSamples,
8486
const float *RealIn, const float *ImagIn, float *RealOut);
8587

@@ -89,6 +91,7 @@ void InverseRealFFT(size_t NumSamples,
8991
* inverse transform as well.
9092
*/
9193

94+
AUDACITY_DLL_API
9295
void FFT(size_t NumSamples,
9396
bool InverseTransform,
9497
const float *RealIn, const float *ImagIn, float *RealOut, float *ImagOut);
@@ -117,6 +120,7 @@ enum eWindowFunctions
117120
eWinFuncCount
118121
};
119122

123+
AUDACITY_DLL_API
120124
void WindowFunc(int whichFunction, size_t NumSamples, float *data);
121125

122126
/*
@@ -125,6 +129,7 @@ void WindowFunc(int whichFunction, size_t NumSamples, float *data);
125129
* otherwise about (NumSamples - 1) / 2
126130
* All functions have 0 in data[0] except Rectangular, Hamming and Gaussians
127131
*/
132+
AUDACITY_DLL_API
128133
void NewWindowFunc(int whichFunction, size_t NumSamples, bool extraSample, float *data);
129134

130135
/*
@@ -134,19 +139,20 @@ void NewWindowFunc(int whichFunction, size_t NumSamples, bool extraSample, float
134139
* otherwise about (NumSamples - 1) / 2
135140
* All functions have 0 in data[0] except Rectangular, Hamming and Gaussians
136141
*/
142+
AUDACITY_DLL_API
137143
void DerivativeOfWindowFunc(int whichFunction, size_t NumSamples, bool extraSample, float *data);
138144

139145
/*
140146
* Returns the name of the windowing function (for UI display)
141147
*/
142148

143-
const TranslatableString WindowFuncName(int whichFunction);
149+
AUDACITY_DLL_API const TranslatableString WindowFuncName(int whichFunction);
144150

145151
/*
146152
* Returns the number of windowing functions supported
147153
*/
148154

149-
int NumWindowFuncs();
155+
AUDACITY_DLL_API int NumWindowFuncs();
150156

151157
void DeinitFFT();
152158

src/FileException.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include <wx/filename.h> // wxFileName member variable
1515

1616
//! Thrown for failure of file or database operations in deeply nested places
17-
class FileException /* not final */ : public MessageBoxException
17+
class AUDACITY_DLL_API FileException /* not final */
18+
: public MessageBoxException
1819
{
1920
public:
2021
//! Identifies file operation that failed

src/FileFormats.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class wxString;
3030
/** @brief Get the number of container formats supported by libsndfile
3131
*
3232
* Uses SFC_GET_FORMAT_MAJOR_COUNT in sf_command interface */
33+
AUDACITY_DLL_API
3334
int sf_num_headers();
3435

3536
/** @brief Get the name of a container format from libsndfile
@@ -39,20 +40,25 @@ int sf_num_headers();
3940
* @param format_num The libsndfile format number for the container format
4041
* required
4142
*/
43+
AUDACITY_DLL_API
4244
wxString sf_header_index_name(int format_num);
4345

46+
AUDACITY_DLL_API
4447
unsigned int sf_header_index_to_type(int format_num);
4548

4649
//
4750
// enumerating encodings
4851
//
4952
/** @brief Get the number of data encodings libsndfile supports (in any
5053
* container or none */
54+
AUDACITY_DLL_API
5155
int sf_num_encodings();
5256
/** @brief Get the string name of the data encoding of the requested format
5357
*
5458
* uses SFC_GET_FORMAT_SUBTYPE */
59+
AUDACITY_DLL_API
5560
wxString sf_encoding_index_name(int encoding_num);
61+
AUDACITY_DLL_API
5662
unsigned int sf_encoding_index_to_subtype(int encoding_num);
5763

5864
//
@@ -64,20 +70,23 @@ unsigned int sf_encoding_index_to_subtype(int encoding_num);
6470
* then use SFC_GET_FORMAT_INFO to get the description
6571
* @param format the libsndfile format to get the name for (only the container
6672
* part is used) */
73+
AUDACITY_DLL_API
6774
wxString sf_header_name(int format);
6875
/** @brief Get an abbreviated form of the string name of the specified format
6976
*
7077
* Do sf_header_name() then truncate the string at the first space in the name
7178
* to get just the first word of the format name.
7279
* @param format the libsndfile format to get the name for (only the container
7380
* part is used) */
81+
AUDACITY_DLL_API
7482
wxString sf_header_shortname(int format);
7583
/** @brief Get the most common file extension for the given format
7684
*
7785
* AND the given format with SF_FORMAT_TYPEMASK to get just the container
7886
* format, then retrieve the most common extension using SFC_GET_FORMAT_INFO.
7987
* @param format the libsndfile format to get the name for (only the container
8088
* part is used) */
89+
AUDACITY_DLL_API
8190
wxString sf_header_extension(int format);
8291
/** @brief Get the string name of the specified data encoding
8392
*
@@ -98,13 +107,18 @@ SF_FORMAT_INFO *sf_simple_format(int i);
98107
// other utility functions
99108
//
100109

110+
AUDACITY_DLL_API
101111
bool sf_subtype_more_than_16_bits(unsigned int format);
112+
AUDACITY_DLL_API
102113
bool sf_subtype_is_integer(unsigned int format);
114+
AUDACITY_DLL_API
103115
int sf_subtype_bytes_per_sample(unsigned int format);
104116

117+
AUDACITY_DLL_API
105118
//! Choose the narrowest value in the sampleFormat enumeration for a given libsndfile format
106119
sampleFormat sf_subtype_to_effective_format(unsigned int format);
107120

121+
AUDACITY_DLL_API
108122
extern FileExtensions sf_get_all_extensions();
109123

110124
wxString sf_normalize_name(const char *name);
@@ -123,7 +137,7 @@ inline R SFCall(F fun, Args&&... args)
123137
}
124138

125139
//RAII for SNDFILE*
126-
struct SFFileCloser { int operator () (SNDFILE*) const; };
140+
struct AUDACITY_DLL_API SFFileCloser { int operator () (SNDFILE*) const; };
127141
struct SFFile : public std::unique_ptr<SNDFILE, ::SFFileCloser>
128142
{
129143
SFFile() = default;

src/FileIO.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class wxOutputStream;
1818
class wxFFileOutputStream;
1919
class wxFileNameWrapper;
2020

21-
class FileIO
21+
class AUDACITY_DLL_API FileIO
2222
{
2323
public:
2424
typedef enum FileIOMode

0 commit comments

Comments
 (0)