Skip to content

Commit

Permalink
config dialog, looping .org-files # times, devc++
Browse files Browse the repository at this point in the history
.dev file added for devc++ project file. I recommend using wxDevC++.
.h and .rc added for config dialog.
.c changed (dialog added, volume correction).

org-files that Loop will loop the number you set within the
config-dialog. Using 0 means endless. org-files that has no
looping-setting won't loop. winamp will use its shuffle-procedure
afterwards.

I also let org be played at the winamp volume. Before it was
automatically set to full-volume.

Output dll-file is inside \src\Output\MingW\
  • Loading branch information
Dediggefedde authored and Yukitty committed Mar 15, 2015
1 parent 6fc6901 commit a1067de
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 10 deletions.
43 changes: 43 additions & 0 deletions src/Makefile.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Project: in_org
# Compiler: Default GCC compiler
# Compiler Type: MingW 3
# Makefile created by wxDev-C++ IDE 7.4.2.569 on 14.03.15 18:22

WXLIBNAME = wxmsw29u
CPP = g++.exe
CC = gcc.exe
WINDRES = "windres.exe"
OBJ = Objects/MingW/in_org.o Objects/MingW/in_org_private.res
LINKOBJ = "Objects/MingW/in_org.o" Objects/MingW/in_org_private.res
LIBS = -L"C:/Program Files (x86)/Dev-Cpp/lib/wx/gcc_lib" -L"C:/Program Files (x86)/Dev-Cpp/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -Wl,--add-stdcall-alias
INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include"
CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW32/include" -I"C:/Program Files (x86)/Dev-Cpp/" -I"C:/Program Files (x86)/Dev-Cpp/include/common"
RCINCS = --include-dir "C:/PROGRA~2/Dev-Cpp/include/common"
BIN = Output/MingW/in_org.dll
DEFINES =
CXXFLAGS = $(CXXINCS) $(DEFINES) -DBUILDING_DLL=1
CFLAGS = $(INCS) $(DEFINES) -DBUILDING_DLL=1
GPROF = gprof.exe
ifeq ($(OS),Windows_NT)
RM = del /Q
FixPath = $(subst /,\,$1)
else
RM = rm -f
FixPath = $1
endif
LINK = g++.exe

.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after

clean: clean-custom
$(RM) $(call FixPath,$(LINKOBJ)) "$(call FixPath,$(BIN))"

$(BIN): $(OBJ)
$(LINK) -shared $(STATICLIB) $(LINKOBJ) $(LIBS) -Wl,--out-implib,Output/MingW/libin_org.a -o Output/MingW/in_org.dll

Objects/MingW/in_org.o: $(GLOBALDEPS) in_org.c winamp/in2.h winamp/out.h Wave100.inc Bass01.inc Bass02.inc Snare01.inc Snare02.inc Tom01.inc HiClose.inc HiOpen.inc Crash.inc Per01.inc Per02.inc Bass03.inc Tom02.inc Bass01Beta.inc CrashBeta.inc HiCloseBeta.inc HiOpenBeta.inc Snare01Beta.inc Bass04.inc Bass05.inc Snare03.inc Snare04.inc HiClos2.inc HiOpen2.inc HiClos3.inc HiOpen3.inc Crash02.inc RevSym.inc Ride01.inc Tom03.inc Tom04.inc Orcdrm.inc Bell.inc Cat.inc in_org.h
$(CC) -c in_org.c -o Objects/MingW/in_org.o $(CFLAGS)

Objects/MingW/in_org_private.res: Objects/MingW/in_org_private.rc in_org.rc
$(WINDRES) --input-format=rc -o Objects/MingW/in_org_private.res $(RCINCS) Objects/MingW/IN_ORG~1.RC -O coff
25 changes: 25 additions & 0 deletions src/Objects/MingW/in_org_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
This file will be overwritten by wxDev-C++ at every compile.
Do not edit this file as your changes will be lost.
You can, however, include this file and use the defines.
*/
#ifndef IN_ORG_PRIVATE_H
#define IN_ORG_PRIVATE_H

