Panda3D
panda
src
movies
movieAudioCursor.h
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file movieAudioCursor.h
10
* @author jyelon
11
* @date 2007-07-02
12
*/
13
14
#ifndef MOVIEAUDIOCURSOR_H
15
#define MOVIEAUDIOCURSOR_H
16
17
#include "
pandabase.h
"
18
#include "
namable.h
"
19
#include "
texture.h
"
20
#include "
pointerTo.h
"
21
class
MovieAudio
;
22
23
/**
24
* A MovieAudio is actually any source that provides a sequence of audio
25
* samples. That could include an AVI file, a microphone, or an internet TV
26
* station. A MovieAudioCursor is a handle that lets you read data
27
* sequentially from a MovieAudio.
28
*
29
* Thread safety: each individual MovieAudioCursor must be owned and accessed
30
* by a single thread. It is OK for two different threads to open the same
31
* file at the same time, as long as they use separate MovieAudioCursor
32
* objects.
33
*/
34
class
EXPCL_PANDA_MOVIES
MovieAudioCursor
:
public
TypedWritableReferenceCount
{
35
36
PUBLISHED:
37
MovieAudioCursor
(
MovieAudio
*src);
38
virtual
~
MovieAudioCursor
();
39
INLINE PT(
MovieAudio
) get_source()
const
;
40
INLINE
int
audio_rate()
const
;
41
INLINE
int
audio_channels()
const
;
42
INLINE
double
length()
const
;
43
INLINE
bool
can_seek()
const
;
44
INLINE
bool
can_seek_fast()
const
;
45
INLINE
double
tell()
const
;
46
INLINE
void
skip_samples(
int
n);
47
INLINE
bool
aborted()
const
;
48
virtual
int
ready()
const
;
49
virtual
void
seek(
double
offset);
50
void
read_samples(
int
n,
Datagram
*dg);
51
std::string read_samples(
int
n);
52
53
public
:
54
virtual
void
read_samples(
int
n, int16_t *data);
55
56
protected
:
57
PT(
MovieAudio
) _source;
58
int
_audio_rate;
59
int
_audio_channels;
60
double
_length;
61
bool
_can_seek;
62
bool
_can_seek_fast;
63
bool
_aborted;
64
double
_last_seek;
65
int64_t _samples_read;
66
67
public
:
68
static
TypeHandle
get_class_type() {
69
return
_type_handle;
70
}
71
static
void
init_type() {
72
TypedWritableReferenceCount::init_type();
73
register_type
(_type_handle,
"MovieAudioCursor"
,
74
TypedWritableReferenceCount::get_class_type());
75
}
76
virtual
TypeHandle
get_type()
const
{
77
return
get_class_type();
78
}
79
virtual
TypeHandle
force_init_type() {init_type();
return
get_class_type();}
80
81
private
:
82
static
TypeHandle
_type_handle;
83
};
84
85
#include "
movieAudioCursor.I
"
86
#include "
movieAudio.h
"
87
88
#endif
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition:
register_type.I:22
movieAudioCursor.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition:
datagram.h:38
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition:
typeHandle.h:81
namable.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
movieAudio.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
MovieAudioCursor
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition:
movieAudioCursor.h:34
MovieAudio
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition:
movieAudio.h:44
texture.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypedWritableReferenceCount
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
Definition:
typedWritableReferenceCount.h:31
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Sat Jan 11 2020 15:15:14 for Panda3D by
1.8.17