Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Refactoring and bug fixes #20

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
- main

env:
FMOD_VERSION: 20214
GODOT_ENGINE_VERSION: "4.1"
FMOD_VERSION: 20217
GODOT_ENGINE_VERSION: "4.1.1"
GODOT_ENGINE_STAGE: "stable"
INTEGRATION_VERSION: "1.0-alpha-2"
INTEGRATION_VERSION: "1.0-alpha-4"

jobs:
build-all:
Expand Down Expand Up @@ -123,12 +123,8 @@ jobs:
cd addons/FMOD/native/tools
python download_fmod.py ${{ secrets.FMOD_USERNAME }} ${{ secrets.FMOD_PASSWORD }} api ${{ matrix.api-platform }} ${{ env.FMOD_VERSION }}
mkdir -p ../fmodapi
if [ "${{ env.FMOD_VERSION }}" = "20214" ]; then
tar -zxvf fmodstudioapi${{env.FMOD_VERSION}}${{matrix.fmod-executable-suffix}}
tar -zxvf fmodstudioapi${{env.FMOD_VERSION}}${{matrix.fmod-executable-suffix}} --strip-components=1 -C ../fmodapi
else
tar -zxvf fmodstudioapi${{env.FMOD_VERSION}}${{matrix.fmod-executable-suffix}} --strip-components=1 -C ../fmodapi
fi
tar -zxvf fmodstudioapi${{env.FMOD_VERSION}}${{matrix.fmod-executable-suffix}}
tar -zxvf fmodstudioapi${{env.FMOD_VERSION}}${{matrix.fmod-executable-suffix}} --strip-components=1 -C ../fmodapi
cd ../../../../

