Skip to content

Commit 52f1076

Browse files
WIP: Export symbols also with enabled LTO
1 parent 12f4202 commit 52f1076

10 files changed

Lines changed: 108 additions & 42 deletions

File tree

src/libaudcore/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ SRCS = adder.cc \
3535
playlist-data.cc \
3636
playlist-files.cc \
3737
playlist-utils.cc \
38+
plugin.cc \
3839
plugin-init.cc \
3940
plugin-load.cc \
4041
plugin-registry.cc \

src/libaudcore/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ libaudcore_sources = [
3434
'playlist-data.cc',
3535
'playlist-files.cc',
3636
'playlist-utils.cc',
37+
'plugin.cc',
3738
'plugin-init.cc',
3839
'plugin-load.cc',
3940
'plugin-registry.cc',

src/libaudcore/plugin.cc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* plugin.cc
3+
* Copyright 2005-2013 Ariadne Conill, Yoshiki Yazawa, Eugene Zagidullin, and
4+
* John Lindgren
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions, and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright notice,
13+
* this list of conditions, and the following disclaimer in the documentation
14+
* provided with the distribution.
15+
*
16+
* This software is provided "as is" and without any warranty, express or
17+
* implied. In no event shall the authors be liable for any damages arising from
18+
* the use of this software.
19+
*/
20+
21+
#include "plugin.h"
22+
23+
bool Plugin::init() { return true; }
24+
25+
void Plugin::cleanup() {}
26+
27+
int Plugin::take_message(const char * code, const void * data, int size)
28+
{
29+
return -1;
30+
}
31+
32+
VFSFileTest TransportPlugin::test_file(const char * filename, VFSFileTest test,
33+
String & error)
34+
{
35+
return VFSFileTest(0);
36+
}
37+
38+
Index<String> TransportPlugin::read_folder(const char * filename, String & error)
39+
{
40+
return Index<String>();
41+
}
42+
43+
bool PlaylistPlugin::save(const char * path, VFSFile & file, const char * title,
44+
const Index<PlaylistAddItem> & items)
45+
{
46+
return false;
47+
}
48+
49+
void OutputPlugin::set_info(const char * filename, const Tuple & tuple) {}
50+
51+
bool EffectPlugin::flush(bool force) { return true; }
52+
53+
Index<float> & EffectPlugin::finish(Index<float> & data, bool end_of_playlist)
54+
{
55+
return process(data);
56+
}
57+
58+
int EffectPlugin::adjust_delay(int delay) { return delay; }
59+
60+
bool InputPlugin::write_tuple(const char * filename, VFSFile & file,
61+
const Tuple & tuple)
62+
{
63+
return false;
64+
}
65+
66+
bool InputPlugin::file_info_box(const char * filename, VFSFile & file)
67+
{
68+
return false;
69+
}
70+
71+
void * DockablePlugin::get_gtk_widget() { return nullptr; }
72+
73+
void * DockablePlugin::get_qt_widget() { return nullptr; }
74+
75+
void IfacePlugin::startup_notify(const char * id) {}

src/libaudcore/plugin.h

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,10 @@ class LIBAUDCORE_PUBLIC Plugin
129129
const PluginType type;
130130
const PluginInfo info;
131131

132-
virtual bool init() { return true; }
133-
virtual void cleanup() {}
132+
virtual bool init();
133+
virtual void cleanup();
134134

135-
virtual int take_message(const char * code, const void * data, int size)
136-
{
137-
return -1;
138-
}
135+
virtual int take_message(const char * code, const void * data, int size);
139136
};
140137

141138
class LIBAUDCORE_PUBLIC TransportPlugin : public Plugin
@@ -154,15 +151,9 @@ class LIBAUDCORE_PUBLIC TransportPlugin : public Plugin
154151
String & error) = 0;
155152

