Resume

This function will resume a paused source. If the source is stopped, it will begin playing from the beginning of its source.

Syntax

Returns

Returns the source's current time, in seconds.

Example

#include "Leadwerks.h"

using namespace Leadwerks;

Source* source = NULL;

int main(int argc, const char *argv[])
{
Leadwerks::Window* window = Leadwerks::Window::Create();
Context* context = Context::Create(window);
//Load a sound
Sound* sound = Sound::Load("Sound/Music/menutheme.wav");

source = Source::Create();
source->SetSound(sound);
sound->Release();
source->SetLoopMode(true);
source->Play();

while (true)
{
//Press space key to pause/resume sound
if (window->KeyHit(Key::Space))
{
if (source->GetState() == Source::Paused)
{
source->Resume();
}
else
{
source->Pause();
}
}

if (window->Closed() || window->KeyDown(Key::Escape)) return false;
Leadwerks::Time::Update();
context->SetColor(0, 0, 0, 0);
context->Clear();
context->Sync();
}
return 0;
}