aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h')
-rw-r--r--Src/Plugins/Encoder/enc_wma/AudioCoderWMA.h50
1 files changed, 50 insertions, 0 deletions
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