diff options
Diffstat (limited to 'Src/Plugins/SDK/burner')
24 files changed, 1498 insertions, 0 deletions
diff --git a/Src/Plugins/SDK/burner/BurnerCommon.cpp b/Src/Plugins/SDK/burner/BurnerCommon.cpp new file mode 100644 index 00000000..933b8862 --- /dev/null +++ b/Src/Plugins/SDK/burner/BurnerCommon.cpp @@ -0,0 +1,25 @@ +#include "BurnerCommon.h" +#include "api.h" +#include <api/service/waservicefactory.h> + +BurnerCommon::BurnerCommon(obj_primo *_primo) +{ + primo = _primo; + triggerEvent=0; + triggerEvent = CreateEvent(NULL, FALSE, FALSE, NULL); +} + +BurnerCommon::~BurnerCommon() +{ + if (triggerEvent) + CloseHandle(triggerEvent); + + waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(obj_primo::getServiceGuid()); + if (sf) sf->releaseInterface(primo); +} + +void BurnerCommon::TriggerCallback() +{ + if (triggerEvent) + SetEvent(triggerEvent); +}
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/BurnerCommon.h b/Src/Plugins/SDK/burner/BurnerCommon.h new file mode 100644 index 00000000..48b0d1b8 --- /dev/null +++ b/Src/Plugins/SDK/burner/BurnerCommon.h @@ -0,0 +1,14 @@ +#pragma once +#include <windows.h> +#include "../primo/obj_primo.h" + +class BurnerCommon +{ +public: + BurnerCommon(obj_primo *_primo); + ~BurnerCommon(); + void TriggerCallback(); +protected: + obj_primo *primo; + HANDLE triggerEvent; +}; diff --git a/Src/Plugins/SDK/burner/DataBurner.cpp b/Src/Plugins/SDK/burner/DataBurner.cpp new file mode 100644 index 00000000..e5cd579d --- /dev/null +++ b/Src/Plugins/SDK/burner/DataBurner.cpp @@ -0,0 +1,148 @@ +#include "DataBurner.h" +#include "ifc_burner_writecallback.h" +#include <malloc.h> +#include <strsafe.h> + +DataBurner::DataBurner(obj_primo *_primo) : BurnerCommon(_primo) +{ + driveLetter=0; +} + +DataBurner::~DataBurner() +{ + if (primo) + primo->CloseImage(); +} + +int DataBurner::Open(const wchar_t *volumeName, wchar_t driveLetter, int format) +{ + this->driveLetter = driveLetter; + if (!primo) + return 1; + + + DWORD units[] = {driveLetter, 0xFFFFFFFF}; + + + // TODO: use PrimoSDK_DiscInfoEx to verify that a disc is available + + // TODO: PrimoSDK_UnitVxBlock after we're done debugging + // TODO: PrimoSDK_UnitAIN + // TODO: PrimoSDK_UnitLock + + DWORD ret = primo->NewImageWCS(units, + (PWORD)volumeName, + 0, // no track session # needed, I don't think + PRIMOSDK_ORIGDATE | format, + 0, // TODO + 0 // TODO + ); // TODO: validate format + + return 0; +} + +// TODO: check AddFolderWCS for return values +static void createDirForFileW(obj_primo *primo, const wchar_t *str) +{ + const wchar_t *p = str; + if ((p[0] ==L'\\' || p[0] ==L'/') && (p[1] ==L'\\' || p[1] ==L'/')) + { + p += 2; + while (*p && *p !=L'\\' && *p !=L'/') p++; + if (!*p) return ; + p++; + while (*p && *p !=L'\\' && *p !=L'/') p++; + } + else + { + while (*p && *p !=L'\\' && *p !=L'/') p++; + } + + while (*p) + { + while (*p !=L'\\' && *p !=L'/' && *p) p = CharNextW(p); + if (*p) + { + size_t copySize = (p-str+1)*sizeof(wchar_t); + wchar_t *copy = (wchar_t *)alloca(copySize); + StringCbCopy(copy, copySize, str); + primo->AddFolderWCS(copy); + p++; + } + } +} + +int DataBurner::AddFile(const wchar_t *source, const wchar_t *destination) +{ + createDirForFileW(primo, destination); + DWORD ret = primo->AddFileWCS((PWORD)destination, (PWORD)source); + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +int DataBurner::AddFolder(const wchar_t *folder) +{ + createDirForFileW(primo, folder); + DWORD ret = primo->AddFolderWCS(folder); // add again in case they didn't terminate with a slash + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +int DataBurner::Write(int flags, unsigned int speed, ifc_burner_writecallback *callback) +{ + DWORD size=0; + DWORD ret = primo->WriteImage(flags, speed, &size); + if (ret != PRIMOSDK_OK) + return 1; + + while (1) + { + DWORD cursec = 0, totsec = 0; + ret = primo->RunningStatus(PRIMOSDK_GETSTATUS, &cursec, &totsec); + + if (ret == PRIMOSDK_RUNNING) + { + if (callback) + { + int abort = callback->OnStatus(cursec, totsec); + if (abort) + { + ret = primo->RunningStatus(PRIMOSDK_ABORT, 0, 0); + callback = 0; // cheap way to prevent making further callbacks + } + } + WaitForSingleObject(triggerEvent, 500); + } + else if (ret == PRIMOSDK_OK) + { + DWORD unit = driveLetter; + ret = primo->UnitStatus(&unit, NULL, NULL, NULL, NULL); + + if (ret == PRIMOSDK_OK && callback) + callback->Finished(); + break; + } + else + break; + } + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +#define CBCLASS DataBurner +START_DISPATCH; +CB(DATABURNER_OPEN, Open) +CB(DATABURNER_ADDFILE, AddFile) +CB(DATABURNER_ADDFOLDER, AddFolder) +CB(DATABURNER_WRITE, Write) +VCB(DATABURNER_FORCECALLBACK, ForceCallback) +END_DISPATCH; +#undef CBCLASS diff --git a/Src/Plugins/SDK/burner/DataBurner.h b/Src/Plugins/SDK/burner/DataBurner.h new file mode 100644 index 00000000..f30c1e7c --- /dev/null +++ b/Src/Plugins/SDK/burner/DataBurner.h @@ -0,0 +1,20 @@ +#pragma once +#include "obj_databurner.h" +#include "BurnerCommon.h" + +class DataBurner : public obj_databurner, protected BurnerCommon +{ +public: + DataBurner(obj_primo *primo); + ~DataBurner(); + int Open(const wchar_t *volumeName, wchar_t driveLetter, int format); + int AddFile(const wchar_t *source, const wchar_t *destination); + int AddFolder(const wchar_t *folder); + int Write(int flags, unsigned int speed, ifc_burner_writecallback *callback); + inline void ForceCallback() { BurnerCommon::TriggerCallback(); } +protected: + RECVS_DISPATCH; + +private: + wchar_t driveLetter; +}; diff --git a/Src/Plugins/SDK/burner/ISOBurner.cpp b/Src/Plugins/SDK/burner/ISOBurner.cpp new file mode 100644 index 00000000..84d45f62 --- /dev/null +++ b/Src/Plugins/SDK/burner/ISOBurner.cpp @@ -0,0 +1,67 @@ +#include "ISOBurner.h" +#include "../nu/AutoChar.h" +#include "ifc_burner_writecallback.h" + +ISOBurner::ISOBurner(obj_primo *_primo) : BurnerCommon(_primo) +{ +} + +int ISOBurner::Open() +{ + if (!primo) + return 1; + + return 0; +} + +int ISOBurner::Write(wchar_t driveLetter, const wchar_t *isoFile, int flags, unsigned int speed, ifc_burner_writecallback *callback) +{ + DWORD unit[] = {driveLetter, 0xFFFFFFFF}; + DWORD ret = primo->WriteOtherCDImage(unit, (PBYTE)(char *)AutoChar(isoFile), flags, speed); + if (ret != PRIMOSDK_OK) + return 1; + + while (1) + { + DWORD cursec = 0, totsec = 0; + ret = primo->RunningStatus(PRIMOSDK_GETSTATUS, &cursec, &totsec); + + if (ret == PRIMOSDK_RUNNING) + { + if (callback) + { + int abort = callback->OnStatus(cursec, totsec); + if (abort) + { + ret = primo->RunningStatus(PRIMOSDK_ABORT, 0, 0); + callback = 0; // cheap way to prevent making further callbacks + } + } + WaitForSingleObject(triggerEvent, 500); + } + else if (ret == PRIMOSDK_OK) + { + DWORD unit = driveLetter; + ret = primo->UnitStatus(&unit, NULL, NULL, NULL, NULL); + + if (ret == PRIMOSDK_OK && callback) + callback->Finished(); + break; + } + else + break; + } + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +#define CBCLASS ISOBurner +START_DISPATCH; +CB(ISOBURNER_OPEN, Open) +CB(ISOBURNER_WRITE, Write) +VCB(ISOBURNER_FORCECALLBACK, ForceCallback) +END_DISPATCH; +#undef CBCLASS diff --git a/Src/Plugins/SDK/burner/ISOBurner.h b/Src/Plugins/SDK/burner/ISOBurner.h new file mode 100644 index 00000000..ab331908 --- /dev/null +++ b/Src/Plugins/SDK/burner/ISOBurner.h @@ -0,0 +1,15 @@ +#pragma once + +#include "obj_isoburner.h" +#include "BurnerCommon.h" + +class ISOBurner : public obj_isoburner, protected BurnerCommon +{ +public: + ISOBurner(obj_primo *_primo); + int Open(); + int Write(wchar_t driveLetter, const wchar_t *isoFile, int flags, unsigned int speed, ifc_burner_writecallback *callback); + inline void ForceCallback() { BurnerCommon::TriggerCallback(); } +protected: + RECVS_DISPATCH; +};
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/ISOCreator.cpp b/Src/Plugins/SDK/burner/ISOCreator.cpp new file mode 100644 index 00000000..bf8b83f3 --- /dev/null +++ b/Src/Plugins/SDK/burner/ISOCreator.cpp @@ -0,0 +1,139 @@ +#include "ISOCreator.h" +#include <malloc.h> +#include "../nu/AutoChar.h" +#include "ifc_burner_writecallback.h" +#include <strsafe.h> + +ISOCreator::ISOCreator(obj_primo *_primo) : BurnerCommon(_primo) +{ +} + +ISOCreator::~ISOCreator() +{ + if (primo) + primo->CloseImage(); +} + +int ISOCreator::Open(const wchar_t *volumeName, int format, int media) +{ + if (!primo) + return 1; + + DWORD units=0xFFFFFFFF; + DWORD ret = primo->NewImageWCS( + &units, + (PWORD)volumeName, + 0, // no track session # needed, I don't think + PRIMOSDK_ORIGDATE | format | media, + 0, // don't think we need a swap file for ISO + 0 // probably don't need a swap location either, we'll see ... + ); // TODO: validate format and media + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +// TODO: check AddFolderWCS for return values +static void createDirForFileW(obj_primo *primo, const wchar_t *str) +{ + const wchar_t *p = str; + if ((p[0] ==L'\\' || p[0] ==L'/') && (p[1] ==L'\\' || p[1] ==L'/')) + { + p += 2; + while (*p && *p !=L'\\' && *p !=L'/') p++; + if (!*p) return ; + p++; + while (*p && *p !=L'\\' && *p !=L'/') p++; + } + else + { + while (*p && *p !=L'\\' && *p !=L'/') p++; + } + + while (*p) + { + while (*p !=L'\\' && *p !=L'/' && *p) p = CharNextW(p); + if (*p) + { + size_t copySize = (p-str+1)*sizeof(wchar_t); + wchar_t *copy = (wchar_t *)alloca(copySize); + StringCbCopy(copy, copySize, str); + primo->AddFolderWCS(copy); + p++; + } + } +} + +int ISOCreator::AddFile(const wchar_t *source, const wchar_t *destination) +{ + createDirForFileW(primo, destination); + DWORD ret = primo->AddFileWCS((PWORD)destination, (PWORD)source); + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +int ISOCreator::AddFolder(const wchar_t *folder) +{ + createDirForFileW(primo, folder); + DWORD ret = primo->AddFolderWCS(folder); // add again in case they didn't terminate with a slash + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +int ISOCreator::Write(const wchar_t *destination, ifc_burner_writecallback *callback) +{ + DWORD size=0; + DWORD ret = primo->SaveImage((PBYTE)(char *)AutoChar(destination), &size); + if (ret != PRIMOSDK_OK) + return 1; + + while (1) + { + DWORD cursec = 0, totsec = 0; + ret = primo->RunningStatus(PRIMOSDK_GETSTATUS, &cursec, &totsec); + + if (ret == PRIMOSDK_RUNNING) + { + if (callback) + { + int abort = callback->OnStatus(cursec, totsec); + if (abort) + { + ret = primo->RunningStatus(PRIMOSDK_ABORT, 0, 0); + callback = 0; // cheap way to prevent making further callbacks + } + } + WaitForSingleObject(triggerEvent, 500); + } + else if (ret == PRIMOSDK_OK) + { + if (callback) + callback->Finished(); + break; + } + else + break; + } + + if (ret != PRIMOSDK_OK) + return 1; + + return 0; +} + +#define CBCLASS ISOCreator +START_DISPATCH; +CB(ISOCREATOR_OPEN, Open) +CB(ISOCREATOR_ADDFILE, AddFile) +CB(ISOCREATOR_ADDFOLDER, AddFolder) +CB(ISOCREATOR_WRITE, Write) +VCB(ISOCREATOR_FORCECALLBACK, ForceCallback) +END_DISPATCH; +#undef CBCLASS diff --git a/Src/Plugins/SDK/burner/api.h b/Src/Plugins/SDK/burner/api.h new file mode 100644 index 00000000..6555c035 --- /dev/null +++ b/Src/Plugins/SDK/burner/api.h @@ -0,0 +1,5 @@ +#pragma once + +#include <api/service/api_service.h> +extern api_service *serviceManager; +#define WASABI_API_SVC serviceManager diff --git a/Src/Plugins/SDK/burner/burner.rc b/Src/Plugins/SDK/burner/burner.rc new file mode 100644 index 00000000..a78e00ea --- /dev/null +++ b/Src/Plugins/SDK/burner/burner.rc @@ -0,0 +1,114 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 5,6,4,0 + PRODUCTVERSION 5,6,4,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Winamp SA" + VALUE "FileDescription", "Winamp 5.x System Component" + VALUE "FileVersion", "5, 6, 4, 0" + VALUE "InternalName", "burner.w5s" + VALUE "LegalCopyright", "Copyright © 2005-2014 Winamp SA" + VALUE "OriginalFilename", "burner.w5s" + VALUE "ProductName", "Winamp CD Rip & Burn Support Service" + VALUE "ProductVersion", "5, 6, 4, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Src/Plugins/SDK/burner/burner.vcxproj b/Src/Plugins/SDK/burner/burner.vcxproj new file mode 100644 index 00000000..3f9b5507 --- /dev/null +++ b/Src/Plugins/SDK/burner/burner.vcxproj @@ -0,0 +1,270 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>17.0</VCProjectVersion> + <ProjectGuid>{7872D4D3-7026-4F1C-9E8A-C469FFD743DF}</ProjectGuid> + <RootNamespace>burner</RootNamespace> + <Keyword>Win32Proj</Keyword> + <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>17.0.32708.82</_ProjectFileVersion> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <LinkIncremental>false</LinkIncremental> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>false</LinkIncremental> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + <LinkIncremental>false</LinkIncremental> + <GenerateManifest>true</GenerateManifest> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <GenerateManifest>true</GenerateManifest> + <IncludePath>$(IncludePath)</IncludePath> + <LibraryPath>$(LibraryPath)</LibraryPath> + <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir> + <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Label="Vcpkg"> + <VcpkgEnabled>false</VcpkgEnabled> + </PropertyGroup> + <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <VcpkgConfiguration>Debug</VcpkgConfiguration> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\..;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BURNER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader /> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <FunctionLevelLinking>true</FunctionLevelLinking> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention /> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\..;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BURNER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>false</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <FunctionLevelLinking>true</FunctionLevelLinking> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MinSpace</Optimization> + <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <AdditionalIncludeDirectories>..\..;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BURNER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader /> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> + <GenerateDebugInformation>false</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention /> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MinSpace</Optimization> + <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> + <OmitFramePointers>true</OmitFramePointers> + <AdditionalIncludeDirectories>..\..;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BURNER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <BufferSecurityCheck>false</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>None</DebugInformationFormat> + <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> + <GenerateDebugInformation>false</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> + <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="BurnerCommon.cpp" /> + <ClCompile Include="DataBurner.cpp" /> + <ClCompile Include="factory_databurner.cpp" /> + <ClCompile Include="factory_isoburner.cpp" /> + <ClCompile Include="factory_isocreator.cpp" /> + <ClCompile Include="ISOBurner.cpp" /> + <ClCompile Include="ISOCreator.cpp" /> + <ClCompile Include="main.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="api.h" /> + <ClInclude Include="BurnerCommon.h" /> + <ClInclude Include="DataBurner.h" /> + <ClInclude Include="factory_databurner.h" /> + <ClInclude Include="factory_isoburner.h" /> + <ClInclude Include="factory_isocreator.h" /> + <ClInclude Include="ifc_burner_writecallback.h" /> + <ClInclude Include="ISOBurner.h" /> + <ClInclude Include="isocreator.h" /> + <ClInclude Include="obj_databurner.h" /> + <ClInclude Include="obj_isoburner.h" /> + <ClInclude Include="obj_isocreator.h" /> + <ClInclude Include="resource.h" /> + <ClInclude Include="veritas.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="burner.rc" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/burner.vcxproj.filters b/Src/Plugins/SDK/burner/burner.vcxproj.filters new file mode 100644 index 00000000..819e2fc8 --- /dev/null +++ b/Src/Plugins/SDK/burner/burner.vcxproj.filters @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Data Burner"> + <UniqueIdentifier>{fc5aff02-d57c-487b-9237-e29174dac75f}</UniqueIdentifier> + </Filter> + <Filter Include="ISO Burner"> + <UniqueIdentifier>{f63ae2ba-ac00-4d5e-94fd-c4e25abadcb3}</UniqueIdentifier> + </Filter> + <Filter Include="ISO Creator"> + <UniqueIdentifier>{517c3c9f-3204-4b73-89d3-3ecfa2bbec82}</UniqueIdentifier> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{65bb2e39-9fa9-4f92-ae7a-88829da14f0c}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="BurnerCommon.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="main.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="DataBurner.cpp"> + <Filter>Data Burner</Filter> + </ClCompile> + <ClCompile Include="factory_databurner.cpp"> + <Filter>Data Burner</Filter> + </ClCompile> + <ClCompile Include="factory_isoburner.cpp"> + <Filter>ISO Burner</Filter> + </ClCompile> + <ClCompile Include="ISOBurner.cpp"> + <Filter>ISO Burner</Filter> + </ClCompile> + <ClCompile Include="factory_isocreator.cpp"> + <Filter>ISO Creator</Filter> + </ClCompile> + <ClCompile Include="ISOCreator.cpp"> + <Filter>ISO Creator</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="BurnerCommon.h"> + <Filter>Source Files</Filter> + </ClInclude> + <ClInclude Include="api.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="ifc_burner_writecallback.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="veritas.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="DataBurner.h"> + <Filter>Data Burner</Filter> + </ClInclude> + <ClInclude Include="factory_databurner.h"> + <Filter>Data Burner</Filter> + </ClInclude> + <ClInclude Include="obj_databurner.h"> + <Filter>Data Burner</Filter> + </ClInclude> + <ClInclude Include="factory_isoburner.h"> + <Filter>ISO Burner</Filter> + </ClInclude> + <ClInclude Include="ISOBurner.h"> + <Filter>ISO Burner</Filter> + </ClInclude> + <ClInclude Include="obj_isoburner.h"> + <Filter>ISO Burner</Filter> + </ClInclude> + <ClInclude Include="factory_isocreator.h"> + <Filter>ISO Creator</Filter> + </ClInclude> + <ClInclude Include="isocreator.h"> + <Filter>ISO Creator</Filter> + </ClInclude> + <ClInclude Include="obj_isocreator.h"> + <Filter>ISO Creator</Filter> + </ClInclude> + <ClInclude Include="resource.h"> + <Filter>Resource Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="burner.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_databurner.cpp b/Src/Plugins/SDK/burner/factory_databurner.cpp new file mode 100644 index 00000000..349cdc44 --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_databurner.cpp @@ -0,0 +1,71 @@ +#include "api.h" +#include "factory_databurner.h" +#include "DataBurner.h" + +static const char serviceName[] = "Data Burner"; + +FOURCC DataBurnerFactory::GetServiceType() +{ + return WaSvc::OBJECT; +} + +const char *DataBurnerFactory::GetServiceName() +{ + return serviceName; +} + +GUID DataBurnerFactory::GetGUID() +{ + return obj_databurnerGUID; +} + +void *DataBurnerFactory::GetInterface(int global_lock) +{ + obj_primo *primo=0; + waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(obj_primo::getServiceGuid()); + if (sf) primo = reinterpret_cast<obj_primo *>(sf->getInterface()); + if (!primo) + return 0; + DataBurner *creator = new DataBurner(primo); + obj_databurner *ifc= static_cast<obj_databurner *>(creator); +// if (global_lock) +// WASABI_API_SVC->service_lock(this, (void *)ifc); + return ifc; +} + +int DataBurnerFactory::SupportNonLockingInterface() +{ + return 1; +} + +int DataBurnerFactory::ReleaseInterface(void *ifc) +{ + //WASABI_API_SVC->service_unlock(ifc); + obj_databurner *creatorIFC = static_cast<obj_databurner *>(ifc); + DataBurner *creator = static_cast<DataBurner *>(creatorIFC); + delete creator; + return 1; +} + +const char *DataBurnerFactory::GetTestString() +{ + return NULL; +} + +int DataBurnerFactory::ServiceNotify(int msg, int param1, int param2) +{ + return 1; +} + +#define CBCLASS DataBurnerFactory +START_DISPATCH; +CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType) +CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName) +CB(WASERVICEFACTORY_GETGUID, GetGUID) +CB(WASERVICEFACTORY_GETINTERFACE, GetInterface) +CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface) +CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface) +CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString) +CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify) +END_DISPATCH; +#undef CBCLASS
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_databurner.h b/Src/Plugins/SDK/burner/factory_databurner.h new file mode 100644 index 00000000..14d2fd81 --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_databurner.h @@ -0,0 +1,23 @@ +#ifndef NULLSOFT_BURNER_FACTORY_DATABURNER_H +#define NULLSOFT_BURNER_FACTORY_DATABURNER_H + +#include <api/service/waservicefactory.h> +#include <api/service/services.h> + +class DataBurnerFactory : public waServiceFactory +{ +public: + FOURCC GetServiceType(); + const char *GetServiceName(); + GUID GetGUID(); + void *GetInterface(int global_lock); + int SupportNonLockingInterface(); + int ReleaseInterface(void *ifc); + const char *GetTestString(); + int ServiceNotify(int msg, int param1, int param2); + +protected: + RECVS_DISPATCH; +}; + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_isoburner.cpp b/Src/Plugins/SDK/burner/factory_isoburner.cpp new file mode 100644 index 00000000..d98a786d --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_isoburner.cpp @@ -0,0 +1,71 @@ +#include "api.h" +#include "factory_isoburner.h" +#include "isoburner.h" + +static const char serviceName[] = "ISO Burner"; + +FOURCC ISOBurnerFactory::GetServiceType() +{ + return WaSvc::OBJECT; +} + +const char *ISOBurnerFactory::GetServiceName() +{ + return serviceName; +} + +GUID ISOBurnerFactory::GetGUID() +{ + return obj_isoburnerGUID; +} + +void *ISOBurnerFactory::GetInterface(int global_lock) +{ + obj_primo *primo=0; + waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(obj_primo::getServiceGuid()); + if (sf) primo = reinterpret_cast<obj_primo *>(sf->getInterface()); + if (!primo) + return 0; + ISOBurner *creator = new ISOBurner(primo); + obj_isoburner *ifc= static_cast<obj_isoburner *>(creator); + // if (global_lock) + // WASABI_API_SVC->service_lock(this, (void *)ifc); + return ifc; +} + +int ISOBurnerFactory::SupportNonLockingInterface() +{ + return 1; +} + +int ISOBurnerFactory::ReleaseInterface(void *ifc) +{ + //WASABI_API_SVC->service_unlock(ifc); + obj_isoburner *creatorIFC = static_cast<obj_isoburner *>(ifc); + ISOBurner *creator = static_cast<ISOBurner *>(creatorIFC); + delete creator; + return 1; +} + +const char *ISOBurnerFactory::GetTestString() +{ + return NULL; +} + +int ISOBurnerFactory::ServiceNotify(int msg, int param1, int param2) +{ + return 1; +} + +#define CBCLASS ISOBurnerFactory +START_DISPATCH; +CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType) +CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName) +CB(WASERVICEFACTORY_GETGUID, GetGUID) +CB(WASERVICEFACTORY_GETINTERFACE, GetInterface) +CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface) +CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface) +CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString) +CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify) +END_DISPATCH; +#undef CBCLASS
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_isoburner.h b/Src/Plugins/SDK/burner/factory_isoburner.h new file mode 100644 index 00000000..25bf87e6 --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_isoburner.h @@ -0,0 +1,23 @@ +#ifndef NULLSOFT_BURNER_FACTORY_ISOBURNER_H +#define NULLSOFT_BURNER_FACTORY_ISOBURNER_H + +#include <api/service/waservicefactory.h> +#include <api/service/services.h> + +class ISOBurnerFactory : public waServiceFactory +{ +public: + FOURCC GetServiceType(); + const char *GetServiceName(); + GUID GetGUID(); + void *GetInterface(int global_lock); + int SupportNonLockingInterface(); + int ReleaseInterface(void *ifc); + const char *GetTestString(); + int ServiceNotify(int msg, int param1, int param2); + +protected: + RECVS_DISPATCH; +}; + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_isocreator.cpp b/Src/Plugins/SDK/burner/factory_isocreator.cpp new file mode 100644 index 00000000..c2584747 --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_isocreator.cpp @@ -0,0 +1,72 @@ +#include "api.h" +#include "factory_isocreator.h" +#include "isocreator.h" + +static const char serviceName[] = "ISO Creator"; + +FOURCC ISOCreatorFactory::GetServiceType() +{ + return WaSvc::OBJECT; +} + +const char *ISOCreatorFactory::GetServiceName() +{ + return serviceName; +} + +GUID ISOCreatorFactory::GetGUID() +{ + return obj_isocreatorGUID; +} + +void *ISOCreatorFactory::GetInterface(int global_lock) +{ + obj_primo *primo=0; + waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(obj_primo::getServiceGuid()); + if (sf) primo = reinterpret_cast<obj_primo *>(sf->getInterface()); + if (!primo) + return 0; + + ISOCreator *creator = new ISOCreator(primo); + obj_isocreator *ifc= static_cast<obj_isocreator *>(creator); +// if (global_lock) +// WASABI_API_SVC->service_lock(this, (void *)ifc); + return ifc; +} + +int ISOCreatorFactory::SupportNonLockingInterface() +{ + return 1; +} + +int ISOCreatorFactory::ReleaseInterface(void *ifc) +{ + //WASABI_API_SVC->service_unlock(ifc); + obj_isocreator *creatorIFC = static_cast<obj_isocreator *>(ifc); + ISOCreator *creator = static_cast<ISOCreator *>(creatorIFC); + delete creator; + return 1; +} + +const char *ISOCreatorFactory::GetTestString() +{ + return NULL; +} + +int ISOCreatorFactory::ServiceNotify(int msg, int param1, int param2) +{ + return 1; +} + +#define CBCLASS ISOCreatorFactory +START_DISPATCH; +CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType) +CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName) +CB(WASERVICEFACTORY_GETGUID, GetGUID) +CB(WASERVICEFACTORY_GETINTERFACE, GetInterface) +CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface) +CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface) +CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString) +CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify) +END_DISPATCH; +#undef CBCLASS
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/factory_isocreator.h b/Src/Plugins/SDK/burner/factory_isocreator.h new file mode 100644 index 00000000..35849ce4 --- /dev/null +++ b/Src/Plugins/SDK/burner/factory_isocreator.h @@ -0,0 +1,23 @@ +#ifndef NULLSOFT_BURNER_FACTORY_ISOCREATOR_H +#define NULLSOFT_BURNER_FACTORY_ISOCREATOR_H + +#include <api/service/waservicefactory.h> +#include <api/service/services.h> + +class ISOCreatorFactory : public waServiceFactory +{ +public: + FOURCC GetServiceType(); + const char *GetServiceName(); + GUID GetGUID(); + void *GetInterface(int global_lock); + int SupportNonLockingInterface(); + int ReleaseInterface(void *ifc); + const char *GetTestString(); + int ServiceNotify(int msg, int param1, int param2); + +protected: + RECVS_DISPATCH; +}; + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/ifc_burner_writecallback.h b/Src/Plugins/SDK/burner/ifc_burner_writecallback.h new file mode 100644 index 00000000..0eb3aa08 --- /dev/null +++ b/Src/Plugins/SDK/burner/ifc_burner_writecallback.h @@ -0,0 +1,33 @@ +#ifndef NULLSOFT_BURNER_IFC_BURNER_WRITECALLBACK_H +#define NULLSOFT_BURNER_IFC_BURNER_WRITECALLBACK_H + +#include <bfc/dispatch.h> +#include <bfc/platform/types.h> + +class ifc_burner_writecallback : public Dispatchable +{ +protected: + ifc_burner_writecallback() {} + ~ifc_burner_writecallback() {} +public: + int OnStatus(uint32_t sectorsWritten, uint32_t totalSectors); // return 1 to abort or 0 to continue + int Finished(); + enum + { + BURNER_WRITECALLBACK_ONSTATUS = 0, + BURNER_WRITECALLBACK_FINISHED = 1, + }; +}; + + +inline int ifc_burner_writecallback::OnStatus(uint32_t sectorsWritten, uint32_t totalSectors) +{ + return _call(BURNER_WRITECALLBACK_ONSTATUS, (int)0, sectorsWritten, totalSectors); +} + +inline int ifc_burner_writecallback::Finished() +{ + return _call(BURNER_WRITECALLBACK_FINISHED, (int)0); +} + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/isocreator.h b/Src/Plugins/SDK/burner/isocreator.h new file mode 100644 index 00000000..4dd2aa42 --- /dev/null +++ b/Src/Plugins/SDK/burner/isocreator.h @@ -0,0 +1,20 @@ +#pragma once +#include "obj_isocreator.h" +#include "BurnerCommon.h" + + +class ISOCreator : public obj_isocreator, protected BurnerCommon +{ +public: + ISOCreator(obj_primo *_primo); + ~ISOCreator(); + int Open(const wchar_t *volumeName, int format, int media); + int AddFile(const wchar_t *source, const wchar_t *destination); + int AddFolder(const wchar_t *folder); + int Write(const wchar_t *destination, ifc_burner_writecallback *callback); + inline void ForceCallback() { BurnerCommon::TriggerCallback(); } + +protected: + RECVS_DISPATCH; + +};
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/main.cpp b/Src/Plugins/SDK/burner/main.cpp new file mode 100644 index 00000000..6ff0fbe9 --- /dev/null +++ b/Src/Plugins/SDK/burner/main.cpp @@ -0,0 +1,55 @@ +#include "api.h" +#include "../Agave/Component/ifc_wa5component.h" +#include "factory_isocreator.h" +#include "factory_isoburner.h" +#include "factory_databurner.h" +#include <bfc/platform/export.h> + +class WA5_Burner : public ifc_wa5component +{ +public: + void RegisterServices(api_service *service); + int RegisterServicesSafeModeOk(); + void DeregisterServices(api_service *service); +protected: + RECVS_DISPATCH; +}; + +ISOCreatorFactory creatorFactory; +ISOBurnerFactory isoBurnerFactory; +DataBurnerFactory dataBurnerFactory; +api_service *WASABI_API_SVC = 0; + +void WA5_Burner::RegisterServices(api_service *service) +{ + WASABI_API_SVC = service; + WASABI_API_SVC->service_register(&creatorFactory); + WASABI_API_SVC->service_register(&isoBurnerFactory); + WASABI_API_SVC->service_register(&dataBurnerFactory); +} + +int WA5_Burner::RegisterServicesSafeModeOk() +{ + return 1; +} + +void WA5_Burner::DeregisterServices(api_service *service) +{ + service->service_deregister(&creatorFactory); + service->service_deregister(&isoBurnerFactory); + service->service_deregister(&dataBurnerFactory); +} + +static WA5_Burner wa5_burner; +extern "C" DLLEXPORT ifc_wa5component *GetWinamp5SystemComponent() +{ + return &wa5_burner; +} + +#define CBCLASS WA5_Burner +START_DISPATCH; +VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices) +CB(15, RegisterServicesSafeModeOk) +VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices) +END_DISPATCH; +#undef CBCLASS
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/obj_databurner.h b/Src/Plugins/SDK/burner/obj_databurner.h new file mode 100644 index 00000000..2f78d5c0 --- /dev/null +++ b/Src/Plugins/SDK/burner/obj_databurner.h @@ -0,0 +1,60 @@ +#ifndef NULLSOFT_BURNER_OBJ_DATABURNER_H +#define NULLSOFT_BURNER_OBJ_DATABURNER_H + +#include <bfc/dispatch.h> +#include <bfc/platform/types.h> +class ifc_burner_writecallback; + +class obj_databurner : public Dispatchable +{ +protected: + obj_databurner() {} + ~obj_databurner() {} +public: + int Open(const wchar_t *volumeName, wchar_t driveLetter, int format); + int AddFile(const wchar_t *source, const wchar_t *destination); + int AddFolder(const wchar_t *folder); + int Write(int flags, unsigned int speed, ifc_burner_writecallback *callback); + void ForceCallback(); // call this (from another thread) to force the Write() function to call your callback ASAP + + DISPATCH_CODES + { + DATABURNER_OPEN = 0, + DATABURNER_ADDFILE = 1, + DATABURNER_ADDFOLDER = 2, + DATABURNER_WRITE = 3, + DATABURNER_FORCECALLBACK = 4, + }; +}; + +inline int obj_databurner::Open(const wchar_t *volumeName, wchar_t driveLetter, int format) +{ + return _call(DATABURNER_OPEN, (int)1, volumeName, driveLetter, format); +} + +inline int obj_databurner::AddFile(const wchar_t *source, const wchar_t *destination) +{ + return _call(DATABURNER_ADDFILE, (int)1, source, destination); +} + +inline int obj_databurner::AddFolder(const wchar_t *folder) +{ + return _call(DATABURNER_ADDFOLDER, (int)1, folder); +} + +inline int obj_databurner::Write(int flags, unsigned int speed, ifc_burner_writecallback *callback) +{ + return _call(DATABURNER_WRITE, (int)1, flags, speed, callback); +} + +inline void obj_databurner::ForceCallback() +{ + _voidcall(DATABURNER_FORCECALLBACK); +} + +// {0AF177FF-EC9E-4004-8886-B092879895BC} +static const GUID obj_databurnerGUID = +{ 0xaf177ff, 0xec9e, 0x4004, { 0x88, 0x86, 0xb0, 0x92, 0x87, 0x98, 0x95, 0xbc } }; + + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/obj_isoburner.h b/Src/Plugins/SDK/burner/obj_isoburner.h new file mode 100644 index 00000000..477f6671 --- /dev/null +++ b/Src/Plugins/SDK/burner/obj_isoburner.h @@ -0,0 +1,46 @@ +#ifndef NULLSOFT_BURNER_OBJ_ISOBURNER_H +#define NULLSOFT_BURNER_OBJ_ISOBURNER_H + +#include <bfc/dispatch.h> + +class ifc_burner_writecallback; +class obj_isoburner : public Dispatchable +{ +protected: + obj_isoburner(){} + ~obj_isoburner(){} +public: + int Open(); + int Write(wchar_t driveLetter, const wchar_t *isoFile, int flags, unsigned int speed, ifc_burner_writecallback *callback); + void ForceCallback(); // call this (from another thread) to force the Write() function to call your callback ASAP + + DISPATCH_CODES + { + ISOBURNER_OPEN = 0, + ISOBURNER_WRITE = 3, + ISOBURNER_FORCECALLBACK = 4, + }; + +}; + +inline int obj_isoburner::Open() +{ + return _call(ISOBURNER_OPEN, (int)1); +} + +inline int obj_isoburner::Write(wchar_t driveLetter, const wchar_t *isoFile, int flags, unsigned int speed, ifc_burner_writecallback *callback) +{ + return _call(ISOBURNER_OPEN, (int)1, driveLetter, isoFile, flags, speed, callback); +} + +inline void obj_isoburner::ForceCallback() +{ + _voidcall(ISOBURNER_FORCECALLBACK); +} + +// {E3B85A59-E56F-4d2b-8ED2-F02BC4AF8BB5} +static const GUID obj_isoburnerGUID = +{ 0xe3b85a59, 0xe56f, 0x4d2b, { 0x8e, 0xd2, 0xf0, 0x2b, 0xc4, 0xaf, 0x8b, 0xb5 } }; + + +#endif
\ No newline at end of file diff --git a/Src/Plugins/SDK/burner/obj_isocreator.h b/Src/Plugins/SDK/burner/obj_isocreator.h new file mode 100644 index 00000000..8d1014ca --- /dev/null +++ b/Src/Plugins/SDK/burner/obj_isocreator.h @@ -0,0 +1,70 @@ +#pragma once +#include <bfc/dispatch.h> +#include <bfc/platform/types.h> +class ifc_burner_writecallback; + +class obj_isocreator : public Dispatchable +{ +protected: + obj_isocreator(){} + ~obj_isocreator(){} +public: + int Open(const wchar_t *volumeName, int format, int media); + int AddFile(const wchar_t *source, const wchar_t *destination); + int AddFolder(const wchar_t *folder); // AddFile auto-creates the folders. Use AddFolder if you need to create an empty directory + int Write(const wchar_t *destination, ifc_burner_writecallback *callback); + void ForceCallback(); // call this (from another thread) to force the Write() function to call your callback ASAP + + enum + { + FORMAT_ISOLEVEL1 = 0x00000100, + FORMAT_JOLIET = 0x00000200, + FORMAT_UDF = 0x00000400, + FORMAT_ISOLEVEL2 = 0x00200000, + FORMAT_ISOLEVEL3 = 0x00400000, + FORMAT_UDF201 = 0x00100000, + + MEDIA_CD = 0x0, + MEDIA_DVD = 0x08000000, + }; + + enum + { + ISOCREATOR_OPEN = 0, + ISOCREATOR_ADDFILE = 1, + ISOCREATOR_ADDFOLDER = 2, + ISOCREATOR_WRITE = 3, + ISOCREATOR_FORCECALLBACK = 4, + }; + +}; + +inline int obj_isocreator::Open(const wchar_t *volumeName, int format, int media) +{ + return _call(ISOCREATOR_OPEN, (int)1, volumeName, format, media); +} + +inline int obj_isocreator::AddFile(const wchar_t *source, const wchar_t *destination) +{ + return _call(ISOCREATOR_ADDFILE, (int)1, source, destination); +} + +inline int obj_isocreator::AddFolder(const wchar_t *folder) +{ + return _call(ISOCREATOR_ADDFOLDER, (int)1, folder); +} + +inline int obj_isocreator::Write(const wchar_t *destination, ifc_burner_writecallback *callback) +{ + return _call(ISOCREATOR_WRITE, (int)1, destination, callback); +} + +inline void obj_isocreator::ForceCallback() +{ + _voidcall(ISOCREATOR_FORCECALLBACK); +} + +// {4F0ED42C-A6C1-4c60-97D1-16D9BD02E461} +static const GUID obj_isocreatorGUID = +{ 0x4f0ed42c, 0xa6c1, 0x4c60, { 0x97, 0xd1, 0x16, 0xd9, 0xbd, 0x2, 0xe4, 0x61 } }; + diff --git a/Src/Plugins/SDK/burner/resource.h b/Src/Plugins/SDK/burner/resource.h new file mode 100644 index 00000000..9d1284b1 --- /dev/null +++ b/Src/Plugins/SDK/burner/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by burner.rc + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif |