From 3bad56613c15539e8db4830632e89380ea524d6d Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:05:14 +0400 Subject: [PATCH 1/6] examples(project-data): remove setMuteMusic method usage. --- examples/project-data/update-project-data.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/project-data/update-project-data.php b/examples/project-data/update-project-data.php index df65970..1b80a2b 100644 --- a/examples/project-data/update-project-data.php +++ b/examples/project-data/update-project-data.php @@ -9,8 +9,6 @@ $projectData = $renderforestClient->getProjectData(16165971); -$projectData->setMuteMusic(false); - $projectData ->getScreenByOrder(1) ->getAreaByOrder(1) From 7e05e7184c3e7c7aab05e98c86e94fbae728e0a0 Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:05:55 +0400 Subject: [PATCH 2/6] examples(project-data): change mute music to mute SFX. --- examples/project-data/get-project-data.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/project-data/get-project-data.php b/examples/project-data/get-project-data.php index cef5f0b..e555017 100644 --- a/examples/project-data/get-project-data.php +++ b/examples/project-data/get-project-data.php @@ -16,7 +16,8 @@ echo 'Is Equalizer - ' . ($projectData->isEqualizer() ? 'True' : 'False') . PHP_EOL; echo 'Is Extendable Screens - ' . ($projectData->isExtendableScreens() ? 'True' : 'False') . PHP_EOL; echo 'Is Lego - ' . ($projectData->isLego() ? 'True' : 'False') . PHP_EOL; -echo 'Is Mute Music - ' . ($projectData->isMuteMusic() ? 'True' : 'False') . PHP_EOL; +echo 'Has Sfx - ' . ($projectData->hasSfx() ? 'True' : 'False') . PHP_EOL; +echo 'Is Mute Sfx - ' . ($projectData->isMuteSfx() ? 'True' : 'False') . PHP_EOL; echo 'Project Colors: ' . PHP_EOL; foreach ($projectData->getProjectColors() as $projectColor) { From aa2df12bc49a9349d0323a94f7db28e527f5b63e Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:06:29 +0400 Subject: [PATCH 3/6] examples(projects): use mute sfx instead of mute music. --- examples/projects/get-trial-project.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/projects/get-trial-project.php b/examples/projects/get-trial-project.php index 07efb90..35ea926 100644 --- a/examples/projects/get-trial-project.php +++ b/examples/projects/get-trial-project.php @@ -11,7 +11,8 @@ echo 'Is Equalizer - ' . ($trialProject->isEqualizer() ? 'True' : 'False') . PHP_EOL; echo 'Is Extendable Screens - ' . ($trialProject->isExtendableScreens() ? 'True' : 'False') . PHP_EOL; echo 'Is Lego - ' . ($trialProject->isLego() ? 'True' : 'False') . PHP_EOL; -echo 'Is Mute Music - ' . ($trialProject->isMuteMusic() ? 'True' : 'False') . PHP_EOL; +echo 'Has Sfx - ' . ($trialProject->hasSfx() ? 'True' : 'False') . PHP_EOL; +echo 'Is Mute Sfx - ' . ($trialProject->isMuteSfx() ? 'True' : 'False') . PHP_EOL; echo 'Project Colors: ' . PHP_EOL; foreach ($trialProject->getProjectColors() as $projectColor) { From 96d289c8713f780aad8afea12fa4115c5f182db2 Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:06:59 +0400 Subject: [PATCH 4/6] ProjectData: remove mute music functionality and add mute sfx. --- src/ProjectData/ProjectData.php | 53 ++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/ProjectData/ProjectData.php b/src/ProjectData/ProjectData.php index db8d69e..725b06d 100644 --- a/src/ProjectData/ProjectData.php +++ b/src/ProjectData/ProjectData.php @@ -26,7 +26,8 @@ class ProjectData extends ApiEntityBase const KEY_EQUALIZER = 'equalizer'; const KEY_EXTENDABLE_SCREENS = 'extendableScreens'; const KEY_IS_LEGO = 'isLego'; - const KEY_MUTE_MUSIC = 'muteMusic'; + const KEY_MUTE_SFX = 'muteSfx'; + const KEY_HAS_SFX = 'hasSfx'; const KEY_PROJECT_COLORS = 'projectColors'; const KEY_PROJECT_VERSION = 'projectVersion'; const KEY_SCREENS = 'screens'; @@ -42,7 +43,7 @@ class ProjectData extends ApiEntityBase const WRITABLE_KEYS = [ self::KEY_CURRENT_SCREEN_ID, self::KEY_EDITING_MODE, - self::KEY_MUTE_MUSIC, + self::KEY_MUTE_SFX, self::KEY_SOUNDS, self::KEY_PROJECT_COLORS, self::KEY_SCREENS, @@ -83,7 +84,10 @@ class ProjectData extends ApiEntityBase protected $isLego; /** @var bool */ - protected $muteMusic; + protected $muteSfx; + + /** @var bool */ + protected $hasSfx; /** @var ColorCollection */ protected $projectColors; @@ -266,6 +270,25 @@ public function isLego(): bool return $this->isLego; } + /** + * @return bool + */ + public function hasSfx(): bool + { + return $this->hasSfx; + } + + /** + * @param bool $hasSfx + * @return ProjectData + */ + public function setHasSfx(bool $hasSfx): ProjectData + { + $this->hasSfx = $hasSfx; + + return $this; + } + /** * @param bool $isLego * @return ProjectData @@ -280,18 +303,22 @@ public function setIsLego(bool $isLego): ProjectData /** * @return bool */ - public function isMuteMusic(): bool + public function isMuteSfx(): bool { - return $this->muteMusic; + return $this->muteSfx; } /** - * @param bool $muteMusic + * @param bool $muteSfx * @return ProjectData */ - public function setMuteMusic(bool $muteMusic): ProjectData + public function setMuteSfx(bool $muteSfx): ProjectData { - $this->muteMusic = $muteMusic; + if (true === $this->hasSfx) { + $this->muteSfx = $muteSfx; + } else { + $this->muteSfx = false; + } return $this; } @@ -604,8 +631,11 @@ public function exchangeArray(array $projectDataArrayData) $isLego = $projectDataArrayData[self::KEY_IS_LEGO]; $this->setIsLego($isLego); - $muteMusic = $projectDataArrayData[self::KEY_MUTE_MUSIC]; - $this->setMuteMusic($muteMusic); + $hasSfx = $projectDataArrayData[self::KEY_HAS_SFX]; + $this->setHasSfx($hasSfx); + + $muteSfx = $projectDataArrayData[self::KEY_MUTE_SFX]; + $this->setMuteSfx($muteSfx); if (array_key_exists(self::KEY_PROJECT_COLORS, $projectDataArrayData)) { $projectColorsArrayData = $projectDataArrayData[self::KEY_PROJECT_COLORS]; @@ -723,7 +753,8 @@ public function getArrayCopyFull(): array self::KEY_EQUALIZER => $this->isEqualizer(), self::KEY_EXTENDABLE_SCREENS => $this->isExtendableScreens(), self::KEY_IS_LEGO => $this->isLego(), - self::KEY_MUTE_MUSIC => $this->isMuteMusic(), + self::KEY_HAS_SFX => $this->hasSfx(), + self::KEY_MUTE_SFX => $this->isMuteSfx(), self::KEY_PROJECT_COLORS => $this->projectColors->getArrayCopy(), self::KEY_PROJECT_VERSION => $this->getProjectVersion(), self::KEY_SCREENS => $this->screens->getArrayCopy(), From f6105f69bbdaa3f0820c6d1e378ac85c180f8a8a Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:07:15 +0400 Subject: [PATCH 5/6] doc: update Project api documentation. --- doc/PROJECTS_API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/PROJECTS_API.md b/doc/PROJECTS_API.md index 617a78a..bbcc032 100644 --- a/doc/PROJECTS_API.md +++ b/doc/PROJECTS_API.md @@ -59,9 +59,9 @@ $renderforestClient = new \Renderforest\ApiClient( $projectId = $renderforestClient->addProject(701); // template id ``` - Also, project-data is created with the following list of initial properties: - templateId, title, duration, equalizer, isLego, extendableScreens, fps, projectVersion, screens, muteMusic, + templateId, title, duration, equalizer, isLego, extendableScreens, fps, projectVersion, screens, muteSfx, currentScreenId, projectColors (optional), themeVariableName (optional), themeVariableValue (optional). -- The "muteMusic" is false initially. +- The "muteSfx" is false initially. - If template is lego ("isLego": true), then no initial screen is added and "screens" defaults to []. Otherwise, at least one screen is present. - The "currentScreenId" is the id of the first screen for non-lego templates & null for lego templates. - The "projectColors" is optional and gets value if the template has default colors. Both lego & non-lego templates might have default colors. From 6b40c52690cca9fa10ff4743deab225a5154e22e Mon Sep 17 00:00:00 2001 From: Artyom Date: Sun, 13 Jun 2021 02:08:22 +0400 Subject: [PATCH 6/6] release 0.5.6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 09e20a8..ec11aa4 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "renderforest/sdk-php", "description": "Renderforest SDK for PHP", - "version": "0.5.5", + "version": "0.5.6", "homepage": "https://github.com/renderforest/renderforest-sdk-php", "keywords": [ "animation maker",