Skip to content

Commit

Permalink
seq2wav -> libclef
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Higerd committed Feb 19, 2024
1 parent 36d07fa commit 1cdc837
Show file tree
Hide file tree
Showing 34 changed files with 152 additions and 151 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ core
# build outputs
depends.mak
include
*2wav
*2wav_d
/*-clef
/*-clef_d
*.dll
*.a
*.so
*.exe
*_gui
*_gui_d
*.clap
Makefile.d
gui/Makefile*

# external dependencies
Expand All @@ -41,4 +42,4 @@ plugins/pfc
plugins/libPPUI

# de-ignore submodule
!/seq2wav
!/libclef
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "seq2wav"]
path = seq2wav
url = https://bitbucket.org/ahigerd/seq2wav
[submodule "libclef"]
path = libclef
url = https://github.com/ahigerd/libclef
[submodule "plugins/clap"]
path = plugins/clap
url = https://github.com/free-audio/clap.git
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
This sample project has not been properly customized yet.
dse-clef is copyright (c) 2020-2024 Adam Higerd

This project is based upon seq2wav, distributed under the following terms:
libclef is copyright (c) 2020-2024 Adam Higerd

seq2wav is copyright (c) 2020 Adam Higerd
Both dse-clef and libclef are distributed under the following terms:

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
70 changes: 35 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,68 +24,68 @@ clap: $(PLUGIN_NAME).clap

clapdebug: $(PLUGIN_NAME)_d.clap

seq2wav/src:
libclef/src:
git submodule update --init --recursive

ifeq ($(CROSS),msvc)
depends.mak: seq2wav/src $(wildcard src/*.h src/*.cpp src/*/*.h src/*/*.cpp plugins/*.cpp seq2wav/src/*.cpp seq2wav/src/*/*.h seq2wav/src/*/*.cpp seq2wav/src/*/*.h)
depends.mak: libclef/src $(wildcard src/*.h src/*.cpp src/*/*.h src/*/*.cpp plugins/*.cpp libclef/src/*.cpp libclef/src/*/*.h libclef/src/*/*.cpp libclef/src/*/*.h)
$(WINE) cmd /c buildvs.cmd depends

foo_input_$(PLUGIN_NAME).$(DLL) in_$(PLUGIN_NAME).$(DLL) aud_$(PLUGIN_NAME).$(DLL) clean: FORCE depends.mak
MAKEFLAGS= $(WINE) nmake /f msvc32.mak $@
else
seq2wav/$(BUILDPATH)/libseq2wav.a seq2wav/$(BUILDPATH)/libseq2wav_d.a: seq2wav/src $(wildcard seq2wav/src/*.cpp seq2wav/*/*.h seq2wav/src/*/*.cpp seq2wav/*/*/*.h)
$(MAKE) -C seq2wav $(BUILDPATH)/$(notdir $@)
libclef/$(BUILDPATH)/libclef.a libclef/$(BUILDPATH)/libclef_d.a: libclef/src $(wildcard libclef/src/*.cpp libclef/*/*.h libclef/src/*/*.cpp libclef/*/*/*.h)
+$(MAKE) -C libclef $(BUILDPATH)/$(notdir $@)

$(BUILDPATH)/Makefile.d: $(wildcard src/*.cpp src/*/*.cpp src/*.h src/*/*.h) Makefile src/Makefile config.mak
$(MAKE) -C src ../$@
+$(MAKE) -C src ../$@

$(PLUGIN_NAME)$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav.a
$(MAKE) -C src ../$@
$(PLUGIN_NAME)$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef.a
+$(MAKE) -C src ../$@

$(PLUGIN_NAME)_d$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav_d.a
$(MAKE) -C src ../$@
$(PLUGIN_NAME)_d$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef_d.a
+$(MAKE) -C src ../$@

$(BUILDPATH)/lib$(PLUGIN_NAME).a: src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav.a
$(MAKE) -C src ../$@
$(BUILDPATH)/lib$(PLUGIN_NAME).a: src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef.a
+$(MAKE) -C src ../$@

