PianoView | A custom view of piano on Android | Audio Utils library

 by   ParadiseHell Java Version: 1.1.1 License: No License

kandi X-RAY | PianoView Summary

kandi X-RAY | PianoView Summary

PianoView is a Java library typically used in Audio, Audio Utils applications. PianoView has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

A custom view on Android,which can help you easily to create a piano on Android.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              PianoView has a low active ecosystem.
              It has 51 star(s) with 19 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 6 have been closed. On average issues are closed in 228 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PianoView is 1.1.1

            kandi-Quality Quality

              PianoView has 0 bugs and 0 code smells.

            kandi-Security Security

              PianoView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              PianoView code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              PianoView does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              PianoView releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              PianoView saves you 871 person hours of effort in developing the same functionality from scratch.
              It has 1994 lines of code, 143 functions and 29 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed PianoView and discovered the below as its top functions. This is intended to give you an instant insight into PianoView implemented functionality, and help decide if they suit your requirements.
            • Handle touch events
            • Moves all keys in the key
            • Handle mouse motion
            • Checks if the given x and y are contained in the map
            • Handles auto scroll
            • Handle a black key down
            • Auto scroll
            • Scroll the progress
            • Initialize window
            • Gets auto - play entity list
            • Converts an InputStream from an InputStream
            • Initial letter player speaker
            • Get AutoPlay entity list from custom json string
            • Obtain music key
            • Convert String to Object array
            • Initializes the prekey keys
            • Get white pen key area
            • Set the bounds of a black key drawable
            • Set progress bar
            • On auto playback
            • Generates the cue
            • Load the music
            • Handle an audio status message
            • Reads a list of AutoPlayEntity from a JSON stream
            • Convert json object to array
            • Calculate scale
            Get all kandi verified functions for this library.

            PianoView Key Features

            No Key Features are available at this moment for PianoView.

            PianoView Examples and Code Snippets

            No Code Snippets are available at this moment for PianoView.

            Community Discussions

            QUESTION

            How to model parent-child relationship in Android MVVM VMs?
            Asked 2020-Oct-23 at 14:06

            I'm working on an Android piano "quiz" app - users tap on the piano keys and then click the yellow "check" button to submit the answer for evaluation and see the correct answer drawn on the piano. The main QuizActivity has this layout:

            The upper part of the screen hosts a couple of controls (Text, submit buttons, etc.). The lower part of the screen is occupied by a custom PianoView component, that handles drawing of the piano keyboard.

            According to the MVVM principles, the PianoView should have its own PianoViewModel, that stores its state (i.e. currently pressed keys, highlighted keys, etc...) in a KeysStateRepository. The enclosing QuizActivity should also have a QuizActivityViewModel, that handles the various controls (submitting an answer, skipping a question...). The QuizActivityViewModel needs to be able to query the selected keys from the PianoView (or rather from its KeysStateRepository), submit them to the Domain layer for evaluation and then send the results back to the PianoView for visualization.

            In other words, the QuizActivity's ViewModel should own/be a parent of the PianoView's ViewModel to facilitate communication and data sharing.

            How can I model this parent-child relationship to communicate between the ViewModels?

            AFAIK a ViewModel cannot depend on another ViewModel (What would I pass as the ViewModelStoreOwner to obtain a ViewModel in another Viewmodel?). I don't think it's possible to achieve with Dagger-Hilt at least.

            Three solutions to work around this problem came to mind, all of them unusable:

            1 - The official way of sharing data between Views

            The Android dev docs recommend using a shared ViewModel to facilitate sharing of data between two Fragments / Views. However, this does not fit my use-case. The PianoView (or its ViewModel) should be the sole owner of its state with a Repository scoped to its ViewModel. Otherwise, the PianoView component would not be reusable. Consider for example another Activity, where I'd like to have two independent PianoView instances visible:

            Reusing a Shared ViewModel from the quiz activity would be obviously wrong, because it contains irrelevant methods and logic (i.e. submitting quiz answers) and would not fit the two-keyboard scenario.

            2 - Application-scoped repository

            A similar problem was tackled on Reddit with a proposed solution of using a shared instance of the repository. However, using a @Singleton KeyStateRepository would once again prevent the two independent keyboards to display different data.

            3(EDIT) - 2 duplicate repositories replicated by an Event Bus

            I could in theory create 2 independent ViewModels and 2 KeyStateRepository instances. The ViewModels would subscribe to an event bus. Each time a ViewModel invokes a mutable operation on its repository, it would also fire an event and the operation would get replicated via the other ViewModel subscribed to the same event bus.

            However, this feels like a fragile & complicated hack. I'd like to have a simple MVVM-compatible solution. I can't believe a simple parent-child relationship for two UI components is something unattainable in MVVM.

            ...

            ANSWER

            Answered 2020-Oct-14 at 06:43

            I would do the following, if you don't want to tie the PianoViewModel to your ActivityViewModel, I'd just create an interface, which the ActivityViewModel implements, and the PianoVM could have a nullable reference to that interface. This way neither the implementation, nor the existence of the component would be required for the PianoViewModel to work.

            How you get the ActivityViewModel is another question. Check out by activityViewModels() implementation for fragments, you probably can do the same with by viewModels() passing in the viewModelStore of the activity instead

            Source https://stackoverflow.com/questions/64339055

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install PianoView

            You can download it from GitHub.
            You can use PianoView like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the PianoView component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ParadiseHell/PianoView.git

          • CLI

            gh repo clone ParadiseHell/PianoView

          • sshUrl

            git@github.com:ParadiseHell/PianoView.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Audio Utils Libraries

            howler.js

            by goldfire

            fingerprintjs

            by fingerprintjs

            Tone.js

            by Tonejs

            AudioKit

            by AudioKit

            sonic-pi

            by sonic-pi-net

            Try Top Libraries by ParadiseHell

            one

            by ParadiseHellKotlin

            android-auto-update

            by ParadiseHellJava

            BeautifulLED

            by ParadiseHellJava

            cultural-creative

            by ParadiseHellJava

            paradisehell.github.io

            by ParadiseHellHTML