/* VERSION DEFINITIONS */
#define VER_STRING "0.1.1.1"
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_RELEASE 1
#define VER_BUILD 1
#define COMPANY_NAME ""
#define FILE_VERSION ""
#define FILE_DESCRIPTION ""
#define INTERNAL_NAME ""
#define LEGAL_COPYRIGHT ""
#define LEGAL_TRADEMARKS ""
#define ORIGINAL_FILENAME ""
#define PRODUCT_NAME ""
#define PRODUCT_VERSION ""

#endif /*IN_ORG_PRIVATE_H*/
4 changes: 4 additions & 0 deletions src/Objects/MingW/in_org_private.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file is automatically generated by wxDev-C++.
// All changes to this file will be lost when the project is recompiled.
#include "../../in_org.rc"

Binary file added src/Objects/MingW/in_org_private.res
Binary file not shown.
87 changes: 77 additions & 10 deletions src/in_org.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@
#include "Bell.inc"
#include "Cat.inc"

#define VERSION "v1.07"
#include "in_org.h"

#define VERSION "v1.08 config"

extern In_Module mod;
char lastfn[MAX_PATH];
int paused;
int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms.
int decode_pos_ms; // current decoding position, in milliseconds
int play_pos_ms;
char ini_path[250]={0};

// post this to the main window at end of file (after playback as stopped)
#define WM_WA_MPEG_EOF WM_USER+2
Expand Down Expand Up @@ -131,7 +134,8 @@ static void clear_sound(void)
org.chan[i].playing.len = 0;
}
}