156153
virtual VFSFileTest test_file(const char * filename, VFSFileTest test,
157-
String & error)
158-
{
159-
return VFSFileTest(0);
160-
}
154+
String & error);
161155

162-
virtual Index<String> read_folder(const char * filename, String & error)
163-
{
164-
return Index<String>();
165-
}
156+
virtual Index<String> read_folder(const char * filename, String & error);
166157
};
167158

168159
class LIBAUDCORE_PUBLIC PlaylistPlugin : public Plugin
@@ -194,10 +185,7 @@ class LIBAUDCORE_PUBLIC PlaylistPlugin : public Plugin
194185
* title: title of playlist (in)
195186
* items: playlist entries (in) */
196187
virtual bool save(const char * path, VFSFile & file, const char * title,
197-
const Index<PlaylistAddItem> & items)
198-
{
199-
return false;
200-
}
188+
const Index<PlaylistAddItem> & items);
201189
};
202190

203191
class LIBAUDCORE_PUBLIC OutputPlugin : public Plugin
@@ -227,7 +215,7 @@ class LIBAUDCORE_PUBLIC OutputPlugin : public Plugin
227215

228216
/* Sets information about the song being played. This function will be
229217
* called before open_audio(). */
230-
virtual void set_info(const char * filename, const Tuple & tuple) {}
218+
virtual void set_info(const char * filename, const Tuple & tuple);
231219

232220
/* Begins playback of a PCM stream. <format> is one of the FMT_*
233221
* enumeration values defined in libaudcore/audio.h. Returns true on
@@ -298,23 +286,20 @@ class LIBAUDCORE_PUBLIC EffectPlugin : public Plugin
298286
* perform crossfading). The flush() function should return false in this
299287
* case to prevent flush() from being called in downstream effect plugins.
300288
*/
301-
virtual bool flush(bool force) { return true; }
289+
virtual bool flush(bool force);
302290

303291
/* Exactly like process() except that any buffers should be drained (i.e.
304292
* the data processed and returned). finish() will be called a second time
305293
* at the end of the last song in the playlist. */
306-
virtual Index<float> & finish(Index<float> & data, bool end_of_playlist)
307-
{
308-
return process(data);
309-
}
294+
virtual Index<float> & finish(Index<float> & data, bool end_of_playlist);
310295

311296
/* Required only for plugins that change the time domain (e.g. a time
312297
* stretch) or use read-ahead buffering. translate_delay() must do two
313298
* things: first, translate <delay> (which is in milliseconds) from the
314299
* output time domain back to the input time domain; second, increase
315300
* <delay> by the size of the read-ahead buffer. It should return the
316301
* adjusted delay. */
317-
virtual int adjust_delay(int delay) { return delay; }
302+
virtual int adjust_delay(int delay);
318303
};
319304

320305
enum class InputKey
@@ -427,18 +412,12 @@ class LIBAUDCORE_PUBLIC InputPlugin : public Plugin
427412

428413
/* Optional. Writes metadata to the file, returning false on error. */
429414
virtual bool write_tuple(const char * filename, VFSFile & file,
430-
const Tuple & tuple)
431-
{
432-
return false;
433-
}
415+
const Tuple & tuple);
434416

435417
/* Optional. Displays a window showing info about the file. In general,
436418
* this function should be avoided since Audacious already provides a file
437419
* info window. */
438-
virtual bool file_info_box(const char * filename, VFSFile & file)
439-
{
440-
return false;
441-
}
420+
virtual bool file_info_box(const char * filename, VFSFile & file);
442421

443422
protected:
444423
/* Prepares the output system for playback in the specified format. Also
@@ -489,10 +468,10 @@ class LIBAUDCORE_PUBLIC DockablePlugin : public Plugin
489468
}
490469

491470
/* GtkWidget * get_gtk_widget () */
492-
virtual void * get_gtk_widget() { return nullptr; }
471+
virtual void * get_gtk_widget();
493472

