/***************************************************************************
                          alsound.cpp  -  description
                             -------------------
    begin                : Wed Jan 21 2004
    copyright            : (C) 2004 by Harald Krippel
    email                : neuro.harald@surfeu.at
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 * todo:                                                                   *
 *       make memberfunctins to get boxobjtrans and set boxobjtrans        *
 *       make memberfunctins to get snd and set snd                        *
 ***************************************************************************/
#include <alsound.h>
#include <main.h>

AlSound::AlSound(void)
{
  snd = 0;
  boxobjtrans = NULL;
}


void AlSound::SetPosition ()
{
     Audio->SetSourcePosition( snd, pos.xyz);
}

void AlSound::Play()
{
    if(snd != 0 && Audio->IsPlaying(snd) == 0)
    {
       Audio->Play(snd);
    }
}

void AlSound::Stop()
{
    if(snd != 0 && Audio->IsPlaying(snd) == 1)
    {
       Audio->Stop(snd);
    }
}

void AlSound::Loop(int flag)
{
    if(snd != 0 )
    {
       Audio->Loop(snd,flag);
    }
}

void AlSound::Relative(int flag)
{
    if(snd != 0 )
    {
       Audio->Relative(snd,flag);
    }
}

void AlSound::adjustVolume(float gain)
{
    if(snd != 0 )
    {
       Audio->SetSourceGain (snd, gain);
    }
}
    

AlSound::~AlSound()
{

}
