/* * * Copyright (c) 2022 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "MediaCommandBase.h" #include "MediaSubscriptionBase.h" #include #include #include // COMMAND CLASSES class PlayCommand : public MediaCommandBase { public: PlayCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class PauseCommand : public MediaCommandBase { public: PauseCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class StopPlaybackCommand : public MediaCommandBase { public: StopPlaybackCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class NextCommand : public MediaCommandBase { public: NextCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class SeekCommand : public MediaCommandBase { public: SeekCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(uint64_t position, std::function responseCallback); }; class SkipForwardCommand : public MediaCommandBase { public: SkipForwardCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(uint64_t deltaPositionMilliseconds, std::function responseCallback); }; class SkipBackwardCommand : public MediaCommandBase { public: SkipBackwardCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(uint64_t deltaPositionMilliseconds, std::function responseCallback); }; class FastForwardCommand : public MediaCommandBase { public: FastForwardCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class RewindCommand : public MediaCommandBase { public: RewindCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class PreviousCommand : public MediaCommandBase { public: PreviousCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; class StartOverCommand : public MediaCommandBase { public: StartOverCommand() : MediaCommandBase(chip::app::Clusters::MediaPlayback::Id) {} CHIP_ERROR Invoke(std::function responseCallback); }; // SUBSCRIBER CLASSES class CurrentStateSubscriber : public MediaSubscriptionBase { public: CurrentStateSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class StartTimeSubscriber : public MediaSubscriptionBase { public: StartTimeSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class DurationSubscriber : public MediaSubscriptionBase { public: DurationSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class SampledPositionSubscriber : public MediaSubscriptionBase { public: SampledPositionSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class PlaybackSpeedSubscriber : public MediaSubscriptionBase { public: PlaybackSpeedSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class SeekRangeEndSubscriber : public MediaSubscriptionBase { public: SeekRangeEndSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} }; class SeekRangeStartSubscriber : public MediaSubscriptionBase { public: SeekRangeStartSubscriber() : MediaSubscriptionBase(chip::app::Clusters::MediaPlayback::Id) {} };