mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 21:02:39 +02:00
Added support for launching the Album applet via albumLa.
This commit is contained in:
parent
76e86a9a80
commit
b89191c435
@ -112,6 +112,7 @@ extern "C" {
|
|||||||
#include "switch/audio/driver.h"
|
#include "switch/audio/driver.h"
|
||||||
|
|
||||||
#include "switch/applets/libapplet.h"
|
#include "switch/applets/libapplet.h"
|
||||||
|
#include "switch/applets/album_la.h"
|
||||||
#include "switch/applets/pctlauth.h"
|
#include "switch/applets/pctlauth.h"
|
||||||
#include "switch/applets/error.h"
|
#include "switch/applets/error.h"
|
||||||
#include "switch/applets/swkbd.h"
|
#include "switch/applets/swkbd.h"
|
||||||
|
31
nx/include/switch/applets/album_la.h
Normal file
31
nx/include/switch/applets/album_la.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* @file album_la.h
|
||||||
|
* @brief Wrapper for using the Album LibraryApplet.
|
||||||
|
* @author yellows8
|
||||||
|
* @copyright libnx Authors
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
#include "../types.h"
|
||||||
|
|
||||||
|
/// Arg type values pushed for the applet input storage, stored as an u8.
|
||||||
|
typedef enum {
|
||||||
|
AlbumLaArg_ShowAlbumFiles = 0, ///< ShowAlbumFiles. Only displays AlbumFiles associated with the title which launched the Album applet, with the filter button disabled.
|
||||||
|
AlbumLaArg_ShowAllAlbumFiles = 1, ///< ShowAllAlbumFiles. Displays all AlbumFiles, with filtering allowed.
|
||||||
|
AlbumLaArg_ShowAllAlbumFilesForHomeMenu = 2, ///< ShowAllAlbumFilesForHomeMenu. Similar to ::AlbumLaArg_ShowAllAlbumFiles.
|
||||||
|
} AlbumLaArg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Launches the applet with ::AlbumLaArg_ShowAlbumFiles and playStartupSound=false.
|
||||||
|
*/
|
||||||
|
Result albumLaShowAlbumFiles(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Launches the applet with ::AlbumLaArg_ShowAllAlbumFiles and playStartupSound=false.
|
||||||
|
*/
|
||||||
|
Result albumLaShowAllAlbumFiles(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Launches the applet with ::AlbumLaArg_ShowAllAlbumFilesForHomeMenu and playStartupSound=true.
|
||||||
|
*/
|
||||||
|
Result albumLaShowAllAlbumFilesForHomeMenu(void);
|
||||||
|
|
31
nx/source/applets/album_la.c
Normal file
31
nx/source/applets/album_la.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <string.h>
|
||||||
|
#include "types.h"
|
||||||
|
#include "result.h"
|
||||||
|
#include "services/applet.h"
|
||||||
|
#include "applets/libapplet.h"
|
||||||
|
#include "applets/album_la.h"
|
||||||
|
|
||||||
|
static Result _albumLaShow(u8 arg, bool playStartupSound) {
|
||||||
|
Result rc=0;
|
||||||
|
LibAppletArgs commonargs;
|
||||||
|
|
||||||
|
libappletArgsCreate(&commonargs, 0x10000);
|
||||||
|
libappletArgsSetPlayStartupSound(&commonargs, playStartupSound);
|
||||||
|
|
||||||
|
rc = libappletLaunch(AppletId_photoViewer, &commonargs, &arg, sizeof(arg), NULL, 0, NULL);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result albumLaShowAlbumFiles(void) {
|
||||||
|
return _albumLaShow(AlbumLaArg_ShowAlbumFiles, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result albumLaShowAllAlbumFiles(void) {
|
||||||
|
return _albumLaShow(AlbumLaArg_ShowAllAlbumFiles, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Result albumLaShowAllAlbumFilesForHomeMenu(void) {
|
||||||
|
return _albumLaShow(AlbumLaArg_ShowAllAlbumFilesForHomeMenu, true);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user