From Brad Colbert with ammendments by Robert Osfield, add set/getVolume support

This commit is contained in:
Robert Osfield 2007-06-28 14:19:30 +00:00
parent 4953e23ab5
commit 15ff70d298
3 changed files with 12 additions and 3 deletions

View File

@ -73,7 +73,10 @@ class OSG_EXPORT ImageStream : public Image
virtual double getReferenceTime() const { return 0.0; } virtual double getReferenceTime() const { return 0.0; }
virtual void setTimeMultiplier(double) {} virtual void setTimeMultiplier(double) {}
virtual double getTimeMultiplier() { return 0.0; } virtual double getTimeMultiplier() const { return 0.0; }
virtual void setVolume(float) {}
virtual float getVolume() const { return 0.0f; }
virtual void update() {} virtual void update() {}

View File

@ -16,6 +16,8 @@
#include "QTUtils.h" #include "QTUtils.h"
#include <math.h>
/** /**
* the class MovieData encapsulates all quicktime-related stuff, so it doesn't polute the namespaces * the class MovieData encapsulates all quicktime-related stuff, so it doesn't polute the namespaces
@ -60,8 +62,8 @@
void setMovieRate(float rate); void setMovieRate(float rate);
/** sets the volume for the soundtrack of this movie */ /** sets the volume for the soundtrack of this movie */
void setVolume(float volume) { SetMovieVolume(_movie,(short)(volume*255));} void setVolume(float volume) { SetMovieVolume(_movie,(short)(ceil(volume*255.0f)));}
float getVolume() { return GetMovieVolume(_movie) / 255.0f; } float getVolume() const { return GetMovieVolume(_movie) / 255.0f; }
void setAudioBalance(float f) { void setAudioBalance(float f) {
Float32 balance = f; Float32 balance = f;

View File

@ -131,6 +131,10 @@ public:
return 0.0; return 0.0;
} }
// Get and Set the playback volume of the stream.
virtual void setVolume(float volume);
virtual float getVolume() const;
protected: protected:
/// apply the looping mode to quicktime /// apply the looping mode to quicktime