OpenShot Audio Library | OpenShotAudio  0.3.2
juce_AudioPlayHead.h
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2017 - ROLI Ltd.
6 
7  JUCE is an open source library subject to commercial or open-source
8  licensing.
9 
10  The code included in this file is provided under the terms of the ISC license
11  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12  To use, copy, modify, and/or distribute this software for any purpose with or
13  without fee is hereby granted provided that the above copyright notice and
14  this permission notice appear in all copies.
15 
16  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18  DISCLAIMED.
19 
20  ==============================================================================
21 */
22 
23 namespace juce
24 {
25 
26 //==============================================================================
38 class JUCE_API AudioPlayHead
39 {
40 protected:
41  //==============================================================================
42  AudioPlayHead() = default;
43 
44 public:
45  virtual ~AudioPlayHead() = default;
46 
47  //==============================================================================
50  {
51  fps23976 = 0,
52  fps24 = 1,
53  fps25 = 2,
54  fps2997 = 3,
55  fps30 = 4,
56  fps2997drop = 5,
57  fps30drop = 6,
58  fps60 = 7,
59  fps60drop = 8,
60  fpsUnknown = 99
61  };
62 
63  //==============================================================================
66  struct JUCE_API CurrentPositionInfo
67  {
69  double bpm;
70 
75 
79  double timeInSeconds;
80 
83 
85  double ppqPosition;
86 
96 
99 
101  bool isPlaying;
102 
108 
113  double ppqLoopStart;
114 
119  double ppqLoopEnd;
120 
122  bool isLooping;
123 
124  //==============================================================================
125  bool operator== (const CurrentPositionInfo& other) const noexcept;
126  bool operator!= (const CurrentPositionInfo& other) const noexcept;
127 
128  void resetToDefault();
129  };
130 
131  //==============================================================================
142  virtual bool getCurrentPosition (CurrentPositionInfo& result) = 0;
143 
145  virtual bool canControlTransport() { return false; }
146 
148  virtual void transportPlay (bool shouldStartPlaying) { ignoreUnused (shouldStartPlaying); }
149 
151  virtual void transportRecord (bool shouldStartRecording) { ignoreUnused (shouldStartRecording); }
152 
154  virtual void transportRewind() {}
155 };
156 
157 } // namespace juce
virtual bool canControlTransport()
virtual void transportPlay(bool shouldStartPlaying)
virtual void transportRecord(bool shouldStartRecording)
virtual bool getCurrentPosition(CurrentPositionInfo &result)=0
virtual void transportRewind()