Skip to content

Instantly share code, notes, and snippets.

struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id)
{
BOOL res;
struct hid_device_info *root = NULL; /* return object */
struct hid_device_info *cur_dev = NULL;
/* Windows objects for interacting with the driver. */
GUID InterfaceClassGuid = {0x4d1e55b2, 0xf16f, 0x11cf, {0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30} };
SP_DEVINFO_DATA devinfo_data;
SP_DEVICE_INTERFACE_DATA device_interface_data;
/* Make sure this device is of Setup Class "HIDClass" and has a
driver bound to it. */
#define ENABLE_HIDCLASS_CHECK 1
#define ENABLE_FOR_LOOP 1
#if ENABLE_FOR_LOOP
for (i = 0; ; i++) {
#else
i = device_index;
#endif
char driver_name[256];
/* Make sure this device is of Setup Class "HIDClass" and has a driver bound to it. */
i = device_index
char driver_name[256];
/* Populate devinfo_data. This function will return failure
when there are no more interfaces left. */
res = SetupDiEnumDeviceInfo(device_info_set, i, &devinfo_data);
if (!res)
goto cont;
/* Make sure this device is of Setup Class "HIDClass" and has a driver bound to it. */
i = device_index;
char driver_name[256];
/* Populate devinfo_data. This function will return failure
when there are no more interfaces left. */
res = SetupDiEnumDeviceInfo(device_info_set, i, &devinfo_data);
if (!res)
goto cont;
@drojf
drojf / old_comment.md
Last active September 25, 2016 17:44

edit3

Just so it's recorded somewhere, to use chvol, you must call it AFTER the dwave or dwaveloop command, not before!


edit2: things are not as simple as described below. the chvol command appears to have no effect on the channel volumes in this version of the game :S. Also, channels 1-15 and 49 have their volumes set at various times during the game by the script ??? which suggest it does work ??? I dunno.

It's probably easier to fix this one by simply making special audio files for when multiple voices play, since it only happens 9 times in the script. Alternatively you could use my voice player thing (which doesn't currently support multiple voices).

@drojf
drojf / setwindow.txt
Created September 26, 2016 10:24
Setwindow functions in umi script
Line 44: menusetwindow 20,20,5,3,1,0,#cccccc
Line 49374: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 49421: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 86296: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 129671: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 183318: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 246918: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 253966: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 254692: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
Line 256446: setwindow 137,16,25,20,23,23,0,2,20,1,1,#999999,0,0,853,479
@drojf
drojf / get_audio_lengths.py
Last active September 30, 2016 15:05
script to get the audio lengths of files in a folder
#http://stackoverflow.com/questions/16953842/using-os-walk-to-recursively-traverse-directories-in-python
#http://stackoverflow.com/questions/6239350/how-to-extract-duration-time-from-ffmpeg-output
import os, subprocess, math
#!!!!!!!!!!!!!!! SET THESE TWO PATHS ACCORDING TO YOUR FFMPEG / GAME LOCATION !!!!!!!!!!!!!!!
search_dir=r'C:\games\Steam\steamapps\common\Umineko\voice'
ffprobe_path = r'c:\prog\ffmpeg\ffprobe.exe' #download ffmpeg exe pack from here: https://ffmpeg.zeranoe.com/builds/
file_extensions=[r'.ogg']
@drojf
drojf / audio_lengths.txt
Created October 1, 2016 00:42
voice lengths in milliseconds (rounded up)
This file has been truncated, but you can view the full file.
voice\01\11500001.ogg, 1767
voice\01\11500002.ogg, 5216
voice\01\11500003.ogg, 3587
voice\01\11500004.ogg, 1511
voice\01\11500005.ogg, 645
voice\01\11500006.ogg, 1378
voice\01\11500007.ogg, 1594
voice\01\11500008.ogg, 2360
voice\01\11500009.ogg, 918
voice\01\11500010.ogg, 3421
@drojf
drojf / mglplot_opengl.c
Created October 14, 2016 02:15
Using IupMglPlot in OpenGL mode prints error "MathGL message - AddLight: light: ID is out of range" when graph updated
#include "stdafx.h"
#include "iup.h"
#include "iup_mglplot.h"
double plug_current_graph_y[100];
Ihandle * plot;
void update_gui_callback()
{
grammar template;
start: in_line out_line code_group (symbol code_group)*;
in_line: IN name_type* NEWLINE;
out_line: OUT name_type* NEWLINE;
name_type: name COLON type;
name: TEXT;
type: TEXT;