-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Regan
committed
Jul 22, 2017
0 parents
commit b8e43e1
Showing
6 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/build | ||
*.exe | ||
*.res | ||
/asio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "iup"] | ||
path = iup | ||
url = https://github.com/jprjr/iup-build.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
all: | ||
TARGET=x86_64-w64-mingw32 | ||
IUP_VER=3.22 | ||
|
||
include iup/Makefile | ||
|
||
.PHONY: all asioconfig clean | ||
|
||
all: build/$(TARGET)/asioconfig.exe | ||
|
||
ASIO_INCDIRS = -Iasio/common -Iasio/host -Iasio/host/pc | ||
ASIO_FILES = asio/common/asio.cpp asio/host/pc/asiolist.cpp asio/host/asiodrivers.cpp | ||
WINDOWS_LIBS = -lgdi32 -lcomdlg32 -lcomctl32 -luuid -loleaut32 -lole32 | ||
|
||
|
||
|
||
build/$(TARGET)/asioconfig.exe: asioconfig.cpp $(LIBIUP) asioconfig.res | ||
mkdir -p build/$(TARGET) | ||
$(TARGET_CXX) -mwindows -static -I$(IUP_INCDIR) $(ASIO_INCDIRS) -o $@ asioconfig.cpp $(ASIO_FILES) -L$(IUP_LIBDIR) -liup $(WINDOWS_LIBS) asioconfig.res | ||
$(TARGET_STRIP) $@ | ||
upx $@ | ||
|
||
|
||
asioconfig.res: asioconfig.rc | ||
$(TARGET_WINDRES) -c 1252 asioconfig.rc -O coff -o asioconfig.res | ||
|
||
clean: | ||
rm -f asioconfig.res asioconfig.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <iup.h> | ||
#include "asio.h" | ||
#include "asiodrivers.h" | ||
|
||
AsioDrivers *drivers; | ||
ASIODriverInfo my_info; | ||
|
||
static int doubleclick_handler(Ihandle *ih, int item, char *text) { | ||
my_info.sysRef = GetForegroundWindow(); | ||
strcpy(my_info.name,text); | ||
ASIOInit(&my_info); | ||
ASIOControlPanel(); | ||
return 0; | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
drivers = new AsioDrivers(); | ||
char **names; | ||
int i = 0; | ||
long devices = 0; | ||
names = (char **)malloc(sizeof(char *) * 32); | ||
if(names == 0) { | ||
return 1; | ||
} | ||
for(i=0; i<32; i++) { | ||
names[i] = (char *)malloc(sizeof(char) * 32); | ||
if(names[i] == 0) { | ||
return 1; | ||
} | ||
} | ||
|
||
my_info.asioVersion = 2; | ||
|
||
Ihandle *dlg, *list; | ||
IupOpen(&argc, &argv); | ||
|
||
list = IupList(0); | ||
|
||
devices = drivers->asioGetNumDev(); | ||
if(devices == 0) { | ||
IupSetAttribute(list,"1","No items found"); | ||
/* return 1; */ | ||
} | ||
|
||
char listIndexString[3]; | ||
|
||
for(i=0; i<devices; i++) { | ||
if(i < 32) { | ||
snprintf(listIndexString,3,"%d",i+1); | ||
drivers->asioGetDriverName(i,names[i],32); | ||
IupSetAttribute(list,listIndexString,names[i]); | ||
} | ||
} | ||
IupSetCallback(list,"DBLCLICK_CB",(Icallback)doubleclick_handler); | ||
|
||
dlg = IupDialog(IupVbox(list,NULL)); | ||
IupSetAttribute(dlg, "TITLE", "Hello world"); | ||
|
||
IupShowXY(dlg, IUP_CENTER, IUP_CENTER); | ||
|
||
IupMainLoop(); | ||
|
||
IupClose(); | ||
|
||
return EXIT_SUCCESS; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
CURSOR_PEN CURSOR "iup/deps/iup-3.22/etc/pen.cur" | ||
|
||
1 VERSIONINFO | ||
FILEVERSION 1,0,0,0 | ||
PRODUCTVERSION 1,0,0,0 | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "040904b0" | ||
BEGIN | ||
VALUE "Comments", "ASIO Config\0" | ||
VALUE "CompanyName", "John Regan\0" | ||
VALUE "FileDescription", "ASIO Config\0" | ||
VALUE "FileVersion", "1.0.0\0" | ||
VALUE "LegalCopyright", "Copyright 2017 John Regan.\0" | ||
VALUE "OriginalFilename", "asioconfig.exe\0" | ||
VALUE "ProductName", "ASIO Config\0" | ||
VALUE "ProductVersion", "1.0.0\0" | ||
END | ||
END | ||
END | ||
|
||
/****************************************************/ | ||
/* Used by IupFileDlg when SHOWPREVIEW=Yes */ | ||
|
||
/* To avoid the inclusion of <winuser.h> */ | ||
#define WS_CHILD 0x40000000L | ||
#define WS_VISIBLE 0x10000000L | ||
#define WS_CLIPSIBLINGS 0x04000000L | ||
#define DS_3DLOOK 0x0004L | ||
#define DS_CONTROL 0x0400L | ||
#define SS_OWNERDRAW 0x0000000DL | ||
#define WS_EX_STATICEDGE 0x00020000L | ||
|
||
#define IUP_PREVIEWCANVAS 3000 /* 0x0BB8 */ | ||
|
||
iupPreviewDlg DIALOG DISCARDABLE 0, 0, 250, 95 | ||
STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | DS_3DLOOK | DS_CONTROL | ||
FONT 8, "MS Shell Dlg" | ||
BEGIN | ||
/* ..., SS_OWNERDRAW, x, y, width, height, ... */ | ||
CONTROL "", IUP_PREVIEWCANVAS, "STATIC", SS_OWNERDRAW, 70, 0, 120, 90, WS_EX_STATICEDGE | ||
END | ||
|
||
/****************************************************/ | ||
/* The following lines will enable Windows XP/Vista Visual Styles */ | ||
|
||
/* don't add this if building the DLL */ | ||
#ifndef IUP_DLL | ||
#ifdef TEC_64 | ||
1 24 "iup/deps/iup-3.22/etc/iup64.manifest" | ||
#else | ||
1 24 "iup/deps/iup-3.22/etc/iup.manifest" | ||
#endif | ||
#endif | ||
|
||
/****************************************************/ |