4 @SuppressWarnings public class QMediaPlayer : QMediaObject{
8 public QMediaPlayer(long handle){
13 nativehandle = QtXnl.createQPObject(QType.qtMediaPlayer,
this, 0l, (
long)f, 0l, 0l, 0l);
14 if (nativehandle == 0){
20 public bool create(@NotNilptr QObject parent, Flag f) {
21 nativehandle = QtXnl.createQPObject(QType.qtMediaPlayer,
this, parent.nativehandle, (
long)f, 0l, 0l, 0l);
22 if (nativehandle == 0){
32 StreamPlayback = 0x02,
54 public enum MediaStatus
68 return (SupportEstimate)QtXnl.long_object_string((
long)flags, Constant.QMEDIAPLAYER_HASSUPPORT, codecs, mimeType);
72 return (
String[]) QtXnl.object_get_handle(0, Constant.QMEDIAPLAYER_SUPPORTEDMIMETYPES, (
long)flags);
76 QtXnl.core_getintlong(nativehandle, Constant.QMEDIAPLAYER_SETVIDEOOUTPUT, w.nativehandle);
80 return (State)QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_STATE);
84 return (MediaStatus)QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_MEDIASTATUS);
88 return QtXnl.long_get(nativehandle, Constant.QMEDIAPLAYER_DURATION);
92 return QtXnl.long_get(nativehandle, Constant.QMEDIAPLAYER_POSITION);
96 return QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_VOLUME);
100 return QtXnl.widget_get_bool_value(nativehandle, Constant.QMEDIAPLAYER_ISMUTED);
104 return QtXnl.widget_get_bool_value(nativehandle, Constant.QMEDIAPLAYER_ISAUDIOAVAILABLE);
108 return QtXnl.widget_get_bool_value(nativehandle, Constant.QMEDIAPLAYER_ISVIDEOAVAILABLE);
112 return QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_BUFFERSTATUS);
116 return QtXnl.widget_get_bool_value(nativehandle, Constant.QMEDIAPLAYER_ISSEEKABLE);
120 return QtXnl.widget_get_double_value(nativehandle, Constant.QMEDIAPLAYER_PLAYBACKRATE);
124 return (Error)QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_ERROR);
128 return (
String)QtXnl.core_getString(nativehandle, Constant.QMEDIAPLAYER_ERRORSTRING);
132 return (AvailabilityStatus)QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_AVAILABILITY);
136 return (QAudio.Role)QtXnl.widget_get_int_value(nativehandle, Constant.QMEDIAPLAYER_AUDIOROLE);
140 QtXnl.widget_set_vint_value(nativehandle, Constant.QMEDIAPLAYER_SETAUDIOROLE, (
int)audioRole);
144 return (QAudio.Role [])QtXnl.widget_get_object(nativehandle, Constant.QMEDIAPLAYER_SUPPORTEDAUDIOROLES);
148 QtXnl.widget_slot(nativehandle, Constant.QMEDIAPLAYER_PLAY);
151 QtXnl.widget_slot(nativehandle, Constant.QMEDIAPLAYER_PAUSE);
154 QtXnl.widget_slot(nativehandle, Constant.QMEDIAPLAYER_STOP);
158 QtXnl.widget_set_native_value(nativehandle, Constant.QMEDIAPLAYER_SETPOSITION, position);
161 QtXnl.widget_set_vint_value(nativehandle, Constant.QMEDIAPLAYER_SETVOLUME, volume);
164 QtXnl.widget_set_bool_value(nativehandle, Constant.QMEDIAPLAYER_SETMUTED, muted);
167 QtXnl.widget_set_double_value(nativehandle, Constant.QMEDIAPLAYER_SETPLAYBACKRATE, rate);
170 QtXnl.widget_slot_string(nativehandle, Constant.QMEDIAPLAYER_SETMEDIA, uri);
173 onMediaPlayerListener __listener = nilptr;
183 if (__listener != nilptr){
184 __listener.mediaChanged(
this,uri);
188 if (__listener != nilptr){
189 __listener.currentMediaChanged(
this,uri);
193 if (__listener != nilptr){
194 __listener.stateChanged(
this, newState);
198 if (__listener != nilptr){
199 __listener.mediaStatusChanged(
this, status);
203 if (__listener != nilptr){
204 __listener.durationChanged(
this, duration);
208 if (__listener != nilptr){
209 __listener.positionChanged(
this, position);
213 if (__listener != nilptr){
214 __listener.volumeChanged(
this, volume);
218 if (__listener != nilptr){
219 __listener.mutedChanged(
this, muted);
223 if (__listener != nilptr){
224 __listener.audioAvailableChanged(
this, available);
228 if (__listener != nilptr){
229 __listener.videoAvailableChanged(
this, videoAvailable);
233 if (__listener != nilptr){
234 __listener.bufferStatusChanged(
this, percentFilled);
238 if (__listener != nilptr){
239 __listener.seekableChanged(
this, seekable);
243 if (__listener != nilptr){
244 __listener.playbackRateChanged(
this, rate);
248 if (__listener != nilptr){
249 __listener.audioRoleChanged(
this, role);
252 public void error(QMediaPlayer.Error error){
253 if (__listener != nilptr){
254 __listener.error(
this, error);