annotate src/main.c @ 0:d91dfd53b8b4

Initial commit
author Paper <mrpapersonic@gmail.com>
date Sun, 07 Aug 2022 07:26:27 -0400
parents
children 7abb5d8b20ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #include <assert.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #include <stdio.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <stdint.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <stdlib.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <time.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <Winamp/wa_ipc.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include "main.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include "discord_game_sdk.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 #include "timer.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 #include "config.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 #include "dirtools.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 #ifndef WIN32_LEAN_AND_MEAN
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 # define WIN32_LEAN_AND_MEAN
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 #endif
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 #include <windows.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 #define CLIENT_ID 969367220599803955
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 #define DISCORD_REQUIRE(x) \
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 assert(x == DiscordResult_Ok)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 #define GPPHDR_VER 0x10
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 winamp_general_purpose_plugin g_plugin = {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 GPPHDR_VER, // version of the plugin, defined in "gen_myplugin.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 "Discord GameSDK", // name/title of the plugin, defined in "gen_myplugin.h"
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 init, // function name which will be executed on init event
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 NULL, // function name which will be executed on config event
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 quit, // function name which will be executed on quit event
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29 0, // handle to Winamp main window, loaded by winamp when this dll is loaded
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30 0 // hinstance to this dll, loaded by winamp when this dll is loaded
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 WNDPROC g_lpWndProcOld = 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 struct timer_t timer_callbacks = { .interval = 16 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 struct config_t config = {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 .display_title = 1,
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 .show_elapsed_time = 1
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 struct DiscordActivity activity = {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 .application_id = CLIENT_ID,
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43 .name = "Winamp",
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 .instance = 0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 struct IDiscordActivityEvents activities_events;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 struct app_t app;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 void update_activity_callback(void* data, enum EDiscordResult result)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 DISCORD_REQUIRE(result);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 void report_current_song_status(int playbackState)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 assert(playbackState != 0);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59 activity.timestamps.start = 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 strcpy(activity.state, playbackState == 1 ? "(Playing)" : "(Paused)");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 if (playbackState == 1) {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
63 FILETIME ft;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
64 GetSystemTimeAsFileTime(&ft);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65 ULARGE_INTEGER ul;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66 ul.LowPart = ft.dwLowDateTime;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 ul.HighPart = ft.dwHighDateTime;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68 long long dtn = ((ul.QuadPart - 116444736000000000ULL)/10000000);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
70 activity.timestamps.start = dtn - SendMessage(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_GETOUTPUTTIME) / 1000;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
71 } else {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
72 activity.timestamps.start = 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
75 char* detailsMessage = calloc(256, sizeof(char));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 //if (g_pluginSettings.DisplayTitleInStatus)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 //{
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
78 wchar_t* title = (wchar_t*)SendMessageW(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_GET_PLAYING_TITLE);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
79 assert(WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, title, -1, detailsMessage, 256, NULL, NULL));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
80 //}
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
81 //else
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
82 //{
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
83 // strcpy(activity.details, "");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
84 //}
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
85 strcpy(activity.details, detailsMessage);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
86 free(detailsMessage);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
87
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
88 app.activities->update_activity(app.activities, &activity, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
89 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
90
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
91 void report_idle_status(void)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
92 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
93 activity.timestamps.start = 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
94 strcpy(activity.state, "(Idle)");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
95
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
96 app.activities->update_activity(app.activities, &activity, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
97 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
98
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
99 void update_rich_presence_details(void)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
100 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
101 LONG isPlayingResult = SendMessageW(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_ISPLAYING);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
102
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
103 switch (isPlayingResult) {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
104 case 1:
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
105 report_current_song_status(1);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
106 break;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
107 case 3:
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
108 report_current_song_status(3);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
109 break;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
110 case 0:
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
111 report_idle_status();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
112 break;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
113 default: break;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
114 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
115 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
116
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
117 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
118 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
119 if (message == WM_WA_IPC && lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
120 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
121 // Notification sent from Winamp on any change in playback.
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
122
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
123 update_rich_presence_details();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
124 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
125
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
126 return CallWindowProc(g_lpWndProcOld, hwnd, message, wParam, lParam);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
127 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
128
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
129 int init() {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
130 char* path = dirtools_concat_paths(getenv("APPDATA"), "Winamp\\Plugins\\wgsdk");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
131 printf("%s", path);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
132 memset(&app, 0, sizeof(app));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
133 if (IsWindowUnicode(g_plugin.hwndParent)) {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
134 g_lpWndProcOld = (WNDPROC)SetWindowLongW(g_plugin.hwndParent, -4, (LONG)WndProc);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
135 } else {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
136 g_lpWndProcOld = (WNDPROC)SetWindowLongA(g_plugin.hwndParent, -4, (LONG)WndProc);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
137 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
138
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
139 memset(&activity, 0, sizeof(activity));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
140 memset(&activities_events, 0, sizeof(activities_events));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
141
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
142 struct DiscordCreateParams params;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
143 DiscordCreateParamsSetDefault(&params);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
144 params.client_id = CLIENT_ID;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
145 params.flags = DiscordCreateFlags_Default;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
146 params.event_data = &app;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
147 params.activity_events = &activities_events;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
148
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
149 DISCORD_REQUIRE(DiscordCreate(DISCORD_VERSION, &params, &app.core));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
150
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
151 app.activities = app.core->get_activity_manager(app.core);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
152
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
153 timer_init(&timer_callbacks, g_plugin.hwndParent, TimerProc);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
154 timer_set(&timer_callbacks, g_plugin.hwndParent);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
155
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
156 cfg_load(&config);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
157
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
158 strcpy(activity.assets.large_image, "winamp-logo");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
159
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
160 update_rich_presence_details();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
161
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
162 return 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
163 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
164
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
165 void quit() {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
166 assert(!cfg_save(config));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
167 app.activities->clear_activity(app.activities, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
168 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
169
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
170 void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
171 DISCORD_REQUIRE(app.core->run_callbacks(app.core));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
172 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
173
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
174 __declspec(dllexport) winamp_general_purpose_plugin* winampGetGeneralPurposePlugin() {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
175 return &g_plugin;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
176 }