Commit Graph

77 Commits

Author SHA1 Message Date
Nicholas Lamicela
8d82a96dfa fix end of song detection 2025-01-24 19:55:24 -08:00
Nicholas Lamicela
cf455d8381 add autoplay 2025-01-24 19:34:20 -08:00
Nicholas Lamicela
83ab6c3c51 use ZL and ZR to change songs with lid closed! 2025-01-24 16:51:54 -08:00
Mahyar Koshkouei
cdf49f8dcf play: add current and total time of music
Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2023-07-08 16:51:14 +01:00
Mahyar Koshkouei
0143d7ece1 build: fix ctru API change in SDMC access
Additionally updated buildtools.
Tested with Citra 3DS emulator only.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2021-04-28 15:50:49 +01:00
Mahyar Koshkouei
ef0289bceb Refactor for testing
Added basic decoding functionality to test.

Refactored some code to stop 3DS specific code from compiling on
GNU/Linux.

Tested working by running the test executable on GNU/Linux. Vorbis
decoding has many errors detected by valgrind (but still decodes
successfully).
Opus, flac, and mp3 decoding work without errors.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2017-08-14 23:14:45 +01:00
Mahyar Koshkouei
ed5eaba746 Add Vorbis decoder
Additionally implemented better handling of the playback stopping
procedure.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2017-07-08 12:43:41 +01:00
Mahyar Koshkouei
c6f27ae957 Update submodules
Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
2017-07-07 22:59:18 +01:00
Mahyar Koshkouei
b7efc57b1a Fix error and line clear bugs
Fixed a bug whereby error messages may appear on the bottom screen.
Fixed a bug whereby some lines on the bottom screen would not be cleared
whilst browsing files, causing some file names to appear where they
shouldn't.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-22 15:53:26 +00:00
Mahyar Koshkouei
136cc59632 Remove debugging
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-20 16:27:01 +00:00
Mahyar Koshkouei
057a13f7a2 Fix directory flashing
Fixed an issue whereby the console would flash when browsing files.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-20 16:22:39 +00:00
Mahyar Koshkouei
ae4b713bf6 Add new key mappings
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-15 17:25:02 +00:00
Mahyar Koshkouei
59688aaf0e Remove error on going up directory
Removed an error that would briefly appear on the screen if the user
were to attempt to change to the above directory whilst being in the
root directory.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-15 16:53:33 +00:00
Mahyar Koshkouei
073b507118 Browse files with Left & Right
Added feature to browse a folder with Left & Right buttons to skip over
half a screens worth of files (13 files).

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-15 16:34:50 +00:00
Mahyar Koshkouei
02746ec1d0 Fix playback bug & don't stop on every file select
Fixed a bug where ctrmus would freeze after selecting an unsupported
file.
Fixed a bug whereby selecting an unsupported file would stop playback.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-15 16:03:37 +00:00
Mahyar Koshkouei
65bb01ee72 Add missing function headers
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-14 22:45:18 +00:00
Mahyar Koshkouei
295edd06f0 Fix segfault on exit
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-14 17:58:21 +00:00
Mahyar Koshkouei
b7f3a70406 Remove header order requirement and debug
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-14 17:34:48 +00:00
Mahyar Koshkouei
711864cfa9 Fix error handling
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-14 17:00:15 +00:00
Mahyar Koshkouei
984192eebe Improve error handling
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-14 17:00:15 +00:00
Mahyar Koshkouei
488a3d9357 Add pause/play display again
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-10 12:15:56 +00:00
Mahyar Koshkouei
5b433f2396 Add showControls, error handling, optimisations
Add a function to show button mappings using L + LEFT.
Added preliminary error handling that will be improved later to
determine playback issues.
Music is not stopped when an unsupported file is selected.
Some other minor modifications.

TODO:
Pause/play status does not show currently.
Obtain error status of playback thread.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-10 11:41:01 +00:00
Mahyar Koshkouei
888c4a1505 Minor fixes to improve thread safety
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-10 08:48:26 +00:00
Mahyar Koshkouei
3df3461027 Fix pausing
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-10 08:21:29 +00:00
Mahyar Koshkouei
a06e17a66a Put playback in separate thread (WIP)
Selecting a file is possible whilst music is playing.
Additionally fixes #19, an issue where the Home would not appear whilst
music is playing.

