id3v1.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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>
  20. #include <iostream>
  21. #include <vcclr.h>
  22. using namespace std;
  23. using namespace System;
  24. using namespace System::Runtime::InteropServices;
  25. namespace mpg123clr
  26. {
  27. namespace id3
  28. {
  29. ///<summary>id3check enumeration.</summary>
  30. public enum class id3check
  31. {
  32. none = 0,
  33. id3 = 2, /**< 0010 There is some ID3 info. */
  34. upd_id3 = MPG123_ID3, /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */
  35. new_id3 = MPG123_NEW_ID3, /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */
  36. icy = 8, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
  37. upd_icy = MPG123_ICY, /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
  38. new_icy = MPG123_NEW_ICY, /**< 0100 There is ICY info that changed since last call to mpg123_icy. */
  39. };
  40. // Recommended usage when creating reference type on the managed heap (not using stack semantics
  41. // for reference types...) [see Destructors and Finalizers in Visual C++]
  42. //
  43. // A ^ myA = gcnew A;
  44. // try
  45. // {
  46. // use myA
  47. // }
  48. // finally
  49. // {
  50. // delete myA;
  51. // }
  52. ///<summary>Wrapper for mpg123_id3v1.</summary>
  53. [StructLayout(LayoutKind::Sequential)]
  54. public ref struct mpg123id3v1
  55. {
  56. private:
  57. mpg123_id3v1* sb;
  58. protected:
  59. ///<summary>Finalizer.
  60. ///<para>Cleanly handles mpg123_delete of internal (unmanaged) mpg123 handle.</para></summary>
  61. /// Implementation of CLR Finalize().
  62. !mpg123id3v1(void);
  63. internal:
  64. ///<summary>Working Constructor.
  65. ///<para>Maps to mpg123_id3v1 memory.</para>
  66. ///</summary>
  67. mpg123id3v1(mpg123_id3v1* sb);
  68. public:
  69. ///<summary>Constructor.
  70. ///<para>Only creates object for use as "out" target in ID3 constructor.</para>
  71. ///</summary>
  72. mpg123id3v1(void);
  73. ///<summary>Destructor. Used for final object deletion.
  74. ///<para>Calls finalizer for clean disposal of internal (unmanaged) library handles.</para>
  75. ///</summary>
  76. /// Implementation of CLR Dispose().
  77. /// ~Destructor and !Finalizer are the prescribed implementation of Dispose() and Finalize().
  78. /// See Destructors and Finalizers in Visual C++
  79. ~mpg123id3v1(void);
  80. ///<summary>Get the ID3v1 tag descriptor.
  81. ///<para>Property returns the ID3v1 tag (should always be "TAG").</para>
  82. ///</summary>
  83. ///<value>The ID3v1 tag (should always be "TAG").</value>
  84. property String^ tag{String^ __clrcall get();}
  85. ///<summary>Get the ID3v1 title text.
  86. ///<para>Property returns the ID3v1 title text.</para>
  87. ///</summary>
  88. ///<value>The ID3v1 title text.</value>
  89. property String^ title{String^ __clrcall get();}
  90. ///<summary>Get the ID3v1 artist text.
  91. ///<para>Property returns the ID3v1 artist text.</para>
  92. ///</summary>
  93. ///<value>The ID3v1 artist text.</value>
  94. property String^ artist{String^ __clrcall get();}
  95. ///<summary>Get the ID3v1 album text.
  96. ///<para>Property returns the ID3v1 album text.</para>
  97. ///</summary>
  98. ///<value>The ID3v1 album text.</value>
  99. property String^ album{String^ __clrcall get();}
  100. ///<summary>Get the ID3v1 comment text.
  101. ///<para>Property returns the ID3v1 comment text.</para>
  102. ///</summary>
  103. ///<value>The ID3v1 comment text.</value>
  104. property String^ comment{String^ __clrcall get();}
  105. ///<summary>Get the ID3v1 genre index.
  106. ///<para>Property returns the ID3v1 genre index.</para>
  107. ///</summary>
  108. ///<value>The ID3v1 genre index.</value>
  109. property int genre{int __clrcall get();}
  110. };
  111. }
  112. }