11 #include "AudioDecoder.h" 12 #include "cores/AudioEngine/Interfaces/AE.h" 13 #include "cores/AudioEngine/Interfaces/IAudioCallback.h" 14 #include "cores/IPlayer.h" 15 #include "threads/CriticalSection.h" 16 #include "threads/Thread.h" 17 #include "utils/Job.h" 29 friend class CQueueNextFileJob;
35 bool QueueNextFile(
const CFileItem &file)
override;
36 void OnNothingToQueueNotify()
override;
37 bool CloseFile(
bool reopen =
false)
override;
38 bool IsPlaying()
const override;
39 void Pause()
override;
40 bool HasVideo()
const override {
return false; }
41 bool HasAudio()
const override {
return true; }
42 bool CanSeek()
const override;
43 void Seek(
bool bPlus =
true,
bool bLargeStep =
false,
bool bChapterOverride =
false)
override;
44 void SeekPercentage(
float fPercent = 0.0f)
override;
45 void SetVolume(
float volume)
override;
46 void SetDynamicRangeCompression(
long drc)
override;
47 void SetSpeed(
float speed = 0)
override;
48 int GetCacheLevel()
const override;
50 void GetAudioStreamInfo(
int index,
AudioStreamInfo& info)
const override;
51 void SetTime(int64_t time)
override;
52 void SeekTime(int64_t iTime = 0)
override;
53 void GetAudioCapabilities(std::vector<int>& audioCaps)
const override {}
55 int GetAudioStreamCount()
const override {
return 1; }
56 int GetAudioStream()
override {
return 0; }
76 void OnStartup()
override {}
77 void Process()
override;
78 void OnExit()
override;
79 float GetPercentage();
84 std::unique_ptr<CFileItem> m_fileItem;
85 std::unique_ptr<CFileItem> m_nextFileItem;
87 int64_t m_startOffset;
89 int64_t m_decoderTotal = 0;
91 unsigned int m_bytesPerSample;
92 unsigned int m_bytesPerFrame;
97 int m_prepareNextAtFrame;
98 bool m_prepareTriggered;
99 int m_playNextAtFrame;
100 bool m_playNextTriggered;
101 bool m_fadeOutTriggered;
102 int m_seekNextAtFrame;
105 IAE::StreamPtr m_stream;
112 typedef std::list<StreamInfo*> StreamList;
114 bool m_signalSpeedChange =
false;
115 bool m_signalStarted =
true;
116 std::atomic_int m_playbackSpeed;
117 bool m_isPlaying =
false;
118 bool m_isPaused =
false;
119 bool m_isFinished =
false;
121 unsigned int m_defaultCrossfadeMS = 0;
122 unsigned int m_upcomingCrossfadeMS = 0;
124 StreamInfo* m_currentStream =
nullptr;
127 CCriticalSection m_streamsLock;
128 StreamList m_streams;
129 StreamList m_finishing;
130 int m_jobCounter = 0;
132 int64_t m_newForcedPlayerTime = -1;
133 int64_t m_newForcedTotalTime = -1;
134 std::unique_ptr<CProcessInfo> m_processInfo;
136 bool QueueNextFileEx(
const CFileItem &file,
bool fadeIn);
137 void SoftStart(
bool wait =
false);
138 void SoftStop(
bool wait =
false,
bool close =
true);
139 void CloseAllStreams(
bool fade =
true);
140 void ProcessStreams(
double &freeBufferTime);
141 bool PrepareStream(StreamInfo *si);
142 bool ProcessStream(StreamInfo *si,
double &freeBufferTime);
143 bool QueueData(StreamInfo *si);
144 int64_t GetTotalTime64();
145 void UpdateCrossfadeTime(
const CFileItem& file);
146 void UpdateStreamInfoPlayNextAtFrame(StreamInfo *si,
unsigned int crossFadingTime);
147 void UpdateGUIData(StreamInfo *si);
148 int64_t GetTimeInternal();
149 bool SetTimeInternal(int64_t time);
150 bool SetTotalTimeInternal(int64_t time);
151 void CloseFileCB(StreamInfo &si);
152 void AdvancePlaylistOnError(
CFileItem &fileItem);
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Definition: IAudioCallback.h:15
Definition: AudioDecoder.h:40
IAEStream Stream Interface for streaming audio.
Definition: AEStream.h:52
Definition: StreamInfo.h:55
void SetTime(int64_t time) override
Sets the current time. This can be used for injecting the current time. This is not to be confused wi...
Definition: PAPlayer.cpp:1034
Definition: PAPlayer.h:27
void OnJobComplete(unsigned int jobID, bool success, CJob *job) override
The callback used when a job completes.
Definition: PAPlayer.cpp:1164
Definition: ProcessInfo.h:26
Definition: IPlayerCallback.h:18
Callback interface for asynchronous jobs.
Definition: Job.h:31
void SetTotalTime(int64_t time) override
Set the total time in milliseconds this can be used for injecting the duration in case its not availa...
Definition: PAPlayer.cpp:1052
Represents a file on a share.
Definition: FileItem.h:102