-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
1f21f25
commit 458b817
Showing
6 changed files
with
160 additions
and
55 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,22 @@ | ||
#include "vbdec.h" | ||
|
||
#define WIN32_LEAN_AND_MEAN | ||
#define NOMINMAX | ||
#include <windows.h> | ||
|
||
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) | ||
{ | ||
//UNREFERENCED_PARAMETER(hModule); | ||
UNREFERENCED_PARAMETER(lpReserved); | ||
|
||
switch ( reason ) | ||
{ | ||
case DLL_PROCESS_ATTACH: | ||
RegisterVBInterface(); | ||
break; | ||
case DLL_PROCESS_DETACH: | ||
UnregisterVBInterface(); | ||
break; | ||
} | ||
return TRUE; | ||
} |
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,91 @@ | ||
#include "vbdec.h" | ||
|
||
|
||
static HPROVIDER providerHandle; | ||
void RegisterVBInterface() | ||
{ | ||
// ASI codec | ||
const RIB_INTERFACE_ENTRY codecEntries[] = { | ||
REG_FN(PROVIDER_query_attribute), | ||
REG_AT("Name", PROVIDER_NAME, RIB_STRING), | ||
REG_AT("Version", PROVIDER_VERSION, RIB_HEX), | ||
REG_AT("Input file types", 0, RIB_STRING), | ||
REG_AT("Input wave tag", 1, RIB_DEC), | ||
REG_AT("Output file types", 2, RIB_STRING), | ||
REG_AT("Maximum frame size", 3, RIB_DEC), | ||
REG_FN(ASI_startup), | ||
REG_FN(ASI_error), | ||
REG_FN(ASI_shutdown), | ||
}; | ||
|
||
// ASI stream | ||
/*const RIB_INTERFACE_ENTRY streamEntries[] = { | ||
REG_FN(ASI_stream_open), | ||
};*/ | ||
|
||
providerHandle = RIB_provider_library_handle(); | ||
RIB_register( providerHandle, "ASI codec", codecEntries ); | ||
//RIB_register( providerHandle, "ASI stream", streamEntries ); | ||
} | ||
|
||
void UnregisterVBInterface() | ||
{ | ||
RIB_unregister_all(providerHandle); | ||
} | ||
|
||
|
||
U32 AILCALL FAR PROVIDER_query_attribute(HATTRIB index) | ||
{ | ||
switch ( index ) | ||
{ | ||
case PROVIDER_NAME: | ||
return (U32)"MSS VB Audio Decoder"; | ||
case PROVIDER_VERSION: | ||
return 0x100; | ||
case 0: // Input file types | ||
return (U32)"VB audio files\0*.VB"; | ||
case 1: // Input wave tag | ||
return 85; | ||
case 2: // Output file types; | ||
return (U32)"Raw PCM files\0*.RAW"; | ||
case 3: // Maximum frame size | ||
return 0x1000; | ||
default: | ||
return 0; | ||
} | ||
} | ||
|
||
static int startingCount = 0; | ||
ASIRESULT AILCALL FAR ASI_startup(void) | ||
{ | ||
// TODO: Implement | ||
if ( startingCount++ == 0 ) | ||
{ | ||
return ASI_NOERR; | ||
} | ||
else | ||
{ | ||
return ASI_ALREADY_STARTED; | ||
} | ||
|
||
} | ||
|
||
ASIRESULT AILCALL FAR ASI_shutdown(void) | ||
{ | ||
// TODO: Implement | ||
if ( startingCount != 0 ) | ||
{ | ||
startingCount--; | ||
return ASI_NOERR; | ||
} | ||
else | ||
{ | ||
return ASI_NOT_INIT; | ||
} | ||
} | ||
|
||
C8 FAR* AILCALL FAR ASI_error(void) | ||
{ | ||
// TODO: Implement | ||
return nullptr; | ||
} |
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,11 @@ | ||
#pragma once | ||
|
||
#include "mss/mss.h" | ||
|
||
void RegisterVBInterface(); | ||
void UnregisterVBInterface(); | ||
|
||
U32 AILCALL FAR PROVIDER_query_attribute(HATTRIB index); | ||
ASIRESULT AILCALL FAR ASI_startup(void); | ||
ASIRESULT AILCALL FAR ASI_shutdown(void); | ||
C8 FAR* AILCALL FAR ASI_error(void); |
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
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
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