aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Encoder/enc_wma
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Plugins/Encoder/enc_wma')
-rw-r--r--Src/Plugins/Encoder/enc_wma/ASFErr.h256
-rw-r--r--Src/Plugins/Encoder/enc_wma/AudioCoderWMA.cpp468
-rw-r--r--Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h50
-rw-r--r--Src/Plugins/Encoder/enc_wma/config.cpp648
-rw-r--r--Src/Plugins/Encoder/enc_wma/enc_wma.rc128
-rw-r--r--Src/Plugins/Encoder/enc_wma/enc_wma.sln30
-rw-r--r--Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj276
-rw-r--r--Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj.filters44
-rw-r--r--Src/Plugins/Encoder/enc_wma/main.cpp212
-rw-r--r--Src/Plugins/Encoder/enc_wma/main.h55
-rw-r--r--Src/Plugins/Encoder/enc_wma/nserror.h1631
-rw-r--r--Src/Plugins/Encoder/enc_wma/resource.h57
-rw-r--r--Src/Plugins/Encoder/enc_wma/version.rc239
-rw-r--r--Src/Plugins/Encoder/enc_wma/wmaudiosdk.h1009
14 files changed, 4903 insertions, 0 deletions
diff --git a/Src/Plugins/Encoder/enc_wma/ASFErr.h b/Src/Plugins/Encoder/enc_wma/ASFErr.h
new file mode 100644
index 00000000..66bb165e
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/ASFErr.h
@@ -0,0 +1,256 @@
+//=========================================================================
+//
+// THIS SOFTWARE HAS BEEN LICENSED FROM MICROSOFT CORPORATION PURSUANT
+// TO THE TERMS OF AN END USER LICENSE AGREEMENT ("EULA").
+// PLEASE REFER TO THE TEXT OF THE EULA TO DETERMINE THE RIGHTS TO USE THE SOFTWARE.
+//
+// Copyright (C) Microsoft Corporation, 1996 - 1998 All Rights Reserved.
+//
+//=========================================================================
+///////////////////////////////////////////////////////////////////////////
+//
+// ASFErr.h - definition of ASF HRESULT codes
+//
+// Copyright (C) Microsoft Corporation, 1997 - 1998
+//
+// This file is generated by the MC tool from ASFErr.mc
+//
+
+#ifndef _ASFERR_H
+#define _ASFERR_H
+
+
+#define STATUS_SEVERITY(hr) (((hr) >> 30) & 0x3)
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Advanced Streaming Format (ASF) Errors (2000 - 2999)
+//
+//
+// Values are 32 bit values layed out as follows:
+//
+// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +---+-+-+-----------------------+-------------------------------+
+// |Sev|C|R| Facility | Code |
+// +---+-+-+-----------------------+-------------------------------+
+//
+// where
+//
+// Sev - is the severity code
+//
+// 00 - Success
+// 01 - Informational
+// 10 - Warning
+// 11 - Error
+//
+// C - is the Customer code flag
+//
+// R - is a reserved bit
+//
+// Facility - is the facility code
+//
+// Code - is the facility's status code
+//
+//
+// Define the facility codes
+//
+#define FACILITY_NS 0xD
+
+
+//
+// Define the severity codes
+//
+#define STATUS_SEVERITY_WARNING 0x2
+#define STATUS_SEVERITY_SUCCESS 0x0
+#define STATUS_SEVERITY_INFORMATIONAL 0x1
+#define STATUS_SEVERITY_ERROR 0x3
+
+
+//
+// MessageId: ASF_E_BUFFEROVERRUN
+//
+// MessageText:
+//
+// An attempt was made to seek or position past the end of a buffer.%0
+//
+#define ASF_E_BUFFEROVERRUN 0xC00D07D0L
+
+//
+// MessageId: ASF_E_BUFFERTOOSMALL
+//
+// MessageText:
+//
+// The supplied input or output buffer was too small.%0
+//
+#define ASF_E_BUFFERTOOSMALL 0xC00D07D1L
+
+//
+// MessageId: ASF_E_BADLANGUAGEID
+//
+// MessageText:
+//
+// The language ID was not found.%0
+//
+#define ASF_E_BADLANGUAGEID 0xC00D07D2L
+
+//
+// MessageId: ASF_E_NOPAYLOADLENGTH
+//
+// MessageText:
+//
+// The multiple payload packet is missing the payload length.%0
+//
+#define ASF_E_NOPAYLOADLENGTH 0xC00D07DBL
+
+//
+// MessageId: ASF_E_TOOMANYPAYLOADS
+//
+// MessageText:
+//
+// The packet contains too many payloads.%0
+//
+#define ASF_E_TOOMANYPAYLOADS 0xC00D07DCL
+
+//
+// MessageId: ASF_E_PACKETCONTENTTOOLARGE
+//
+// MessageText:
+//
+// ASF_E_PACKETCONTENTTOOLARGE
+//
+#define ASF_E_PACKETCONTENTTOOLARGE 0xC00D07DEL
+
+//
+// MessageId: ASF_E_UNKNOWNPACKETSIZE
+//
+// MessageText:
+//
+// Expecting a fixed packet size but min. and max. are not equal.%0
+//
+#define ASF_E_UNKNOWNPACKETSIZE 0xC00D07E0L
+
+//
+// MessageId: ASF_E_INVALIDHEADER
+//
+// MessageText:
+//
+// ASF_E_INVALIDHEADER
+//
+#define ASF_E_INVALIDHEADER 0xC00D07E2L
+
+//
+// MessageId: ASF_E_NOCLOCKOBJECT
+//
+// MessageText:
+//
+// The object does not have a valid clock object.%0
+//
+#define ASF_E_NOCLOCKOBJECT 0xC00D07E6L
+
+//
+// MessageId: ASF_E_UNKNOWNCLOCKTYPE
+//
+// MessageText:
+//
+// ASF_E_UNKNOWNCLOCKTYPE
+//
+#define ASF_E_UNKNOWNCLOCKTYPE 0xC00D07EBL
+
+//
+// MessageId: ASF_E_OPAQUEPACKET
+//
+// MessageText:
+//
+// An attempt was made to restore or access an opaque packet.%0
+//
+#define ASF_E_OPAQUEPACKET 0xC00D07EDL
+
+//
+// MessageId: ASF_E_WRONGVERSION
+//
+// MessageText:
+//
+// ASF_E_WRONGVERSION
+//
+#define ASF_E_WRONGVERSION 0xC00D07EEL
+
+//
+// MessageId: ASF_E_OVERFLOW
+//
+// MessageText:
+//
+// An attempt was made to store a value which was larger than then destination's maximum value.%0
+//
+#define ASF_E_OVERFLOW 0xC00D07EFL
+
+//
+// MessageId: ASF_E_NOTFOUND
+//
+// MessageText:
+//
+// The object was not found.%0
+//
+#define ASF_E_NOTFOUND 0xC00D07F0L
+
+//
+// MessageId: ASF_E_OBJECTTOOBIG
+//
+// MessageText:
+//
+// The object is too large to be processed in the requested manner.%0
+//
+#define ASF_E_OBJECTTOOBIG 0xC00D07F1L
+
+//
+// MessageId: ASF_E_UNEXPECTEDVALUE
+//
+// MessageText:
+//
+// A value was not set as expected.%0
+//
+#define ASF_E_UNEXPECTEDVALUE 0xC00D07F2L
+
+//
+// MessageId: ASF_E_INVALIDSTATE
+//
+// MessageText:
+//
+// The request is not valid in the object's current state.%0
+//
+#define ASF_E_INVALIDSTATE 0xC00D07F3L
+
+//
+// MessageId: ASF_E_NOLIBRARY
+//
+// MessageText:
+//
+// This object does not have a valid library pointer; it has not been Init()'ed or it has been Shutdown().%0
+//
+#define ASF_E_NOLIBRARY 0xC00D07F4L
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Advanced Streaming Format (ASF) Success Codes (2000 - 2999)
+//
+
+//
+// MessageId: ASF_S_OPAQUEPACKET
+//
+// MessageText:
+//
+// ASF_S_OPAQUEPACKET
+//
+#define ASF_S_OPAQUEPACKET 0x000D07F0L
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Advanced Streaming Format (ASF) Warnings (2000 - 2999)
+//
+
+
+#endif // _ASFERR_H
+
diff --git a/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.cpp b/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.cpp
new file mode 100644
index 00000000..3fa7a7f0
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.cpp
@@ -0,0 +1,468 @@
+#include <windows.h>
+#include <mmreg.h>
+#include <msacm.h>
+#include "../nu/ns_wc.h"
+#include "resource.h"
+#include "wmsdk.h" // for IWMWriterSink
+
+#include "AudioCoderWMA.h"
+
+#include <cassert>
+#include <exception>
+
+#include "../nu/AutoLock.h"
+#include "../nu/AutoWide.h"
+#include "../Winamp/strutil.h"
+#include "../Agave/Language/api_language.h"
+
+/* TODO: implement 2-pass encoding via IWMWriterPreprocess */
+
+int config_bitrate, config_samplerate, config_nch;
+// New globals for encoder query
+
+class CustomIndexStatus : public IWMStatusCallback
+{
+public:
+ CustomIndexStatus( HANDLE _done ) : done(_done), IWMStatusCallback(), refcount(1)
+ {}
+
+ // IUnknown methods
+public:
+ virtual ULONG STDMETHODCALLTYPE AddRef()
+ {
+ return ++refcount;
+ }
+
+
+ virtual ULONG STDMETHODCALLTYPE Release()
+ {
+ // If we go to zero, who cares?
+ return --refcount;
+ }
+
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void **ppvObject)
+ {
+ HRESULT hRetval = E_NOINTERFACE;
+ if (IID_IWMStatusCallback == iid)
+ {
+ *ppvObject = static_cast<IWMStatusCallback *>(this);
+ hRetval = S_OK;
+ }
+ else
+ {
+ *ppvObject = NULL;
+ }
+ return hRetval;
+ }
+
+ // IWMStatusCallback methods
+public:
+ HRESULT STDMETHODCALLTYPE OnStatus( WMT_STATUS Status, HRESULT hr, WMT_ATTR_DATATYPE dwType, BYTE* pValue, void* pvContext )
+ {
+ switch ( Status )
+ {
+ case WMT_CLOSED:
+ // You may want to deal with the HRESULT value passed with the status.
+ // If you do, you should do it here.
+
+ // Signal the event.
+ SetEvent(done);
+ break;
+ }
+ return S_OK;
+ }
+
+protected:
+ ULONG refcount;
+ HANDLE done;
+};
+
+
+// Our custom buffer object, used by the writer sink.
+
+AudioCoderWMA::AudioCoderWMA(int numchannels, int samplerate, int bitspersamp, configtype *cfg, char *configfile) : AudioCoder()
+{
+ lastByteCount=0;
+ writerAdvanced=0;
+ begin_writing = false;
+ error = WMA_NO_ERROR;
+ sink = NULL;
+
+ // Get globals from Winamp.ini config file
+ config_bitrate = cfg->config_bitrate;
+ config_samplerate = cfg->config_samplesSec;
+ config_nch = cfg->config_nch;
+
+ timeunits_per_byte = ( ( (10000000.0) / (double)samplerate ) / (double)numchannels ) / ( (double)bitspersamp / 8.0 );
+ //char t[100] = {0};
+ //wsprintf(t,"%d", timeunits_per_byte);
+ //::MessageBox(NULL, t, t, MB_OK);
+ input_bytecount = 0;
+
+ HRESULT hr = CreateAndConfigureWriter(numchannels, samplerate, bitspersamp, configfile);
+
+ if ( FAILED(hr) )
+ {
+ error = WMA_CANT_CREATE_WRITER;
+ }
+}
+
+AudioCoderWMA::~AudioCoderWMA()
+{
+ if (writer)
+ {
+ if ( begin_writing )
+ {
+ begin_writing = false;
+ writer->EndWriting();
+ }
+ writer->Release();
+ writer = NULL;
+ }
+ if (writerAdvanced)
+ {
+ writerAdvanced->Release();
+ writerAdvanced=0;
+ }
+ if (sink)
+ {
+ sink->Release();
+ sink=0;
+ }
+}
+
+int AudioCoderWMA::GetLastError()
+{
+ return error;
+}
+
+void AudioCoderWMA::PrepareToFinish()
+{
+ // We don't want to kill the objects here, because there might still be data in the pipeline.
+ if (writer && begin_writing)
+ {
+ begin_writing = false;
+ // Tell WM that we're done giving it input data.
+
+ writer->EndWriting();
+ // TODO: do we have to wait for this to finish?
+ }
+}
+
+void AudioCoderWMA::OnFinished(const wchar_t *wfname)
+{
+ //
+ // Okay, here we need to go back and index the file we just wrote so it's seekable.
+ //
+
+ // From: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmform/htm/toconfiguretheindexer.asp
+ // And: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmform/htm/toindexanasffile.asp
+ IWMIndexer* pBaseIndexer = NULL;
+ IWMIndexer2* pMyIndexer = NULL;
+
+ // Create an indexer.
+ WMCreateIndexer(&pBaseIndexer);
+
+ // Retrieve an IWMIndexer2 interface pointer for the indexer just created.
+ pBaseIndexer->QueryInterface(IID_IWMIndexer2, (void **) & pMyIndexer);
+
+ // Release the base indexer.
+ pBaseIndexer->Release();
+ pBaseIndexer = NULL;
+
+ // Configure the indexer to create a timecode-based index.
+ pMyIndexer->Configure(0, // Stream Number, use all.
+ WMT_IT_PRESENTATION_TIME, // Indexer type.
+ NULL, // Index interval, use default.
+ NULL); // Index type, use default.
+
+ // Create an event for asynchronous calls.
+ HANDLE done = CreateEvent(NULL, TRUE, FALSE, NULL);
+
+ // Give that to the status object
+ CustomIndexStatus status( done );
+
+ // Start the indexer.
+ pMyIndexer->StartIndexing(tempFilename, &status, NULL);
+
+ // Wait for the indexer to finish.
+ WaitForSingleObject(done, INFINITE);
+
+ // Release the remaining interface.
+ pMyIndexer->Release();
+ pMyIndexer = NULL;
+
+ // Cleanup
+ CloseHandle( done );
+ DeleteFileW(wfname);
+ MoveFileW(tempFilename, wfname);
+
+}
+
+int AudioCoderWMA::Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail)
+{
+ HRESULT hr = S_OK;
+ int retval = 0; // number of bytes written into "out"
+ *in_used = 0; // number of bytes read from "in"
+ if ( !framepos && !in_avail )
+ {
+ int x = 0;
+ x++;
+ }
+ assert(writer);
+
+ // Hopefully, at the end of the stream, we still get called with "Encode" until we return 0?
+ if (in_avail)
+ {
+ // Allocate an INSSBuffer of the proper size to hold all the data.
+ INSSBuffer* pSample = NULL;
+ if (FAILED(writer->AllocateSample(in_avail, &pSample))) return -1;
+
+ // Get its internal memory buffer
+ DWORD newBufferLength;
+ pSample->GetLength(&newBufferLength);
+ assert(newBufferLength == in_avail);
+
+ BYTE *pdwBuffer = NULL;
+ if (FAILED(pSample->GetBuffer(&pdwBuffer))) return -1;
+
+ memcpy(pdwBuffer, in, in_avail); // Send all the available bytes in the input buffer into the IWMWriter,
+
+ pSample->SetLength(in_avail); // Tell the buffer object how much we used
+
+ QWORD timeunits = (QWORD)( (double)input_bytecount * timeunits_per_byte ); // Compute the current timecode
+ // And stuff it into the writer
+ hr = writer->WriteSample(0, timeunits, 0, pSample);
+ if (FAILED(hr))
+ {
+ }
+ else
+ {
+ // Increment the bytecount to be able to calculate the next timecode
+ input_bytecount += in_avail;
+ // And tell the host we used up all the available input data.
+ *in_used = in_avail;
+ }
+ // Release immediately
+ pSample->Release();
+ }
+
+ WM_WRITER_STATISTICS stats;
+ writerAdvanced->GetStatistics(0, &stats);
+ retval = (int)(stats.qwByteCount - lastByteCount);
+ retval = min(retval, out_avail);
+ lastByteCount+=retval;
+ memset(out, 0, retval); // so we don't write random memory to disk
+
+ return retval;
+}
+
+HRESULT AudioCoderWMA::SelectAndLoadResampler(int numchannels, int samplerate, int bitspersamp)
+{
+ DWORD inCount = 0;
+ BOOL success = false;
+
+ //wsprintf(junk,"IN Chan=%d, SRate=%d, BPS=%d", numchannels, samplerate,bitspersamp);
+ //MessageBox(NULL, junk, "INPUT FMT", MB_OK);
+ // First get the number of input streams
+ HRESULT hr = writer->GetInputCount(&inCount);
+ if(!FAILED(hr)){
+ //wsprintf(junk, "Input Count = %d", inCount);
+ //MessageBox(NULL, junk, "DEBUG", MB_OK);
+ // Now get the number of input formats we can resample for
+ DWORD fmtCount = 0;
+ hr = writer->GetInputFormatCount(0, &fmtCount);
+ if(!FAILED(hr)){
+ //wsprintf(junk, "Format Count = %d", fmtCount);
+ //MessageBox(NULL, junk, "DEBUG", MB_OK);
+ // Now cycle through and find the one that matches our input fmt
+ for(size_t i = 0;i < fmtCount;i++){
+ IWMInputMediaProps* pProps = NULL;
+ hr = writer->GetInputFormat(0, (DWORD)i, &pProps);
+ if(!FAILED(hr)){
+ DWORD cbSize = 0;
+ // Get the size of the media type structure.
+ pProps->GetMediaType(NULL, &cbSize);
+ // Allocate memory for the media type structure.
+ WM_MEDIA_TYPE* pType = (WM_MEDIA_TYPE*) new BYTE[cbSize];
+ if(pType != NULL){
+ WAVEFORMATEX* pwave = NULL;
+ // Get the media type structure.
+ hr = pProps->GetMediaType(pType, &cbSize);
+ // Check that the format data is present.
+ if (pType->cbFormat >= sizeof(WAVEFORMATEX)){
+ pwave = (WAVEFORMATEX*)pType->pbFormat;
+ //wsprintf(junk, "Cnannels = %d, SPerSec = %d, AvgBPS = %d, BPS = %d BALIGN = %d",
+ // pwave->nChannels,
+ // pwave->nSamplesPerSec,
+ // pwave->nAvgBytesPerSec,
+ // pwave->wBitsPerSample,
+ // pwave->nBlockAlign);
+ //MessageBox(NULL, junk, "DEBUG", MB_OK);
+ }
+ else{
+ break;
+ }
+ // Try to match the channels/samplerate/and bits/samp
+ if((pwave->nChannels == numchannels) && (pwave->nSamplesPerSec == samplerate) && (pwave->wBitsPerSample == bitspersamp)){
+ writer->SetInputProps(0, pProps);
+ success = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if(success != 1){
+ wchar_t junk[FILETITLE_SIZE] = {0};
+ wsprintfW(junk,WASABI_API_LNGSTRINGW(IDS_CANNOT_FIND_INPUT_FORMATTER),
+ numchannels, samplerate,bitspersamp);
+ MessageBoxW(NULL, junk, WASABI_API_LNGSTRINGW(IDS_WARNING), MB_OK);
+ }
+ if (success)
+ return S_OK;
+ else if (FAILED(hr)) // if we have an error code, return it
+ return hr;
+ else
+ return E_FAIL;
+}
+
+
+HRESULT AudioCoderWMA::CreateAndConfigureWriter(WORD numchannels, WORD samplerate, WORD bitspersamp, char *configfile)
+{
+ // First, create the writer.
+ HRESULT hr = WMCreateWriter( NULL, &writer );
+ if ( !FAILED(hr) )
+ {
+ // Create and Configure a stream profile with the given wave limits.
+ WAVEFORMATEX WaveLimits =
+ {
+ WAVE_FORMAT_PCM,
+ numchannels,
+ samplerate,
+ samplerate * numchannels * bitspersamp / (DWORD)8,
+ numchannels * bitspersamp / (DWORD)8,
+ bitspersamp,
+ 0
+ };
+ IWMProfile* pProfile = NULL;
+ hr = CreateAndConfigureProfile(&WaveLimits, &pProfile, configfile);
+ if ( !FAILED(hr) )
+ {
+ // Set the profile into the writer
+ hr = writer->SetProfile( pProfile );
+ if ( !FAILED(hr) )
+ {
+ // Go get the input resampler and load it to the profile
+ hr = SelectAndLoadResampler(numchannels, samplerate, bitspersamp);
+ if (!FAILED(hr))
+ {
+ wchar_t tempPath[MAX_PATH] = {0};
+ GetTempPathW(MAX_PATH,tempPath);
+ GetTempFileNameW(tempPath, L"wma", 0, tempFilename);
+
+ // Make the custom data sink object
+ WMCreateWriterFileSink(&sink);
+ //sink = new CustomWMWriterSink;
+ if ( sink )
+ {
+ sink->Open(tempFilename);
+ HRESULT hr;
+ // From MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmform/htm/addingsinkstothewriter.asp
+ IWMWriterSink* pSinkBase = NULL;
+ hr = writer->QueryInterface( IID_IWMWriterAdvanced, (void **) & writerAdvanced );
+ if ( !FAILED(hr) )
+ {
+ hr = sink->QueryInterface( IID_IWMWriterSink, (void**) & pSinkBase );
+ if ( !FAILED(hr) )
+ {
+ // Stuff the custom data sink into the writer.
+ hr = writerAdvanced->AddSink(pSinkBase);
+ if ( !FAILED(hr) )
+ {
+ // And let the writer initialize itself for output.
+ hr = writer->BeginWriting();
+ if ( !FAILED(hr) )
+ {
+ begin_writing = true;
+ }
+ }
+ else
+ {
+ error = WMA_CANT_ADD_SINK;
+ }
+ }
+ else
+ {
+ error = WMA_CANT_QUERY_SINK_INTERFACE;
+ }
+ }
+ else
+ {
+ error = WMA_CANT_QUERY_WRITER_INTERFACE;
+ }
+ }
+ else
+ {
+ error = WMA_CANT_MAKE_CUSTOM_SINK;
+ }
+ }
+ }
+ }
+ }
+
+ return hr;
+}
+
+HRESULT AudioCoderWMA::CreateAndConfigureProfile(WAVEFORMATEX* pWaveLimits, IWMProfile** ppProfile, char *configfile)
+{
+ IWMProfileManager* pProfileMgr = NULL;
+
+ // Instantiate a profile manager object.
+ HRESULT hr = WMCreateProfileManager(&pProfileMgr);
+ if ( !FAILED(hr) )
+ {
+ /* SAVE
+ // Create the empty profile.
+ //hr = pProfileMgr->CreateEmptyProfile(WMT_VER_9_0, ppProfile);
+ if ( !FAILED(hr) ){
+ IWMCodecInfo3 *codecInfo = NULL;
+ hr = pProfileMgr->QueryInterface(&codecInfo);
+ if(!FAILED(hr)){
+ // Find the proper IWMStreamConfig that matches the WAVEFORMATEX data.
+ IWMStreamConfig* pStreamConfig = NULL;
+ //hr = FindAudioFormat(WMMEDIASUBTYPE_WMAudioV2, pProfileMgr, pWaveLimits, config_bitrate * 1000, FALSE, &pStreamConfig);
+ hr = codecInfo->GetCodecFormat(WMMEDIATYPE_Audio, config_encOffset, config_formatOffset, &pStreamConfig);
+ if ( !FAILED(hr) ){
+ // Config the stream.
+ // hr = pStreamConfig->SetBitrate( config_bitrate );
+ hr = pStreamConfig->SetConnectionName( L"enc_wma" );
+ hr = pStreamConfig->SetStreamName( L"enc_wma" );
+ hr = pStreamConfig->SetStreamNumber( 1 );
+
+ // Stuff it into the profile
+ hr = (*ppProfile)->AddStream( pStreamConfig );
+ }
+ }
+ }
+ */
+ if ( !FAILED(hr) ){
+ // Load the .prx file into the writer
+ if(configfile == NULL){
+ hr = E_FAIL;
+ }
+ else{
+ wchar_t cstring[4000] = {0};
+ GetPrivateProfileStructW(L"audio_wma", L"profile", cstring, sizeof(cstring)/sizeof(*cstring), AutoWide(configfile));
+ hr = pProfileMgr->LoadProfileByData(cstring, ppProfile);
+ if(hr != S_OK){
+ hr = E_FAIL;
+ }
+ }
+ }
+ pProfileMgr->Release();
+ }
+ return hr;
+} \ No newline at end of file
diff --git a/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h b/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h
new file mode 100644
index 00000000..0e877a97
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h
@@ -0,0 +1,50 @@
+#ifndef AUDIOCODERWMA_H
+#define AUDIOCODERWMA_H
+
+#include "../nsv/enc_if.h"
+#include "main.h"
+
+class CustomWMWriterSink;
+
+class AudioCoderWMA : public AudioCoder
+{
+public:
+ AudioCoderWMA(int nch, int srate, int bps, configtype *cfg, char *configfile);
+ virtual int Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail); //returns bytes in out
+ virtual ~AudioCoderWMA();
+ int GetLastError();
+ void PrepareToFinish();
+ void OnFinished(const wchar_t *filename);
+ HRESULT SelectAndLoadResampler(int numchannels, int samplerate, int bitpersamp);
+
+ HRESULT CreateAndConfigureWriter(WORD nch, WORD srate, WORD bps, char *configfile);
+ HRESULT CreateAndConfigureProfile(WAVEFORMATEX* pWaveLimits, IWMProfile** ppProfile, char *configfile);
+
+private:
+ bool begin_writing;
+ int error;
+ IWMWriterFileSink *sink;
+ IWMWriter *writer;
+ IWMWriterAdvanced *writerAdvanced;
+ double timeunits_per_byte; // "100 nanosecond units" -- ie: ( ( (10000000.0) / (double)samplerate ) / (double)numchannels ) / ( (double)bitspersamp/ 8.0 )
+ int input_bytecount;
+ QWORD lastByteCount;
+ wchar_t tempFilename[MAX_PATH];
+
+};
+
+enum AudioCoderWMAErrors
+{
+ WMA_NO_ERROR = 0,
+ WMA_CANT_FIND_WMSDK = -1,
+ WMA_CANT_LOAD_CREATOR = -2,
+ WMA_CANT_CREATE_WRITER = -3,
+ WMA_CANT_SET_INPUT_FORMAT = -4,
+ WMA_CANT_SET_OUTPUT_FORMAT = -5,
+ WMA_CANT_MAKE_CUSTOM_SINK = -6,
+ WMA_CANT_QUERY_WRITER_INTERFACE = -7,
+ WMA_CANT_QUERY_SINK_INTERFACE = -8,
+ WMA_CANT_ADD_SINK = -9,
+};
+
+#endif//AUDIOCODERWMA_H
diff --git a/Src/Plugins/Encoder/enc_wma/config.cpp b/Src/Plugins/Encoder/enc_wma/config.cpp
new file mode 100644
index 00000000..a1114f17
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/config.cpp
@@ -0,0 +1,648 @@
+#include <windows.h>
+
+// LGIVEN Mods 4-10-05
+#include "main.h"
+#include <wmsdk.h>
+#include "../nu/AutoWide.h"
+#include "../nu/ns_wc.h"
+#include "../Agave/Language/api_language.h"
+#include <MMSystem.h>
+#include <assert.h>
+
+#define MAX_PASSES 1 // limited to 1pass encoding until we work out some code for 2pass encoding
+
+// LGIVEN Mods 4-10-05
+void readconfig(char *configfile, configtype *cfg)
+{
+ cfg->config_bitrate = 0;
+ cfg->config_bitsSample = 0;
+ cfg->config_nch = 0;
+ cfg->config_samplesSec = 0;
+ cfg->config_encoder = 0;
+ cfg->config_vbr = 0;
+ cfg->config_passes = 1;
+ if (configfile)
+ {
+ GetPrivateProfileStructA("audio_wma", "conf", cfg, sizeof(configtype), configfile);
+ }
+}
+
+void writeconfig(char *configfile, configtype *cfg)
+{
+ if (configfile)
+ {
+ WritePrivateProfileStructA("audio_wma", "conf", cfg, sizeof(configtype), configfile);
+ }
+}
+
+// New global table for channels,samplerates and bitrates
+static EncoderType* encs = NULL; // Pointer to the TABLE with all config data
+// Globals store current selections from Config Dialog
+// Number of encoders
+static int encNumbs = 0; // Total number of encoders installed WMA
+
+// New routine to read all config info from WMA encoder and load tables
+
+static BOOL loadWMATables()
+{
+ IWMProfileManager *profileManager;
+ IWMProfileManager2 *profileManager2;
+ IWMCodecInfo3 *codecInfo;
+ WAVEFORMATEX *pwave;
+ HRESULT hr;
+ int legalFormats = 0;
+
+ WMCreateProfileManager(&profileManager);
+ profileManager->QueryInterface(&profileManager2);
+ profileManager2->SetSystemProfileVersion(WMT_VER_9_0);
+
+ profileManager->QueryInterface(&codecInfo);
+ // Get the number of AUDIO Codecs
+ DWORD numCodecs = 0;
+ codecInfo->GetCodecInfoCount(WMMEDIATYPE_Audio, &numCodecs);
+ // If there are no encoders, just return
+ if (numCodecs == 0)
+ {
+ return false;
+ }
+ // Allocate structs for codecs and zero them all
+ encs = (EncoderType *) calloc(numCodecs * 4, sizeof(struct EncoderType));
+ if (encs != NULL)
+ {
+ encNumbs = numCodecs * 4;
+ }
+ else
+ {
+ wchar_t titleStr[32] = {0};
+ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_ALLOCATE_MEM),
+ WASABI_API_LNGSTRINGW_BUF(IDS_WMA_ENCODER_ERROR,titleStr,32), MB_OK);
+ return false;
+ }
+ // Now cycle through the codecs
+ EncoderType* encp = encs;
+ for (BOOL isVBR = 0;isVBR != 2;isVBR++)
+ for (DWORD numPasses = 1;numPasses <= MAX_PASSES;numPasses++)
+ for (DWORD i = 0;i != numCodecs;i++)
+ {
+ wchar_t codecName[5000] = {0};
+ DWORD codecNameSize = 5000;
+
+ codecInfo->SetCodecEnumerationSetting(WMMEDIATYPE_Audio, i, g_wszVBREnabled, WMT_TYPE_BOOL, (BYTE *)&isVBR, sizeof(BOOL));
+ codecInfo->SetCodecEnumerationSetting(WMMEDIATYPE_Audio, i, g_wszNumPasses, WMT_TYPE_DWORD, (BYTE *)&numPasses, sizeof(DWORD));
+ codecInfo->GetCodecName(WMMEDIATYPE_Audio, i, codecName, &codecNameSize);
+ // Get the number of formats for this codec
+ DWORD formatCount = 0;
+ hr = codecInfo->GetCodecFormatCount( WMMEDIATYPE_Audio, i, &formatCount );
+ if (FAILED(hr))
+ {
+ continue;
+ }
+ else if (formatCount == 0)
+ {
+ continue;
+ }
+ else
+ {
+ // Fill the EncoderType struct and allocate structs for format info
+ // First allocate the space for all the formatType structs
+ encp->formats = (formatType *) malloc(formatCount * sizeof(struct formatType));
+ if (encp->formats == NULL)
+ {
+ wchar_t titleStr[32] = {0};
+ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_ALLOCATE_MEM),
+ WASABI_API_LNGSTRINGW_BUF(IDS_WMA_ENCODER_ERROR,titleStr,32), MB_OK);
+ return false;
+ }
+ // Now fill the EncoderType struct with name and info
+ encp->encoderName = _wcsdup(codecName);
+ encp->numFormats = formatCount;
+ encp->offset = i;
+ encp->vbr = isVBR;
+ encp->numPasses = numPasses;
+ }
+ // Now cycle through the formats for this codec
+ legalFormats = 0;
+ formatType *fmts = encp->formats;
+ for (DWORD f = 0;f != formatCount;f++)
+ {
+ wchar_t fDesc[5000] = {0};
+ DWORD size = 5000;
+ // Get the config info for this encoding format in string format
+ IWMStreamConfig *streamConfig;
+ codecInfo->GetCodecFormatDesc(WMMEDIATYPE_Audio, i, f, &streamConfig, fDesc, &size);
+ // Now get the config info
+ IWMMediaProps *props;
+ streamConfig->QueryInterface(&props);
+ // Get the bitrate
+ //DWORD bitRate;
+ //streamConfig->GetBitrate(&bitRate);
+ // Get the Media Encoder type
+ DWORD mediaTypeSize;
+ props->GetMediaType(0, &mediaTypeSize);
+ WM_MEDIA_TYPE *mediaType = (WM_MEDIA_TYPE *)new char[mediaTypeSize];
+ props->GetMediaType(mediaType, &mediaTypeSize);
+ // Go get the WAVEFORMATEX Struct from the
+ if (mediaType->cbFormat >= sizeof(WAVEFORMATEX))
+ {
+ pwave = (WAVEFORMATEX*)mediaType->pbFormat;
+ if (pwave != NULL)
+ {
+ // Check to see if this is an A/V codec format
+ // If so, do not save it
+
+ /*
+ if ((pwave->nAvgBytesPerSec / pwave->nBlockAlign) ==
+ ((pwave->nAvgBytesPerSec >= 3995) ? 5 : 3))
+ {
+ delete(mediaType);
+ props->Release();
+ streamConfig->Release();
+ continue;
+ }*/
+
+ // old way of checking
+ if ((wcsstr(fDesc, L"A/V")) != NULL)
+ {
+ delete[] (mediaType);
+ props->Release();
+ streamConfig->Release();
+ continue;
+ }
+ // Load the format name
+ fmts->formatName = _wcsdup(fDesc);
+ // Load all the format values and the offset
+ if ((pwave->nAvgBytesPerSec & 0x7FFFFF00) == 0x7FFFFF00)
+ {
+ fmts->bitrate = (pwave->nAvgBytesPerSec & 0x000000FF);
+ fmts->vbr = 1;
+ }
+ else
+ {
+ fmts->bitrate = (pwave->nAvgBytesPerSec * 8);
+ fmts->vbr = 0;
+ }
+ fmts->bitsSample = pwave->wBitsPerSample;
+ fmts->nChannels = pwave->nChannels;
+ fmts->samplesSec = pwave->nSamplesPerSec;
+ fmts->offset = f;
+ }
+ else
+ {
+ wchar_t titleStr[32] = {0};
+ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_GET_STRUCTURE),
+ WASABI_API_LNGSTRINGW_BUF(IDS_WMA_ENCODER_ERROR,titleStr,32), MB_OK);
+ return false;
+ }
+ }
+ else
+ {
+ wchar_t titleStr[32] = {0};
+ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_GET_ENCODER4_INFO),
+ WASABI_API_LNGSTRINGW_BUF(IDS_WMA_ENCODER_ERROR,titleStr,32), MB_OK);
+ return false;
+ }
+ // Set the media type value in the EncoderType struct on first legal format
+ if (f == 0)
+ {
+ encp->mediaType = mediaType->subtype;
+ }
+ // Now point to the next table block and inc the legal formats count
+ fmts++;
+ legalFormats++;
+ // And release the props and streams structs
+ delete[] (mediaType);
+ props->Release();
+ streamConfig->Release();
+
+ }
+ // If there are no legal formats for this codec then skip it
+ if (legalFormats == 0)
+ {
+ delete[] encp->encoderName;
+ encp->encoderName = NULL;
+ encp->numFormats = legalFormats;
+ encp->offset = 0;
+ }
+ // Else load number of legal formats and save it
+ else
+ {
+ encp->numFormats = legalFormats;
+ encp++;
+ }
+ }
+ return true;
+}
+
+static int FindFormatNumber(formatType *formats, int numFormats, configtype *cfg)
+{
+ for (int i = 0;i < numFormats;i++, formats++)
+ {
+ if (formats->bitrate == cfg->config_bitrate
+ && formats->bitsSample == cfg->config_bitsSample
+ && formats->nChannels == cfg->config_nch
+ && formats->samplesSec == cfg->config_samplesSec)
+ return formats->offset;
+ }
+
+ return 0;
+}
+
+static VOID dumpProfile(char *configfile, BOOL isVBR, DWORD numPasses, int encNumb, int fmtNumb)
+{
+ // Create a Profile and dump it
+ IWMProfileManager *pmgr = NULL;
+ IWMProfile *prof = NULL;
+ IWMStreamConfig *sconf = NULL;
+ IWMCodecInfo3 *cinfo = NULL;
+ DWORD ssize;
+ wchar_t errorTitle[128] = {0};
+ WASABI_API_LNGSTRINGW_BUF(IDS_WMA_CONFIG_FILE_ERROR,errorTitle,128);
+
+ HRESULT hr = WMCreateProfileManager(&pmgr);
+ if (!FAILED(hr))
+ {
+ hr = pmgr->CreateEmptyProfile(WMT_VER_9_0, &prof);
+ if (!FAILED(hr))
+ {
+ hr = pmgr->QueryInterface(&cinfo);
+ if (!FAILED(hr))
+ {
+ cinfo->SetCodecEnumerationSetting(WMMEDIATYPE_Audio, encNumb, g_wszVBREnabled, WMT_TYPE_BOOL, (BYTE *)&isVBR, sizeof(BOOL));
+ cinfo->SetCodecEnumerationSetting(WMMEDIATYPE_Audio, encNumb, g_wszNumPasses, WMT_TYPE_DWORD, (BYTE *)&numPasses, sizeof(DWORD));
+ cinfo->GetCodecFormat(WMMEDIATYPE_Audio, encNumb, fmtNumb, &sconf);
+ sconf->SetConnectionName(L"enc_wma");
+ sconf->SetStreamName(L"enc_wma");
+ sconf->SetStreamNumber(1);
+ hr = prof->AddStream(sconf);
+ if (!FAILED(hr))
+ {
+ hr = pmgr->SaveProfile(prof, NULL, &ssize);
+ if (!FAILED(hr))
+ {
+ WCHAR* pstring = new WCHAR[ssize];
+ if (pstring != NULL)
+ {
+ hr = pmgr->SaveProfile(prof, pstring, &ssize);
+ if (!FAILED(hr))
+ {
+ wchar_t cstring[4000] = {0};
+ wcsncpy(cstring, pstring, 4000 - 1);
+ WritePrivateProfileStructW(L"audio_wma", L"profile", cstring, sizeof(cstring) / sizeof(*cstring), AutoWide(configfile));
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_SAVE_PROFILE_READ_ERROR), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_MEM_ALLOCATION_ERROR), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_PROFILE_SAVE_SIZE_ERROR), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_READ_AUDIO_STREAM), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_GET_CODEC_INFO), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_CREATE_A_PROFILE), errorTitle, MB_OK); }
+ }
+ else{ MessageBoxW(NULL, WASABI_API_LNGSTRINGW(IDS_CANNOT_CREATE_PROFILE_MANAGER), errorTitle, MB_OK); }
+ pmgr->Release();
+ prof->Release();
+ sconf->Release();
+ cinfo->Release();
+}
+
+static bool Has(HWND hwndDlg, int item, int data)
+{
+ int numChoices = SendDlgItemMessage(hwndDlg, item, CB_GETCOUNT, 0, 0);
+ for (int i = 0;i < numChoices;i++)
+ {
+ if (SendDlgItemMessage(hwndDlg, item, CB_GETITEMDATA, i, 0) == data)
+ return true;
+ }
+ return false;
+}
+
+static int EncodeSampleFormat(int bps, int numChannels, int sampleRate)
+{
+ // 20 bits sampleRate
+ assert((sampleRate & 0xFFFFF) == sampleRate);
+ // 6 bits numChannels
+ assert((numChannels & 0x3F) == numChannels);
+ // 6 bits bps
+ assert((bps & 0x3F) == bps);
+
+ return (sampleRate << 12) | (numChannels << 6) | (bps);
+}
+
+static void DecodeSampleFormat(int data, int &bps, int &numChannels, int &sampleRate)
+{
+ bps = data & 0x3F;
+ data >>= 6;
+ numChannels = data & 0x3F;
+ data >>= 6;
+ sampleRate = data;
+}
+
+static int EncodeVBR(BOOL isVBR, DWORD numPasses)
+{
+ // 1 bits VBR
+ assert((isVBR & 0x1) == isVBR);
+ // 15 bits numPasses
+ assert((numPasses & 0x7FFF) == numPasses);
+
+ return (isVBR << 15) | (numPasses);
+}
+
+static void DecodeVBR(int data, BOOL &isVBR, DWORD &numPasses)
+{
+ numPasses = data & 0x7FFF;
+ data >>= 15;
+ isVBR = data & 0x1;
+}
+
+static void AutoSelect(HWND hwndDlg, int dlgItem)
+{
+ if (SendDlgItemMessage(hwndDlg, dlgItem, CB_GETCURSEL, 0, 0) == CB_ERR)
+ SendDlgItemMessage(hwndDlg, dlgItem, CB_SETCURSEL, 0, 0);
+}
+
+static EncoderType *FindEncoder(int encoderNumber, BOOL isVBR, DWORD numPasses)
+{
+ EncoderType* enc = encs;
+ for (int i = 0;i < encNumbs;i++, enc++)
+ {
+ if (enc->encoderName == NULL)
+ return 0; //WTF?
+ if (enc->offset == encoderNumber && enc->vbr == isVBR && enc->numPasses == numPasses)
+ return enc;
+ }
+ return 0; //WTF?
+}
+
+#define MASK_ENCODER 0x1
+#define MASK_VBR 0x2
+#define MASK_SAMPLE_FORMAT 0x4
+#define MASK_BITRATE 0x8
+#define MASK_ALL 0xF
+
+static void ResetConfig(HWND hwndDlg, EncoderType *encs, configtype *cfg, int mask)
+{
+ wchar_t buf1[100] = {0};
+ EncoderType* enc = encs;
+
+ if (mask & MASK_ENCODER) SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_RESETCONTENT, 0, 0);
+ if (mask & MASK_SAMPLE_FORMAT) SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_RESETCONTENT, 0, 0);
+ if (mask & MASK_BITRATE) SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_RESETCONTENT, 0, 0);
+ if (mask & MASK_VBR) SendDlgItemMessage(hwndDlg, IDC_VBR, CB_RESETCONTENT, 0, 0);
+
+ // reset encoders
+ int thisVBR = EncodeVBR(cfg->config_vbr, cfg->config_passes);
+ for (int i = 0;i < encNumbs;i++, enc++)
+ {
+ if (enc->encoderName == NULL)
+ break;
+ else if ((mask & MASK_ENCODER) && !Has(hwndDlg, IDC_ENCODER, enc->offset))
+ {
+ int newpos = SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_ADDSTRING, 0, (LPARAM)enc->encoderName);
+ SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_SETITEMDATA, newpos, enc->offset);
+
+ if (cfg->config_encoder == enc->offset)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_SETCURSEL, newpos, 0);
+ }
+ }
+ int data = EncodeVBR(enc->vbr, enc->numPasses);
+ if ((mask & MASK_VBR) && cfg->config_encoder == enc->offset && !Has(hwndDlg, IDC_VBR, data))
+ {
+ int newpos = CB_ERR;
+ if (enc->vbr == FALSE && enc->numPasses == 1)
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_VBR, CB_ADDSTRING, 0, (LPARAM)WASABI_API_LNGSTRINGW(IDS_CBR));
+ else if (enc->vbr == FALSE && enc->numPasses == 2)
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_VBR, CB_ADDSTRING, 0, (LPARAM)WASABI_API_LNGSTRINGW(IDS_2_PASS_CBR));
+ else if (enc->vbr == TRUE && enc->numPasses == 1)
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_VBR, CB_ADDSTRING, 0, (LPARAM)WASABI_API_LNGSTRINGW(IDS_VBR));
+ else if (enc->vbr == TRUE && enc->numPasses == 2)
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_VBR, CB_ADDSTRING, 0, (LPARAM)WASABI_API_LNGSTRINGW(IDS_ABR));
+
+ SendDlgItemMessage(hwndDlg, IDC_VBR, CB_SETITEMDATA, newpos, data);
+
+ if (thisVBR == data)
+ SendDlgItemMessage(hwndDlg, IDC_VBR, CB_SETCURSEL, newpos, 0);
+ }
+ }
+
+ AutoSelect(hwndDlg, IDC_ENCODER);
+ AutoSelect(hwndDlg, IDC_VBR);
+ int pos = SendDlgItemMessage(hwndDlg, IDC_VBR, CB_GETCURSEL, 0, 0);
+ int data = SendDlgItemMessage(hwndDlg, IDC_VBR, CB_GETITEMDATA, pos, 0);
+ DecodeVBR(data, cfg->config_vbr, cfg->config_passes);
+
+ pos = SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_GETCURSEL, 0, 0);
+ data = SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_GETITEMDATA, pos, 0);
+ cfg->config_encoder = data;
+
+ // Now set up for dialog fill
+ enc = FindEncoder(cfg->config_encoder, cfg->config_vbr, cfg->config_passes);
+
+ // Fill the current values
+ formatType *fmt = enc->formats;
+
+ int thisSampleFormat = EncodeSampleFormat(cfg->config_bitsSample, cfg->config_nch, cfg->config_samplesSec);
+ for (int i = 0;i < enc->numFormats;i++, fmt++)
+ {
+ int data = EncodeSampleFormat(fmt->bitsSample, fmt->nChannels, fmt->samplesSec);
+ // Add channels to list
+ if ((mask & MASK_SAMPLE_FORMAT) && !Has(hwndDlg, IDC_SAMPLE_FORMAT, data))
+ {
+ if (fmt->nChannels == 1)
+ wsprintfW(buf1, WASABI_API_LNGSTRINGW(IDS_MONO_INFO), fmt->bitsSample, fmt->samplesSec);
+ else if (fmt->nChannels == 2)
+ wsprintfW(buf1, WASABI_API_LNGSTRINGW(IDS_STEREO_INFO), fmt->bitsSample, fmt->samplesSec);
+ else
+ wsprintfW(buf1, WASABI_API_LNGSTRINGW(IDS_CHANNELS_INFO), fmt->bitsSample, fmt->nChannels, fmt->samplesSec);
+
+ int newpos;
+ if (fmt->bitsSample)
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_SAMPLE_FORMAT, CB_ADDSTRING, 0, (LPARAM)buf1);
+ else
+ newpos = SendDlgItemMessageW(hwndDlg, IDC_SAMPLE_FORMAT, CB_ADDSTRING, 0, (LPARAM)buf1 + 8); // skip "0 bits, "
+
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_SETITEMDATA, newpos, data);
+ // Now set current select for number of channels sample
+ if (thisSampleFormat == data)
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_SETCURSEL, newpos, 0);
+ }
+ }
+
+ if (SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETCURSEL, 0, 0) == CB_ERR)
+ {
+ int num = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETCOUNT, 0, 0);
+ int defaultSampleFormat = EncodeSampleFormat(16, 2, 44100);
+ for (int i = 0;i < num;i++)
+ {
+ int data = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETITEMDATA, i, 0);
+ if (data == defaultSampleFormat)
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_SETCURSEL, i, 0);
+ }
+ }
+
+ AutoSelect(hwndDlg, IDC_SAMPLE_FORMAT);
+ pos = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETCURSEL, 0, 0);
+ data = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETITEMDATA, pos, 0);
+ DecodeSampleFormat(data, cfg->config_bitsSample, cfg->config_nch, cfg->config_samplesSec);
+
+ thisSampleFormat = EncodeSampleFormat(cfg->config_bitsSample, cfg->config_nch, cfg->config_samplesSec);
+
+ // Next Show the Bitrates
+ fmt = enc->formats;
+ for (int i = 0;i < enc->numFormats;i++, fmt++)
+ {
+ int data = EncodeSampleFormat(fmt->bitsSample, fmt->nChannels, fmt->samplesSec);
+ if (thisSampleFormat == data)
+ {
+ if ((mask & MASK_BITRATE) && !Has(hwndDlg, IDC_BRATE, fmt->bitrate))
+ {
+ if (fmt->vbr)
+ SetDlgItemTextW(hwndDlg, IDC_STATIC_BITRATE, WASABI_API_LNGSTRINGW(IDS_QUALITY));
+ else
+ SetDlgItemTextW(hwndDlg, IDC_STATIC_BITRATE, WASABI_API_LNGSTRINGW(IDS_BITRATE));
+
+ wsprintfW(buf1, L"%d", fmt->bitrate);
+ int newpos = SendDlgItemMessageW(hwndDlg, IDC_BRATE, CB_ADDSTRING, 0, (LPARAM)buf1);
+ SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_SETITEMDATA, newpos, fmt->bitrate);
+ // Set the current bit rate
+ if (cfg->config_bitrate == fmt->bitrate)
+ {
+ SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_SETCURSEL, newpos, 0);
+ }
+ }
+ }
+ }
+
+ if (SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETCURSEL, 0, 0) == CB_ERR)
+ {
+ int num = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETCOUNT, 0, 0);
+
+ for (int i = 0;i < num;i++)
+ {
+ int data = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETITEMDATA, i, 0);
+ if (data == 50 || (data / 1000 == 128))
+ SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_SETCURSEL, i, 0);
+ }
+ }
+
+ AutoSelect(hwndDlg, IDC_BRATE);
+
+ pos = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETCURSEL, 0, 0);
+ data = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETITEMDATA, pos, 0);
+ cfg->config_bitrate = data;
+}
+
+BOOL CALLBACK ConfigProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ configwndrec *wc = NULL;
+ if (uMsg == WM_INITDIALOG)
+ {
+ // LGIVEN Mod 4-10-05
+#if defined(_WIN64)
+ SetWindowLong(hwndDlg, GWLP_USERDATA, lParam);
+#else
+ SetWindowLong(hwndDlg, GWL_USERDATA, lParam);
+#endif
+ if (lParam)
+ {
+ // Get the saved params
+ wc = (configwndrec*)lParam;
+
+ loadWMATables();
+ ResetConfig(hwndDlg, encs , &wc->cfg, MASK_ALL);
+ }
+ return 1;
+ }
+ if (uMsg == WM_DESTROY)
+ {
+#if defined(_WIN64)
+ wc = (configwndrec*)SetWindowLong(hwndDlg, GWLP_USERDATA, 0);
+#else
+ wc = (configwndrec*)SetWindowLong(hwndDlg, GWL_USERDATA, 0);
+#endif
+ if (wc)
+ {
+ EncoderType *encoder=FindEncoder(wc->cfg.config_encoder,wc->cfg.config_vbr, wc->cfg.config_passes);
+ int formatNumber = FindFormatNumber(encoder->formats, encoder->numFormats, &wc->cfg);
+ // Dump the profile in WMA format
+ dumpProfile(wc->configfile, wc->cfg.config_vbr, wc->cfg.config_passes, wc->cfg.config_encoder, formatNumber);
+ // Write it to config file
+ writeconfig(wc->configfile, &wc->cfg);
+ free(wc->configfile);
+ free(wc);
+ }
+ return 0;
+ }
+ if (uMsg == WM_COMMAND)
+ {
+ switch (LOWORD(wParam))
+ {
+ case IDC_VBR:
+ if ((HIWORD(wParam) == CBN_SELCHANGE))
+ {
+#if defined(_WIN64)
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWLP_USERDATA);
+#else
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWL_USERDATA);
+#endif
+ int pos = SendDlgItemMessage(hwndDlg, IDC_VBR, CB_GETCURSEL, 0, 0);
+ int data = SendDlgItemMessage(hwndDlg, IDC_VBR, CB_GETITEMDATA, pos, 0);
+ DecodeVBR(data, wc->cfg.config_vbr, wc->cfg.config_passes);
+ ResetConfig(hwndDlg, encs, &wc->cfg, MASK_BITRATE | MASK_SAMPLE_FORMAT);
+ }
+ break;
+
+ case IDC_SAMPLE_FORMAT:
+ if ((HIWORD(wParam) == CBN_SELCHANGE))
+ {
+#if defined(_WIN64)
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWLP_USERDATA);
+#else
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWL_USERDATA);
+#endif
+ int pos = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETCURSEL, 0, 0);
+ int data = SendDlgItemMessage(hwndDlg, IDC_SAMPLE_FORMAT, CB_GETITEMDATA, pos, 0);
+ DecodeSampleFormat(data, wc->cfg.config_bitsSample, wc->cfg.config_nch, wc->cfg.config_samplesSec);
+ ResetConfig(hwndDlg, encs, &wc->cfg, MASK_BITRATE);
+ }
+ break;
+
+ case IDC_BRATE:
+ if ((HIWORD(wParam) == CBN_SELCHANGE))
+ {
+#if defined(_WIN64)
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWLP_USERDATA);
+#else
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWL_USERDATA);
+#endif
+ int pos = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETCURSEL, 0, 0);
+ int data = SendDlgItemMessage(hwndDlg, IDC_BRATE, CB_GETITEMDATA, pos, 0);
+ wc->cfg.config_bitrate = data;
+ }
+ break;
+
+ case IDC_ENCODER:
+ if ((HIWORD(wParam) == CBN_SELCHANGE))
+ {
+#if defined(_WIN64)
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWLP_USERDATA);
+#else
+ wc = (configwndrec*)GetWindowLong(hwndDlg, GWL_USERDATA);
+#endif
+ if (wc)
+ {
+ int pos = SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_GETCURSEL, 0, 0);
+ int data = SendDlgItemMessage(hwndDlg, IDC_ENCODER, CB_GETITEMDATA, pos, 0);
+ wc->cfg.config_encoder = data;
+ ResetConfig(hwndDlg, encs, &wc->cfg, MASK_VBR | MASK_SAMPLE_FORMAT | MASK_BITRATE);
+ }
+ }
+ break;
+
+ }
+ }
+ return 0;
+} \ No newline at end of file
diff --git a/Src/Plugins/Encoder/enc_wma/enc_wma.rc b/Src/Plugins/Encoder/enc_wma/enc_wma.rc
new file mode 100644
index 00000000..6b81c4a4
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/enc_wma.rc
@@ -0,0 +1,128 @@
+// 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
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DIALOG1 DIALOGEX 0, 0, 256, 167
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ GROUPBOX "Windows Media Audio",IDC_STATIC,0,0,256,167
+ COMBOBOX IDC_ENCODER,18,13,145,148,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Encoder Format",IDC_STATIC,166,13,60,12,SS_CENTERIMAGE
+ COMBOBOX IDC_SAMPLE_FORMAT,17,30,145,133,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Sample Format",IDC_STATIC,166,30,71,12,SS_CENTERIMAGE
+ COMBOBOX IDC_VBR,18,48,59,67,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_BRATE,86,48,77,116,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Bitrate (Bits/Sec)",IDC_STATIC_BITRATE,165,48,54,12,SS_CENTERIMAGE
+ CTEXT "Portions utilize Microsoft Windows Media Technologies.\nCopyright © 1992-2019 Microsoft Corporation. All Rights Reserved.",IDC_STATIC,14,144,227,18
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "#include ""version.rc2""\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ 65535 "{33BC12FD-E7F7-42ec-8FE3-2D8BD3A977C2}"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_CANNOT_FIND_INPUT_FORMATTER
+ "Cannot find input formatter for:\n\nChannels = %d, Sample Rate = %d, Bits/Sample = %d\n\nNo resampler available for this input format"
+ IDS_WARNING "WARNING"
+ IDS_CANNOT_ALLOCATE_MEM "Cannot allocate memory for WMA encoder format info"
+ IDS_WMA_ENCODER_ERROR "WMA Encoder Error"
+ IDS_CANNOT_GET_STRUCTURE "Cannot get structure with format details"
+ IDS_CANNOT_GET_ENCODER4_INFO "Cannot get detail info for Encoder4 format"
+ IDS_SAVE_PROFILE_READ_ERROR "Save profile read error"
+ IDS_MEM_ALLOCATION_ERROR "Memory allocation error"
+ IDS_PROFILE_SAVE_SIZE_ERROR "Profile save size get error"
+ IDS_CANNOT_READ_AUDIO_STREAM "Cannot create audio stream"
+ IDS_CANNOT_GET_CODEC_INFO "Cannot get codec interface"
+ IDS_CANNOT_CREATE_A_PROFILE "Cannot create a profile"
+ IDS_CANNOT_CREATE_PROFILE_MANAGER "Cannot create a profile manager"
+ IDS_WMA_CONFIG_FILE_ERROR "WMA Config File Error"
+END
+
+STRINGTABLE
+BEGIN
+ IDS_CBR "CBR"
+ IDS_2_PASS_CBR "2-pass CBR"
+ IDS_VBR "VBR"
+ IDS_ABR "ABR"
+ IDS_MONO_INFO "%d bits, mono, %d Hz"
+ IDS_STEREO_INFO "%d bits, stereo, %d Hz"
+ IDS_CHANNELS_INFO "%d bits, %d channels, %d Hz"
+ IDS_QUALITY "Quality (0-100)"
+ IDS_BITRATE "Bitrate (Bits/Sec)"
+ IDS_ENC_WMA_DESC "WMA Encoder %s"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+#include "version.rc2"
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/Src/Plugins/Encoder/enc_wma/enc_wma.sln b/Src/Plugins/Encoder/enc_wma/enc_wma.sln
new file mode 100644
index 00000000..6eb2c7ca
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/enc_wma.sln
@@ -0,0 +1,30 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29613.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "enc_wma", "enc_wma.vcxproj", "{5F4B0989-B35B-40C0-BAA1-E7058377B398}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Debug|Win32.Build.0 = Debug|Win32
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Debug|x64.ActiveCfg = Debug|x64
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Debug|x64.Build.0 = Debug|x64
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Release|Win32.ActiveCfg = Release|Win32
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Release|Win32.Build.0 = Release|Win32
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Release|x64.ActiveCfg = Release|x64
+ {5F4B0989-B35B-40C0-BAA1-E7058377B398}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {424261B8-8392-4100-A876-CD8560D5D1AC}
+ EndGlobalSection
+EndGlobal
diff --git a/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj b/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj
new file mode 100644
index 00000000..c0580d2c
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" 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">
+ <ProjectGuid>{5F4B0989-B35B-40C0-BAA1-E7058377B398}</ProjectGuid>
+ <RootNamespace>enc_wma</RootNamespace>
+ <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>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PlatformToolset>v142</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ </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)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </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" />
+ </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" />
+ </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" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <IncludePath>$(IncludePath)</IncludePath>
+ <LibraryPath>$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
+ <IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
+ <IncludePath>$(IncludePath)</IncludePath>
+ <LibraryPath>$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <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>
+ <VcpkgTriplet>
+ </VcpkgTriplet>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <VcpkgTriplet>
+ </VcpkgTriplet>
+ </PropertyGroup>
+ <PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <VcpkgConfiguration>Debug</VcpkgConfiguration>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NSV_CODER_WMA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>wmvcore.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
+xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;NSV_CODER_WMA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4244;4312;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>wmvcore.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
+xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NSV_CODER_WMA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ignore:4210 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>wmvcore.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <Optimization>MinSpace</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;NSV_CODER_WMA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4244;4312;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ignore:4210 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>wmvcore.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ </Link>
+ <PostBuildEvent>
+ <Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
+ <Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="AudioCoderWMA.cpp" />
+ <ClCompile Include="config.cpp" />
+ <ClCompile Include="main.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="AudioCoderWMA.h" />
+ <ClInclude Include="CustomWMWriterSink.h" />
+ <ClInclude Include="main.h" />
+ <ClInclude Include="resource.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="enc_wma.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Wasabi\Wasabi.vcxproj">
+ <Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj.filters b/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj.filters
new file mode 100644
index 00000000..6b65e74e
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/enc_wma.vcxproj.filters
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <ClCompile Include="AudioCoderWMA.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="config.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="main.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="AudioCoderWMA.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="CustomWMWriterSink.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="main.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{497dbf34-c784-481d-bc15-343f4d25c508}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Ressource Files">
+ <UniqueIdentifier>{a60f8eac-325c-466b-8a17-69b1064e57fb}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{33266828-89ee-4119-b784-03c8edaad9a1}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="enc_wma.rc">
+ <Filter>Ressource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/Src/Plugins/Encoder/enc_wma/main.cpp b/Src/Plugins/Encoder/enc_wma/main.cpp
new file mode 100644
index 00000000..451304a1
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/main.cpp
@@ -0,0 +1,212 @@
+/*
+** nsv_coder_lame: main.cpp - LAME mp3 encoder plug-in
+** (requires lame_enc.dll)
+**
+** Copyright (C) 2001-2006 Nullsoft, Inc.
+**
+** This software is provided 'as-is', without any express or implied warranty.
+** In no event will the authors be held liable for any damages arising from the use of this software.
+**
+** Permission is granted to anyone to use this software for any purpose, including commercial
+** applications, and to alter it and redistribute it freely, subject to the following restrictions:
+** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the
+** original software. If you use this software in a product, an acknowledgment in the product
+** documentation would be appreciated but is not required.
+** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as
+** being the original software.
+** 3. This notice may not be removed or altered from any source distribution.
+*/
+
+#define ENC_VERSION "v1.23"
+
+#include <windows.h>
+#include <stdio.h>
+#include <wmsdk.h>
+
+#include <mmreg.h>
+#include <msacm.h>
+
+#include "AudioCoderWMA.h"
+#include "../nu/AutoWideFn.h"
+
+// wasabi based services for localisation support
+#include <api/service/waServiceFactory.h>
+#include "../Agave/Language/api_language.h"
+#include "../winamp/wa_ipc.h"
+
+#include <strsafe.h>
+
+HWND winampwnd = 0;
+api_service *WASABI_API_SVC = 0;
+api_language *WASABI_API_LNG = 0;
+HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ return TRUE;
+}
+
+int getwrittentime();
+
+HINSTANCE g_hinst;
+
+int g_srate, g_numchan, g_bps;
+volatile int writtentime, w_offset;
+
+// LGIVEN Mod 4-10-05
+void readconfig(char *configfile, configtype *cfg);
+void writeconfig(char *configfile, configtype *cfg);
+
+static HINSTANCE GetMyInstance()
+{
+ MEMORY_BASIC_INFORMATION mbi = {0};
+ if(VirtualQuery(GetMyInstance, &mbi, sizeof(mbi)))
+ return (HINSTANCE)mbi.AllocationBase;
+ return NULL;
+}
+
+void GetLocalisationApiService(void)
+{
+ if(!WASABI_API_LNG)
+ {
+ // loader so that we can get the localisation service api for use
+ if(!WASABI_API_SVC)
+ {
+ WASABI_API_SVC = (api_service*)SendMessage(winampwnd, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
+ if (WASABI_API_SVC == (api_service*)1)
+ {
+ WASABI_API_SVC = NULL;
+ return;
+ }
+ }
+
+ if(!WASABI_API_LNG)
+ {
+ waServiceFactory *sf;
+ sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
+ if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
+ }
+
+ // need to have this initialised before we try to do anything with localisation features
+ WASABI_API_START_LANG(GetMyInstance(),EncWMALangGUID);
+ }
+}
+
+
+// ==================================================================
+//
+// Published enc_wma methods.
+//
+// ==================================================================
+#include <cassert>
+
+extern "C"
+{
+
+ unsigned int __declspec(dllexport) GetAudioTypes3(int idx, char *desc)
+ {
+ if ( idx == 0 )
+ {
+ GetLocalisationApiService();
+ StringCchPrintfA(desc, 1024, WASABI_API_LNGSTRING(IDS_ENC_WMA_DESC), ENC_VERSION);
+ return mmioFOURCC('W', 'M', 'A', ' ');
+ }
+ return 0;
+ }
+
+ AudioCoder __declspec(dllexport) *CreateAudio3(int nch, int srate, int bps, unsigned int srct, unsigned int *outt, char *configfile)
+ {
+ if (srct == mmioFOURCC('P', 'C', 'M', ' ') && *outt == mmioFOURCC('W', 'M', 'A', ' '))
+ {
+ GetLocalisationApiService();
+ configtype cfg;
+ readconfig(configfile, &cfg);
+
+ AudioCoderWMA *t = new AudioCoderWMA(nch, srate, bps, &cfg, configfile);
+
+ if ( t && t->GetLastError())
+ {
+ delete t;
+ return NULL;
+ }
+ else return t;
+ }
+ return NULL;
+ }
+
+ void __declspec(dllexport) FinishAudio3(const char *filename, AudioCoder *coder)
+ {
+ ((AudioCoderWMA*)coder)->OnFinished(AutoWideFn(filename));
+ }
+
+ void __declspec(dllexport) FinishAudio3W(const wchar_t *filename, AudioCoder *coder)
+ {
+ ((AudioCoderWMA*)coder)->OnFinished(filename);
+ }
+
+ void __declspec(dllexport) PrepareToFinish(const char *filename, AudioCoder *coder)
+ {
+ ((AudioCoderWMA*)coder)->PrepareToFinish();
+ }
+
+ void __declspec(dllexport) PrepareToFinishW(const wchar_t *filename, AudioCoder *coder)
+ {
+ ((AudioCoderWMA*)coder)->PrepareToFinish();
+ }
+
+ HWND __declspec(dllexport) ConfigAudio3(HWND hwndParent, HINSTANCE hinst, unsigned int outt, char *configfile)
+ {
+ if (outt == mmioFOURCC('W', 'M', 'A', ' '))
+ {
+ configwndrec *wr = (configwndrec*)malloc(sizeof(configwndrec));
+ if (configfile)
+ {
+ wr->configfile = _strdup(configfile);
+ }
+ else
+ {
+ wr->configfile = 0;
+ }
+ readconfig(configfile, &wr->cfg);
+ GetLocalisationApiService();
+ return WASABI_API_CREATEDIALOGPARAMW(IDD_DIALOG1, hwndParent, ConfigProc, (LPARAM)wr);
+ }
+ return NULL;
+ }
+
+ int __declspec(dllexport) SetConfigItem(unsigned int outt, char *item, char *data, char *configfile)
+ {
+ if (outt == mmioFOURCC('W', 'M', 'A', ' '))
+ {
+ configtype cfg;
+ readconfig(configfile, &cfg);
+ if (!lstrcmpiA(item, "bitrate"))
+ {
+ //cfg.config_bitrate = atoi(data) * 1000;
+ }
+ writeconfig(configfile, &cfg);
+ return 1;
+ }
+ return 0;
+ }
+
+ int __declspec(dllexport) GetConfigItem(unsigned int outt, char *item, char *data, int len, char *configfile)
+ {
+ if (outt == mmioFOURCC('W', 'M', 'A', ' '))
+ {
+ configtype cfg;
+ readconfig(configfile, &cfg);
+ if (!lstrcmpiA(item, "bitrate"))
+ {
+ StringCchPrintfA(data, len, "%d", cfg.config_bitrate / 1000);
+ }
+ return 1;
+ }
+ return 0;
+ }
+
+ void __declspec(dllexport) SetWinampHWND(HWND hwnd)
+ {
+ winampwnd = hwnd;
+ }
+}; \ No newline at end of file
diff --git a/Src/Plugins/Encoder/enc_wma/main.h b/Src/Plugins/Encoder/enc_wma/main.h
new file mode 100644
index 00000000..460fb03e
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/main.h
@@ -0,0 +1,55 @@
+#include <windows.h>
+#include <stdio.h>
+
+#include "../nsv/enc_if.h"
+#include "resource.h"
+
+// LGIVEN Mods 4-25-05
+// Config info saved in Winamp.ini [enc_wma]---conf=xxxxxxxxxxx
+typedef struct
+{
+ int config_nch; // Number of channels of encoder/fmt selected
+ int config_bitrate; // Bitrate of encoder/fmt selected
+ int config_bitsSample; // Bits/Sample of encoder/fmt selected
+ int config_samplesSec; // Sample rate of encoder/fmt selected
+ int config_encoder; // Encoder offset in table in Config Dialog
+ BOOL config_vbr; // VBR or not
+ DWORD config_passes; // number of passes (1 or 2)
+}
+configtype;
+
+typedef struct
+{
+ configtype cfg; // config type struct
+ char *configfile; // Name of config file (...\Winamp.ini)
+}
+configwndrec;
+
+// Data table values in Config Dialog
+// One of these for each format
+
+struct formatType
+{
+ wchar_t *formatName; // Format Name (for display)
+ int offset; // offset in WMEncoder for this Encoder
+ int nChannels; // number of channels
+ int bitsSample; // Bits per sample
+ int samplesSec; // Samples per sec
+ int bitrate; // Bitrate value
+ int vbr;
+};
+
+// One of these for each encoder
+struct EncoderType
+{
+ wchar_t *encoderName; // Encoder name (for display)
+ int offset; // Offset in WMEncoder
+ int numFormats; // Number of formats in WMEncoder for this encoder
+ struct _GUID mediaType; // Media type GUID
+ BOOL vbr;
+ DWORD numPasses;
+ formatType* formats;
+};
+
+
+BOOL CALLBACK ConfigProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
diff --git a/Src/Plugins/Encoder/enc_wma/nserror.h b/Src/Plugins/Encoder/enc_wma/nserror.h
new file mode 100644
index 00000000..84d844a4
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/nserror.h
@@ -0,0 +1,1631 @@
+/*++
+
+Copyright (C) Microsoft Corporation, 1992 - 1999
+
+Module Name:
+
+ nserror.mc
+
+Abstract:
+
+ Definitions for NetShow events.
+
+Author:
+
+
+Revision History:
+
+Notes:
+
+ This file is used by the MC tool to generate the nserror.h file
+
+ Add new Ids ONLY in the sections marked **New**
+
+--*/
+
+#ifndef _NSERROR_H
+#define _NSERROR_H
+
+
+#define STATUS_SEVERITY(hr) (((hr) >> 30) & 0x3)
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// NETSHOW Success Events
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// Values are 32 bit values layed out as follows:
+//
+// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +---+-+-+-----------------------+-------------------------------+
+// |Sev|C|R| Facility | Code |
+// +---+-+-+-----------------------+-------------------------------+
+//
+// where
+//
+// Sev - is the severity code
+//
+// 00 - Success
+// 01 - Informational
+// 10 - Warning
+// 11 - Error
+//
+// C - is the Customer code flag
+//
+// R - is a reserved bit
+//
+// Facility - is the facility code
+//
+// Code - is the facility's status code
+//
+//
+// Define the facility codes
+//
+#define FACILITY_NS_WIN32 0x7
+#define FACILITY_NS 0xD
+
+
+//
+// Define the severity codes
+//
+#define STATUS_SEVERITY_WARNING 0x2
+#define STATUS_SEVERITY_SUCCESS 0x0
+#define STATUS_SEVERITY_INFORMATIONAL 0x1
+#define STATUS_SEVERITY_ERROR 0x3
+
+
+//
+// MessageId: NS_S_CALLPENDING
+//
+// MessageText:
+//
+// The requested operation is pending completion.%0
+//
+#define NS_S_CALLPENDING 0x000D0000L
+
+//
+// MessageId: NS_S_CALLABORTED
+//
+// MessageText:
+//
+// The requested operation was aborted by the client.%0
+//
+#define NS_S_CALLABORTED 0x000D0001L
+
+//
+// MessageId: NS_S_STREAM_TRUNCATED
+//
+// MessageText:
+//
+// The stream was purposefully stopped before completion.%0
+//
+#define NS_S_STREAM_TRUNCATED 0x000D0002L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// NETSHOW Warning Events
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_W_SERVER_BANDWIDTH_LIMIT
+//
+// MessageText:
+//
+// The maximum filebitrate value specified is greater than the server's configured maximum bandwidth.%0
+//
+#define NS_W_SERVER_BANDWIDTH_LIMIT 0x800D0003L
+
+//
+// MessageId: NS_W_FILE_BANDWIDTH_LIMIT
+//
+// MessageText:
+//
+// The maximum bandwidth value specified is less than the maximum filebitrate.%0
+//
+#define NS_W_FILE_BANDWIDTH_LIMIT 0x800D0004L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// NETSHOW Error Events
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_E_NOCONNECTION
+//
+// MessageText:
+//
+// There is no connection established with the NetShow server. The operation failed.%0
+//
+#define NS_E_NOCONNECTION 0xC00D0005L
+
+//
+// MessageId: NS_E_CANNOTCONNECT
+//
+// MessageText:
+//
+// Unable to establish a connection to the server.%0
+//
+#define NS_E_CANNOTCONNECT 0xC00D0006L
+
+//
+// MessageId: NS_E_CANNOTDESTROYTITLE
+//
+// MessageText:
+//
+// Unable to destroy the title.%0
+//
+#define NS_E_CANNOTDESTROYTITLE 0xC00D0007L
+
+//
+// MessageId: NS_E_CANNOTRENAMETITLE
+//
+// MessageText:
+//
+// Unable to rename the title.%0
+//
+#define NS_E_CANNOTRENAMETITLE 0xC00D0008L
+
+//
+// MessageId: NS_E_CANNOTOFFLINEDISK
+//
+// MessageText:
+//
+// Unable to offline disk.%0
+//
+#define NS_E_CANNOTOFFLINEDISK 0xC00D0009L
+
+//
+// MessageId: NS_E_CANNOTONLINEDISK
+//
+// MessageText:
+//
+// Unable to online disk.%0
+//
+#define NS_E_CANNOTONLINEDISK 0xC00D000AL
+
+//
+// MessageId: NS_E_NOREGISTEREDWALKER
+//
+// MessageText:
+//
+// There is no file parser registered for this type of file.%0
+//
+#define NS_E_NOREGISTEREDWALKER 0xC00D000BL
+
+//
+// MessageId: NS_E_NOFUNNEL
+//
+// MessageText:
+//
+// There is no data connection established.%0
+//
+#define NS_E_NOFUNNEL 0xC00D000CL
+
+//
+// MessageId: NS_E_NO_LOCALPLAY
+//
+// MessageText:
+//
+// Failed to load the local play DLL.%0
+//
+#define NS_E_NO_LOCALPLAY 0xC00D000DL
+
+//
+// MessageId: NS_E_NETWORK_BUSY
+//
+// MessageText:
+//
+// The network is busy.%0
+//
+#define NS_E_NETWORK_BUSY 0xC00D000EL
+
+//
+// MessageId: NS_E_TOO_MANY_SESS
+//
+// MessageText:
+//
+// The server session limit was exceeded.%0
+//
+#define NS_E_TOO_MANY_SESS 0xC00D000FL
+
+//
+// MessageId: NS_E_ALREADY_CONNECTED
+//
+// MessageText:
+//
+// The network connection already exists.%0
+//
+#define NS_E_ALREADY_CONNECTED 0xC00D0010L
+
+//
+// MessageId: NS_E_INVALID_INDEX
+//
+// MessageText:
+//
+// Index %1 is invalid.%0
+//
+#define NS_E_INVALID_INDEX 0xC00D0011L
+
+//
+// MessageId: NS_E_PROTOCOL_MISMATCH
+//
+// MessageText:
+//
+// There is no protocol or protocol version supported by both the client and the server.%0
+//
+#define NS_E_PROTOCOL_MISMATCH 0xC00D0012L
+
+//
+// MessageId: NS_E_TIMEOUT
+//
+// MessageText:
+//
+// There was no timely response from server.%0
+//
+#define NS_E_TIMEOUT 0xC00D0013L
+
+//
+// MessageId: NS_E_NET_WRITE
+//
+// MessageText:
+//
+// Error writing to the network.%0
+//
+#define NS_E_NET_WRITE 0xC00D0014L
+
+//
+// MessageId: NS_E_NET_READ
+//
+// MessageText:
+//
+// Error reading from the network.%0
+//
+#define NS_E_NET_READ 0xC00D0015L
+
+//
+// MessageId: NS_E_DISK_WRITE
+//
+// MessageText:
+//
+// Error writing to a disk.%0
+//
+#define NS_E_DISK_WRITE 0xC00D0016L
+
+//
+// MessageId: NS_E_DISK_READ
+//
+// MessageText:
+//
+// Error reading from a disk.%0
+//
+#define NS_E_DISK_READ 0xC00D0017L
+
+//
+// MessageId: NS_E_FILE_WRITE
+//
+// MessageText:
+//
+// Error writing to a file.%0
+//
+#define NS_E_FILE_WRITE 0xC00D0018L
+
+//
+// MessageId: NS_E_FILE_READ
+//
+// MessageText:
+//
+// Error reading from a file.%0
+//
+#define NS_E_FILE_READ 0xC00D0019L
+
+//
+// MessageId: NS_E_FILE_NOT_FOUND
+//
+// MessageText:
+//
+// The system cannot find the file specified.%0
+//
+#define NS_E_FILE_NOT_FOUND 0xC00D001AL
+
+//
+// MessageId: NS_E_FILE_EXISTS
+//
+// MessageText:
+//
+// The file already exists.%0
+//
+#define NS_E_FILE_EXISTS 0xC00D001BL
+
+//
+// MessageId: NS_E_INVALID_NAME
+//
+// MessageText:
+//
+// The file name, directory name, or volume label syntax is incorrect.%0
+//
+#define NS_E_INVALID_NAME 0xC00D001CL
+
+//
+// MessageId: NS_E_FILE_OPEN_FAILED
+//
+// MessageText:
+//
+// Failed to open a file.%0
+//
+#define NS_E_FILE_OPEN_FAILED 0xC00D001DL
+
+//
+// MessageId: NS_E_FILE_ALLOCATION_FAILED
+//
+// MessageText:
+//
+// Unable to allocate a file.%0
+//
+#define NS_E_FILE_ALLOCATION_FAILED 0xC00D001EL
+
+//
+// MessageId: NS_E_FILE_INIT_FAILED
+//
+// MessageText:
+//
+// Unable to initialize a file.%0
+//
+#define NS_E_FILE_INIT_FAILED 0xC00D001FL
+
+//
+// MessageId: NS_E_FILE_PLAY_FAILED
+//
+// MessageText:
+//
+// Unable to play a file.%0
+//
+#define NS_E_FILE_PLAY_FAILED 0xC00D0020L
+
+//
+// MessageId: NS_E_SET_DISK_UID_FAILED
+//
+// MessageText:
+//
+// Could not set the disk UID.%0
+//
+#define NS_E_SET_DISK_UID_FAILED 0xC00D0021L
+
+//
+// MessageId: NS_E_INDUCED
+//
+// MessageText:
+//
+// An error was induced for testing purposes.%0
+//
+#define NS_E_INDUCED 0xC00D0022L
+
+//
+// MessageId: NS_E_CCLINK_DOWN
+//
+// MessageText:
+//
+// Two Content Servers failed to communicate.%0
+//
+#define NS_E_CCLINK_DOWN 0xC00D0023L
+
+//
+// MessageId: NS_E_INTERNAL
+//
+// MessageText:
+//
+// An unknown error occurred.%0
+//
+#define NS_E_INTERNAL 0xC00D0024L
+
+//
+// MessageId: NS_E_BUSY
+//
+// MessageText:
+//
+// The requested resource is in use.%0
+//
+#define NS_E_BUSY 0xC00D0025L
+
+//
+// MessageId: NS_E_UNRECOGNIZED_STREAM_TYPE
+//
+// MessageText:
+//
+// The specified stream type is not recognized.%0
+//
+#define NS_E_UNRECOGNIZED_STREAM_TYPE 0xC00D0026L
+
+//
+// MessageId: NS_E_NETWORK_SERVICE_FAILURE
+//
+// MessageText:
+//
+// The network service provider failed.%0
+//
+#define NS_E_NETWORK_SERVICE_FAILURE 0xC00D0027L
+
+//
+// MessageId: NS_E_NETWORK_RESOURCE_FAILURE
+//
+// MessageText:
+//
+// An attempt to acquire a network resource failed.%0
+//
+#define NS_E_NETWORK_RESOURCE_FAILURE 0xC00D0028L
+
+//
+// MessageId: NS_E_CONNECTION_FAILURE
+//
+// MessageText:
+//
+// The network connection has failed.%0
+//
+#define NS_E_CONNECTION_FAILURE 0xC00D0029L
+
+//
+// MessageId: NS_E_SHUTDOWN
+//
+// MessageText:
+//
+// The session is being terminated locally.%0
+//
+#define NS_E_SHUTDOWN 0xC00D002AL
+
+//
+// MessageId: NS_E_INVALID_REQUEST
+//
+// MessageText:
+//
+// The request is invalid in the current state.%0
+//
+#define NS_E_INVALID_REQUEST 0xC00D002BL
+
+//
+// MessageId: NS_E_INSUFFICIENT_BANDWIDTH
+//
+// MessageText:
+//
+// There is insufficient bandwidth available to fulfill the request.%0
+//
+#define NS_E_INSUFFICIENT_BANDWIDTH 0xC00D002CL
+
+//
+// MessageId: NS_E_NOT_REBUILDING
+//
+// MessageText:
+//
+// The disk is not rebuilding.%0
+//
+#define NS_E_NOT_REBUILDING 0xC00D002DL
+
+//
+// MessageId: NS_E_LATE_OPERATION
+//
+// MessageText:
+//
+// An operation requested for a particular time could not be carried out on schedule.%0
+//
+#define NS_E_LATE_OPERATION 0xC00D002EL
+
+//
+// MessageId: NS_E_INVALID_DATA
+//
+// MessageText:
+//
+// Invalid or corrupt data was encountered.%0
+//
+#define NS_E_INVALID_DATA 0xC00D002FL
+
+//
+// MessageId: NS_E_FILE_BANDWIDTH_LIMIT
+//
+// MessageText:
+//
+// The bandwidth required to stream a file is higher than the maximum file bandwidth allowed on the server.%0
+//
+#define NS_E_FILE_BANDWIDTH_LIMIT 0xC00D0030L
+
+//
+// MessageId: NS_E_OPEN_FILE_LIMIT
+//
+// MessageText:
+//
+// The client cannot have any more files open simultaneously.%0
+//
+#define NS_E_OPEN_FILE_LIMIT 0xC00D0031L
+
+//
+// MessageId: NS_E_BAD_CONTROL_DATA
+//
+// MessageText:
+//
+// The server received invalid data from the client on the control connection.%0
+//
+#define NS_E_BAD_CONTROL_DATA 0xC00D0032L
+
+//
+// MessageId: NS_E_NO_STREAM
+//
+// MessageText:
+//
+// There is no stream available.%0
+//
+#define NS_E_NO_STREAM 0xC00D0033L
+
+//
+// MessageId: NS_E_STREAM_END
+//
+// MessageText:
+//
+// There is no more data in the stream.%0
+//
+#define NS_E_STREAM_END 0xC00D0034L
+
+//
+// MessageId: NS_E_SERVER_NOT_FOUND
+//
+// MessageText:
+//
+// The specified server could not be found.%0
+//
+#define NS_E_SERVER_NOT_FOUND 0xC00D0035L
+
+//
+// MessageId: NS_E_DUPLICATE_NAME
+//
+// MessageText:
+//
+// The specified name is already in use.
+//
+#define NS_E_DUPLICATE_NAME 0xC00D0036L
+
+//
+// MessageId: NS_E_DUPLICATE_ADDRESS
+//
+// MessageText:
+//
+// The specified address is already in use.
+//
+#define NS_E_DUPLICATE_ADDRESS 0xC00D0037L
+
+//
+// MessageId: NS_E_BAD_MULTICAST_ADDRESS
+//
+// MessageText:
+//
+// The specified address is not a valid multicast address.
+//
+#define NS_E_BAD_MULTICAST_ADDRESS 0xC00D0038L
+
+//
+// MessageId: NS_E_BAD_ADAPTER_ADDRESS
+//
+// MessageText:
+//
+// The specified adapter address is invalid.
+//
+#define NS_E_BAD_ADAPTER_ADDRESS 0xC00D0039L
+
+//
+// MessageId: NS_E_BAD_DELIVERY_MODE
+//
+// MessageText:
+//
+// The specified delivery mode is invalid.
+//
+#define NS_E_BAD_DELIVERY_MODE 0xC00D003AL
+
+//
+// MessageId: NS_E_INVALID_CHANNEL
+//
+// MessageText:
+//
+// The specified station does not exist.
+//
+#define NS_E_INVALID_CHANNEL 0xC00D003BL
+
+//
+// MessageId: NS_E_INVALID_STREAM
+//
+// MessageText:
+//
+// The specified stream does not exist.
+//
+#define NS_E_INVALID_STREAM 0xC00D003CL
+
+//
+// MessageId: NS_E_INVALID_ARCHIVE
+//
+// MessageText:
+//
+// The specified archive could not be opened.
+//
+#define NS_E_INVALID_ARCHIVE 0xC00D003DL
+
+//
+// MessageId: NS_E_NOTITLES
+//
+// MessageText:
+//
+// The system cannot find any titles on the server.%0
+//
+#define NS_E_NOTITLES 0xC00D003EL
+
+//
+// MessageId: NS_E_INVALID_CLIENT
+//
+// MessageText:
+//
+// The system cannot find the client specified.%0
+//
+#define NS_E_INVALID_CLIENT 0xC00D003FL
+
+//
+// MessageId: NS_E_INVALID_BLACKHOLE_ADDRESS
+//
+// MessageText:
+//
+// The Blackhole Address is not initialized.%0
+//
+#define NS_E_INVALID_BLACKHOLE_ADDRESS 0xC00D0040L
+
+//
+// MessageId: NS_E_INCOMPATIBLE_FORMAT
+//
+// MessageText:
+//
+// The station does not support the stream format.
+//
+#define NS_E_INCOMPATIBLE_FORMAT 0xC00D0041L
+
+//
+// MessageId: NS_E_INVALID_KEY
+//
+// MessageText:
+//
+// The specified key is not valid.
+//
+#define NS_E_INVALID_KEY 0xC00D0042L
+
+//
+// MessageId: NS_E_INVALID_PORT
+//
+// MessageText:
+//
+// The specified port is not valid.
+//
+#define NS_E_INVALID_PORT 0xC00D0043L
+
+//
+// MessageId: NS_E_INVALID_TTL
+//
+// MessageText:
+//
+// The specified TTL is not valid.
+//
+#define NS_E_INVALID_TTL 0xC00D0044L
+
+//
+// MessageId: NS_E_STRIDE_REFUSED
+//
+// MessageText:
+//
+// The request to fast forward or rewind could not be fulfilled.
+//
+#define NS_E_STRIDE_REFUSED 0xC00D0045L
+
+//
+// IMmsAutoServer Errors
+//
+//
+// MessageId: NS_E_MMSAUTOSERVER_CANTFINDWALKER
+//
+// MessageText:
+//
+// Unable to load the appropriate file parser.%0
+//
+#define NS_E_MMSAUTOSERVER_CANTFINDWALKER 0xC00D0046L
+
+//
+// MessageId: NS_E_MAX_BITRATE
+//
+// MessageText:
+//
+// Cannot exceed the maximum bandwidth limit.%0
+//
+#define NS_E_MAX_BITRATE 0xC00D0047L
+
+//
+// MessageId: NS_E_LOGFILEPERIOD
+//
+// MessageText:
+//
+// Invalid value for LogFilePeriod.%0
+//
+#define NS_E_LOGFILEPERIOD 0xC00D0048L
+
+//
+// MessageId: NS_E_MAX_CLIENTS
+//
+// MessageText:
+//
+// Cannot exceed the maximum client limit.%0
+//
+//
+#define NS_E_MAX_CLIENTS 0xC00D0049L
+
+//
+// MessageId: NS_E_LOG_FILE_SIZE
+//
+// MessageText:
+//
+// Log File Size too small.%0
+//
+//
+#define NS_E_LOG_FILE_SIZE 0xC00D004AL
+
+//
+// MessageId: NS_E_MAX_FILERATE
+//
+// MessageText:
+//
+// Cannot exceed the maximum file rate.%0
+//
+#define NS_E_MAX_FILERATE 0xC00D004BL
+
+//
+// File Walker Errors
+//
+//
+// MessageId: NS_E_WALKER_UNKNOWN
+//
+// MessageText:
+//
+// Unknown file type.%0
+//
+#define NS_E_WALKER_UNKNOWN 0xC00D004CL
+
+//
+// MessageId: NS_E_WALKER_SERVER
+//
+// MessageText:
+//
+// The specified file, %1, cannot be loaded onto the specified server, %2.%0
+//
+#define NS_E_WALKER_SERVER 0xC00D004DL
+
+//
+// MessageId: NS_E_WALKER_USAGE
+//
+// MessageText:
+//
+// There was a usage error with file parser.%0
+//
+#define NS_E_WALKER_USAGE 0xC00D004EL
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// NETSHOW Monitor Events
+//
+/////////////////////////////////////////////////////////////////////////
+
+
+ // Tiger Events
+
+ // %1 is the tiger name
+
+//
+// MessageId: NS_I_TIGER_START
+//
+// MessageText:
+//
+// The Title Server %1 is running.%0
+//
+#define NS_I_TIGER_START 0x400D004FL
+
+//
+// MessageId: NS_E_TIGER_FAIL
+//
+// MessageText:
+//
+// The Title Server %1 has failed.%0
+//
+#define NS_E_TIGER_FAIL 0xC00D0050L
+
+
+ // Cub Events
+
+ // %1 is the cub ID
+ // %2 is the cub name
+
+//
+// MessageId: NS_I_CUB_START
+//
+// MessageText:
+//
+// Content Server %1 (%2) is starting.%0
+//
+#define NS_I_CUB_START 0x400D0051L
+
+//
+// MessageId: NS_I_CUB_RUNNING
+//
+// MessageText:
+//
+// Content Server %1 (%2) is running.%0
+//
+#define NS_I_CUB_RUNNING 0x400D0052L
+
+//
+// MessageId: NS_E_CUB_FAIL
+//
+// MessageText:
+//
+// Content Server %1 (%2) has failed.%0
+//
+#define NS_E_CUB_FAIL 0xC00D0053L
+
+
+ // Disk Events
+
+ // %1 is the tiger disk ID
+ // %2 is the device name
+ // %3 is the cub ID
+//
+// MessageId: NS_I_DISK_START
+//
+// MessageText:
+//
+// Disk %1 ( %2 ) on Content Server %3, is running.%0
+//
+#define NS_I_DISK_START 0x400D0054L
+
+//
+// MessageId: NS_E_DISK_FAIL
+//
+// MessageText:
+//
+// Disk %1 ( %2 ) on Content Server %3, has failed.%0
+//
+#define NS_E_DISK_FAIL 0xC00D0055L
+
+//
+// MessageId: NS_I_DISK_REBUILD_STARTED
+//
+// MessageText:
+//
+// Started rebuilding disk %1 ( %2 ) on Content Server %3.%0
+//
+#define NS_I_DISK_REBUILD_STARTED 0x400D0056L
+
+//
+// MessageId: NS_I_DISK_REBUILD_FINISHED
+//
+// MessageText:
+//
+// Finished rebuilding disk %1 ( %2 ) on Content Server %3.%0
+//
+#define NS_I_DISK_REBUILD_FINISHED 0x400D0057L
+
+//
+// MessageId: NS_I_DISK_REBUILD_ABORTED
+//
+// MessageText:
+//
+// Aborted rebuilding disk %1 ( %2 ) on Content Server %3.%0
+//
+#define NS_I_DISK_REBUILD_ABORTED 0x400D0058L
+
+
+ // Admin Events
+
+//
+// MessageId: NS_I_LIMIT_FUNNELS
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 set the data stream limit to %2 streams.%0
+//
+#define NS_I_LIMIT_FUNNELS 0x400D0059L
+
+//
+// MessageId: NS_I_START_DISK
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 started disk %2.%0
+//
+#define NS_I_START_DISK 0x400D005AL
+
+//
+// MessageId: NS_I_STOP_DISK
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 stopped disk %2.%0
+//
+#define NS_I_STOP_DISK 0x400D005BL
+
+//
+// MessageId: NS_I_STOP_CUB
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 stopped Content Server %2.%0
+//
+#define NS_I_STOP_CUB 0x400D005CL
+
+//
+// MessageId: NS_I_KILL_VIEWER
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 disconnected viewer %2 from the system.%0
+//
+#define NS_I_KILL_VIEWER 0x400D005DL
+
+//
+// MessageId: NS_I_REBUILD_DISK
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 started rebuilding disk %2.%0
+//
+#define NS_I_REBUILD_DISK 0x400D005EL
+
+//
+// MessageId: NS_W_UNKNOWN_EVENT
+//
+// MessageText:
+//
+// Unknown %1 event encountered.%0
+//
+#define NS_W_UNKNOWN_EVENT 0x800D005FL
+
+
+ // Alerts
+
+//
+// MessageId: NS_E_MAX_FUNNELS_ALERT
+//
+// MessageText:
+//
+// The NetShow data stream limit of %1 streams was reached.%0
+//
+#define NS_E_MAX_FUNNELS_ALERT 0xC00D0060L
+
+//
+// MessageId: NS_E_ALLOCATE_FILE_FAIL
+//
+// MessageText:
+//
+// The NetShow Video Server was unable to allocate a %1 block file named %2.%0
+//
+#define NS_E_ALLOCATE_FILE_FAIL 0xC00D0061L
+
+//
+// MessageId: NS_E_PAGING_ERROR
+//
+// MessageText:
+//
+// A Content Server was unable to page a block.%0
+//
+#define NS_E_PAGING_ERROR 0xC00D0062L
+
+//
+// MessageId: NS_E_BAD_BLOCK0_VERSION
+//
+// MessageText:
+//
+// Disk %1 has unrecognized control block version %2.%0
+//
+#define NS_E_BAD_BLOCK0_VERSION 0xC00D0063L
+
+//
+// MessageId: NS_E_BAD_DISK_UID
+//
+// MessageText:
+//
+// Disk %1 has incorrect uid %2.%0
+//
+#define NS_E_BAD_DISK_UID 0xC00D0064L
+
+//
+// MessageId: NS_E_BAD_FSMAJOR_VERSION
+//
+// MessageText:
+//
+// Disk %1 has unsupported file system major version %2.%0
+//
+#define NS_E_BAD_FSMAJOR_VERSION 0xC00D0065L
+
+//
+// MessageId: NS_E_BAD_STAMPNUMBER
+//
+// MessageText:
+//
+// Disk %1 has bad stamp number in control block.%0
+//
+#define NS_E_BAD_STAMPNUMBER 0xC00D0066L
+
+//
+// MessageId: NS_E_PARTIALLY_REBUILT_DISK
+//
+// MessageText:
+//
+// Disk %1 is partially reconstructed.%0
+//
+#define NS_E_PARTIALLY_REBUILT_DISK 0xC00D0067L
+
+//
+// MessageId: NS_E_ENACTPLAN_GIVEUP
+//
+// MessageText:
+//
+// EnactPlan gives up.%0
+//
+#define NS_E_ENACTPLAN_GIVEUP 0xC00D0068L
+
+
+ // MCMADM warnings/errors
+
+//
+// MessageId: MCMADM_I_NO_EVENTS
+//
+// MessageText:
+//
+// Event initialization failed, there will be no MCM events.%0
+//
+#define MCMADM_I_NO_EVENTS 0x400D0069L
+
+//
+// MessageId: MCMADM_E_REGKEY_NOT_FOUND
+//
+// MessageText:
+//
+// The key was not found in the registry.%0
+//
+#define MCMADM_E_REGKEY_NOT_FOUND 0xC00D006AL
+
+//
+// MessageId: NS_E_NO_FORMATS
+//
+// MessageText:
+//
+// No stream formats were found in an NSC file.%0
+//
+#define NS_E_NO_FORMATS 0xC00D006BL
+
+//
+// MessageId: NS_E_NO_REFERENCES
+//
+// MessageText:
+//
+// No reference URLs were found in an ASX file.%0
+//
+#define NS_E_NO_REFERENCES 0xC00D006CL
+
+//
+// MessageId: NS_E_WAVE_OPEN
+//
+// MessageText:
+//
+// Error opening wave device, the device might be in use.%0
+//
+#define NS_E_WAVE_OPEN 0xC00D006DL
+
+//
+// MessageId: NS_I_LOGGING_FAILED
+//
+// MessageText:
+//
+// The logging operation failed.
+//
+#define NS_I_LOGGING_FAILED 0x400D006EL
+
+//
+// MessageId: NS_E_CANNOTCONNECTEVENTS
+//
+// MessageText:
+//
+// Unable to establish a connection to the NetShow event monitor service.%0
+//
+#define NS_E_CANNOTCONNECTEVENTS 0xC00D006FL
+
+//
+// MessageId: NS_I_LIMIT_BANDWIDTH
+//
+// MessageText:
+//
+// A NetShow administrator at network location %1 set the maximum bandwidth limit to %2 bps.%0
+//
+#define NS_I_LIMIT_BANDWIDTH 0x400D0070L
+
+//
+// MessageId: NS_E_NOTHING_TO_DO
+//
+// MessageText:
+//
+// NS_E_NOTHING_TO_DO
+//
+#define NS_E_NOTHING_TO_DO 0xC00D07F1L
+
+//
+// MessageId: NS_E_NO_MULTICAST
+//
+// MessageText:
+//
+// NS_E_NO_MULTICAST
+//
+#define NS_E_NO_MULTICAST 0xC00D07F2L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// **New** NETSHOW Error Events
+//
+// IdRange = 200..399
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_E_MONITOR_GIVEUP
+//
+// MessageText:
+//
+// Netshow Events Monitor is not operational and has been disconnected.%0
+//
+#define NS_E_MONITOR_GIVEUP 0xC00D00C8L
+
+//
+// MessageId: NS_E_REMIRRORED_DISK
+//
+// MessageText:
+//
+// Disk %1 is remirrored.%0
+//
+#define NS_E_REMIRRORED_DISK 0xC00D00C9L
+
+//
+// MessageId: NS_E_INSUFFICIENT_DATA
+//
+// MessageText:
+//
+// Insufficient data found.%0
+//
+#define NS_E_INSUFFICIENT_DATA 0xC00D00CAL
+
+//
+// MessageId: NS_E_ASSERT
+//
+// MessageText:
+//
+// %1 failed in file %2 line %3.%0
+//
+#define NS_E_ASSERT 0xC00D00CBL
+
+//
+// MessageId: NS_E_BAD_ADAPTER_NAME
+//
+// MessageText:
+//
+// The specified adapter name is invalid.%0
+//
+#define NS_E_BAD_ADAPTER_NAME 0xC00D00CCL
+
+//
+// MessageId: NS_E_NOT_LICENSED
+//
+// MessageText:
+//
+// The application is not licensed for this feature.%0
+//
+#define NS_E_NOT_LICENSED 0xC00D00CDL
+
+//
+// MessageId: NS_E_NO_SERVER_CONTACT
+//
+// MessageText:
+//
+// Unable to contact the server.%0
+//
+#define NS_E_NO_SERVER_CONTACT 0xC00D00CEL
+
+//
+// MessageId: NS_E_TOO_MANY_TITLES
+//
+// MessageText:
+//
+// Maximum number of titles exceeded.%0
+//
+#define NS_E_TOO_MANY_TITLES 0xC00D00CFL
+
+//
+// MessageId: NS_E_TITLE_SIZE_EXCEEDED
+//
+// MessageText:
+//
+// Maximum size of a title exceeded.%0
+//
+#define NS_E_TITLE_SIZE_EXCEEDED 0xC00D00D0L
+
+//
+// MessageId: NS_E_UDP_DISABLED
+//
+// MessageText:
+//
+// UDP protocol not enabled. Not trying %1!ls!.%0
+//
+#define NS_E_UDP_DISABLED 0xC00D00D1L
+
+//
+// MessageId: NS_E_TCP_DISABLED
+//
+// MessageText:
+//
+// TCP protocol not enabled. Not trying %1!ls!.%0
+//
+#define NS_E_TCP_DISABLED 0xC00D00D2L
+
+//
+// MessageId: NS_E_HTTP_DISABLED
+//
+// MessageText:
+//
+// HTTP protocol not enabled. Not trying %1!ls!.%0
+//
+#define NS_E_HTTP_DISABLED 0xC00D00D3L
+
+//
+// MessageId: NS_E_LICENSE_EXPIRED
+//
+// MessageText:
+//
+// The product license has expired.%0
+//
+#define NS_E_LICENSE_EXPIRED 0xC00D00D4L
+
+//
+// MessageId: NS_E_TITLE_BITRATE
+//
+// MessageText:
+//
+// Source file exceeds the per title maximum bitrate. See NetShow Theater documentation for more information.%0
+//
+#define NS_E_TITLE_BITRATE 0xC00D00D5L
+
+//
+// MessageId: NS_E_EMPTY_PROGRAM_NAME
+//
+// MessageText:
+//
+// The program name cannot be empty.%0
+//
+#define NS_E_EMPTY_PROGRAM_NAME 0xC00D00D6L
+
+//
+// MessageId: NS_E_MISSING_CHANNEL
+//
+// MessageText:
+//
+// Station %1 does not exist.%0
+//
+#define NS_E_MISSING_CHANNEL 0xC00D00D7L
+
+//
+// MessageId: NS_E_NO_CHANNELS
+//
+// MessageText:
+//
+// You need to define at least one station before this operation can complete.%0
+//
+#define NS_E_NO_CHANNELS 0xC00D00D8L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// **New** NETSHOW Monitor Events
+//
+// IdRange = 400..599
+//
+// Admin Events:
+//
+// Alerts:
+//
+// Title Server:
+// %1 is the Title Server name
+//
+// Content Server:
+// %1 is the Content Server ID
+// %2 is the Content Server name
+// %3 is the Peer Content Server name (optional)
+//
+// Disks:
+// %1 is the Title Server disk ID
+// %2 is the device name
+// %3 is the Content Server ID
+//
+;/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_E_CUB_FAIL_LINK
+//
+// MessageText:
+//
+// Content Server %1 (%2) has failed its link to Content Server %3.%0
+//
+#define NS_E_CUB_FAIL_LINK 0xC00D0190L
+
+//
+// MessageId: NS_I_CUB_UNFAIL_LINK
+//
+// MessageText:
+//
+// Content Server %1 (%2) has established its link to Content Server %3.%0
+//
+#define NS_I_CUB_UNFAIL_LINK 0x400D0191L
+
+//
+// MessageId: NS_E_BAD_CUB_UID
+//
+// MessageText:
+//
+// Content Server %1 (%2) has incorrect uid %3.%0
+//
+#define NS_E_BAD_CUB_UID 0xC00D0192L
+
+//
+// MessageId: NS_I_RESTRIPE_START
+//
+// MessageText:
+//
+// Restripe operation has started.%0
+//
+#define NS_I_RESTRIPE_START 0x400D0193L
+
+//
+// MessageId: NS_I_RESTRIPE_DONE
+//
+// MessageText:
+//
+// Restripe operation has completed.%0
+//
+#define NS_I_RESTRIPE_DONE 0x400D0194L
+
+//
+// MessageId: NS_E_GLITCH_MODE
+//
+// MessageText:
+//
+// Server unreliable because multiple components failed.%0
+//
+#define NS_E_GLITCH_MODE 0xC00D0195L
+
+//
+// MessageId: NS_I_RESTRIPE_DISK_OUT
+//
+// MessageText:
+//
+// Content disk %1 (%2) on Content Server %3 has been restriped out.%0
+//
+#define NS_I_RESTRIPE_DISK_OUT 0x400D0196L
+
+//
+// MessageId: NS_I_RESTRIPE_CUB_OUT
+//
+// MessageText:
+//
+// Content server %1 (%2) has been restriped out.%0
+//
+#define NS_I_RESTRIPE_CUB_OUT 0x400D0197L
+
+//
+// MessageId: NS_I_DISK_STOP
+//
+// MessageText:
+//
+// Disk %1 ( %2 ) on Content Server %3, has been offlined.%0
+//
+#define NS_I_DISK_STOP 0x400D0198L
+
+//
+// MessageId: NS_I_CATATONIC_FAILURE
+//
+// MessageText:
+//
+// Disk %1 ( %2 ) on Content Server %3, will be failed because it is catatonic.%0
+//
+#define NS_I_CATATONIC_FAILURE 0x800D0199L
+
+//
+// MessageId: NS_I_CATATONIC_AUTO_UNFAIL
+//
+// MessageText:
+//
+// Disk %1 ( %2 ) on Content Server %3, auto online from catatonic state.%0
+//
+#define NS_I_CATATONIC_AUTO_UNFAIL 0x800D019AL
+
+//
+// MessageId: NS_E_NO_MEDIA_PROTOCOL
+//
+// MessageText:
+//
+// Content Server %1 (%2) is unable to communicate with the Media System Network Protocol.%0
+//
+#define NS_E_NO_MEDIA_PROTOCOL 0xC00D019BL
+
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// **New** NETSHOW IMmsAutoServer Errors
+//
+// IdRange = 600..799
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_E_INITIAL
+//
+// MessageText:
+//
+// Placeholder.%0
+//
+#define NS_E_INITIAL 0xC00D0258L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// **New** MCMADM warnings/errors
+//
+// IdRange = 1000..1199
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: MCMADM_E_INITIAL
+//
+// MessageText:
+//
+// Placeholder.%0
+//
+#define MCMADM_E_INITIAL 0xC00D03E8L
+
+
+//
+// Advanced Streaming Format (ASF) codes occupy MessageIds 2000-2999
+//
+// See ASFErr.mc for more details - please do not define any symbols
+// in that range in this file.
+//
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// Windows Media Audio SDK Errors
+//
+// IdRange = 3000-3199
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_E_INVALID_INPUT_FORMAT
+//
+// MessageText:
+//
+// The input audio format must be a valid, PCM audio format.%0
+//
+#define NS_E_INVALID_INPUT_FORMAT 0xC00D0BB8L
+
+//
+// MessageId: NS_E_MSAUDIO_NOT_INSTALLED
+//
+// MessageText:
+//
+// The MSAudio codec is not installed on this system.%0
+//
+#define NS_E_MSAUDIO_NOT_INSTALLED 0xC00D0BB9L
+
+//
+// MessageId: NS_E_UNEXPECTED_MSAUDIO_ERROR
+//
+// MessageText:
+//
+// An unexpected error occured with the MSAudio codec.%0
+//
+#define NS_E_UNEXPECTED_MSAUDIO_ERROR 0xC00D0BBAL
+
+//
+// MessageId: NS_E_INVALID_OUTPUT_FORMAT
+//
+// MessageText:
+//
+// The MSAudio codec does not support the specified output format.%0
+//
+#define NS_E_INVALID_OUTPUT_FORMAT 0xC00D0BBBL
+
+//
+// MessageId: NS_E_NOT_CONFIGURED
+//
+// MessageText:
+//
+// The object must be fully configured before audio samples can be processed.%0
+//
+#define NS_E_NOT_CONFIGURED 0xC00D0BBCL
+
+//
+// MessageId: NS_E_PROTECTED_CONTENT
+//
+// MessageText:
+//
+// The content is protected and cannot be opened at this time.%0
+//
+#define NS_E_PROTECTED_CONTENT 0xC00D0BBDL
+
+//
+// MessageId: NS_E_LICENSE_REQUIRED
+//
+// MessageText:
+//
+// A playback license is required to open this content.%0
+//
+#define NS_E_LICENSE_REQUIRED 0xC00D0BBEL
+
+//
+// MessageId: NS_E_TAMPERED_CONTENT
+//
+// MessageText:
+//
+// This content has been tampered with and cannot be opened.%0
+//
+#define NS_E_TAMPERED_CONTENT 0xC00D0BBFL
+
+//
+// MessageId: NS_E_LICENSE_OUTOFDATE
+//
+// MessageText:
+//
+// The license is to open this content has expired.%0
+//
+#define NS_E_LICENSE_OUTOFDATE 0xC00D0BC0L
+
+//
+// MessageId: NS_E_LICENSE_INCORRECT_RIGHTS
+//
+// MessageText:
+//
+// The requested rights prevent the content from being opened.%0
+//
+#define NS_E_LICENSE_INCORRECT_RIGHTS 0xC00D0BC1L
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// **New** NETSHOW Warning Events
+//
+// IdRange = 10000
+//
+/////////////////////////////////////////////////////////////////////////
+
+//
+// MessageId: NS_W_INITIAL
+//
+// MessageText:
+//
+// Placeholder.%0
+//
+#define NS_W_INITIAL 0x800D2710L
+
+
+#endif _NSERROR_H
+
diff --git a/Src/Plugins/Encoder/enc_wma/resource.h b/Src/Plugins/Encoder/enc_wma/resource.h
new file mode 100644
index 00000000..61332778
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/resource.h
@@ -0,0 +1,57 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Script1.rc
+//
+#define IDS_CANNOT_FIND_INPUT_FORMATTER 0
+#define IDS_WARNING 1
+#define IDOK2 2
+#define IDS_CANNOT_ALLOCATE_MEM 2
+#define IDS_WMA_ENCODER_ERROR 3
+#define IDS_CANNOT_GET_STRUCTURE 4
+#define IDS_CANNOT_GET_ENCODER4_INFO 5
+#define IDS_SAVE_PROFILE_READ_ERROR 6
+#define IDS_MEM_ALLOCATION_ERROR 7
+#define IDS_PROFILE_SAVE_SIZE_ERROR 8
+#define IDS_CANNOT_READ_AUDIO_STREAM 9
+#define IDS_CANNOT_GET_CODEC_INFO 10
+#define IDS_CANNOT_CREATE_A_PROFILE 11
+#define IDS_CANNOT_CREATE_PROFILE_MANAGER 12
+#define IDS_WMA_CONFIG_FILE_ERROR 13
+#define IDS_CBR 16
+#define IDS_2_PASS_CBR 17
+#define IDS_VBR 18
+#define IDS_ABR 19
+#define IDS_MONO_INFO 20
+#define IDS_STEREO_INFO 21
+#define IDS_CHANNELS_INFO 22
+#define IDS_QUALITY 23
+#define IDS_BITRATE 24
+#define IDS_ENC_WMA_DESC 25
+#define IDD_DIALOG1 101
+#define IDC_DIR 1000
+#define IDC_SRATE 1001
+#define IDC_BRATE 1002
+#define IDC_NCH 1003
+#define IDC_PROFILE 1004
+#define IDC_ABRATE 1005
+#define IDC_CBR 1005
+#define IDC_ENCODER 1006
+#define IDC_BPSAMPLE 1007
+#define IDC_VBR 1008
+#define IDC_1PASS 1009
+#define IDC_RADIO4 1010
+#define IDC_2PASS 1010
+#define IDC_STATIC_BITRATE 1011
+#define IDC_SAMPLE_FORMAT 1012
+#define IDC_COMBO1 1013
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1014
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/Src/Plugins/Encoder/enc_wma/version.rc2 b/Src/Plugins/Encoder/enc_wma/version.rc2
new file mode 100644
index 00000000..d3cf0a16
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/version.rc2
@@ -0,0 +1,39 @@
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+#include "../../../Winamp/buildType.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,23,0,0
+ PRODUCTVERSION WINAMP_PRODUCTVER
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Winamp SA"
+ VALUE "FileDescription", "Winamp Encoder Plug-in"
+ VALUE "FileVersion", "1,23,0,0"
+ VALUE "InternalName", "Nullsoft WMA Encoder"
+ VALUE "LegalCopyright", "Copyright © 2006-2023 Winamp SA"
+ VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
+ VALUE "OriginalFilename", "enc_wma.dll"
+ VALUE "ProductName", "Winamp"
+ VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/Src/Plugins/Encoder/enc_wma/wmaudiosdk.h b/Src/Plugins/Encoder/enc_wma/wmaudiosdk.h
new file mode 100644
index 00000000..99199d9d
--- /dev/null
+++ b/Src/Plugins/Encoder/enc_wma/wmaudiosdk.h
@@ -0,0 +1,1009 @@
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+/* File created by MIDL compiler version 3.01.75 */
+/* at Mon Aug 09 13:10:31 1999
+ */
+/* Compiler settings for .\wmaudiosdk.idl:
+ Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
+ error checks: none
+*/
+//@@MIDL_FILE_HEADING( )
+#include "rpc.h"
+#include "rpcndr.h"
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __wmaudiosdk_h__
+#define __wmaudiosdk_h__
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IWMAudioWriter_FWD_DEFINED__
+#define __IWMAudioWriter_FWD_DEFINED__
+typedef interface IWMAudioWriter IWMAudioWriter;
+#endif /* __IWMAudioWriter_FWD_DEFINED__ */
+
+
+#ifndef __IWMAudioReader_FWD_DEFINED__
+#define __IWMAudioReader_FWD_DEFINED__
+typedef interface IWMAudioReader IWMAudioReader;
+#endif /* __IWMAudioReader_FWD_DEFINED__ */
+
+
+#ifndef __IWMAudioReadCallback_FWD_DEFINED__
+#define __IWMAudioReadCallback_FWD_DEFINED__
+typedef interface IWMAudioReadCallback IWMAudioReadCallback;
+#endif /* __IWMAudioReadCallback_FWD_DEFINED__ */
+
+
+#ifndef __IWMAudioInfo_FWD_DEFINED__
+#define __IWMAudioInfo_FWD_DEFINED__
+typedef interface IWMAudioInfo IWMAudioInfo;
+#endif /* __IWMAudioInfo_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+
+void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
+void __RPC_USER MIDL_user_free( void __RPC_FAR * );
+
+/****************************************
+ * Generated header for interface: __MIDL_itf_wmaudiosdk_0000
+ * at Mon Aug 09 13:10:31 1999
+ * using MIDL 3.01.75
+ ****************************************/
+/* [local] */
+
+
+//=========================================================================
+//
+// THIS SOFTWARE HAS BEEN LICENSED FROM MICROSOFT CORPORATION PURSUANT
+// TO THE TERMS OF AN END USER LICENSE AGREEMENT ("EULA").
+// PLEASE REFER TO THE TEXT OF THE EULA TO DETERMINE THE RIGHTS TO USE THE SOFTWARE.
+//
+// Copyright (C) Microsoft Corporation, 1996 - 1999 All Rights Reserved.
+//
+//=========================================================================
+typedef struct tWAVEFORMATEX WAVEFORMATEX;
+
+
+
+
+#include "nserror.h"
+#include "asferr.h"
+EXTERN_GUID( IID_IWMAudioWriter, 0x1A5636F1, 0xDB5E, 0x11d2, 0x9D, 0x41, 0x00, 0x60, 0x08, 0x31, 0x78, 0xAF );
+EXTERN_GUID( IID_IWMAudioReader, 0x1A5636F2, 0xDB5E, 0x11d2, 0x9D, 0x41, 0x00, 0x60, 0x08, 0x31, 0x78, 0xAF );
+EXTERN_GUID( IID_IWMAudioReadCallback, 0x1A5636F3, 0xDB5E, 0x11d2, 0x9D, 0x41, 0x00, 0x60, 0x08, 0x31, 0x78, 0xAF );
+EXTERN_GUID( IID_IWMAudioInfo, 0xaa139f0, 0xf6a8, 0x11d2, 0x97, 0xf7, 0x0, 0xa0, 0xc9, 0x5e, 0xa8, 0x50 );
+#define WMT_SAMPLE_MUSIC 0
+#define WMT_SAMPLE_SPEECH 0xFFFFFFFF
+////////////////////////////////////////////////////////////////
+//
+// These are the special case attributes that give information
+// about the ASF file.
+//
+static const DWORD g_dwWMASpecialAttributes = 7;
+static const WCHAR *g_wszWMADuration = L"Duration";
+static const WCHAR *g_wszWMABitrate = L"Bitrate";
+static const WCHAR *g_wszWMASeekable = L"Seekable";
+static const WCHAR *g_wszWMABroadcast = L"Broadcast";
+static const WCHAR *g_wszWMAProtected = L"Is_Protected";
+static const WCHAR *g_wszWMATrusted = L"Is_Trusted";
+static const WCHAR *g_wszWMASignature_Name = L"Signature_Name";
+
+////////////////////////////////////////////////////////////////
+//
+// The content description object supports 5 basic attributes.
+//
+static const DWORD g_dwWMAContentAttributes = 5;
+static const WCHAR *g_wszWMATitle = L"Title";
+static const WCHAR *g_wszWMAAuthor = L"Author";
+static const WCHAR *g_wszWMADescription = L"Description";
+static const WCHAR *g_wszWMARating = L"Rating";
+static const WCHAR *g_wszWMACopyright = L"Copyright";
+
+////////////////////////////////////////////////////////////////
+//
+// These attributes are used to set DRM properties on an ASF.
+//
+static const WCHAR *g_wszWMAUse_DRM = L"Use_DRM";
+static const WCHAR *g_wszWMADRM_Flags = L"DRM_Flags";
+static const WCHAR *g_wszWMADRM_Level = L"DRM_Level";
+
+////////////////////////////////////////////////////////////////
+//
+// These are the additional attributes defined in the ASF attribute
+// namespace that gives information about the content in the ASF file.
+//
+static const WCHAR *g_wszWMAAlbumTitle = L"WM/AlbumTitle";
+static const WCHAR *g_wszWMATrack = L"WM/Track";
+static const WCHAR *g_wszWMAPromotionURL = L"WM/PromotionURL";
+static const WCHAR *g_wszWMAAlbumCoverURL = L"WM/AlbumCoverURL";
+static const WCHAR *g_wszWMAGenre = L"WM/Genre";
+static const WCHAR *g_wszWMAYear = L"WM/Year";
+
+HRESULT STDMETHODCALLTYPE WMAudioCreateWriter( LPCWSTR pszFilename, IWMAudioWriter **ppIWMAudioWriter );
+HRESULT STDMETHODCALLTYPE WMAudioCreateReader( LPCWSTR pszFilename, IWMAudioReadCallback *pIWMReadCallback, IWMAudioReader **ppIWMAudioReader, void *pvReserved );
+HRESULT STDMETHODCALLTYPE WMAudioCreateInfo( LPCWSTR pszFilename, IWMAudioInfo **ppIWMAudioInfo );
+
+/*
+
+ // Already defined in wmsdk.h
+
+typedef
+enum WMT_STATUS
+ { WMT_ERROR = 0,
+ WMT_BUFFERING_START = 1,
+ WMT_BUFFERING_STOP = 2,
+ WMT_EOF = 3,
+ WMT_LOCATING = 4,
+ WMT_CONNECTING = 5,
+ WMT_NO_RIGHTS = 6,
+ WMT_MISSING_CODEC = 7
+ } WMT_STATUS;
+
+typedef
+enum WMT_ATTR_DATATYPE
+ { WMT_TYPE_DWORD = 0,
+ WMT_TYPE_STRING = 1,
+ WMT_TYPE_BINARY = 2,
+ WMT_TYPE_BOOL = 3
+ } WMT_ATTR_DATATYPE;
+
+typedef
+enum WMT_RIGHTS
+ { WMT_RIGHT_PLAYBACK = 0x1,
+ WMT_RIGHT_COPY_TO_PORTABLE = 0x2,
+ WMT_RIGHT_COPY_TO_CD = 0x8
+ } WMT_RIGHTS;
+
+typedef
+enum WMT_AUDIO_OPTIONS
+ { WMT_OPTION_DEFAULT = 0
+ } WMT_AUDIO_OPTIONS;
+*/
+
+
+extern RPC_IF_HANDLE __MIDL_itf_wmaudiosdk_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_wmaudiosdk_0000_v0_0_s_ifspec;
+
+#ifndef __IWMAudioWriter_INTERFACE_DEFINED__
+#define __IWMAudioWriter_INTERFACE_DEFINED__
+
+/****************************************
+ * Generated header for interface: IWMAudioWriter
+ * at Mon Aug 09 13:10:31 1999
+ * using MIDL 3.01.75
+ ****************************************/
+/* [local][unique][helpstring][uuid][object] */
+
+
+
+EXTERN_C const IID IID_IWMAudioWriter;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ interface DECLSPEC_UUID("1A5636F1-DB5E-11d2-9D41-0060083178AF")
+ IWMAudioWriter : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetAttribute(
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetInputFormat(
+ /* [in] */ const WAVEFORMATEX __RPC_FAR *pWfx) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetOutputFormat(
+ /* [in] */ DWORD dwBitrate,
+ /* [in] */ DWORD dwSampleRate,
+ /* [in] */ DWORD dwNumChannels,
+ /* [in] */ DWORD dwAudioOptions) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOutputFormat(
+ /* [out] */ DWORD __RPC_FAR *pdwBitrate,
+ /* [out] */ DWORD __RPC_FAR *pdwSampleRate,
+ /* [out] */ DWORD __RPC_FAR *pdwNumChannels,
+ /* [out] */ DWORD __RPC_FAR *pdwAudioOptions) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE WriteSample(
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Flush( void) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IWMAudioWriterVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
+ IWMAudioWriter __RPC_FAR * This);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
+ IWMAudioWriter __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetAttribute )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetInputFormat )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ const WAVEFORMATEX __RPC_FAR *pWfx);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetOutputFormat )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ DWORD dwBitrate,
+ /* [in] */ DWORD dwSampleRate,
+ /* [in] */ DWORD dwNumChannels,
+ /* [in] */ DWORD dwAudioOptions);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetOutputFormat )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [out] */ DWORD __RPC_FAR *pdwBitrate,
+ /* [out] */ DWORD __RPC_FAR *pdwSampleRate,
+ /* [out] */ DWORD __RPC_FAR *pdwNumChannels,
+ /* [out] */ DWORD __RPC_FAR *pdwAudioOptions);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *WriteSample )(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Flush )(
+ IWMAudioWriter __RPC_FAR * This);
+
+ END_INTERFACE
+ } IWMAudioWriterVtbl;
+
+ interface IWMAudioWriter
+ {
+ CONST_VTBL struct IWMAudioWriterVtbl __RPC_FAR *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IWMAudioWriter_QueryInterface(This,riid,ppvObject) \
+ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IWMAudioWriter_AddRef(This) \
+ (This)->lpVtbl -> AddRef(This)
+
+#define IWMAudioWriter_Release(This) \
+ (This)->lpVtbl -> Release(This)
+
+
+#define IWMAudioWriter_SetAttribute(This,pszName,Type,pValue,cbLength) \
+ (This)->lpVtbl -> SetAttribute(This,pszName,Type,pValue,cbLength)
+
+#define IWMAudioWriter_SetInputFormat(This,pWfx) \
+ (This)->lpVtbl -> SetInputFormat(This,pWfx)
+
+#define IWMAudioWriter_SetOutputFormat(This,dwBitrate,dwSampleRate,dwNumChannels,dwAudioOptions) \
+ (This)->lpVtbl -> SetOutputFormat(This,dwBitrate,dwSampleRate,dwNumChannels,dwAudioOptions)
+
+#define IWMAudioWriter_GetOutputFormat(This,pdwBitrate,pdwSampleRate,pdwNumChannels,pdwAudioOptions) \
+ (This)->lpVtbl -> GetOutputFormat(This,pdwBitrate,pdwSampleRate,pdwNumChannels,pdwAudioOptions)
+
+#define IWMAudioWriter_WriteSample(This,pData,cbData) \
+ (This)->lpVtbl -> WriteSample(This,pData,cbData)
+
+#define IWMAudioWriter_Flush(This) \
+ (This)->lpVtbl -> Flush(This)
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_SetAttribute_Proxy(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength);
+
+
+void __RPC_STUB IWMAudioWriter_SetAttribute_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_SetInputFormat_Proxy(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ const WAVEFORMATEX __RPC_FAR *pWfx);
+
+
+void __RPC_STUB IWMAudioWriter_SetInputFormat_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_SetOutputFormat_Proxy(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ DWORD dwBitrate,
+ /* [in] */ DWORD dwSampleRate,
+ /* [in] */ DWORD dwNumChannels,
+ /* [in] */ DWORD dwAudioOptions);
+
+
+void __RPC_STUB IWMAudioWriter_SetOutputFormat_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_GetOutputFormat_Proxy(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [out] */ DWORD __RPC_FAR *pdwBitrate,
+ /* [out] */ DWORD __RPC_FAR *pdwSampleRate,
+ /* [out] */ DWORD __RPC_FAR *pdwNumChannels,
+ /* [out] */ DWORD __RPC_FAR *pdwAudioOptions);
+
+
+void __RPC_STUB IWMAudioWriter_GetOutputFormat_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_WriteSample_Proxy(
+ IWMAudioWriter __RPC_FAR * This,
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData);
+
+
+void __RPC_STUB IWMAudioWriter_WriteSample_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioWriter_Flush_Proxy(
+ IWMAudioWriter __RPC_FAR * This);
+
+
+void __RPC_STUB IWMAudioWriter_Flush_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IWMAudioWriter_INTERFACE_DEFINED__ */
+
+
+#ifndef __IWMAudioReader_INTERFACE_DEFINED__
+#define __IWMAudioReader_INTERFACE_DEFINED__
+
+/****************************************
+ * Generated header for interface: IWMAudioReader
+ * at Mon Aug 09 13:10:31 1999
+ * using MIDL 3.01.75
+ ****************************************/
+/* [local][unique][helpstring][uuid][object] */
+
+
+
+EXTERN_C const IID IID_IWMAudioReader;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ interface DECLSPEC_UUID("1A5636F2-DB5E-11d2-9D41-0060083178AF")
+ IWMAudioReader : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeByName(
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeCount(
+ /* [out] */ WORD __RPC_FAR *pcAttributes) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeByIndex(
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOutputFormat(
+ /* [out] */ WAVEFORMATEX __RPC_FAR *pWfx,
+ /* [in] */ DWORD cbSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Seek(
+ DWORD dwMsTime) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IWMAudioReaderVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
+ IWMAudioReader __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
+ IWMAudioReader __RPC_FAR * This);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
+ IWMAudioReader __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeByName )(
+ IWMAudioReader __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeCount )(
+ IWMAudioReader __RPC_FAR * This,
+ /* [out] */ WORD __RPC_FAR *pcAttributes);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeByIndex )(
+ IWMAudioReader __RPC_FAR * This,
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetOutputFormat )(
+ IWMAudioReader __RPC_FAR * This,
+ /* [out] */ WAVEFORMATEX __RPC_FAR *pWfx,
+ /* [in] */ DWORD cbSize);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Start )(
+ IWMAudioReader __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Stop )(
+ IWMAudioReader __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Seek )(
+ IWMAudioReader __RPC_FAR * This,
+ DWORD dwMsTime);
+
+ END_INTERFACE
+ } IWMAudioReaderVtbl;
+
+ interface IWMAudioReader
+ {
+ CONST_VTBL struct IWMAudioReaderVtbl __RPC_FAR *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IWMAudioReader_QueryInterface(This,riid,ppvObject) \
+ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IWMAudioReader_AddRef(This) \
+ (This)->lpVtbl -> AddRef(This)
+
+#define IWMAudioReader_Release(This) \
+ (This)->lpVtbl -> Release(This)
+
+
+#define IWMAudioReader_GetAttributeByName(This,pszName,pType,pValue,pcbLength) \
+ (This)->lpVtbl -> GetAttributeByName(This,pszName,pType,pValue,pcbLength)
+
+#define IWMAudioReader_GetAttributeCount(This,pcAttributes) \
+ (This)->lpVtbl -> GetAttributeCount(This,pcAttributes)
+
+#define IWMAudioReader_GetAttributeByIndex(This,wIndex,pwszName,pcbNameLen,pType,pValue,pcbLength) \
+ (This)->lpVtbl -> GetAttributeByIndex(This,wIndex,pwszName,pcbNameLen,pType,pValue,pcbLength)
+
+#define IWMAudioReader_GetOutputFormat(This,pWfx,cbSize) \
+ (This)->lpVtbl -> GetOutputFormat(This,pWfx,cbSize)
+
+#define IWMAudioReader_Start(This) \
+ (This)->lpVtbl -> Start(This)
+
+#define IWMAudioReader_Stop(This) \
+ (This)->lpVtbl -> Stop(This)
+
+#define IWMAudioReader_Seek(This,dwMsTime) \
+ (This)->lpVtbl -> Seek(This,dwMsTime)
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_GetAttributeByName_Proxy(
+ IWMAudioReader __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+
+void __RPC_STUB IWMAudioReader_GetAttributeByName_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_GetAttributeCount_Proxy(
+ IWMAudioReader __RPC_FAR * This,
+ /* [out] */ WORD __RPC_FAR *pcAttributes);
+
+
+void __RPC_STUB IWMAudioReader_GetAttributeCount_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_GetAttributeByIndex_Proxy(
+ IWMAudioReader __RPC_FAR * This,
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+
+void __RPC_STUB IWMAudioReader_GetAttributeByIndex_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_GetOutputFormat_Proxy(
+ IWMAudioReader __RPC_FAR * This,
+ /* [out] */ WAVEFORMATEX __RPC_FAR *pWfx,
+ /* [in] */ DWORD cbSize);
+
+
+void __RPC_STUB IWMAudioReader_GetOutputFormat_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_Start_Proxy(
+ IWMAudioReader __RPC_FAR * This);
+
+
+void __RPC_STUB IWMAudioReader_Start_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_Stop_Proxy(
+ IWMAudioReader __RPC_FAR * This);
+
+
+void __RPC_STUB IWMAudioReader_Stop_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReader_Seek_Proxy(
+ IWMAudioReader __RPC_FAR * This,
+ DWORD dwMsTime);
+
+
+void __RPC_STUB IWMAudioReader_Seek_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IWMAudioReader_INTERFACE_DEFINED__ */
+
+
+#ifndef __IWMAudioReadCallback_INTERFACE_DEFINED__
+#define __IWMAudioReadCallback_INTERFACE_DEFINED__
+
+/****************************************
+ * Generated header for interface: IWMAudioReadCallback
+ * at Mon Aug 09 13:10:31 1999
+ * using MIDL 3.01.75
+ ****************************************/
+/* [local][unique][helpstring][uuid][object] */
+
+
+
+EXTERN_C const IID IID_IWMAudioReadCallback;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ interface DECLSPEC_UUID("1A5636F3-DB5E-11d2-9D41-0060083178AF")
+ IWMAudioReadCallback : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE OnSample(
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData,
+ /* [in] */ DWORD dwMsTime) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE OnStatus(
+ /* [in] */ WMT_STATUS Status,
+ /* [in] */ HRESULT hr,
+ /* [in] */ const VARIANT __RPC_FAR *pParam) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IWMAudioReadCallbackVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
+ IWMAudioReadCallback __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
+ IWMAudioReadCallback __RPC_FAR * This);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
+ IWMAudioReadCallback __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OnSample )(
+ IWMAudioReadCallback __RPC_FAR * This,
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData,
+ /* [in] */ DWORD dwMsTime);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *OnStatus )(
+ IWMAudioReadCallback __RPC_FAR * This,
+ /* [in] */ WMT_STATUS Status,
+ /* [in] */ HRESULT hr,
+ /* [in] */ const VARIANT __RPC_FAR *pParam);
+
+ END_INTERFACE
+ } IWMAudioReadCallbackVtbl;
+
+ interface IWMAudioReadCallback
+ {
+ CONST_VTBL struct IWMAudioReadCallbackVtbl __RPC_FAR *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IWMAudioReadCallback_QueryInterface(This,riid,ppvObject) \
+ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IWMAudioReadCallback_AddRef(This) \
+ (This)->lpVtbl -> AddRef(This)
+
+#define IWMAudioReadCallback_Release(This) \
+ (This)->lpVtbl -> Release(This)
+
+
+#define IWMAudioReadCallback_OnSample(This,pData,cbData,dwMsTime) \
+ (This)->lpVtbl -> OnSample(This,pData,cbData,dwMsTime)
+
+#define IWMAudioReadCallback_OnStatus(This,Status,hr,pParam) \
+ (This)->lpVtbl -> OnStatus(This,Status,hr,pParam)
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReadCallback_OnSample_Proxy(
+ IWMAudioReadCallback __RPC_FAR * This,
+ /* [in] */ const BYTE __RPC_FAR *pData,
+ /* [in] */ DWORD cbData,
+ /* [in] */ DWORD dwMsTime);
+
+
+void __RPC_STUB IWMAudioReadCallback_OnSample_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioReadCallback_OnStatus_Proxy(
+ IWMAudioReadCallback __RPC_FAR * This,
+ /* [in] */ WMT_STATUS Status,
+ /* [in] */ HRESULT hr,
+ /* [in] */ const VARIANT __RPC_FAR *pParam);
+
+
+void __RPC_STUB IWMAudioReadCallback_OnStatus_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IWMAudioReadCallback_INTERFACE_DEFINED__ */
+
+
+#ifndef __IWMAudioInfo_INTERFACE_DEFINED__
+#define __IWMAudioInfo_INTERFACE_DEFINED__
+
+/****************************************
+ * Generated header for interface: IWMAudioInfo
+ * at Mon Aug 09 13:10:31 1999
+ * using MIDL 3.01.75
+ ****************************************/
+/* [local][unique][helpstring][uuid][object] */
+
+
+
+EXTERN_C const IID IID_IWMAudioInfo;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ interface DECLSPEC_UUID("0AA139F0-F6A8-11d2-97F7-00A0C95EA850")
+ IWMAudioInfo : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeCount(
+ /* [out] */ WORD __RPC_FAR *pcAttributes) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeByIndex(
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeByName(
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAttribute(
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
+
+ };
+
+#else /* C style interface */
+
+ typedef struct IWMAudioInfoVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ REFIID riid,
+ /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
+ IWMAudioInfo __RPC_FAR * This);
+
+ ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
+ IWMAudioInfo __RPC_FAR * This);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeCount )(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [out] */ WORD __RPC_FAR *pcAttributes);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeByIndex )(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetAttributeByName )(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *SetAttribute )(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength);
+
+ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Close )(
+ IWMAudioInfo __RPC_FAR * This);
+
+ END_INTERFACE
+ } IWMAudioInfoVtbl;
+
+ interface IWMAudioInfo
+ {
+ CONST_VTBL struct IWMAudioInfoVtbl __RPC_FAR *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IWMAudioInfo_QueryInterface(This,riid,ppvObject) \
+ (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
+
+#define IWMAudioInfo_AddRef(This) \
+ (This)->lpVtbl -> AddRef(This)
+
+#define IWMAudioInfo_Release(This) \
+ (This)->lpVtbl -> Release(This)
+
+
+#define IWMAudioInfo_GetAttributeCount(This,pcAttributes) \
+ (This)->lpVtbl -> GetAttributeCount(This,pcAttributes)
+
+#define IWMAudioInfo_GetAttributeByIndex(This,wIndex,pwszName,pcbNameLen,pType,pValue,pcbLength) \
+ (This)->lpVtbl -> GetAttributeByIndex(This,wIndex,pwszName,pcbNameLen,pType,pValue,pcbLength)
+
+#define IWMAudioInfo_GetAttributeByName(This,pszName,pType,pValue,pcbLength) \
+ (This)->lpVtbl -> GetAttributeByName(This,pszName,pType,pValue,pcbLength)
+
+#define IWMAudioInfo_SetAttribute(This,pszName,Type,pValue,cbLength) \
+ (This)->lpVtbl -> SetAttribute(This,pszName,Type,pValue,cbLength)
+
+#define IWMAudioInfo_Close(This) \
+ (This)->lpVtbl -> Close(This)
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioInfo_GetAttributeCount_Proxy(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [out] */ WORD __RPC_FAR *pcAttributes);
+
+
+void __RPC_STUB IWMAudioInfo_GetAttributeCount_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioInfo_GetAttributeByIndex_Proxy(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ WORD wIndex,
+ /* [out] */ WCHAR __RPC_FAR *pwszName,
+ /* [out][in] */ WORD __RPC_FAR *pcbNameLen,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+
+void __RPC_STUB IWMAudioInfo_GetAttributeByIndex_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioInfo_GetAttributeByName_Proxy(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [out] */ WMT_ATTR_DATATYPE __RPC_FAR *pType,
+ /* [out] */ BYTE __RPC_FAR *pValue,
+ /* [out][in] */ WORD __RPC_FAR *pcbLength);
+
+
+void __RPC_STUB IWMAudioInfo_GetAttributeByName_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioInfo_SetAttribute_Proxy(
+ IWMAudioInfo __RPC_FAR * This,
+ /* [in] */ LPCWSTR pszName,
+ /* [in] */ WMT_ATTR_DATATYPE Type,
+ /* [in] */ const BYTE __RPC_FAR *pValue,
+ /* [in] */ WORD cbLength);
+
+
+void __RPC_STUB IWMAudioInfo_SetAttribute_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+HRESULT STDMETHODCALLTYPE IWMAudioInfo_Close_Proxy(
+ IWMAudioInfo __RPC_FAR * This);
+
+
+void __RPC_STUB IWMAudioInfo_Close_Stub(
+ IRpcStubBuffer *This,
+ IRpcChannelBuffer *_pRpcChannelBuffer,
+ PRPC_MESSAGE _pRpcMessage,
+ DWORD *_pdwStubPhase);
+
+
+
+#endif /* __IWMAudioInfo_INTERFACE_DEFINED__ */
+
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif