forked from sgomin/ddb_medialib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
medialib.cpp
51 lines (43 loc) · 1.34 KB
/
medialib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "medialib.h"
#include "plugin.hpp"
#include <iostream>
#define PLUGIN_VERSION_MAJOR 0
#define PLUGIN_VERSION_MINOR 1
DB_functions_t * deadbeef = nullptr;
extern "C" DB_plugin_t *
#ifdef USE_GTK2
ddb_misc_medialib_gtk2_load
#else
ddb_misc_medialib_gtk3_load
#endif
(DB_functions_t *ddb)
{
std::clog << "Loading " PLUGIN_NAME << std::endl;
deadbeef = ddb;
if (!deadbeef)
{
std::cerr << "Invalid parameter!" << std::endl;
return nullptr;
}
static DB_plugin_t plugin;
plugin.api_vmajor = DB_API_VERSION_MAJOR;
plugin.api_vminor = DB_API_VERSION_MINOR;
plugin.type = DB_PLUGIN_MISC;
plugin.version_major = PLUGIN_VERSION_MAJOR;
plugin.version_minor = PLUGIN_VERSION_MINOR;
//#if GTK_CHECK_VERSION(3,0,0)
// .plugin.id = "filebrowser-gtk3",
//#else
plugin.id = "madialib";
//#endif
plugin.name = PLUGIN_NAME;
plugin.descr = "Media library";
plugin.copyright = "TODO";
plugin.website = "http://TODO";
plugin.start = &Plugin::start;
plugin.stop = &Plugin::stop;
plugin.connect = &Plugin::connect;
plugin.disconnect = &Plugin::disconnect;
plugin.configdialog = nullptr;
return &plugin;
}