mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 15:25:54 -04:00
new top level interface to noises
This commit is contained in:
parent
724106ccdb
commit
f7209145c2
65
panda/src/audio/audio_sound.h
Normal file
65
panda/src/audio/audio_sound.h
Normal file
@ -0,0 +1,65 @@
|
||||
// Filename: audio_sound.h
|
||||
// Created by: cary (17Oct00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __AUDIO_SOUND_H__
|
||||
#define __AUDIO_SOUND_H__
|
||||
|
||||
#include "audio_trait.h"
|
||||
#include "typedReferenceCount.h"
|
||||
#include "namable.h"
|
||||
|
||||
class AudioPool;
|
||||
class AudioManager;
|
||||
|
||||
class EXPCL_PANDA AudioSound : public TypedReferenceCount, public Namable {
|
||||
private:
|
||||
AudioTraits::SoundClass *_sound;
|
||||
AudioTraits::PlayingClass *_state;
|
||||
AudioTraits::PlayerClass *_player;
|
||||
AudioTraits::DeletePlayingFunc *_delstate;
|
||||
protected:
|
||||
INLINE AudioSound(AudioTraits::SoundClass*, AudioTraits::PlayingClass*,
|
||||
AudioTraits::PlayerClass*, AUdioTraits::DeletePlayingFunc*,
|
||||
const string&);
|
||||
INLINE AudioSound(const AudioSound&);
|
||||
INLINE AudioSound& operator=(const AudioSound&);
|
||||
|
||||
INLINE AudioTraits::PlayerClass* get_player(void) const;
|
||||
INLINE AudioTraits::SoundClass* get_sound(void) const;
|
||||
INLINE AudioTraits::PlayingClass* get_state(void) const;
|
||||
|
||||
friend class AudioPool;
|
||||
friend class AudioManager;
|
||||
public:
|
||||
virtual ~AudioSound(void);
|
||||
INLINE bool operator==(const AudioSound&) const;
|
||||
INLINE bool operator!=(const AudioSound&) const;
|
||||
|
||||
enum SoundStatus { BAD, READY, PLAYING } ;
|
||||
|
||||
float length(void) const;
|
||||
SoundStatus status(void) const;
|
||||
public:
|
||||
// type stuff
|
||||
static TypeHandle get_class_type(void) {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type(void) {
|
||||
TypedReferenceCount::init_type();
|
||||
register_type(_type_handle, "AudioSound",
|
||||
TypedReferenceCount::get_class_type());
|
||||
}
|
||||
virtual TypeHandle get_type(void) const {
|
||||
return get_class_type();
|
||||
}
|
||||
virtual TypeHandle force_init_type(void) {
|
||||
init_type();
|
||||
return get_class_type();
|
||||
}
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#endif /* __AUDIO_SOUND_H__ */
|
Loading…
x
Reference in New Issue
Block a user