svc_audioFileEncoder.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. /*
  3. Service for creating Audio Encoders which encode straight to a file.
  4. This interface is not meant to do the encoding itself, it is a factory to create and destroy
  5. encoder objects (ifc_audioFileEncoder)
  6. */
  7. #include <bfc/dispatch.h>
  8. #include "ifc_audioFileEncoder.h"
  9. #include "../DecodeFile/api_decodefile.h" // for AudioParameters struct
  10. #include <bfc/std_mkncc.h> // for MKnCC()
  11. class svc_audioFileEncoder : public Dispatchable
  12. {
  13. protected:
  14. svc_audioFileEncoder() {}
  15. ~svc_audioFileEncoder() {}
  16. public:
  17. static FOURCC getServiceType() { return svc_albumArtProvider::SERVICETYPE; }
  18. /*
  19. General parameter notes (for all methods of this class):
  20. @param profile is a filename of an INI file where the encoder settings are stored
  21. @param parameters defines the input audio data. For methods where this parameter
  22. is optional (default parameter value == 0), it is meant to be passed to optionally
  23. limit configuration choices. For example, an AAC encoder could hide surround-sound
  24. encoding options when parameters->channels == 2
  25. */
  26. // return a user-friendly name for the encoder,
  27. // e.g. "Nullsoft FLAC encoder v2.1"
  28. const wchar_t *GetName();
  29. // retrieve information about a particular profile
  30. // @param profile_item information to retrieve. currently, there are only three defined strings
  31. // "bitrate" -- retrieve an estimate bitrate (in kbps) for the profile
  32. // "profile" -- retrieve a more specific name for a given profile (and optional input parameters)
  33. // e.g. an AAC encoder could return "HE-AAC v2, 16kbps, MP4 File Format" or "AAC LC, ADTS stream"
  34. // "settings" -- retrieve a string that codifies the settings in the profile
  35. // for most codecs, this should mirror what the commandline string would be for the corresponding
  36. // commandline codec (flac.exe, lame.exe, etc).
  37. // e.g. "-V 2"
  38. int GetProfileInfo(const wchar_t *profile, const wchar_t *profile_item, wchar_t *value, size_t value_cch, const AudioParameters *parameters = 0);
  39. // not currently used for anything
  40. int SetProfileInfo(const wchar_t *profile, const wchar_t *profile_item, const wchar_t *value, AudioParameters *parameters = 0);
  41. // this function gets the party started. call after you have opened your input file (thru
  42. // api_decodefile, for example) so you can pass in a valid parameters struct.
  43. // @param filename destination filename
  44. int Create(ifc_audioFileEncoder **encoder, const wchar_t *filename, const wchar_t *profile, const AudioParameters *parameters);
  45. // call this when you are done
  46. void Destroy(ifc_audioFileEncoder *encoder);
  47. // if parent is NULL, pop up a modal dialog/window
  48. // if parent is not NULL, return a modeless child dialog/window
  49. HWND Configure(HWND parent, const wchar_t *profile, const AudioParameters *parameters = 0);
  50. enum
  51. {
  52. SERVICETYPE = MK4CC('a','f','e', 'n')
  53. };
  54. };