$(BUILDPATH)/lib$(PLUGIN_NAME)_d.a: src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav_d.a
$(MAKE) -C src ../$@
$(BUILDPATH)/lib$(PLUGIN_NAME)_d.a: src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef_d.a
+$(MAKE) -C src ../$@

gui/Makefile: gui/gui.pro seq2wav/gui/gui.pri Makefile config.mak
cd gui && $(QMAKE) BUILDPATH=../$(BUILDPATH) PLUGIN_NAME=$(PLUGIN_NAME) S2W_LDFLAGS="$(LDFLAGS_R)"
gui/Makefile: gui/gui.pro libclef/gui/gui.pri Makefile config.mak
cd gui && $(QMAKE) BUILDPATH=../$(BUILDPATH) PLUGIN_NAME=$(PLUGIN_NAME) CLEF_LDFLAGS="$(LDFLAGS_R)"

gui/Makefile.debug: gui/gui.pro seq2wav/gui/gui.pri Makefile config.mak
cd gui && $(QMAKE) -o Makefile.debug BUILD_DEBUG=1 BUILDPATH=../$(BUILDPATH) PLUGIN_NAME=$(PLUGIN_NAME) S2W_LDFLAGS="$(LDFLAGS_D)"
gui/Makefile.debug: gui/gui.pro libclef/gui/gui.pri Makefile config.mak
cd gui && $(QMAKE) -o Makefile.debug BUILD_DEBUG=1 BUILDPATH=../$(BUILDPATH) PLUGIN_NAME=$(PLUGIN_NAME) CLEF_LDFLAGS="$(LDFLAGS_D)"

$(PLUGIN_NAME)_gui$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav.a gui/Makefile $(BUILDPATH)/lib$(PLUGIN_NAME).a
$(MAKE) -C gui
$(PLUGIN_NAME)_gui$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef.a gui/Makefile $(BUILDPATH)/lib$(PLUGIN_NAME).a
+$(MAKE) -C gui

$(PLUGIN_NAME)_gui_d$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak seq2wav/$(BUILDPATH)/libseq2wav_d.a gui/Makefile.debug $(BUILDPATH)/lib$(PLUGIN_NAME)_d.a
$(MAKE) -C gui -f Makefile.debug
$(PLUGIN_NAME)_gui_d$(EXE): src/Makefile $(BUILDPATH)/Makefile.d config.mak libclef/$(BUILDPATH)/libclef_d.a gui/Makefile.debug $(BUILDPATH)/lib$(PLUGIN_NAME)_d.a
+$(MAKE) -C gui -f Makefile.debug

aud_$(PLUGIN_NAME).$(DLL): $(PLUGIN_NAME)$(EXE) seq2wav/$(BUILDPATH)/libseq2wav.a plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
aud_$(PLUGIN_NAME).$(DLL): $(PLUGIN_NAME)$(EXE) libclef/$(BUILDPATH)/libclef.a plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@

aud_$(PLUGIN_NAME)_d.$(DLL): seq2wav/$(BUILDPATH)/libseq2wav_d.a $(PLUGIN_NAME)_d$(EXE) plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
aud_$(PLUGIN_NAME)_d.$(DLL): libclef/$(BUILDPATH)/libclef_d.a $(PLUGIN_NAME)_d$(EXE) plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@

ifeq ($(OS),Windows_NT)
in_$(PLUGIN_NAME).$(DLL): $(PLUGIN_NAME)$(EXE) seq2wav/$(BUILDPATH)/libseq2wav.a plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
in_$(PLUGIN_NAME).$(DLL): $(PLUGIN_NAME)$(EXE) libclef/$(BUILDPATH)/libclef.a plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@

in_$(PLUGIN_NAME)_d.$(DLL): $(PLUGIN_NAME)_d$(EXE) seq2wav/$(BUILDPATH)/libseq2wav_d.a plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
in_$(PLUGIN_NAME)_d.$(DLL): $(PLUGIN_NAME)_d$(EXE) libclef/$(BUILDPATH)/libclef_d.a plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@
else
in_$(PLUGIN_NAME).dll in_$(PLUGIN_NAME)_d.dll: FORCE
$(MAKE) CROSS=mingw $@
+$(MAKE) CROSS=mingw $@
endif

