From 2dc317e98ea977a25330755e1d8ed43a69cfa1ff Mon Sep 17 00:00:00 2001 From: Respirant Date: Sat, 12 Dec 2020 08:31:55 +0100 Subject: [PATCH] Minor include and readme changes --- README.md | 1 + .../Public/RuntimeAudioImporterBPLibrary.h | 4 +- image/feed.php | 146 ++++++++++++++++++ 3 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 image/feed.php diff --git a/README.md b/README.md index 684a5f2..2e0d023 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ ![GitHub](https://img.shields.io/github/languages/code-size/Respirant/RuntimeAudioImporter) # RuntimeAudioImporter This plugin will be useful for those who want to be able to import audio files of MP3, WAV and FLAC formats into the game in runtime (for example, if the game involves importing audio files from the player's device memory). It's easy to use in both C++ and Blueprints. +Some theoretical information is presented here: [How to import an audio file into Unreal Engine at runtime](https://unreal.blog/how-to-import-an-audio-file-into-unreal-engine-at-runtime). ![Runtime Audio Importer Unreal Engine Plugin Logo](image/runtimeaudioimporter.png "RuntimeAudioImporter Unreal Engine Plugin Logo") diff --git a/RuntimeAudioImporter/Source/RuntimeAudioImporter/Public/RuntimeAudioImporterBPLibrary.h b/RuntimeAudioImporter/Source/RuntimeAudioImporter/Public/RuntimeAudioImporterBPLibrary.h index f8f783d..bb991e0 100644 --- a/RuntimeAudioImporter/Source/RuntimeAudioImporter/Public/RuntimeAudioImporterBPLibrary.h +++ b/RuntimeAudioImporter/Source/RuntimeAudioImporter/Public/RuntimeAudioImporterBPLibrary.h @@ -5,10 +5,8 @@ #include "Kismet/BlueprintFunctionLibrary.h" #include "Runtime/Engine/Classes/Sound/SoundWave.h" -//#include "Runtime/Engine/Public/VorbisAudioInfo.h" -#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h" -#include "Async/Async.h" +#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h" #include "RuntimeAudioImporterBPLibrary.generated.h" diff --git a/image/feed.php b/image/feed.php new file mode 100644 index 0000000..bd4b2f1 --- /dev/null +++ b/image/feed.php @@ -0,0 +1,146 @@ +"; + } + return $value; + } +function parseHeader($block) +{ +return 'data->level.'>'. $block->data->text .'data->level.'>'; +} +function parseCode($block) +{ +return '
'.$block->data->code   .'
'; +} +function parseParagraph($block) +{ +return '

'.$block->data->text .'

'; +} +function parseTable($block) +{ +unset($return, $line, $cell); +$return = '
+ +'; +foreach ($block->data->content as $line) { +$return .= ''; +foreach ($line as $cell) { +$return .= ''; +} +$return .= ''; +} +$return .= '
'; +$return .= $cell; +$return .= '
'; +return $return; +} +function parseList($block) +{ +unset($tag, $return, $item); +if ($block->data->style == 'ordered'){ +$tag = 'ol'; +}elseif ($block->data->style == 'unordered'){ +$tag = 'ul'; +} +$return = '<'.$tag.'>'; +foreach ($block->data->items as $item) { +$return .= '
  • '.$item.'
  • '; +} +$return .= ''; +return $return; +} +function parseImage($block) +{ +unset($captiontitle, $captionalt); +if ($block->data->caption){ +$captiontitle = '

    '.$block->data->caption.'

    '; +$captionalt = $block->data->caption; +} +return '
    +'.$captionalt.''.$captiontitle.' +
    '; +} +function echofeeddata($resultfeedmysqli, $returnfirstupdated){ +unset($return, $publishing_date); +$author_id = $resultfeedmysqli['author_id']; +$sqlfeed_author = mysqli_query($conn, "SELECT `fullname` FROM `authors` WHERE `id` = '.$author_id.'"); +$resultfeed_author = mysqli_fetch_assoc($sqlfeed_author); +//date +$publishing_date = date("r", strtotime($resultfeedmysqli['publishing_date'])); +//date +if ($returnfirstupdated === true){ +$return .= ''.$publishing_date.''; +} +$return .= ' + + +'.valueToXML($resultfeedmysqli['article_title']).' + + +https://'.$_SERVER[HTTP_HOST].'/'.$resultfeedmysqli['nameaddress'].''; +if ($resultfeed_author['fullname']){ +$return .= ' + +'.valueToXML($resultfeed_author['fullname']).' + +'; +} +$content_array_feed = json_decode($resultfeedmysqli['content']); +if (is_object($content_array_feed)){ +foreach ($content_array_feed->blocks as $block) { +switch ($block->type) { +case 'code': +$content_feed .= parseCode($block); +break; +case 'paragraph': +$content_feed .= parseParagraph($block); +break; +case 'header': +$content_feed .= parseHeader($block); +break; +case 'image': +$content_feed .= parseImage($block); +break; +case 'list': +$content_feed .= parseList($block); +break; +case 'table': +$content_feed .= parseTable($block); +break; +default: +// code... +break; +} +} +} +$content_feed = html_entity_decode($content_feed); +$return .= ' +'.valueToXML($content_feed).' + +'.$publishing_date.' +'; +return $return; +} +echo ' + + https://'.$_SERVER[HTTP_HOST].'/feed + + + <![CDATA[ The Unreal Blog ]]> + + + '; ?> + 0){ +$resultfeed_posts = mysqli_fetch_assoc($sqlfeed_posts); +echo echofeeddata($resultfeed_posts, true); +while($resultfeed_posts = mysqli_fetch_assoc($sqlfeed_posts)){ +echo echofeeddata($resultfeed_posts, false); +} +} +} +?> +