1 /* 2 * Copyright (c) 2000-2008, Ingo Weinhold <ingo_weinhold@gmx.de>, 3 * Copyright (c) 2000-2008, Stephan Aßmus <superstippi@gmx.de>, 4 * All Rights Reserved. Distributed under the terms of the MIT license. 5 */ 6 #include <Message.h> 7 8 #include "PlaybackLOAdapter.h" 9 10 11 PlaybackLOAdapter::PlaybackLOAdapter(BHandler* handler) 12 : AbstractLOAdapter(handler) 13 { 14 } 15 16 17 PlaybackLOAdapter::PlaybackLOAdapter(const BMessenger& messenger) 18 : AbstractLOAdapter(messenger) 19 { 20 } 21 22 23 PlaybackLOAdapter::~PlaybackLOAdapter() 24 { 25 } 26 27 28 void 29 PlaybackLOAdapter::PlayModeChanged(int32 mode) 30 { 31 BMessage message(MSG_PLAYBACK_PLAY_MODE_CHANGED); 32 message.AddInt32("play mode", mode); 33 DeliverMessage(message); 34 } 35 36 37 void 38 PlaybackLOAdapter::LoopModeChanged(int32 mode) 39 { 40 BMessage message(MSG_PLAYBACK_LOOP_MODE_CHANGED); 41 message.AddInt32("loop mode", mode); 42 DeliverMessage(message); 43 } 44 45 46 void 47 PlaybackLOAdapter::LoopingEnabledChanged(bool enabled) 48 { 49 BMessage message(MSG_PLAYBACK_LOOPING_ENABLED_CHANGED); 50 message.AddBool("looping enabled", enabled); 51 DeliverMessage(message); 52 } 53 54 55 void 56 PlaybackLOAdapter::VideoBoundsChanged(BRect bounds) 57 { 58 BMessage message(MSG_PLAYBACK_VIDEO_BOUNDS_CHANGED); 59 message.AddRect("video bounds", bounds); 60 DeliverMessage(message); 61 } 62 63 64 void 65 PlaybackLOAdapter::FramesPerSecondChanged(float fps) 66 { 67 BMessage message(MSG_PLAYBACK_FPS_CHANGED); 68 message.AddFloat("fps", fps); 69 DeliverMessage(message); 70 } 71 72 73 void 74 PlaybackLOAdapter::CurrentFrameChanged(double frame) 75 { 76 BMessage message(MSG_PLAYBACK_CURRENT_FRAME_CHANGED); 77 message.AddDouble("current frame", frame); 78 DeliverMessage(message); 79 } 80 81 82 void 83 PlaybackLOAdapter::SpeedChanged(float speed) 84 { 85 BMessage message(MSG_PLAYBACK_SPEED_CHANGED); 86 message.AddFloat("speed", speed); 87 DeliverMessage(message); 88 } 89 90 91 void 92 PlaybackLOAdapter::FrameDropped() 93 { 94 DeliverMessage(MSG_PLAYBACK_FRAME_DROPPED); 95 } 96 97