- name: Download FMOD API (iOS)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build](https://github.com/alessandrofama/fmod-for-godot/workflows/Build/badge.svg)](https://github.com/alessandrofama/fmod-for-godot/actions/workflows/build_all.yml) [![Discord](https://img.shields.io/discord/1083520667451920394?label=Discord)](https://discord.gg/XQbvRdQcNn)

Welcome! This repository provides an integration of [FMOD Studio's audio middleware](https://www.fmod.com/) into the [Godot game engine](https://godotengine.org). At the moment, **FMOD version 2.02.12** and **Godot 4.0 stable** are supported.
Welcome! This repository provides an integration of [FMOD Studio's audio middleware](https://www.fmod.com/) into the [Godot game engine](https://godotengine.org). At the moment, **FMOD version 2.02.17** and **Godot 4.1.1 stable** are supported.

<img src="https://alessandrofama.com/wp-content/uploads/sites/3/fmod-for-godot-1920.png" width="720">

Expand Down
111 changes: 0 additions & 111 deletions addons/FMOD/editor/editor_addon.gd

This file was deleted.

39 changes: 0 additions & 39 deletions addons/FMOD/editor/inspector_browser_plugin.gd

This file was deleted.

23 changes: 1 addition & 22 deletions addons/FMOD/fmod.gd
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
@tool
extends EditorPlugin

var editor_addon: EditorPlugin


func _enter_tree():
if !ProjectSettings.has_setting("autoload/RuntimeManager"):
add_autoload_singleton("RuntimeManager", "res://addons/FMOD/runtime/runtime_manager.gd")

# note(alex): _enter_tree is called twice here (bug?) so we check if we are already initialized
if !FMODStudioEditorModule.get_is_initialized():
editor_addon = load("res://addons/FMOD/editor/editor_addon.gd").new()
get_editor_interface().get_base_control().add_child(editor_addon)

FMODStudioEditorModule.set_is_initialized(true)


func _exit_tree():
if FMODStudioEditorModule.get_is_initialized():
get_editor_interface().get_base_control().remove_child(editor_addon)
editor_addon.queue_free()
remove_autoload_singleton("RuntimeManager")
extends EditorPlugin
9 changes: 9 additions & 0 deletions addons/FMOD/native/fmod.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ linux.debug = {"lib/linux/debug/libfmodL.so": "", "lib/linux/debug/libfmodL.so.1
linux.release = {"lib/linux/release/libfmod.so": "", "lib/linux/release/libfmod.so.13": "", "lib/linux/release/libfmod.so.13.12": "", "lib/linux/release/libfmodstudio.so": "", "lib/linux/release/libfmodstudio.so.13": "", "lib/linux/release/libfmodstudio.so.13.12": ""}
android.debug.arm64 = {"lib/android/arm64/debug/libfmodL.so": "", "lib/android/arm64/debug/libfmodstudioL.so": ""}
android.release.arm64 = {"lib/android/arm64/release/libfmodL.so": "", "lib/android/arm64/release/libfmodstudioL.so": ""}

[icons]
StudioEventEmitter3D = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioEventEmitter2D = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioParameterTrigger = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioGlobalParameterTrigger = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioBankLoader = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioListener3D = "res://addons/FMOD/editor/images/fmod_icon.svg"
StudioListener2D = "res://addons/FMOD/editor/images/fmod_icon.svg"
26 changes: 13 additions & 13 deletions addons/FMOD/native/src/api/studio_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ void StudioSystem::_bind_methods()
&StudioSystem::get_parameter_label_by_id);
ClassDB::bind_method(D_METHOD("get_parameter_by_id", "parameter_id"), &StudioSystem::get_parameter_by_id);
ClassDB::bind_method(D_METHOD("set_parameter_by_id", "parameter_id", "value", "ignore_seek_speed"),
&StudioSystem::set_parameter_by_id);
&StudioSystem::set_parameter_by_id, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameter_by_id_with_label", "parameter_id", "label", "ignore_seek_speed"),
&StudioSystem::set_parameter_by_id_with_label);
&StudioSystem::set_parameter_by_id_with_label, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameters_by_ids", "parameter_ids", "values", "count", "ignore_seek_speed"),
&StudioSystem::set_parameters_by_ids);
&StudioSystem::set_parameters_by_ids, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_parameter_by_name", "name"), &StudioSystem::get_parameter_by_name);
ClassDB::bind_method(D_METHOD("set_parameter_by_name", "name", "value", "ignore_seek_speed"),
&StudioSystem::set_parameter_by_name);
&StudioSystem::set_parameter_by_name, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameter_by_name_with_label", "name", "label", "ignore_seek_speed"),
&StudioSystem::set_parameter_by_name_with_label);
&StudioSystem::set_parameter_by_name_with_label, DEFVAL(false));
ClassDB::bind_method(D_METHOD("lookup_id", "path"), &StudioSystem::lookup_id);
ClassDB::bind_method(D_METHOD("lookup_path", "guid"), &StudioSystem::lookup_path);
ClassDB::bind_method(D_METHOD("get_num_listeners"), &StudioSystem::get_num_listeners);
Expand Down Expand Up @@ -1261,16 +1261,16 @@ void EventInstance::_bind_methods()
ClassDB::bind_method(D_METHOD("is_virtual"), &EventInstance::is_virtual);
ClassDB::bind_method(D_METHOD("get_parameter_by_id", "parameter_id"), &EventInstance::get_parameter_by_id);
ClassDB::bind_method(D_METHOD("set_parameter_by_id", "parameter_id", "parameter_value", "ignore_seek_speed"),
&EventInstance::set_parameter_by_id);
&EventInstance::set_parameter_by_id, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameter_by_id_with_label", "parameter_id", "label", "ignore_seek_speed"),
&EventInstance::set_parameter_by_id_with_label);
&EventInstance::set_parameter_by_id_with_label, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameters_by_ids", "parameter_ids", "values", "count", "ignore_seek_speed"),
&EventInstance::set_parameters_by_ids);
&EventInstance::set_parameters_by_ids, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_parameter_by_name", "name"), &EventInstance::get_parameter_by_name);
ClassDB::bind_method(D_METHOD("set_parameter_by_name", "name", "parameter_value", "ignore_seek_speed"),
&EventInstance::set_parameter_by_name);
&EventInstance::set_parameter_by_name, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_parameter_by_name_with_label", "name", "label", "ignore_seek_speed"),
&EventInstance::set_parameter_by_name_with_label);
&EventInstance::set_parameter_by_name_with_label, DEFVAL(false));
ClassDB::bind_method(D_METHOD("key_off"), &EventInstance::key_off);
ClassDB::bind_method(D_METHOD("get_cpu_usage", "cpu_usage"), &EventInstance::get_cpu_usage);
ClassDB::bind_method(D_METHOD("get_memory_usage", "memory_usage_ref"), &EventInstance::get_memory_usage);
Expand Down Expand Up @@ -1449,7 +1449,7 @@ bool EventInstance::start() const
return ERROR_CHECK(event_instance->start());
}

