1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gst.mpegts.PMT;
26 
27 private import glib.ConstructionException;
28 private import glib.MemorySlice;
29 private import glib.PtrArray;
30 private import gobject.ObjectG;
31 private import gst.mpegts.c.functions;
32 public  import gst.mpegts.c.types;
33 private import gtkd.Loader;
34 
35 
36 /**
37  * Program Map Table (ISO/IEC 13818-1).
38  * 
39  * The program_number is contained in the subtable_extension field of the
40  * container #GstMpegtsSection.
41  */
42 public final class PMT
43 {
44 	/** the main Gtk struct */
45 	protected GstMpegtsPMT* gstMpegtsPMT;
46 	protected bool ownedRef;
47 
48 	/** Get the main Gtk struct */
49 	public GstMpegtsPMT* getPMTStruct(bool transferOwnership = false)
50 	{
51 		if (transferOwnership)
52 			ownedRef = false;
53 		return gstMpegtsPMT;
54 	}
55 
56 	/** the main Gtk struct as a void* */
57 	protected void* getStruct()
58 	{
59 		return cast(void*)gstMpegtsPMT;
60 	}
61 
62 	/**
63 	 * Sets our main struct and passes it to the parent class.
64 	 */
65 	public this (GstMpegtsPMT* gstMpegtsPMT, bool ownedRef = false)
66 	{
67 		this.gstMpegtsPMT = gstMpegtsPMT;
68 		this.ownedRef = ownedRef;
69 	}
70 
71 	~this ()
72 	{
73 		if ( Linker.isLoaded(LIBRARY_GSTMPEGTS) && ownedRef )
74 			sliceFree(gstMpegtsPMT);
75 	}
76 
77 
78 	/**
79 	 * PID of the stream containing PCR
80 	 */
81 	public @property ushort pcrPid()
82 	{
83 		return gstMpegtsPMT.pcrPid;
84 	}
85 
86 	/** Ditto */
87 	public @property void pcrPid(ushort value)
88 	{
89 		gstMpegtsPMT.pcrPid = value;
90 	}
91 
92 	/** */
93 	public @property ushort programNumber()
94 	{
95 		return gstMpegtsPMT.programNumber;
96 	}
97 
98 	/** Ditto */
99 	public @property void programNumber(ushort value)
100 	{
101 		gstMpegtsPMT.programNumber = value;
102 	}
103 
104 	/**
105 	 * array of #GstMpegtsDescriptor
106 	 */
107 	public @property PtrArray descriptors()
108 	{
109 		return new PtrArray(gstMpegtsPMT.descriptors, false);
110 	}
111 
112 	/** Ditto */
113 	public @property void descriptors(PtrArray value)
114 	{
115 		gstMpegtsPMT.descriptors = value.getPtrArrayStruct();
116 	}
117 
118 	/**
119 	 * Array of #GstMpegtsPMTStream
120 	 */
121 	public @property PtrArray streams()
122 	{
123 		return new PtrArray(gstMpegtsPMT.streams, false);
124 	}
125 
126 	/** Ditto */
127 	public @property void streams(PtrArray value)
128 	{
129 		gstMpegtsPMT.streams = value.getPtrArrayStruct();
130 	}
131 
132 	/** */
133 	public static GType getType()
134 	{
135 		return gst_mpegts_pmt_get_type();
136 	}
137 
138 	/**
139 	 * Allocates and initializes a new #GstMpegtsPMT.
140 	 *
141 	 * Returns: #GstMpegtsPMT
142 	 *
143 	 * Throws: ConstructionException GTK+ fails to create the object.
144 	 */
145 	public this()
146 	{
147 		auto p = gst_mpegts_pmt_new();
148 
149 		if(p is null)
150 		{
151 			throw new ConstructionException("null returned by new");
152 		}
153 
154 		this(cast(GstMpegtsPMT*) p);
155 	}
156 }