diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Library/ml_pmp/transcoder.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Plugins/Library/ml_pmp/transcoder.h')
-rw-r--r-- | Src/Plugins/Library/ml_pmp/transcoder.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_pmp/transcoder.h b/Src/Plugins/Library/ml_pmp/transcoder.h new file mode 100644 index 00000000..2aad4ac7 --- /dev/null +++ b/Src/Plugins/Library/ml_pmp/transcoder.h @@ -0,0 +1,38 @@ +#ifndef _TRANSCODER_H_ +#define _TRANSCODER_H_ + +class Transcoder { +protected: + Transcoder(){} + virtual ~Transcoder(){} +public: + // done at init() + virtual void LoadConfigProfile(wchar_t *profile)=0; // deprecated, do not call + virtual void AddAcceptableFormat(wchar_t *format)=0; // eg, L"mp3" or L"wma" + virtual void AddAcceptableFormat(unsigned int format)=0; // eg, mmioFOURCC('M','4','A',' ') + + // done when file is added to transfer queue + // returns: + // -1 for can't transcode + // output file size estimate if can transcode + // if ext is supplied, it should be a buffer with space for 5 characters, and will be filled with + // the output file type file extention, eg, L".mp3" + virtual int CanTranscode(wchar_t *file, wchar_t *ext = NULL, int length = -1)=0; + + // false if no transcoding needed + virtual bool ShouldTranscode(wchar_t *file)=0; + + // done just before transfer OR in background after file is added to queue + // extention is added to outputFile, allow 5 extra chars + // callback, callbackcontext and killswitch should be similar to those passed by ml_pmp + // return 0 for success, -1 for failed or cancelled + virtual int TranscodeFile(wchar_t *inputFile, wchar_t *outputFile, int *killswitch, void (*callback)(void * callbackContext, wchar_t * status), void* callbackContext, wchar_t * caption=L"Transcoding %d%%")=0; + + + // get a filename which can be used as a staging area. + // ext should be for example L".mp3" + // make sure filename is a buffer at least MAX_PATH characters long. + virtual void GetTempFilePath(const wchar_t *ext, wchar_t *filename)=0; +}; + +#endif //_TRANSCODER_H_
\ No newline at end of file |