Sha256: 95547638af90c5c11d417807359f239edfc12ef9a404ff5f1d3c6d5c5097c159

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

#include "Gosu_FFI_internal.h"

GOSU_FFI_API Gosu_Song* Gosu_Song_create(const char* filename)
{
    return Gosu_translate_exceptions([=] {
        return new Gosu_Song{filename};
    });
}

GOSU_FFI_API void Gosu_Song_destroy(Gosu_Song* song)
{
    delete song;
}

GOSU_FFI_API void Gosu_Song_play(Gosu_Song* song, bool looping)
{
    Gosu_translate_exceptions([=] {
        song->play(looping);
    });
}

GOSU_FFI_API bool Gosu_Song_playing(Gosu_Song* song)
{
    return Gosu_translate_exceptions([=] {
        return song->playing();
    });
}

GOSU_FFI_API void Gosu_Song_pause(Gosu_Song* song)
{
    Gosu_translate_exceptions([=] {
        song->pause();
    });
}

GOSU_FFI_API bool Gosu_Song_paused(Gosu_Song* song)
{
    return Gosu_translate_exceptions([=] {
        return song->paused();
    });
}

GOSU_FFI_API void Gosu_Song_stop(Gosu_Song* song)
{
    Gosu_translate_exceptions([=] {
        song->stop();
    });
}

GOSU_FFI_API double Gosu_Song_volume(Gosu_Song* song)
{
    return Gosu_translate_exceptions([=] {
        return song->volume();
    });
}

GOSU_FFI_API void Gosu_Song_set_volume(Gosu_Song* song, double volume)
{
    Gosu_translate_exceptions([=] {
        return song->set_volume(volume);
    });
}

GOSU_FFI_API Gosu_Song* Gosu_Song_current_song(void)
{
    return Gosu_translate_exceptions([=] {
        return reinterpret_cast<Gosu_Song*>(Gosu::Song::current_song());
    });
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gosu-2.0.0.pre8 ffi/Gosu_Song.cpp
gosu-2.0.0.pre7 ffi/Gosu_Song.cpp
gosu-2.0.0.pre6 ffi/Gosu_Song.cpp