eepp: Updated mojoal, dr_mp3, dr_flac. Fixed various mojoal bugs. Added SoundFileFactory::isKnownFileExtension. SoundFileFactory::isValidAudio, SoundFileFactory::isValidAudioFile.

ecode: Added audio player support (SpartanJ/ecode#96).
This commit is contained in:
Martín Lucas Golini
2025-09-29 00:02:06 -03:00
parent 9d2aec8e14
commit 0ec661852a
39 changed files with 2297 additions and 813 deletions
+12
View File
@@ -7,6 +7,7 @@
#include <eepp/system/filesystem.hpp>
#include <eepp/system/md5.hpp>
#include <eepp/system/sys.hpp>
#include <eepp/ui/tools/uiaudioplayer.hpp>
#include <eepp/ui/tools/uiimageviewer.hpp>
#include <eterm/ui/uiterminal.hpp>
@@ -485,6 +486,14 @@ json AppConfig::saveNode( Node* node ) {
f["type"] = "image_viewer";
f["path"] = iv->getImagePath();
files.emplace_back( f );
} else if ( ownedWidget->isType( UI_TYPE_AUDIO_PLAYER ) ) {
UIAudioPlayer* ap = ownedWidget->asType<UIAudioPlayer>();
if ( ap->getFilePath().empty() )
continue;
json f;
f["type"] = "audio_player";
f["path"] = ap->getFilePath();
files.emplace_back( f );
} else if ( node->isWidget() ) {
UIWidget* widget = ownedWidget->asType<UIWidget>();
if ( widget->getClasses().size() == 1 ) {
@@ -741,6 +750,9 @@ void AppConfig::loadDocuments( UICodeEditorSplitter* editorSplitter, json j,
} else if ( file["type"] == "image_viewer" ) {
if ( file.contains( "path" ) && file["path"].is_string() )
app->loadImageFromMedium( file["path"].get<std::string>(), false, false, true );
} else if ( file["type"] == "audio_player" ) {
if ( file.contains( "path" ) && file["path"].is_string() )
app->loadAudioFromPath( file["path"].get<std::string>(), false );
} else {
auto found = tabWidgetTypes.find( file["type"] );
if ( found != tabWidgetTypes.end() ) {