$(PLUGIN_NAME).clap: $(PLUGIN_NAME)$(EXE) seq2wav/$(BUILDPATH)/libseq2wav.a plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
$(PLUGIN_NAME).clap: $(PLUGIN_NAME)$(EXE) libclef/$(BUILDPATH)/libclef.a plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@

$(PLUGIN_NAME)_d.clap: $(PLUGIN_NAME)_d$(EXE) seq2wav/$(BUILDPATH)/libseq2wav_d.a plugins/Makefile config.mak plugins/s2wplugin.cpp
$(MAKE) -C plugins ../$@
$(PLUGIN_NAME)_d.clap: $(PLUGIN_NAME)_d$(EXE) libclef/$(BUILDPATH)/libclef_d.a plugins/Makefile config.mak plugins/clefplugin.cpp
+$(MAKE) -C plugins ../$@

guiclean: FORCE
-[ -f gui/Makefile ] && $(MAKE) -C gui distclean
Expand All @@ -94,7 +94,7 @@ guiclean: FORCE
clean: guiclean FORCE
-rm -f $(BUILDPATH)/*.o $(BUILDPATH)/*/*.o $(BUILDPATH)/Makefile.d
-rm -f $(PLUGIN_NAME)$(EXE) $(PLUGIN_NAME)_d$(EXE) $(PLUGIN_NAME)_gui$(EXE) $(PLUGIN_NAME)_gui_d$(EXE) *.$(DLL)
-$(MAKE) -C seq2wav clean
-$(MAKE) -C libclef clean
endif

FORCE:
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dse2wav
dse-clef
=======

dse2wav is a player for game music originally published using Procyon Digital Sound Elements.
dse-clef is a player for game music originally published using Procyon Digital Sound Elements.

Building
--------
Expand Down Expand Up @@ -39,10 +39,10 @@ edited in `msvc.mak`.

License
-------
dse2wav is copyright (c) 2020-2022 Adam Higerd and distributed under the terms of the
dse-clef is copyright (c) 2020-2022 Adam Higerd and distributed under the terms of the
[MIT license](LICENSE.md).

This project is based upon seq2wav, copyright (c) 2020-2022 Adam Higerd and distributed
This project is based upon libclef, copyright (c) 2020-2022 Adam Higerd and distributed
under the terms of the [MIT license](LICENSE.md).

Special Thanks
Expand Down
4 changes: 2 additions & 2 deletions buildvs.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
echo. 2> depends.tmp
for /r %%f in (*.cpp) do (
SET "_o=%%f"
call cmd /c if "%%_o:main.cpp=%%"=="%%_o%%" echo "dse2wav.exe" "in_dse2wav.dll" "aud_dse2wav.dll": "%%_o:~0,-4%%.obj">>depends.tmp
call cmd /c if "%%_o:main.cpp=%%"=="%%_o%%" echo "foo_input_dse2wav.dll": "%%_o:~0,-4%%.obj">>depends.tmp
call cmd /c if "%%_o:main.cpp=%%"=="%%_o%%" echo "dse-clef.exe" "in_dse-clef.dll" "aud_dse-clef.dll": "%%_o:~0,-4%%.obj">>depends.tmp
call cmd /c if "%%_o:main.cpp=%%"=="%%_o%%" echo "foo_input_dse-clef.dll": "%%_o:~0,-4%%.obj">>depends.tmp
echo.>>depends.tmp
)
type depends.tmp | find \src\ > depends.mak
Expand Down
4 changes: 2 additions & 2 deletions config.mak
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PLUGIN_NAME = dse2wav
-include $(ROOTPATH)seq2wav/config.mak
PLUGIN_NAME = dse-clef
-include $(ROOTPATH)libclef/config.mak
2 changes: 1 addition & 1 deletion gui/dsewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <QMenu>
#include <QtDebug>

