xref: /aoo4110/main/offapi/com/sun/star/media/XPlayer.idl (revision b1cdbd2c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_media_XPlayer_idl__
24#define __com_sun_star_media_XPlayer_idl__
25
26#ifndef __com_sun_star_awt_Size_idl__
27#include <com/sun/star/awt/Size.idl>
28#endif
29#ifndef __com_sun_star_media_XPlayerWindow_idl__
30#include <com/sun/star/media/XPlayerWindow.idl>
31#endif
32#ifndef __com_sun_star_media_XFrameGrabber_idl__
33#include <com/sun/star/media/XFrameGrabber.idl>
34#endif
35
36module com {  module sun {  module star {  module media {
37
38/** is the multimedia stream handling interface. This allows to
39    perform every basic operation on videos and sounds.
40 */
41interface XPlayer
42{
43    /** starts reading the stream from the current position.
44     */
45    void start();
46
47    /** stops reading the stream and leave the cursor at its current
48        position.
49     */
50    void stop();
51
52    /** indicates whether the stream is played or not.
53
54        @returns
55            <TRUE/> if the stream is played, <FALSE/> otherwise
56     */
57    boolean isPlaying();
58
59    /** gets the stream length
60
61        @returns
62            the stream length in second
63     */
64    double getDuration();
65
66    /** sets the new cursor position in the media stream. After using
67        this method the stream is stopped.
68
69        @param fTime
70            the new position to set in seconds
71     */
72    void setMediaTime( [in] double fTime );
73
74    /** gets the current position of the cursor in the stream
75
76        @returns
77            the cursor position in seconds
78     */
79    double getMediaTime();
80
81    /** sets the time at which to stop reading the stream.
82
83        @param fTime
84            the time at which to stop reading the stream in seconds
85     */
86    void setStopTime( [in] double fTime );
87
88    /** gets the time at which the stream will stop. The result
89        is not guaranteed if no stop time has been set.
90     */
91    double getStopTime();
92
93    /** sets the speed of the stream reading relatively to the normal
94        speed.
95
96        @param fRate
97            the stream reading rate. <code>1.0</code> means normal speed.
98     */
99    void setRate( [in] double fRate );
100
101    /** gets the speed of the stream reading relatively to the normal
102        reading.
103
104        @returns
105            the relative speed. <code>1.0</code> is the normal speed.
106     */
107    double getRate();
108
109    /** sets whether the stream reading should restart at the stream
110        start after the end of the stream.
111
112        @param bSet
113            loops if set to <TRUE/>, otherwise stops at the end of the
114            stream.
115     */
116    void setPlaybackLoop( [in] boolean bSet );
117
118    /** indicates whether the stream reading will restart after the
119        end of the stream.
120
121        @returns
122            <TRUE/> if the stream will loop, <FALSE/> otherwise.
123     */
124    boolean isPlaybackLoop();
125
126    /** sets the audio volume in decibel.
127
128        @param nDB
129            the new volume in Decibel
130     */
131    void setVolumeDB( [in] short nDB );
132
133    /** gets the current audio volume in decibel
134
135        @returns
136            the volume in decibel
137     */
138    short getVolumeDB();
139
140    /** sets the volume to <code>0</code> or to its previous value.
141
142        @param bSet
143            sets the volume to <code>0</code> if <TRUE/>, and switch
144            to the previous non-null value if <FALSE/>
145     */
146    void setMute( [in] boolean bSet );
147
148    /** gets whether the volume is temporarily down to <code>0</code>
149        or not.
150
151        @returns
152            <TRUE/> if the volume is temporarily set to <code>0</code>,
153            <FALSE/> otherwise.
154     */
155    boolean isMute();
156
157    /** gets the preferred window size
158
159        @returns
160            the <type scope="com::sun::star::awt">Size</type>
161     */
162    ::com::sun::star::awt::Size getPreferredPlayerWindowSize();
163
164    /** gets a new player window for this stream control
165
166        @param aArguments
167            arguments passed to the window during its creation.
168     */
169    XPlayerWindow createPlayerWindow( [in] sequence< any > aArguments );
170
171    /** gets a frame grabber for this stream.
172     */
173    XFrameGrabber createFrameGrabber();
174};
175
176}; }; }; };
177
178#endif
179