1 /* 2 // 3 // BEGIN SONGBIRD GPL 4 // 5 // This file is part of the Songbird web player. 6 // 7 // Copyright(c) 2005-2008 POTI, Inc. 8 // http://songbirdnest.com 9 // 10 // This file may be licensed under the terms of of the 11 // GNU General Public License Version 2 (the "GPL"). 12 // 13 // Software distributed under the License is distributed 14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either 15 // express or implied. See the GPL for the specific language 16 // governing rights and limitations. 17 // 18 // You should have received a copy of the GPL along with this 19 // program. If not, go to http://www.gnu.org/licenses/gpl.html 20 // or write to the Free Software Foundation, Inc., 21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 // 23 // END SONGBIRD GPL 24 // 25 */ 26 27 #include "nsISupports.idl" 28 29 interface nsIVariant; 30 31 interface sbIMediacore; 32 interface sbIMediacoreError; 33 interface sbIMediacoreEventTarget; 34 35 /** 36 * \interface sbIMediacoreEvent 37 * \brief Definition of the sbIMediacoreEvent interface. 38 */ 39 [scriptable, uuid(d08a046e-1dd1-11b2-a5b5-f18e37b22e47)] 40 interface sbIMediacoreEvent : nsISupports 41 { 42 const unsigned long UNINTIALIZED = 0x00000000; 43 44 /** 45 * \brief Metadata describing current item has changed 46 * \note data is an sbIPropertyArray object. 47 */ 48 const unsigned long METADATA_CHANGE = 0x00001000; 49 /** 50 * \brief URI used for operation has changed 51 * \note data is an nsIURI object. 52 */ 53 const unsigned long URI_CHANGE = 0x00001001; 54 /** 55 * \brief Current duration has changed 56 * \note data is the new duration as an unsigned long long (in milliseconds). 57 */ 58 const unsigned long DURATION_CHANGE = 0x00001002; 59 /** 60 * \brief Volume has changed 61 * \note data is the new volume as a double (from 0 to 1). 62 */ 63 const unsigned long VOLUME_CHANGE = 0x00001003; 64 /** 65 * \brief Mute status has changed 66 * \note data is the new mute state (boolean, true = muted). 67 */ 68 const unsigned long MUTE_CHANGE = 0x00001004; 69 70 // Sequencer Events 71 72 /** 73 * \brief Before the track playing is changed. 74 * \note This event should only be fired by the sequencer. 75 * \note data is the new sbIMediaItem that will be played. 76 */ 77 const unsigned long BEFORE_TRACK_CHANGE = 0x00001500; 78 /** 79 * \brief Track playing has changed. 80 * \note This event should only be fired by the sequencer. 81 * \note data is the new sbIMediaItem being played. 82 */ 83 const unsigned long TRACK_CHANGE = 0x00001501; 84 /** 85 * \brief Index in view of item currently playing has changed. 86 * \note This event should only be fired by the sequencer. 87 * \note data is the new index (unsigned long). 88 */ 89 const unsigned long TRACK_INDEX_CHANGE = 0x00001502; 90 /** 91 * \brief Sequencer view is about to change 92 * \note data is the new sbIMediaListView. 93 */ 94 const unsigned long BEFORE_VIEW_CHANGE = 0x00001503; 95 /** 96 * \brief Sequencer view changed. 97 * \note data is the new sbIMediaListView. 98 */ 99 const unsigned long VIEW_CHANGE = 0x00001504; 100 /** 101 * \brief Sequence recalculated. 102 * \note This event should only be fired by the sequencer. 103 * \note data is the new sequence. 104 */ 105 const unsigned long SEQUENCE_CHANGE = 0x00001505; 106 /** 107 * \brief Sequence end. 108 * 109 * This event will be fired by the sequencer when it runs 110 * out of items to play from it's sequence. This event will 111 * not be fired when the sequence repeats because of repeat 112 * one or repeat all being turned on. 113 * 114 * \note This event should only be fired by the sequencer. 115 * \note data is null for this event. 116 */ 117 const unsigned long SEQUENCE_END = 0x00001507; 118 119 // End Sequencer Events 120 121 /** 122 * \brief Stream found. 123 * \note Reserved for later use. 124 */ 125 const unsigned long STREAM_FOUND = 0x00002000; 126 127 /** 128 * \brief Stream has video. 129 * \note data is null. 130 */ 131 const unsigned long STREAM_HAS_VIDEO = 0x00002001; 132 133 /** 134 * \brief Buffering. 135 * \note data is the buffering progress as a double (from 0 to 1). 136 */ 137 const unsigned long BUFFERING = 0x00003000; 138 /** 139 * \brief Buffer underrun, operation is likely to halt. 140 * \note This event is likely to be followed by BUFFERING events. 141 * \note data is null. 142 */ 143 const unsigned long BUFFER_UNDERRUN = 0x00003001; 144 145 /** 146 * \brief Stream is about to start. 147 * \note This event is a notification only, and may be dispatched 148 * asynchronously. By the time the event is received the playback 149 * may have already started. 150 * \note data is an empty property bag 151 */ 152 const unsigned long STREAM_BEFORE_START = 0x00004000; 153 /** 154 * \brief Stream has started. 155 * \note data is null. 156 */ 157 const unsigned long STREAM_START = 0x00004001; 158 /** 159 * \brief Stream is about to pause. 160 * \note This event is a notification only, and may be dispatched 161 * asynchronously. By the time the event is received playback may 162 * already have paused. 163 * \note data is a property bag, containing 164 * PRUint64 "position" - the position of the stream when pause was 165 * requested. 166 * PRUint64 "duration" - the length of the stream 167 * nsIURI "uri" - the URI that was playing when the pause started 168 */ 169 const unsigned long STREAM_BEFORE_PAUSE = 0x00004002; 170 /** 171 * \brief Stream is now paused. 172 * \note data is null. 173 */ 174 const unsigned long STREAM_PAUSE = 0x00004003; 175 /** 176 * \brief End of stream. 177 * \note data is null. 178 */ 179 const unsigned long STREAM_END = 0x00004004; 180 /** 181 * \brief Stream is about to stop. 182 * \note This event is a notification only, and may be dispatched 183 * asynchronously. By the time the event is received playback may 184 * already have stopped (and therefore querying the playback controller 185 * may result in different values). 186 * \note data is a property bag, containing 187 * PRUint64 "position" - the position of the stream when stopping of 188 * playback was requested. 189 * PRUint64 "duration" - the length of the stream 190 * nsIURI "uri" - the URI that was playing when the stop was requested. 191 */ 192 const unsigned long STREAM_BEFORE_STOP = 0x00004005; 193 /** 194 * \brief Stream was stopped. 195 * \note data is null. 196 */ 197 const unsigned long STREAM_STOP = 0x00004006; 198 199 // Video specific events 200 201 /** 202 * \brief Video size has changed. 203 * \note data is an sbIVideoSize object. 204 * \see sbIVideoSize 205 */ 206 const unsigned long VIDEO_SIZE_CHANGED = 0x00005000; 207 208 // End video specifc events 209 210 /** 211 * \brief Plugin missing for requested format. 212 * \note Reserved for later use. 213 */ 214 const unsigned long PLUGIN_MISSING = 0x00008000; 215 216 /** 217 * \brief Custom event base value. 218 */ 219 const unsigned long CUSTOM_EVENT_BASE = 0x40000000; 220 221 /** 222 * \brief Indicates the event is an error and will have it's error member set. 223 */ 224 const unsigned long ERROR_EVENT = 0x80000000; 225 226 /** 227 * \brief The event type. 228 */ 229 readonly attribute unsigned long type; 230 /** 231 * \brief Error member is only set when type of event is set to ERROR. 232 */ 233 readonly attribute sbIMediacoreError error; 234 235 /** 236 * \brief The event data. Payload varies per event type. 237 */ 238 readonly attribute nsIVariant data; 239 240 /** 241 * \brief Mediacore that generated the event. 242 */ 243 readonly attribute sbIMediacore origin; 244 /** 245 * \brief Event Target that dispatched the event. 246 */ 247 readonly attribute sbIMediacoreEventTarget target; 248 }; 249 250 %{C++ 251 252 #define SB_MEDIACORE_EVENT_DESCRIPTION \ 253 "Songbird Mediacore Event" 254 #define SB_MEDIACORE_EVENT_CONTRACTID \ 255 "@songbirdnest.com/Songbird/Mediacore/event;1" 256 #define SB_MEDIACORE_EVENT_CLASSNAME \ 257 "sbMediacoreEvent" 258 #define SB_MEDIACORE_EVENT_CID \ 259 {0xedf0959d, 0x21bf, 0x411f, {0x8d, 0x3d, 0x85, 0x9a, 0x76, 0xe7, 0x14, 0x12}} 260 261 %}; 262