//! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality.
//! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application.
/// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen.
/// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console.
///
/// # Notes
///
/// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes.
///
/// # Alternatives
///
/// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself,
/// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`).
/// There are 24 individual channels in total and each can play a different audio [`Wave`] simultaneuosly.
///
/// # Default
///
/// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service.
///
/// In particular:
/// - Default audio format is set to [`AudioFormat::PCM16Mono`].
/// - Default sample rate is set to 1 Hz.
/// - Default interpolation type is set to [`InterpolationType::Polyphase`].
/// - Default mix is set to [`AudioMix::default()`]
pubstructChannel<'ndsp>{
pubstructChannel<'ndsp>{
id: u8,
id: u8,
_rf: RefMut<'ndsp,()>,// we don't need to hold any data
_rf: RefMut<'ndsp,()>,// we don't need to hold any data
@ -169,7 +182,7 @@ impl Channel<'_> {
unsafe{ctru_sys::ndspChnIsPaused(self.id.into())}
unsafe{ctru_sys::ndspChnIsPaused(self.id.into())}
}
}
// Returns the channel's id
/// Returns the channel's index.
pubfnid(&self)-> u8{
pubfnid(&self)-> u8{
self.id
self.id
}
}
@ -458,8 +471,8 @@ impl AudioMix {
}
}
}
}
/// Returns an [`AudioMix`] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%.
implDefaultforAudioMix{
implDefaultforAudioMix{
/// Returns an [`AudioMix`] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%.
/// This service lets the application access a virtual mounted device created using a folder included within the application bundle.
/// `ctru` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information.
///
/// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`.
pubstructRomFS{
pubstructRomFS{
_service_handler: ServiceReference,
_service_handler: ServiceReference,
}
}
@ -25,6 +31,7 @@ pub struct RomFS {
staticROMFS_ACTIVE: Mutex<usize>=Mutex::new(0);
staticROMFS_ACTIVE: Mutex<usize>=Mutex::new(0);
implRomFS{
implRomFS{
/// Mounts the specified RomFS folder as a virtual drive.