text.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. mpg123clr: MPEG Audio Decoder library Common Language Runtime version.
  3. copyright 2009 by Malcolm Boczek - free software under the terms of the LGPL 2.1
  4. mpg123clr.dll is a derivative work of libmpg123 - all original mpg123 licensing terms apply.
  5. All rights to this work freely assigned to the mpg123 project.
  6. */
  7. /*
  8. libmpg123: MPEG Audio Decoder library
  9. copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
  10. see COPYING and AUTHORS files in distribution or http://mpg123.org
  11. */
  12. /*
  13. 1.8.1.0 04-Aug-09 Initial release.
  14. */
  15. #pragma once
  16. #pragma warning(disable : 4635)
  17. #include "mpg123.h"
  18. #pragma warning(default : 4635)
  19. #include "string.h"
  20. #include <string>
  21. #include <iostream>
  22. #include <vcclr.h>
  23. using namespace std;
  24. using namespace System;
  25. using namespace System::Runtime::InteropServices;
  26. namespace mpg123clr
  27. {
  28. // Recommended usage when creating reference type on the managed heap (not using stack semantics
  29. // for reference types...) [see Destructors and Finalizers in Visual C++]
  30. //
  31. // A ^ myA = gcnew A;
  32. // try
  33. // {
  34. // use myA
  35. // }
  36. // finally
  37. // {
  38. // delete myA;
  39. // }
  40. ///<summary>Wrapper for mpg123_text.</summary>
  41. [StructLayout(LayoutKind::Sequential, CharSet=CharSet::Ansi)]
  42. public ref struct mpg123text
  43. {
  44. private:
  45. mpg123_text* sb;
  46. internal:
  47. ///<summary>Constructor.
  48. ///<para>Recommended usage: only as tracking marker to existing mpg123_text objects.</para></summary>
  49. mpg123text(void);
  50. ///<summary>Reference Constructor.
  51. ///<para>Recommended usage: only as tracking marker to existing mpg123_text objects.</para></summary>
  52. mpg123text(mpg123_text* sb);
  53. protected:
  54. ///<summary>Finalizer.
  55. ///<para>Does nothing. mpg123text can only be instanced as a reference to an existing mpg123_text object (which is responsible for its own disposal.</para></summary>
  56. /// Implementation of CLR Finalize().
  57. !mpg123text(void);
  58. public:
  59. ///<summary>Destructor. Used for final object deletion.
  60. ///<para>Calls finalizer.</para>
  61. ///</summary>
  62. /// Implementation of CLR Dispose().
  63. /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize().
  64. /// See Destructors and Finalizers in Visual C++
  65. ~mpg123text(void);
  66. ///<summary>Get a string representation of the 3-letter language code.
  67. ///<para>Only COMM and USLT have a language element.</para>
  68. ///<para>Property returns string representation of the 3-letter language code.</para>
  69. ///</summary>
  70. ///<value>String representation of the 3-letter language code.</value>
  71. property String^ lang{String^ __clrcall get();}
  72. ///<summary>Get a string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.)
  73. ///<para>Property returns string representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.)</para>
  74. ///</summary>
  75. ///<value>String representation of the ID3v2 field id. (i.e. TALB, TPE2 etc.)</value>
  76. property String^ id{String^ __clrcall get();}
  77. ///<summary>Get a string representation of the description field.
  78. ///<para>Only COMM and TXXX have a description element.</para>
  79. ///<para>Property returns string representation of the description field.</para>
  80. ///</summary>
  81. ///<value>String representation of the description field.</value>
  82. property String^ description{String^ __clrcall get();}
  83. ///<summary>Get a string representation of the ID3 tag text.
  84. ///<para>This is for COMM, TXXX and all the other text fields.</para>
  85. ///<para>Property returns string representation of the ID3 tag text.</para>
  86. ///</summary>
  87. ///<value>String representation of the ID3 tag text.</value>
  88. property String^ text{String^ __clrcall get();}
  89. };
  90. }