bool EventInstance::stop(int stop_mode) const
bool EventInstance::stop(FMOD_STUDIO_STOP_MODE stop_mode) const
{
return ERROR_CHECK(event_instance->stop(static_cast<FMOD_STUDIO_STOP_MODE>(stop_mode)));
}
Expand Down Expand Up @@ -1550,7 +1550,7 @@ bool EventInstance::set_parameter_by_id(const Ref<FmodTypes::FMOD_STUDIO_PARAMET
}

bool EventInstance::set_parameter_by_id_with_label(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id,
const String& label, bool ignore_seek_speed)
const String& label, bool ignore_seek_speed) const
{
FMOD_STUDIO_PARAMETER_ID id;
parameter_id->get_parameter_id(id);
Expand Down Expand Up @@ -1599,7 +1599,7 @@ bool EventInstance::set_parameter_by_name(const String& name, float value, bool
return ERROR_CHECK(event_instance->setParameterByName(name.utf8().get_data(), value, ignore_seek_speed));
}

bool EventInstance::set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed)
bool EventInstance::set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed) const
{
return ERROR_CHECK(event_instance->setParameterByNameWithLabel(name.utf8().get_data(), label.utf8().get_data(),
ignore_seek_speed));
Expand Down
24 changes: 12 additions & 12 deletions addons/FMOD/native/src/api/studio_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class StudioSystem : public RefCounted
Ref<EventDescription> get_event_by_id(const String& event_guid) const;
Ref<Bus> get_bus_by_id(const String& bus_guid) const;
Ref<VCA> get_vca_by_id(const String& vca_guid) const;
Ref<Bank> get_bank_by_id(const String& bankGuid) const;
Ref<Bank> get_bank_by_id(const String& bank_guid) const;

// note(alex): StudioSystem::getSoundInfo is not implemented due to missing Core API implementation.
Ref<FmodTypes::FMOD_STUDIO_PARAMETER_DESCRIPTION> get_parameter_description_by_name(const String& name) const;
Expand All @@ -51,14 +51,14 @@ class StudioSystem : public RefCounted

Dictionary get_parameter_by_id(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id) const;
bool set_parameter_by_id(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id, float value,
bool ignore_seek_speed) const;
bool ignore_seek_speed = false) const;
bool set_parameter_by_id_with_label(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id, const String& label,
bool ignore_seek_speed) const;
bool ignore_seek_speed = false) const;
bool set_parameters_by_ids(const Array& parameter_ids, const Array& values, int count,
bool ignore_seek_speed) const;
bool ignore_seek_speed = false) const;
Dictionary get_parameter_by_name(const String& name) const;
bool set_parameter_by_name(const String& name, float value, bool ignore_seek_speed) const;
bool set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed) const;
bool set_parameter_by_name(const String& name, float value, bool ignore_seek_speed = false) const;
bool set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed = false) const;

String lookup_id(const String& path) const;
String lookup_path(const String& guid) const;
Expand Down Expand Up @@ -187,7 +187,7 @@ class EventInstance : public RefCounted
bool set_paused(bool paused) const;

bool start() const;
bool stop(int stop_mode) const;
bool stop(FMOD_STUDIO_STOP_MODE stop_mode) const;

int get_timeline_position() const;
bool set_timeline_position(int position) const;
Expand All @@ -203,14 +203,14 @@ class EventInstance : public RefCounted

Dictionary get_parameter_by_id(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id) const;
bool set_parameter_by_id(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id, float value,
bool ignore_seek_speed) const;
bool ignore_seek_speed = false) const;
bool set_parameter_by_id_with_label(const Ref<FmodTypes::FMOD_STUDIO_PARAMETER_ID>& parameter_id,
const String& label, bool ignore_seek_speed);
bool set_parameters_by_ids(const Array ids, const Array values, int count, bool ignore_seek_speed) const;
const String& label, bool ignore_seek_speed = false) const;
bool set_parameters_by_ids(const Array ids, const Array values, int count, bool ignore_seek_speed = false) const;

Dictionary get_parameter_by_name(const String& name) const;
bool set_parameter_by_name(const String& name, float value, bool ignore_seek_speed) const;
bool set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed);
bool set_parameter_by_name(const String& name, float value, bool ignore_seek_speed = false) const;
bool set_parameter_by_name_with_label(const String& name, const String& label, bool ignore_seek_speed = false) const;

bool key_off() const;

Expand Down
Loading