Commit 878ba454 authored by Josh Coalson's avatar Josh Coalson
Browse files

fixes to work with latest wasabi (beta 3)

parent b549c9bb
......@@ -53,27 +53,20 @@ static WACNAME wac;
WAComponentClient *the = &wac;
#include "studio/services/servicei.h"
static waServiceT<svc_mediaConverter, FlacPcm> flacpcm;
// {683FA153-4055-467c-ABEE-5E35FA03C51E}
static const GUID guid =
{ 0x683fa153, 0x4055, 0x467c, { 0xab, 0xee, 0x5e, 0x35, 0xfa, 0x3, 0xc5, 0x1e } };
_int nch;
_int samplerate;
_int bps;
_int nch("# of channels", 2);
_int samplerate("Sample rate", 44100);
_int bps("Bits per second", 16);
WACNAME::WACNAME() : CfgItemI("RAW files support") {
#ifdef FORTIFY
FortifySetName("cnv_flacpcm.wac");
FortifyEnterScope();
#endif
WACNAME::WACNAME() : WAComponentClient("RAW files support") {
registerService(new waServiceT<svc_mediaConverter, FlacPcm>);
}
WACNAME::~WACNAME() {
#ifdef FORTIFY
FortifyLeaveScope();
#endif
}
GUID WACNAME::getGUID() {
......@@ -81,21 +74,9 @@ GUID WACNAME::getGUID() {
}
void WACNAME::onRegisterServices() {
api->service_register(&flacpcm);
api->core_registerExtension("*.flac","FLAC Files");
nch.setName("# of channels");
nch=2;
registerAttribute(&nch);
samplerate.setName("Sample rate");
samplerate=44100;
registerAttribute(&samplerate);
bps.setName("Bits per second");
bps=16;
registerAttribute(&bps);
}
void WACNAME::onDestroy() {
api->service_deregister(&flacpcm);
WAComponentClient::onDestroy();
}
......@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "cnv_flacpcm_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "\Wasabi SDK\studio" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "cnv_flacpcm_EXPORTS" /D "USE_ASM" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "\Wasabi SDK\studio" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "cnv_flacpcm_EXPORTS" /D "USE_ASM" /D "WACLIENT_NOICONSUPPORT" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
......@@ -105,22 +105,6 @@ SOURCE="\Wasabi SDK\studio\attribs\attribute.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\attribs\attrint.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\bitmap.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\blending.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\canvas.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\attribs\cfgitemi.cpp"
# End Source File
# Begin Source File
......@@ -133,19 +117,19 @@ SOURCE="\Wasabi SDK\studio\common\depend.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\nsGUID.cpp"
SOURCE="\Wasabi SDK\studio\common\memblock.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\pathparse.cpp"
SOURCE="\Wasabi SDK\studio\common\nsGUID.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\ptrlist.cpp"
SOURCE="\Wasabi SDK\studio\common\pathparse.cpp"
# End Source File
# Begin Source File
SOURCE="\Wasabi SDK\studio\common\region.cpp"
SOURCE="\Wasabi SDK\studio\common\ptrlist.cpp"
# End Source File
# Begin Source File
......
......@@ -56,20 +56,14 @@
#define WACNAME WACcnv_flacpcm
class WACNAME : public WAComponentClient, public CfgItemI {
class WACNAME : public WAComponentClient {
public:
WACNAME();
virtual ~WACNAME();
virtual const char *getName() { return "FLAC to PCM converter"; };
virtual GUID getGUID();
virtual void onRegisterServices();
virtual void onDestroy();
virtual int getDisplayComponent() { return FALSE; };
virtual CfgItem *getCfgInterface(int n) { return this; }
};
#endif
......@@ -254,7 +254,7 @@ FLAC__bool FlacPcm::eofCallback_(const FLAC__SeekableStreamDecoder *decoder, voi
return instance->reader->getPos() == instance->reader->getLength();
}
FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *buffer[], void *client_data)
FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
{
FlacPcm *instance = (FlacPcm*)client_data;
const unsigned bps = instance->streaminfo.data.stream_info.bits_per_sample, channels = instance->streaminfo.data.stream_info.channels, wide_samples = frame->header.blocksize;
......@@ -279,7 +279,7 @@ void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, cons
FlacPcm *instance = (FlacPcm*)client_data;
(void)decoder;
if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
instance->streaminfo.data.stream_info = *metadata;
instance->streaminfo = *metadata;
if(instance->streaminfo.data.stream_info.bits_per_sample != 16) {
//@@@ how to do this? MessageBox(mod.hMainWindow, "ERROR: plugin can only handle 16-bit samples\n", "ERROR: plugin can only handle 16-bit samples", 0);
......
......@@ -100,7 +100,7 @@ private:
static FLAC__SeekableStreamDecoderTellStatus tellCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
static FLAC__SeekableStreamDecoderLengthStatus lengthCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
static FLAC__bool eofCallback_(const FLAC__SeekableStreamDecoder *decoder, void *client_data);
static FLAC__StreamDecoderWriteStatus writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 *buffer[], void *client_data);
static FLAC__StreamDecoderWriteStatus writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
static void metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
static void errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment