code style update to match ours (kind of)

license header update
minor clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17876 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2006-06-19 13:24:04 +00:00
parent 3639baa4b0
commit 4810cdcdbc
18 changed files with 785 additions and 992 deletions
+86 -94
View File
@@ -18,32 +18,29 @@ BSynth* be_synth = NULL;
using namespace BPrivate;
//------------------------------------------------------------------------------
BSynth::BSynth()
{
Init();
_Init();
}
//------------------------------------------------------------------------------
BSynth::BSynth(synth_mode mode)
{
Init();
synthMode = mode;
_Init();
fSynthMode = mode;
}
//------------------------------------------------------------------------------
BSynth::~BSynth()
{
delete synth;
delete fSynth;
be_synth = NULL;
}
//------------------------------------------------------------------------------
status_t BSynth::LoadSynthData(entry_ref* instrumentsFile)
status_t
BSynth::LoadSynthData(entry_ref* instrumentsFile)
{
if (instrumentsFile == NULL) {
return B_BAD_VALUE;
@@ -53,173 +50,170 @@ status_t BSynth::LoadSynthData(entry_ref* instrumentsFile)
status_t err = path.InitCheck();
if (err != B_OK)
return err;
return synth->SetInstrumentsFile(path.Path());
return fSynth->SetInstrumentsFile(path.Path());
}
//------------------------------------------------------------------------------
status_t BSynth::LoadSynthData(synth_mode mode)
status_t
BSynth::LoadSynthData(synth_mode mode)
{
// Our softsynth doesn't support multiple modes like Be's synth did.
// Therefore, if you use this function, the synth will revert to its
// default instruments bank. However, we do keep track of the current
// synth_mode here, in order not to confuse old applications.
synthMode = mode;
if (synthMode == B_SAMPLES_ONLY)
{
fSynthMode = mode;
if (fSynthMode == B_SAMPLES_ONLY) {
fprintf(stderr, "[midi] LoadSynthData: BSamples is not supported\n");
}
return synth->SetDefaultInstrumentsFile();
return fSynth->SetDefaultInstrumentsFile();
}
//------------------------------------------------------------------------------
synth_mode BSynth::SynthMode(void)
synth_mode
BSynth::SynthMode()
{
return synthMode;
return fSynthMode;
}
//------------------------------------------------------------------------------
void BSynth::Unload(void)
void
BSynth::Unload()
{
synth->Unload();
fSynth->Unload();
}
//------------------------------------------------------------------------------
bool BSynth::IsLoaded(void) const
bool
BSynth::IsLoaded() const
{
return synth->IsLoaded();
return fSynth->IsLoaded();
}
//------------------------------------------------------------------------------
status_t BSynth::SetSamplingRate(int32 sample_rate)
status_t
BSynth::SetSamplingRate(int32 sample_rate)
{
return synth->SetSamplingRate(sample_rate);
return fSynth->SetSamplingRate(sample_rate);
}
//------------------------------------------------------------------------------
int32 BSynth::SamplingRate() const
int32
BSynth::SamplingRate() const
{
return synth->SamplingRate();
return fSynth->SamplingRate();
}
//------------------------------------------------------------------------------
status_t BSynth::SetInterpolation(interpolation_mode interp_mode)
status_t
BSynth::SetInterpolation(interpolation_mode interp_mode)
{
return synth->SetInterpolation(interp_mode);
return fSynth->SetInterpolation(interp_mode);
}
//------------------------------------------------------------------------------
interpolation_mode BSynth::Interpolation() const
interpolation_mode
BSynth::Interpolation() const
{
return synth->Interpolation();
return fSynth->Interpolation();
}
//------------------------------------------------------------------------------
void BSynth::SetReverb(reverb_mode rev_mode)
void
BSynth::SetReverb(reverb_mode rev_mode)
{
synth->SetReverb(rev_mode);
fSynth->SetReverb(rev_mode);
}
//------------------------------------------------------------------------------
reverb_mode BSynth::Reverb() const
reverb_mode
BSynth::Reverb() const
{
return synth->Reverb();
return fSynth->Reverb();
}
//------------------------------------------------------------------------------
status_t BSynth::EnableReverb(bool reverb_enabled)
status_t
BSynth::EnableReverb(bool reverb_enabled)
{
return synth->EnableReverb(reverb_enabled);
return fSynth->EnableReverb(reverb_enabled);
}
//------------------------------------------------------------------------------
bool BSynth::IsReverbEnabled() const
bool
BSynth::IsReverbEnabled() const
{
return synth->IsReverbEnabled();
return fSynth->IsReverbEnabled();
}
//------------------------------------------------------------------------------
status_t BSynth::SetVoiceLimits(
status_t
BSynth::SetVoiceLimits(
int16 maxSynthVoices, int16 maxSampleVoices, int16 limiterThreshhold)
{
status_t err = B_OK;
err = synth->SetMaxVoices(maxSynthVoices);
if (err == B_OK)
{
err = synth->SetLimiterThreshold(limiterThreshhold);
err = fSynth->SetMaxVoices(maxSynthVoices);
if (err == B_OK) {
err = fSynth->SetLimiterThreshold(limiterThreshhold);
}
return err;
}
//------------------------------------------------------------------------------
int16 BSynth::MaxSynthVoices(void) const
int16
BSynth::MaxSynthVoices() const
{
return synth->MaxVoices();
return fSynth->MaxVoices();
}
//------------------------------------------------------------------------------
int16 BSynth::MaxSampleVoices(void) const
int16
BSynth::MaxSampleVoices() const
{
fprintf(stderr, "[midi] MaxSampleVoices: BSamples not supported\n");
return 0;
}
//------------------------------------------------------------------------------
int16 BSynth::LimiterThreshhold(void) const
int16
BSynth::LimiterThreshhold() const
{
return synth->LimiterThreshold();
return fSynth->LimiterThreshold();
}
//------------------------------------------------------------------------------
void BSynth::SetSynthVolume(double theVolume)
void
BSynth::SetSynthVolume(double theVolume)
{
synth->SetVolume(theVolume);
fSynth->SetVolume(theVolume);
}
//------------------------------------------------------------------------------
double BSynth::SynthVolume(void) const
double
BSynth::SynthVolume() const
{
return synth->Volume();
return fSynth->Volume();
}
//------------------------------------------------------------------------------
void BSynth::SetSampleVolume(double theVolume)
void
BSynth::SetSampleVolume(double theVolume)
{
fprintf(stderr, "[midi] SetSampleVolume: BSamples not supported\n");
}
//------------------------------------------------------------------------------
double BSynth::SampleVolume(void) const
double
BSynth::SampleVolume(void) const
{
fprintf(stderr, "[midi] SampleVolume: BSamples not supported\n");
return 0;
}
//------------------------------------------------------------------------------
status_t BSynth::GetAudio(
int16* pLeft, int16* pRight, int32 max_samples) const
status_t
BSynth::GetAudio(int16* pLeft, int16* pRight, int32 max_samples) const
{
// We don't print a "not supported" message here. That would cause
// significant slowdowns because applications ask for this many times.
@@ -230,50 +224,48 @@ status_t BSynth::GetAudio(
return max_samples;
}
//------------------------------------------------------------------------------
void BSynth::Pause(void)
void
BSynth::Pause()
{
synth->Pause();
fSynth->Pause();
}
//------------------------------------------------------------------------------
void BSynth::Resume(void)
void
BSynth::Resume()
{
synth->Resume();
fSynth->Resume();
}
//------------------------------------------------------------------------------
void BSynth::SetControllerHook(int16 controller, synth_controller_hook cback)
void
BSynth::SetControllerHook(int16 controller, synth_controller_hook cback)
{
fprintf(stderr, "[midi] SetControllerHook is not supported\n");
}
//------------------------------------------------------------------------------
void BSynth::Init()
void
BSynth::_Init()
{
delete be_synth;
be_synth = this;
synthMode = B_NO_SYNTH;
clientCount = 0;
synth = new BSoftSynth();
fSynthMode = B_NO_SYNTH;
fClientCount = 0;
fSynth = new BSoftSynth();
}
//------------------------------------------------------------------------------
int32 BSynth::CountClients(void) const
int32
BSynth::CountClients() const
{
return clientCount;
return fClientCount;
}
//------------------------------------------------------------------------------
void BSynth::_ReservedSynth1() { }
void BSynth::_ReservedSynth2() { }
void BSynth::_ReservedSynth3() { }
void BSynth::_ReservedSynth4() { }
//------------------------------------------------------------------------------