annotate src/main.c @ 8:00399cc5f7ce

git leftovers: remove .gitignore
author Paper
date Fri, 16 Dec 2022 20:46:33 -0500
parents be4835547dd0
children 42ac054c0231
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
1 /**
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
2 * wgsdk - Winamp plugin for Discord's GameSDK
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
3 **/
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <assert.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <stdio.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <stdlib.h>
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <Winamp/wa_ipc.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"
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
11 #include "resource.h"
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
12 #include "utils.h"
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 #ifndef WIN32_LEAN_AND_MEAN
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 # define WIN32_LEAN_AND_MEAN
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 #endif
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 #include <windows.h>
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
17 #include <windowsx.h>
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 #define CLIENT_ID 969367220599803955
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 #define DISCORD_REQUIRE(x) \
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 assert(x == DiscordResult_Ok)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 #define GPPHDR_VER 0x10
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
25 int init();
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
26 void conf();
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
27 void quit();
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
28
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
29 /* Winamp-specific stuff */
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
30 struct winamp_gpp {
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
31 int version; // version of the plugin structure
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
32 char *description; // name/title of the plugin
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
33 int(*init)(); // function which will be executed on init event
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
34 void(*conf)(); // function which will be executed on config event
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
35 void(*quit)(); // function which will be executed on quit event
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
36 HWND hwndParent; // hwnd of the Winamp client main window (stored by Winamp when dll is loaded)
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
37 HINSTANCE hDllInstance; // hinstance of this plugin DLL. (stored by Winamp when dll is loaded)
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
38 };
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
39
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
40 struct winamp_gpp g_plugin = {
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
41 GPPHDR_VER, // version of the plugin, defined in "gen_myplugin.h"
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
42 "Discord GameSDK", // name/title of the plugin, defined in "gen_myplugin.h"
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
43 init, // function name which will be executed on init event
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
44 conf, // function name which will be executed on config event
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
45 quit, // function name which will be executed on quit event
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
46 0, // handle to Winamp main window, loaded by winamp when this dll is loaded
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
47 0 // hinstance to this dll, loaded by winamp when this dll is loaded
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
50 /* Discord stuff */
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 struct DiscordActivity activity = {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 .application_id = CLIENT_ID,
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 .name = "Winamp",
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 .instance = 0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 };
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 struct IDiscordActivityEvents activities_events;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
60 struct application {
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
61 struct IDiscordCore* core;
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
62 struct IDiscordUsers* users;
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
63 struct IDiscordActivityManager* activities;
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
64 } app;
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
65
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
66 /* Now we get to our built-in stuff */
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
67
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
68 struct timer timer_callbacks = { .interval = 16 };
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
70 struct config config = {
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
71 .display_title = 1,
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
72 .show_elapsed_time = 1
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
73 };
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
74
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
75 /* CallWindowProc is the *only* function that ever needs this. */
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
76 WNDPROC _old_wnd_proc = 0;
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
77
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
78 /* ------------------------------------ */
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
79
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
80 void DISCORD_CALLBACK update_activity_callback(void* data, enum EDiscordResult result) {
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
81 DISCORD_REQUIRE(result);
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
82 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
83
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
84 void report_current_song_status(int playback_state) {
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
85 assert(playback_state != 0);
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
86 strcpy(activity.state, playback_state == 1 ? "(Playing)" : "(Paused)");
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
87
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
88 activity.timestamps.start = (playback_state == 1 && config.show_elapsed_time)
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
89 ? get_system_time_in_milliseconds() - SendMessage(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_GETOUTPUTTIME) / 1000
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
90 : 0;
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
91
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
92 if (config.display_title) {
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
93 wchar_t* title = (wchar_t*)SendMessageW(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_GET_PLAYING_TITLE);
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
94 assert(WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, title, -1, activity.details, 256, NULL, NULL));
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
95 }
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
96
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
97 app.activities->update_activity(app.activities, &activity, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
98 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
99
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
100 void report_idle_status(void)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
101 {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
102 activity.timestamps.start = 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
103 strcpy(activity.state, "(Idle)");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
104
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
105 app.activities->update_activity(app.activities, &activity, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
106 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
107
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
108 void update_rich_presence_details(void)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
109 {
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
110 LONG is_playing = SendMessageW(g_plugin.hwndParent, WM_WA_IPC, 0, IPC_ISPLAYING);
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
111
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
112 switch (is_playing) {
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
113 case 0:
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
114 report_idle_status();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
115 break;
4
59bf702b2b21 *: stylistic changes
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
116 case 1:
59bf702b2b21 *: stylistic changes
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
117 case 3:
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
118 report_current_song_status(is_playing);
4
59bf702b2b21 *: stylistic changes
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
119 default:
59bf702b2b21 *: stylistic changes
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
120 break;
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
121 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
122 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
123
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
124 void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) {
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
125 DISCORD_REQUIRE(app.core->run_callbacks(app.core));
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
126 }
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
127
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
128 LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
129 if (message == WM_WA_IPC && lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS)
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
130 update_rich_presence_details();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
131
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
132 return CallWindowProc(_old_wnd_proc, hwnd, message, wParam, lParam);
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
133 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
134
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
135 #define set_wnd_long(x) \
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
136 (WNDPROC)SetWindowLong##x(g_plugin.hwndParent, GWLP_WNDPROC, (LONG)WndProc)
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
137 int init() {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
138 memset(&app, 0, sizeof(app));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
139 memset(&activity, 0, sizeof(activity));
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
140 memset(&activities_events, 0, sizeof(activities_events));
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
141
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
142 if (IsWindowUnicode(g_plugin.hwndParent))
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
143 _old_wnd_proc = set_wnd_long(W);
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
144 else
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
145 _old_wnd_proc = set_wnd_long(A);
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
146
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
147 struct DiscordCreateParams params;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
148 DiscordCreateParamsSetDefault(&params);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
149 params.client_id = CLIENT_ID;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
150 params.flags = DiscordCreateFlags_Default;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
151 params.event_data = &app;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
152 params.activity_events = &activities_events;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
153
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
154 DISCORD_REQUIRE(DiscordCreate(DISCORD_VERSION, &params, &app.core));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
155
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
156 app.activities = app.core->get_activity_manager(app.core);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
157
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
158 timer_init(&timer_callbacks, g_plugin.hwndParent, TimerProc);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
159 timer_set(&timer_callbacks, g_plugin.hwndParent);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
160
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
161 cfg_load(&config);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
162
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
163 strcpy(activity.assets.large_image, "winamp-logo");
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
164
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
165 update_rich_presence_details();
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
166
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
167 return 0;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
168 }
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
169 #undef set_wnd_long
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
170
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
171 void quit() {
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
172 assert(!cfg_save(config));
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
173 app.activities->clear_activity(app.activities, &app, update_activity_callback);
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
174 }
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
175
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
176 void conf() {
4
59bf702b2b21 *: stylistic changes
Paper <mrpapersonic@gmail.com>
parents: 2
diff changeset
177 DialogBoxW(g_plugin.hDllInstance, (LPWSTR)DIALOG_CONFIG, g_plugin.hwndParent, (DLGPROC)cfg_win_proc);
1
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
178 }
7abb5d8b20ea Initial commit: part 2
Paper <mrpapersonic@gmail.com>
parents: 0
diff changeset
179
7
be4835547dd0 clean up code, convert git files to hg, etc.
Paper
parents: 4
diff changeset
180 __declspec(dllexport) struct winamp_gpp* winampGetGeneralPurposePlugin() {
0
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
181 return &g_plugin;
d91dfd53b8b4 Initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
182 }