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 24 #ifndef INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX 25 #define INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX 26 27 #include <boost/shared_ptr.hpp> 28 29 #include "shape.hxx" 30 31 32 namespace slideshow 33 { 34 namespace internal 35 { 36 /** Represents a shape containing media (video, sound). 37 38 This interface adds media handling methods to a shape. It 39 allows starting/stopping and pausing playback. 40 */ 41 class ExternalMediaShape : public Shape 42 { 43 public: 44 // Animation methods 45 //------------------------------------------------------------------ 46 47 /** Notify the Shape that it should start with playback 48 49 This method enters playback mode on all registered 50 views. It makes the media initially visible (for videos). 51 */ 52 virtual void play() = 0; 53 54 /** Notify the Shape that it should stop playback 55 56 This method leaves playback mode on all registered 57 views. The media is then rewound to the start, and 58 removed from screen (for videos) 59 */ 60 virtual void stop() = 0; 61 62 /** Notify the Shape that it should pause playback 63 64 This method stops playback on all registered 65 views. The media stays visible (for videos) 66 */ 67 virtual void pause() = 0; 68 69 /** Query whether the media is currently playing. 70 */ 71 virtual bool isPlaying() const = 0; 72 73 /** Set media time in seconds. 74 75 @param fTime 76 Time in seconds of the media time line, that should now be 77 presented 78 */ 79 virtual void setMediaTime(double fTime) = 0; 80 }; 81 82 typedef ::boost::shared_ptr< ExternalMediaShape > ExternalMediaShapeSharedPtr; 83 84 } 85 } 86 87 #endif /* INCLUDED_SLIDESHOW_EXTERNALMEDIASHAPE_HXX */ 88