int maxstep=3; //julian edit
int sstep=0; //julian edit
static int set_step(unsigned int new_step)
{
int i, j;
Expand All @@ -140,9 +144,15 @@ static int set_step(unsigned int new_step)
return 1;
else if(org.step == org.loop_end)
{
clear_sound();
decode_pos_ms = org.loop_start*org.tempo;
return set_step(org.loop_start);
sstep++; //julian edit
if(sstep<maxstep||maxstep==0){ //julian edit
clear_sound();
decode_pos_ms = org.loop_start*org.tempo; //julian edit
return set_step(org.loop_start); //julian edit
}else{ //julian edit
sstep=0;
org.nonlooping=1;
} //julian edit
}
for(i = 0; i < CHANNELS; i++)
{
Expand Down Expand Up @@ -481,9 +491,56 @@ static int load_org(const char *fn)
return 0;
}

static void config(HWND hwnd)
{
MessageBox(hwnd,"No configuration necessary.","ORG Player Configuration",MB_OK);
//static void config(HWND hwnd)
//{
// DialogBox(mod.hDllInstance, (const char *)sstep, hwnd, config_dialog);
// MessageBox(hwnd,"No configuration necessary.","ORG Player Configuration",MB_OK);
//}


static BOOL CALLBACK WndCfgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
char maxintval[20];

switch (message)
{
case WM_INITDIALOG:
//Anstatt WM_CREATE heisst es hier WM_INITDIALOG
SetDlgItemInt(hWnd, IDC_EditIter, maxstep,FALSE);
return TRUE;
case WM_CLOSE:
maxstep=GetDlgItemInt(hWnd, IDC_EditIter,NULL , FALSE);

itoa(maxstep,maxintval,10);
WritePrivateProfileString( L"winamp_in_org_plugin",L"maxIteration",maxintval,ini_path );
EndDialog(hWnd,0);
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_OK) // is it the OK button?
{

maxstep=GetDlgItemInt(hWnd, IDC_EditIter,NULL , FALSE);

itoa(maxstep,maxintval,10);
WritePrivateProfileString( L"winamp_in_org_plugin",L"maxIteration",maxintval,ini_path );

EndDialog(hWnd, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return FALSE;
}

HWND config_control_hwnd;
void config(struct In_Module *this_mod){
ShowWindow((
config_control_hwnd=CreateDialog(
mod.hDllInstance,
MAKEINTRESOURCE(IDD_DLGFIRST),
mod.hMainWindow,
WndCfgProc)
),
SW_SHOW);
}

static void about(HWND hwnd)
Expand All @@ -492,7 +549,17 @@ static void about(HWND hwnd)
}

static void init(void)
{
{
char dir[32];
sprintf(dir, "%s", (char*)SendMessage(mod.hMainWindow,WM_WA_IPC,0,IPC_GETINIDIRECTORY));
lstrcpyn(ini_path, dir, MAX_PATH - 32); // 32 will be (more than) enough room for \Plugins\plugin.ini
lstrcat(ini_path, "\\Plugins");
CreateDirectory(ini_path, NULL); // can't guarantee that this will exist
lstrcat(ini_path, "\\in_org.ini");


maxstep=GetPrivateProfileInt( L"winamp_in_org_plugin",L"maxIteration",maxstep,ini_path);

org.loaded = 0;
}

Expand Down Expand Up @@ -605,7 +672,7 @@ static int play(const char *fn) {
if (mod.SAVSAInit) mod.SAVSAInit(maxlatency,SAMPLERATE);
if (mod.VSASetInfo) mod.VSASetInfo(SAMPLERATE,NCH);
//mod.outMod->SetVolume(-666);
mod.outMod->SetVolume(255);
// mod.outMod->SetVolume(255);

killThread=0;
thread_handle = (HANDLE)CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)PlayThread,(void *)&killThread,0,&tmp);
Expand Down
117 changes: 117 additions & 0 deletions src/in_org.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
[Project]
FileName=in_org.dev
Name=in_org
UnitCount=2
PchHead=-1
PchSource=-1
Ver=3
IsCpp=1
ProfilesCount=2
ProfileIndex=0
Folders=

[Unit1]
FileName=in_org.c
CompileCpp=0
Folder=
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNrOnRebuild=0
AutoIncBuildNrOnCompile=0
UnitCount=3

[Profile1]
ProfileName=MingW gcc
Type=3
ObjFiles=
Includes=
Libs=
ResourceIncludes=
MakeIncludes=
Compiler=-DBUILDING_DLL=1
CppCompiler=-DBUILDING_DLL=1
Linker=-Wl,--add-stdcall-alias
PreprocDefines=
CompilerSettings=0000000000000000000000
Icon=
ExeOutput=Output\MingW
ImagesOutput=Images\
ObjectOutput=Objects\MingW
OverrideOutput=0
OverrideOutputName=
HostApplication=
CommandLine=
UseCustomMakefile=0
CustomMakefile=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerType=0

[Profile2]
ProfileName=MS Visual C++
Type=3
ObjFiles=
Includes=
Libs=
ResourceIncludes=
MakeIncludes=
Compiler=/DBUILDING_DLL=1
CppCompiler=/DBUILDING_DLL=1
Linker=
PreprocDefines=
CompilerSettings=000000000000010000000000000000000000
Icon=
ExeOutput=Output\Visual C++
ImagesOutput=Images\
ObjectOutput=Objects\Visual C++
OverrideOutput=0
OverrideOutputName=
HostApplication=
CommandLine=
UseCustomMakefile=0
CustomMakefile=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=9
CompilerType=9

[Unit2]
FileName=in_org.rc
Folder=Resources
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit3]
FileName=in_org.h
CompileCpp=1
Folder=in_org
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

8 changes: 8 additions & 0 deletions src/in_org.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define IDD_DLGFIRST 101
#define IDC_BOOGA 102
//#define IDC_SLIDER1 103
#define IDC_EditIter 104
#define IDC_OK 105

#define WM_WA_IPC WM_USER
#define IPC_GETINIDIRECTORY 335
15 changes: 15 additions & 0 deletions src/in_org.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Editor_1]
CursorCol=1
CursorRow=14
TopLine=1
LeftChar=1
[Editor_0]
CursorCol=1
CursorRow=674
TopLine=653
LeftChar=1
[Editor_2]
CursorCol=15
CursorRow=5
TopLine=1
LeftChar=1
13 changes: 13 additions & 0 deletions src/in_org.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <windows.h>
#include "in_org.h"
IDD_DLGFIRST DIALOGEX 0, 0, 100, 40
STYLE DS_SETFONT | DS_CENTER | DS_FIXEDSYS | WS_CHILD | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Organya Plugin Settings"
FONT 8, "MS Sans Serif"
BEGIN
// CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_AUTOTICKS |
// TBS_VERT | WS_TABSTOP,3,0,20,128
LTEXT "Loop iterations (0 for endless):",IDC_BOOGA,5,5,95,10
EDITTEXT IDC_EditIter, 25, 15, 60, 10
DEFPUSHBUTTON "Save/Close", IDC_OK, 60, 27, 40, 10
END

0 comments on commit a1067de

Please sign in to comment.