#include <stdio.h>
#include <switch.h>
}
static void _exampleExit() {
}
static PLSR_RC _examplePlay(
float pitch,
float volume) {
}
int main() {
consoleInit(NULL);
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
PadState pad;
padInitializeDefault(&pad);
printf("romfsMountDataStorageFromProgram: 0x%x\n", romfsMountDataStorageFromProgram(0x0100000000001000, "qlaunch"));
printf("_exampleInit() = 0x%08X\n\n", initRC);
printf("Press + to exit\n");
if(R_SUCCEEDED(initRC)) {
printf("Change pitch with the left stick Y axis\n");
printf("Change volume with the right stick Y axis\n");
printf("Press A to play a sound\n");
}
while(appletMainLoop()) {
padUpdate(&pad);
u64 kDown = padGetButtonsDown(&pad);
if(kDown & HidNpadButton_Plus) {
break;
}
if(R_SUCCEEDED(initRC) && (kDown & HidNpadButton_A)) {
HidAnalogStickState analog_stick_l = padGetStickPos(&pad, 0);
HidAnalogStickState analog_stick_r = padGetStickPos(&pad, 1);
float pitch = 1.0f + (float)analog_stick_l.y / (float)JOYSTICK_MAX;
float volume = 1.0f + (float)analog_stick_r.y / (float)JOYSTICK_MAX;
if(pitch <= 0.05f) {
pitch = 0.05f;
}
printf("_examplePlay(%f, %f) = 0x%08X\n", pitch, volume, _examplePlay(pitch, volume));
}
consoleUpdate(NULL);
}
_exampleExit();
consoleExit(NULL);
return 0;
}