Debian Codegraph @

include/player.h

raw symbols SCIP
1 /* fre:ac - free audio converter
2 * Copyright (C) 2001-2023 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #ifndef H_FREAC_PLAYER
14 #define H_FREAC_PLAYER
15
16 #include <smooth.h>
17 #include <boca.h>
18
19 using namespace smooth;
20
21 namespace freac
22 {
23 class Decoder;
24 class Processor;
25
26 class Player
27 {
28 private:
29 BoCA::AS::OutputComponent *output;
30
31 BoCA::Track track;
32
33 Bool playing;
34 Bool paused;
35
36 Bool stop;
37
38 Int newPosition;
39
40 Int PlayThread();
41
42 Void Loop(Decoder *, Processor *);
43 Void Write(Buffer<UnsignedByte> &);
44 public:
45 Player();
46 ~Player();
47
48 Void Play(const BoCA::Track &);
49
50 Void Pause();
51 Void Resume();
52
53 Void SetPosition(Int);
54
55 Void Stop();
56 accessors:
57 Bool IsPlaying() const { return playing; }
58 Bool IsPaused() const { return paused; }
59
60 const BoCA::Track &GetPlayingTrack() const { return track; }
61 signals:
62 Signal1<Void, const BoCA::Track &> onPlay;
63 Signal1<Void, Int> onProgress;
64 Signal1<Void, const BoCA::Track &> onFinish;
65 };
66 };
67
68 #endif