| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 4 | * 2013-2022 by the Falcon Player Developers. | ||
| 5 | * | ||
| 6 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 7 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 8 | * file for descriptions of what files are covered by each license. | ||
| 9 | * | ||
| 10 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 11 | * included LICENSE.LGPL file. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <string> | ||
| 15 | #include <vector> | ||
| 16 | |||
| 17 | #include <sys/select.h> | ||
| 18 | #include <pthread.h> | ||
| 19 | #include <unistd.h> | ||
| 20 | |||
| 21 | #include "MediaOutputStatus.h" | ||
| 22 | |||
| 23 | #define MEDIAOUTPUTPIPE_READ 0 | ||
| 24 | #define MEDIAOUTPUTPIPE_WRITE 1 | ||
| 25 | |||
| 26 | #define MEDIAOUTPUTSTATUS_IDLE 0 | ||
| 27 | #define MEDIAOUTPUTSTATUS_PLAYING 1 | ||
| 28 | |||
| 29 | #define MediaOutputSpeedDecrease -1 | ||
| 30 | #define MediaOutputSpeedNormal 0 | ||
| 31 | #define MediaOutputSpeedIncrease +1 | ||
| 32 | |||
| 33 | class MediaOutputBase { | ||
| 34 | public: | ||
| 35 | MediaOutputBase(); | ||
| 36 | virtual ~MediaOutputBase(); | ||
| 37 | |||
| 38 | virtual int Start(int msTime = 0); | ||
| 39 | virtual int Stop(void); | ||
| 40 | virtual int Process(void); | ||
| 41 | virtual int AdjustSpeed(float masterPos); | ||
| 42 | virtual void SetVolume(int volume); | ||
| 43 | virtual int Close(void); | ||
| 44 | |||
| 45 | virtual int IsPlaying(void); | ||
| 46 | // Whether sound is actually coming out yet. A sequence started with this | ||
| 47 | // media holds until it is, instead of running ahead while the output | ||
| 48 | // starts up. Outputs that can't tell say yes. | ||
| 49 | ✗ | virtual bool IsAudible(void) { return true; } | |
| 50 | |||
| 51 | float getMediaOffset() { return mediaOffset; }; | ||
| 52 | 264942 | int getMediaOffsetMS() { return mediaOffsetMS; }; | |
| 53 | |||
| 54 | std::string m_mediaFilename; | ||
| 55 | MediaOutputStatus* m_mediaOutputStatus; | ||
| 56 | |||
| 57 | protected: | ||
| 58 | void setMediaElapsed(float curtime, float remaining); | ||
| 59 | |||
| 60 | float mediaOffset = 0.0; | ||
| 61 | int mediaOffsetMS = 0; | ||
| 62 | }; | ||
| 63 |