calcprogrammer1 / calctunes Goto Github PK
View Code? Open in Web Editor NEWAndroid Desktop-Style Music Player
Android Desktop-Style Music Player
In Filesystem (Folders) mode, you can browse the filesystem and play files. Playback will be constrained to one folder and list items will show filenames instead of tag data. There won't be any caching of information, this mode is for quick and simple navigation. Also, allow CalcTunes to be used with "Open With" dialogs for audio files, which will automatically open in Filesystem mode with the track's folder selected and the track playing.
Filesystem mode will be treated as a permanent, special Library.
This is a big one. Android doesn't follow the traditional "close" strategy of desktop applications. Instead, your activity remains in memory until Java decides to kick it out. The media player keeps playing even after the activity is stopped, so a way to maintain application state and connection to media player is necessary. A proper exit function is also a good idea, even if it means killing off our own thread.
The sources list (sidebar) should have an option to hide. It isn't a problem on large screens or landscape mode on medium screens, but on small screens the sidebar takes up a lot of space. An option (either via Options Menu or on the main GUI itself) to expand and collapse the sidebar is necessary for usability on small screens.
The library data consists of media file paths and tag data pulled from said files. This data is currently regenerated every time a library is opened. It would speed up the library process a ton by caching this information to a local file, especially for network libraries where scanning all the files can take a very long time. I am thinking about using XML to store this information, and am currently unsure whether to store it file-by-file or use the artist-album-song hierarchy.
A context (long touch, "right click") menu for the library list should provide the option to delete a library and to edit a library. Editing a library should open the library editing activity pre-loaded with the current library data. Deleting a library should remove its file from the library directory.
The Subsonic (and clones such as Supersonic) project is a media server and streaming system with a REST based API. It provides the needed functions to browse the remote library, download a transcoded version of a file in a lower-quality, streaming-friendly format, and download the original un-transcoded format file. It would be great if CalcTunes supported all of these use cases, including downloading the original file to a local location where it could be pulled into a local library (great for FLAC). Likewise, streaming of MP3 and OGG would be great for on-the-go listening.
I've started working on an API implementation and have added a "Subsonic Servers" category to the sources list. This category adds a server (name, address, IP, port, username, password) and saves its information as an XML file. The original local library format has been redone as XML as well.
It would be nice to support playlists, either in a custom format or in a standardized format. These would be available under the Playlists heading in the sources list and context menu items to add to playlist would be available on menu items.
After the library cache is implemented, an option to re-scan the library is necessary. It also needs to be able to detect if a library is completely or partially offline, as this could be a disconnected network resource or a permanently deleted resource. The user should be prompted to rescan, ignore, or delete the library in this case.
It would be nice to have album art detection. I have added a placeholder for album art and need to figure out a good way to implement it. I would like artwork to be displayed in the main library list next to each album label as well as a larger album art shown at the bottom right for the current song.
Implementing this will likely mean checking for an "albumart.jpg" or "folder.jpg" file located in each album directory. Methods must be available for filtering multiple images (for instance, if one album is located in two different places in the same library).
Even further in the future, it would be nice to add an album art fetching system that scans the Internet for appropriate artwork and automatically inserts it into the media library directories (or local app directory depending on user preference).
I forgot to implement the DISC tag in my sorting routine. The Disc tag is used for multi-disc albums (often on long live albums). Songs should be sorted first by disc, then by track number.
The UI looks a bit boring with all text. Adding some icons should make it look a bit better. For libraries, either a folder or a "library" icon with books. For artists, possibly a "group of people" icon. For albums, the album art is preferred otherwise a vinyl record or CD icon. Songs probably do not need icons. Icons will also be available for playlists when they become supported.
Fragments are parcels of pure joy. They allow you to pack groups of controls into compartmentalized, packaged code rather than one giant messy activity. They allow for context menus to be built into your view code rather than in your activity code. They are great!
From now on, CalcTunes will be using Fragments for all of its window components. When I started the project, Fragments weren't a thing (well, they were I guess, but 3.0 wasn't popular and I didn't know about the support package :| ). So far I've replaced the source list view and the now playing/media controller view with fragments that encompass the view, GUI and, logic code together. I will do the same for the content view and the information view. I also want to make the New Source builders (library, subsonic, and playlist) into fragments instead of activities so that the now playing and title bars can remain on screen, giving the app a more unified feel.
The MediaPlayer class supports different formats on different devices. The application AndLess gets around this by providing native code for lossless playback. I will adapt this system to CalcTunes and provide the option to enable it. It will be used as a fallback if the Android player fails to load the file. To implement this, I will make a wrapping class LosslessMediaCodecHandler that will provide a MediaPlayer-like interface to the AndLess native players.
For more information on AndLess, see http://code.google.com/p/andless/
The ability to sort the library is a must-have. The library is not very useful in its current state, where everything comes up in random garbage order due to the file scanning process. For a start, artists and albums will be sorted by name and songs will be sorted by track number. In the future it would be nice to have many sort options, for instance to sort albums by year.
The ability to display year information on songs and albums would be useful. It may clutter up the main list to display the year of each song, but the year should at least be displayed on the album entries and for the current playing song on the Now Playing area.
For albums (and possibly artists), there is a possibility that not all songs have the same year. In this case, a range of years should be used (for example, "1998-2003"). This could also apply to artists if the user wants to see this information.
The ability to visualize audio was introduced in Android API 10. This provides a low-resolution FFT of the audio data and can be used to produce a bar graph. This could be placed in the Now Playing area provided there is enough screen space for it. I have tested the visualization functionality and it does not like being killed off, so a good way to terminate the visualizer without screwing up the system is essential.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.