DSEWindow::DSEWindow(S2WPluginBase* plugin)
DSEWindow::DSEWindow(ClefPluginBase* plugin)
: MainWindow(plugin)
{
resize(400, 300);
Expand Down
2 changes: 1 addition & 1 deletion gui/dsewindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DSEWindow : public MainWindow
{
Q_OBJECT
public:
DSEWindow(S2WPluginBase* plugin);
DSEWindow(ClefPluginBase* plugin);

public slots:
void extract();
Expand Down
10 changes: 5 additions & 5 deletions gui/extractdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "extractdialog.h"
#include "s2wcontext.h"
#include "clefcontext.h"
#include "dseutil.h"
#include "mojibake.h"
#include "guiutils.h"
Expand All @@ -22,7 +22,7 @@
#include <QFileInfo>
#include <QThread>

ExtractDialog::ScanResult::ScanResult(S2WContext* ctx, const std::vector<uint8_t>& buffer, int offset)
ExtractDialog::ScanResult::ScanResult(ClefContext* ctx, const std::vector<uint8_t>& buffer, int offset)
: dseFile(ctx, buffer, offset)
{
filename = dseFile.originalFilename();
Expand All @@ -44,7 +44,7 @@ ExtractDialog::ScanResult::ScanResult(S2WContext* ctx, const std::vector<uint8_t
originalName = filename;
}

ExtractDialog::ExtractDialog(S2WContext* ctx, QWidget* parent)
ExtractDialog::ExtractDialog(ClefContext* ctx, QWidget* parent)
: QDialog(parent), scanning(false), ctx(ctx)
{
setAttribute(Qt::WA_DeleteOnClose);
Expand Down Expand Up @@ -180,7 +180,7 @@ void ExtractDialog::extract()
if (makeM3U) {
m3u.setFileName(dir.absoluteFilePath("!tags.m3u"));
if (!m3u.open(QIODevice::WriteOnly)) {
QMessageBox::critical(this, tr("dse2wav"), tr("Unable to open file for writing:\n%1").arg(m3u.fileName()));
QMessageBox::critical(this, tr("dse-clef"), tr("Unable to open file for writing:\n%1").arg(m3u.fileName()));
return;
}
QFileInfo src(txtSource->text());
Expand All @@ -201,7 +201,7 @@ void ExtractDialog::extract()
}
QFile dest(dir.absoluteFilePath(item->text()));
if (!dest.open(QIODevice::WriteOnly)) {
QMessageBox::critical(this, tr("dse2wav"), tr("Unable to open file for writing:\n%1").arg(dest.fileName()));
QMessageBox::critical(this, tr("dse-clef"), tr("Unable to open file for writing:\n%1").arg(dest.fileName()));
return;
}
const DSEFile* dseFile = &scannedFiles[i]->dseFile;
Expand Down
8 changes: 4 additions & 4 deletions gui/extractdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <vector>
#include <memory>
#include "dsefile.h"
class S2WContext;
class ClefContext;
class QLineEdit;
class QTableWidget;
class QCheckBox;
Expand All @@ -18,7 +18,7 @@ class ExtractDialog : public QDialog
{
Q_OBJECT
public:
ExtractDialog(S2WContext* ctx, QWidget* parent = nullptr);
ExtractDialog(ClefContext* ctx, QWidget* parent = nullptr);

private slots:
void browseSource();
Expand Down Expand Up @@ -47,14 +47,14 @@ private slots:
bool scanning;

struct ScanResult {
ScanResult(S2WContext* ctx, const std::vector<uint8_t>& buffer, int offset);
ScanResult(ClefContext* ctx, const std::vector<uint8_t>& buffer, int offset);
DSEFile dseFile;
std::string originalName;
std::string romajiFilename;
std::string filename;
};
std::vector<std::unique_ptr<ScanResult>> scannedFiles;
S2WContext* ctx;
ClefContext* ctx;
};

#endif
4 changes: 2 additions & 2 deletions gui/gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ isEmpty(BUILDPATH) {
error("BUILDPATH must be set")
}
BUILDPATH = $$absolute_path($$BUILDPATH)
include($$BUILDPATH/../seq2wav/gui/gui.pri)
include($$BUILDPATH/../libclef/gui/gui.pri)

SOURCES += main.cpp ../plugins/s2wplugin.cpp
SOURCES += main.cpp ../plugins/clefplugin.cpp

HEADERS += dsewindow.h extractdialog.h channelwidget.h
SOURCES += dsewindow.cpp extractdialog.cpp channelwidget.cpp
10 changes: 5 additions & 5 deletions gui/main.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#include <QApplication>
#include "dsewindow.h"
#include "s2wcontext.h"
#include "clefcontext.h"
#include "synth/synthcontext.h"
#include "plugin/baseplugin.h"
#include <QtDebug>

int main(int argc, char** argv)
{
S2WContext ctx;
S2WPluginBase* plugin = S2W::makePlugin(&ctx);
ClefContext ctx;
ClefPluginBase* plugin = Clef::makePlugin(&ctx);

QCoreApplication::setApplicationName(QString::fromStdString(plugin->pluginName()));
QCoreApplication::setApplicationVersion(QString::fromStdString(plugin->version()));
QCoreApplication::setOrganizationName("seq2wav");
QCoreApplication::setOrganizationDomain("seq2wav." + QString::fromStdString(plugin->pluginShortName()));
QCoreApplication::setOrganizationName("libclef");
QCoreApplication::setOrganizationDomain("libclef." + QString::fromStdString(plugin->pluginShortName()));
QApplication app(argc, argv);

DSEWindow mw(plugin);
Expand Down
1 change: 1 addition & 0 deletions libclef
Submodule libclef added at 97a3ca
18 changes: 9 additions & 9 deletions msvc32.mak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLUGIN_NAME = dse2wav
PLUGIN_NAME = dse-clef

cli: "$(PLUGIN_NAME).exe"

Expand All @@ -12,22 +12,22 @@ winamp: "in_$(PLUGIN_NAME).dll"

foobar: "foo_input_$(PLUGIN_NAME).dll"

seq2wav\src:
libclef\src:
git submodules update --init --recursive

!include depends.mak

.cpp.obj:
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /O2 /EHsc /I src /I seq2wav\src /I plugins\foobar2000 /I plugins /c /Fo$@ $<
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /O2 /EHsc /I src /I libclef\src /I plugins\foobar2000 /I plugins /c /Fo$@ $<

plugins\foobarplugin.obj: plugins\s2wplugin.cpp seq2wav\src\plugin\foobarplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_FOOBAR /O2 /EHsc /I src /I seq2wav\src /I plugins\foobar2000 /I plugins /c /Fo$@ plugins\s2wplugin.cpp
plugins\foobarplugin.obj: plugins\clefplugin.cpp libclef\src\plugin\foobarplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_FOOBAR /O2 /EHsc /I src /I libclef\src /I plugins\foobar2000 /I plugins /c /Fo$@ plugins\clefplugin.cpp

plugins\audaciousplugin.obj: plugins\s2wplugin.cpp seq2wav\src\plugin\audaciousplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_AUDACIOUS /O2 /EHsc /I src /I seq2wav\src /c /Fo$@ plugins\s2wplugin.cpp
plugins\audaciousplugin.obj: plugins\clefplugin.cpp libclef\src\plugin\audaciousplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_AUDACIOUS /O2 /EHsc /I src /I libclef\src /c /Fo$@ plugins\clefplugin.cpp

plugins\winampplugin.obj: plugins\s2wplugin.cpp seq2wav\src\plugin\winampplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_WINAMP /O2 /EHsc /I src /I seq2wav\src /c /Fo$@ plugins\s2wplugin.cpp
plugins\winampplugin.obj: plugins\clefplugin.cpp libclef\src\plugin\winampplugin.h FORCE
$(CPP) /std:c++latest /DUNICODE /D_UNICODE /DNDEBUG /DBUILD_WINAMP /O2 /EHsc /I src /I libclef\src /c /Fo$@ plugins\clefplugin.cpp

"$(PLUGIN_NAME).exe": src\main.obj
link.exe /subsystem:console /out:$@ $**
Expand Down
Loading

0 comments on commit 1cdc837

Please sign in to comment.