TODO:
Remove printf from playback module.
Fix pause and stop.
Display errors properly using errno.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-09 17:14:10 +00:00
Mahyar Koshkouei
4933cf554e Use relative file path
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-04 18:31:17 +00:00
Mahyar Koshkouei
6e7de0df65 Remove duplicate check
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-02-03 00:00:40 +00:00
Mahyar Koshkouei
b7e5a3eefd Improve pointer speed
Press and hold for half a second to make the pointer go fast. Closes
issue #26.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-13 22:43:18 +00:00
Mahyar Koshkouei
11b16f1cd0 Fix file selector disappearing in large directory
This fixes issue #27.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-13 22:24:08 +00:00
Mahyar Koshkouei
42cd727166 Remove one more debugging crap
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-12 14:58:38 +00:00
Mahyar Koshkouei
4b8ca4ab6f Remove debugging
Additionally increased the maximum size of the directory path to display
by a whopping 3 characters.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-12 12:11:38 +00:00
Mahyar Koshkouei
fcf538031f Fix WAV playback
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-12 11:48:48 +00:00
Mahyar Koshkouei
27ee6af2e1 Flac refactor WIP
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-12 11:48:48 +00:00
Mahyar Koshkouei
644e501d6e Refactor Opus decoder
Created generic playback handler, first with Opus support. Other
decoders to follow. This is to remove duplicated code.

3DSX tested working with citra and N3DS.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-12 11:48:48 +00:00
Mahyar Koshkouei
5ca8e6cc65 Fix CIA causing instability
Fixed an issue whereby after exiting the ctrmus CIA application, the
user could not load another application.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-07 11:17:24 +00:00
Mahyar Koshkouei
3059bead6b Update README and minor changes for release
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-05 22:22:28 +00:00
Mahyar Koshkouei
0e6a86c551 Fix directory listing bugs
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-05 22:07:39 +00:00
Mahyar Koshkouei
28d2e8d594 Add MP3 Support
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-05 21:12:03 +00:00
Mahyar Koshkouei
2456166647 Update README and limit pointer speed
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-02 11:41:41 +00:00
Mahyar Koshkouei
ba680fb63a Cleanup
Removed some debugging code.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-01 14:11:40 +00:00
Mahyar Koshkouei
f7fa518294 Changes to file browser
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2017-01-01 13:58:36 +00:00
Mahyar Koshkouei
9920fd1ac3 Fix directory browsing
Only the first page of files can be browsed in the directory though.
The top screen is where the playlist will be displayed, but is currently
used for music playback info.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-31 19:47:37 +00:00
Mahyar Koshkouei
91b55285f2 Initial directory changes
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-31 19:47:37 +00:00
Mahyar Koshkouei
dec4618e5a Fix accessing cleared memory
Fixed a major bug whereby file names were being retrieved from a cleared
pointer (issue 9).

Tested working on n3DS.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-31 19:47:37 +00:00
Mahyar Koshkouei
aa39c2f3fb Refactored WAV code in to its own file
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-29 21:15:19 +00:00
Mahyar Koshkouei
42b61ba7f0 Fix pause display
Fixed an issue where the "Paused" text would still be displayed after
un-pausing a WAV file.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-29 20:46:59 +00:00
Mahyar Koshkouei
56d5c7d760 Add working Opus file support
Opus files can now be played.
Fixed an issue where monophonic tracks were being played twice as slow.
Opus decodes to stereo always.
Additionally added ability to loop the file selector from 1 to the last
file when pressing down and vice versa.

There are known issues. Please see the issues page for them.

Tested working with:
196kbit Stereo Opus File
32kbit Stereo Opus File
96kbit Mono Opus File
8kbit Stereo Opus File

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-28 13:03:56 +00:00
Mahyar Koshkouei
3c99a80581 Preliminary Opus file support
Currently has noise issues and plays fast - not for use yet.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-27 22:37:24 +00:00
Mahyar Koshkouei
37ee6e2f58 Add check for Opus file type
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-27 18:00:32 +00:00
Mahyar Koshkouei
c12bf9eb82 Remove Opus example with actual function
Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
2016-12-27 17:37:00 +00:00