494473
/* QWidget * get_qt_widget () */
495-
virtual void * get_qt_widget() { return nullptr; }
474+
virtual void * get_qt_widget();
496475
};
497476

498477
class LIBAUDCORE_PUBLIC GeneralPlugin : public DockablePlugin
@@ -537,7 +516,7 @@ class LIBAUDCORE_PUBLIC IfacePlugin : public Plugin
537516
const char * icon) = 0;
538517
virtual void plugin_menu_remove(AudMenuID id, void func()) = 0;
539518

540-
virtual void startup_notify(const char * id) {}
519+
virtual void startup_notify(const char * id);
541520
};
542521

543522
#endif

src/libaudcore/vfs.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ static TransportPlugin * lookup_transport(const char * filename, String & error,
8080
return nullptr;
8181
}
8282

83+
String VFSImpl::get_metadata(const char * field) { return String(); }
84+
8385
/**
8486
* Opens a stream from a VFS transport using one of the registered
8587
* #VFSConstructor handlers.

src/libaudcore/vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class LIBAUDCORE_PUBLIC VFSImpl
112112
virtual int ftruncate(int64_t length) = 0;
113113
virtual int fflush() = 0;
114114

115-
virtual String get_metadata(const char * field) { return String(); }
115+
virtual String get_metadata(const char * field);
116116
};
117117

118118
class VFSFile

src/libaudcore/visualization.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ static Index<Visualizer *> visualizers;
3131
static int running = false;
3232
static int num_enabled = 0;
3333

34+
void Visualizer::render_mono_pcm(const float * pcm) {}
35+
void Visualizer::render_multi_pcm(const float * pcm, int channels) {}
36+
void Visualizer::render_freq(const float * freq) {}
37+
3438
EXPORT void aud_visualizer_add(Visualizer * vis)
3539
{
3640
visualizers.append(vis);

src/libaudcore/visualizer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class LIBAUDCORE_PUBLIC Visualizer
3939
virtual void clear() = 0;
4040

4141
/* 512 frames of a single-channel PCM signal */
42-
virtual void render_mono_pcm(const float * pcm) {}
42+
virtual void render_mono_pcm(const float * pcm);
4343

4444
/* 512 frames of an interleaved multi-channel PCM signal */
45-
virtual void render_multi_pcm(const float * pcm, int channels) {}
45+
virtual void render_multi_pcm(const float * pcm, int channels);
4646

4747
/* intensity of frequencies 1/512, 2/512, ..., 256/512 of sample rate */
48-
virtual void render_freq(const float * freq) {}
48+
virtual void render_freq(const float * freq);
4949

5050
/* common math for rendering a frequency graph (see util.cc) */
5151
static void compute_log_xscale(float * xscale, int bands);

src/libaudqt/colorbutton.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ ColorButton::ColorButton(QWidget * parent) : QPushButton(parent)
4343
});
4444
}
4545

46+
ColorButton::~ColorButton() = default;
47+
4648
void ColorButton::setColor(const QColor & color)
4749
{
4850
if (color != m_color)
@@ -54,6 +56,8 @@ void ColorButton::setColor(const QColor & color)
5456
}
5557
}
5658

59+
void ColorButton::onColorChanged() {}
60+
5761
void ColorButton::paintEvent(QPaintEvent * event)
5862
{
5963
QPushButton::paintEvent(event);

src/libaudqt/colorbutton.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ class LIBAUDQT_PUBLIC ColorButton : public QPushButton
3232
{
3333
public:
3434
ColorButton(QWidget * parent = nullptr);
35-
~ColorButton(){};
35+
~ColorButton();
3636

3737
void setColor(const QColor &);
3838

3939
QColor color() const { return m_color; }
4040

4141
protected:
42-
virtual void onColorChanged(){};
42+
virtual void onColorChanged();
4343

4444
private:
4545
void paintEvent(QPaintEvent *) override;

0 commit comments

Comments
 (0)